1 {
2      File:       HIToolbox/CarbonEvents.h
3 
4      Contains:   Carbon Event Manager
5 
6      Version:    HIToolbox-624~3
7 
8      Copyright:  � 1999-2008 by Apple Inc., all rights reserved.
9 
10      Bugs?:      For bug reports, consult the following page on
11                  the World Wide Web:
12 
13                      http://bugs.freepascal.org
14 
15 }
16 {       Pascal Translation Updated:  Peter N Lewis, <peter@stairways.com.au>, August 2005 }
17 {       Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, October 2009 }
18 {       Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, October 2012 }
19 {
20     Modified for use with Free Pascal
21     Version 308
22     Please report any bugs to <gpc@microbizz.nl>
23 }
24 
25 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
26 {$mode macpas}
27 {$modeswitch cblocks}
28 {$packenum 1}
29 {$macro on}
30 {$inline on}
31 {$calling mwpascal}
32 
33 unit CarbonEvents;
34 interface
35 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
36 {$setc GAP_INTERFACES_VERSION := $0308}
37 
38 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
39     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
40 {$endc}
41 
42 {$ifc defined CPUPOWERPC and defined CPUI386}
43 	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
44 {$endc}
45 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
46 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
47 {$endc}
48 
49 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
50 	{$setc __ppc__ := 1}
51 {$elsec}
52 	{$setc __ppc__ := 0}
53 {$endc}
54 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
55 	{$setc __ppc64__ := 1}
56 {$elsec}
57 	{$setc __ppc64__ := 0}
58 {$endc}
59 {$ifc not defined __i386__ and defined CPUI386}
60 	{$setc __i386__ := 1}
61 {$elsec}
62 	{$setc __i386__ := 0}
63 {$endc}
64 {$ifc not defined __x86_64__ and defined CPUX86_64}
65 	{$setc __x86_64__ := 1}
66 {$elsec}
67 	{$setc __x86_64__ := 0}
68 {$endc}
69 {$ifc not defined __arm__ and defined CPUARM}
70 	{$setc __arm__ := 1}
71 {$elsec}
72 	{$setc __arm__ := 0}
73 {$endc}
74 {$ifc not defined __arm64__ and defined CPUAARCH64}
75   {$setc __arm64__ := 1}
76 {$elsec}
77   {$setc __arm64__ := 0}
78 {$endc}
79 
80 {$ifc defined cpu64}
81   {$setc __LP64__ := 1}
82 {$elsec}
83   {$setc __LP64__ := 0}
84 {$endc}
85 
86 
87 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
88 	{$error Conflicting definitions for __ppc__ and __i386__}
89 {$endc}
90 
91 {$ifc defined __ppc__ and __ppc__}
92 	{$setc TARGET_CPU_PPC := TRUE}
93 	{$setc TARGET_CPU_PPC64 := FALSE}
94 	{$setc TARGET_CPU_X86 := FALSE}
95 	{$setc TARGET_CPU_X86_64 := FALSE}
96 	{$setc TARGET_CPU_ARM := FALSE}
97 	{$setc TARGET_CPU_ARM64 := FALSE}
98 	{$setc TARGET_OS_MAC := TRUE}
99 	{$setc TARGET_OS_IPHONE := FALSE}
100 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
101 	{$setc TARGET_OS_EMBEDDED := FALSE}
102 {$elifc defined __ppc64__ and __ppc64__}
103 	{$setc TARGET_CPU_PPC := FALSE}
104 	{$setc TARGET_CPU_PPC64 := TRUE}
105 	{$setc TARGET_CPU_X86 := FALSE}
106 	{$setc TARGET_CPU_X86_64 := FALSE}
107 	{$setc TARGET_CPU_ARM := FALSE}
108 	{$setc TARGET_CPU_ARM64 := FALSE}
109 	{$setc TARGET_OS_MAC := TRUE}
110 	{$setc TARGET_OS_IPHONE := FALSE}
111 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
112 	{$setc TARGET_OS_EMBEDDED := FALSE}
113 {$elifc defined __i386__ and __i386__}
114 	{$setc TARGET_CPU_PPC := FALSE}
115 	{$setc TARGET_CPU_PPC64 := FALSE}
116 	{$setc TARGET_CPU_X86 := TRUE}
117 	{$setc TARGET_CPU_X86_64 := FALSE}
118 	{$setc TARGET_CPU_ARM := FALSE}
119 	{$setc TARGET_CPU_ARM64 := FALSE}
120 {$ifc defined iphonesim}
121  	{$setc TARGET_OS_MAC := FALSE}
122 	{$setc TARGET_OS_IPHONE := TRUE}
123 	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
124 {$elsec}
125 	{$setc TARGET_OS_MAC := TRUE}
126 	{$setc TARGET_OS_IPHONE := FALSE}
127 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
128 {$endc}
129 	{$setc TARGET_OS_EMBEDDED := FALSE}
130 {$elifc defined __x86_64__ and __x86_64__}
131 	{$setc TARGET_CPU_PPC := FALSE}
132 	{$setc TARGET_CPU_PPC64 := FALSE}
133 	{$setc TARGET_CPU_X86 := FALSE}
134 	{$setc TARGET_CPU_X86_64 := TRUE}
135 	{$setc TARGET_CPU_ARM := FALSE}
136 	{$setc TARGET_CPU_ARM64 := FALSE}
137 {$ifc defined iphonesim}
138  	{$setc TARGET_OS_MAC := FALSE}
139 	{$setc TARGET_OS_IPHONE := TRUE}
140 	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
141 {$elsec}
142 	{$setc TARGET_OS_MAC := TRUE}
143 	{$setc TARGET_OS_IPHONE := FALSE}
144 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
145 {$endc}
146 	{$setc TARGET_OS_EMBEDDED := FALSE}
147 {$elifc defined __arm__ and __arm__}
148 	{$setc TARGET_CPU_PPC := FALSE}
149 	{$setc TARGET_CPU_PPC64 := FALSE}
150 	{$setc TARGET_CPU_X86 := FALSE}
151 	{$setc TARGET_CPU_X86_64 := FALSE}
152 	{$setc TARGET_CPU_ARM := TRUE}
153 	{$setc TARGET_CPU_ARM64 := FALSE}
154 	{$setc TARGET_OS_MAC := FALSE}
155 	{$setc TARGET_OS_IPHONE := TRUE}
156 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
157 	{$setc TARGET_OS_EMBEDDED := TRUE}
158 {$elifc defined __arm64__ and __arm64__}
159 	{$setc TARGET_CPU_PPC := FALSE}
160 	{$setc TARGET_CPU_PPC64 := FALSE}
161 	{$setc TARGET_CPU_X86 := FALSE}
162 	{$setc TARGET_CPU_X86_64 := FALSE}
163 	{$setc TARGET_CPU_ARM := FALSE}
164 	{$setc TARGET_CPU_ARM64 := TRUE}
165 {$ifc defined ios}
166 	{$setc TARGET_OS_MAC := FALSE}
167 	{$setc TARGET_OS_IPHONE := TRUE}
168 	{$setc TARGET_OS_EMBEDDED := TRUE}
169 {$elsec}
170 	{$setc TARGET_OS_MAC := TRUE}
171 	{$setc TARGET_OS_IPHONE := FALSE}
172 	{$setc TARGET_OS_EMBEDDED := FALSE}
173 {$endc}
174 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
175 {$elsec}
176 	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
177 {$endc}
178 
179 {$ifc defined __LP64__ and __LP64__ }
180   {$setc TARGET_CPU_64 := TRUE}
181 {$elsec}
182   {$setc TARGET_CPU_64 := FALSE}
183 {$endc}
184 
185 {$ifc defined FPC_BIG_ENDIAN}
186 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
187 	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
188 {$elifc defined FPC_LITTLE_ENDIAN}
189 	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
190 	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
191 {$elsec}
192 	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
193 {$endc}
194 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
195 {$setc CALL_NOT_IN_CARBON := FALSE}
196 {$setc OLDROUTINENAMES := FALSE}
197 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
198 {$setc OPAQUE_UPP_TYPES := TRUE}
199 {$setc OTCARBONAPPLICATION := TRUE}
200 {$setc OTKERNEL := FALSE}
201 {$setc PM_USE_SESSION_APIS := TRUE}
202 {$setc TARGET_API_MAC_CARBON := TRUE}
203 {$setc TARGET_API_MAC_OS8 := FALSE}
204 {$setc TARGET_API_MAC_OSX := TRUE}
205 {$setc TARGET_CARBON := TRUE}
206 {$setc TARGET_CPU_68K := FALSE}
207 {$setc TARGET_CPU_MIPS := FALSE}
208 {$setc TARGET_CPU_SPARC := FALSE}
209 {$setc TARGET_OS_UNIX := FALSE}
210 {$setc TARGET_OS_WIN32 := FALSE}
211 {$setc TARGET_RT_MAC_68881 := FALSE}
212 {$setc TARGET_RT_MAC_CFM := FALSE}
213 {$setc TARGET_RT_MAC_MACHO := TRUE}
214 {$setc TYPED_FUNCTION_POINTERS := TRUE}
215 {$setc TYPE_BOOL := FALSE}
216 {$setc TYPE_EXTENDED := FALSE}
217 {$setc TYPE_LONGLONG := TRUE}
218 uses MacTypes,CFBase,QuickdrawTypes,CFArray,HIObject,Events,Menus,AERegistry,CarbonEventsCore,HIGeometry;
219 {$endc} {not MACOSALLINCLUDE}
220 
221 
222 {$ifc TARGET_OS_MAC}
223 
224 {$ALIGN MAC68K}
225 
226 {--------------------------------------------------------------------------------------}
227 { Parameter names and types                                                            }
228 {--------------------------------------------------------------------------------------}
229 
230 const
231 {
232    * This event parameter may be added to any event that is posted to
233    * the main event queue. When the event is removed from the queue and
234    * sent to the event dispatcher, the dispatcher will retrieve the
235    * EventTargetRef contained in this parameter and send the event
236    * directly to that event target.
237    *
238    * Note that it is your application's responsibility to ensure that
239    * the EventTargetRef contained in this parameter is still valid when
240    * the event is dispatched. If the target's object is destroyed
241    * before the event is dispatched, you must remove the event from the
242    * event queue yourself. The behavior when attempting to dispatch an
243    * event to invalid target is undefined and may crash.
244    *
245    * If this parameter is not available in the event, the dispatcher
246    * will send the event to a suitable target, or to the application
247    * target if no more specific target is appropriate. Available in
248    * CarbonLib 1.3.1 and later, and Mac OS X.
249    }
250 	kEventParamPostTarget = FourCharCode('ptrg'); { typeEventTargetRef}
251 
252   {
253    * Indicates an event parameter of type EventTargetRef.
254    }
255 	typeEventTargetRef = FourCharCode('etrg'); { EventTargetRef}
256 
257   {
258    * This event parameter may be added to any event that is posted to
259    * the main event queue. When the event is removed from the queue and
260    * sent to the event dispatcher, the dispatcher will retrieve the
261    * target options contained in this parameter and will pass those
262    * options to SendEventToEventTargetWithOptions. Currently, the
263    * available options are kEventTargetDontPropagate and
264    * kEventTargetSendToAllHandlers.
265    *
266    * If this parameter is not available in the event, the dispatcher
267    * will pass no option bits when sending the event. Available in
268    * CarbonLib 1.3.1 and later, and Mac OS X.
269    }
270 	kEventParamPostOptions = FourCharCode('popt'); { typeEventTargetOptions}
271 	typeEventTargetOptions = FourCharCode('etop'); { OptionBits}
272 
273 { Generic toolbox parameters and types}
274 
275 {
276    *** NOTE ON AUTOMATIC TYPE CONVERSIONS
277    Please keep in mind that some of these types can be automatically converted
278    to other types just by asking for them as different types. The following
279    type conversions are automatic:
280     Mac OS X 10.1 and later:
281         typeQDPoint                             <-->    typeHIPoint
282     Mac OS X 10.2 and later:
283         typeQDRectangle                         <-->    typeHIRect
284         typeCFTypeRef(CFNumber)                  -->    typeSInt16, typeSInt32, typeUInt32, typeSInt64
285         typeCFTypeRef(CFNumber)                  -->    typeIEEE32BitFloatingPoint, typeIEEE64BitFloatingPoint
286         typeCFTypeRef(CFBoolean)                 -->    typeBoolean
287         typeCFTypeRef(CFNumber)                  -->    typeBoolean
288         typeCFTypeRef(AXUIElementRef)            -->    typeHIAccessibleObjectRef
289         any CF type other than typeCFTypeRef     -->    typeCFTypeRef
290     Mac OS X 10.4 and later:
291         type[Mutable]CFStringRef                 -->    typeUnicodeText
292     Mac OS X 10.5 and later:
293         typeVoidPtr                             <-->    typeSInt32 (32-bit only)
294                                                 <-->    typeUInt32 (32-bit only)
295         typeByteCount                           <-->    typeSInt32 (32-bit only)
296         typeByteOffset                          <-->    typeSInt32 (32-bit only)
297         typeGDHandle                            <-->    typeCGDisplayID (32-bit only)
298         typeCGFloat                             <-->    typeFloat/typeIEEE64BitFloatingPoint (32-bit only)
299         The following event parameter types allow clients to explicitly state the coordinate space of
300         the point, size, rectangle or scalar. Automatic translations are provided between all of the
301         various coordinate spaces. The 72DPIGlobal coordinate space is assumed for the pre-existing
302         point, size, rectangle and scalar types. For more information on coordinate spaces see HIGeometry.h.
303         typeHIPoint                             <-->    typeHIPoint72DPIGlobal, typeHIPointScreenPixel
304         typeHISize                              <-->    typeHISize72DPIGlobal, typeHISizeScreenPixel
305         typeHIRect                              <-->    typeHIRect72DPIGlobal, typeHIRectScreenPixel
306         typeCGFloat                             <-->    typeCGFloat72DPIGlobal, typeCGFloatScreenPixel
307     Also, any registered AppleEvent coercion handlers will be called to coerce data types
308     that are otherwise not convertable.
309 }
310 
311 const
312 	kEventParamWindowRef = FourCharCode('wind'); { typeWindowRef}
313 	kEventParamGrafPort = FourCharCode('graf'); { typeGrafPtr}
314 	kEventParamMenuRef = FourCharCode('menu'); { typeMenuRef}
315 	kEventParamEventRef = FourCharCode('evnt'); { typeEventRef}
316 	kEventParamControlRef = FourCharCode('ctrl'); { typeControlRef}
317 	kEventParamRgnHandle = FourCharCode('rgnh'); { typeQDRgnHandle}
318 	kEventParamEnabled = FourCharCode('enab'); { typeBoolean}
319 	kEventParamDimensions = FourCharCode('dims'); { typeQDPoint}
320 	kEventParamBounds = FourCharCode('boun'); { typeQDRectangle}
321 	kEventParamAvailableBounds = FourCharCode('avlb'); { typeQDRectangle}
322 	kEventParamAEEventID = keyAEEventID; { typeType}
323 	kEventParamAEEventClass = keyAEEventClass; { typeType}
324 	kEventParamCGContextRef = FourCharCode('cntx'); { typeCGContextRef}
325 	kEventParamCGImageRef = FourCharCode('cgim'); { typeCGImageRef}
326 	kEventParamDeviceDepth = FourCharCode('devd'); { typeSInt16}
327 	kEventParamDeviceColor = FourCharCode('devc'); { typeBoolean}
328 	kEventParamMutableArray = FourCharCode('marr'); { typeCFMutableArrayRef}
329 	kEventParamResult = FourCharCode('ansr'); { any type - depends on event like direct object}
330 	kEventParamMinimumSize = FourCharCode('mnsz'); { typeHISize}
331 	kEventParamMaximumSize = FourCharCode('mxsz'); { typeHISize}
332 	kEventParamAttributes = FourCharCode('attr'); { typeUInt32}
333 	kEventParamReason = FourCharCode('why?'); { typeUInt32}
334 	kEventParamTransactionID = FourCharCode('trns'); { typeUInt32}
335 	kEventParamDisplayDevice = FourCharCode('gdev'); { typeCGDisplayID or typeGDHandle}
336 	kEventParamGDevice = kEventParamDisplayDevice;
337 	kEventParamIndex = FourCharCode('indx'); { typeCFIndex}
338 	kEventParamUserData = FourCharCode('usrd'); { typeVoidPtr}
339 	kEventParamShape = FourCharCode('shap'); { typeHIShapeRef}
340 	typeWindowRef = FourCharCode('wind'); { WindowRef}
341 	typeGrafPtr = FourCharCode('graf'); { CGrafPtr}
342 	typeGWorldPtr = FourCharCode('gwld'); { GWorldPtr}
343 	typeMenuRef = FourCharCode('menu'); { MenuRef}
344 	typeControlRef = FourCharCode('ctrl'); { ControlRef}
345 	typeCollection = FourCharCode('cltn'); { Collection}
346 	typeQDRgnHandle = FourCharCode('rgnh'); { RgnHandle}
347 	typeOSStatus = FourCharCode('osst'); { OSStatus}
348 	typeCFIndex = FourCharCode('cfix'); { CFIndex}
349 	typeCGContextRef = FourCharCode('cntx'); { CGContextRef}
350 	typeCGImageRef = FourCharCode('cgim'); { CGImageRef}
351 	typeHIPoint = FourCharCode('hipt'); { HIPoint}
352 	typeHISize = FourCharCode('hisz'); { HISize}
353 	typeHIRect = FourCharCode('hirc'); { HIRect}
354 	typeHIShapeRef = FourCharCode('shap'); { HIShapeRef}
355 	typeVoidPtr = FourCharCode('void'); { void *}
356 	typeGDHandle = FourCharCode('gdev'); { GDHandle}
357 	typeCGDisplayID = FourCharCode('cgid'); { CGDirectDisplayID}
358 	typeCGFloat = FourCharCode('cgfl'); { CGFloat}
359 	typeHIPoint72DPIGlobal = FourCharCode('hipg'); { HIPoint}
360 	typeHIPointScreenPixel = FourCharCode('hips'); { HIPoint}
361 	typeHISize72DPIGlobal = FourCharCode('hisg'); { HISize}
362 	typeHISizeScreenPixel = FourCharCode('hiss'); { HISize}
363 	typeHIRect72DPIGlobal = FourCharCode('hirg'); { HIRect}
364 	typeHIRectScreenPixel = FourCharCode('hirs'); { HIRect}
365 	typeCGFloat72DPIGlobal = FourCharCode('hifg'); { CGFloat}
366 	typeCGFloatScreenPixel = FourCharCode('hifs'); { CGFloat}
367 	kEventParamDisplayChangeFlags = FourCharCode('cgdp'); { typeCGDisplayChangeFlags}
368 	typeCGDisplayChangeFlags = FourCharCode('cgdf'); { CGDisplayChangeSummaryFlags    }
369 
370 {
371     Event parameter changes for 64-bit applications
372 
373     With the introduction of 64-bit support in the Carbon Event Manager, four kinds of event parameters
374     require changes to their underlying data types. The parameters that have changed are used to pass
375     refcon data, byte counts, byte offsets, and graphics devices.
376 
377     In the case of refcon data, byte counts, and byte offsets, these parameters used typeSInt32 or
378     typeUInt32 as the event parameter type prior to Mac OS X 10.5. Unfortunately, typeSInt32 and typeUInt32
379     specify a 32-bit value, and on Mac OS X 10.5, these parameters must be 64 bits wide when
380     compiling for the 64-bit API so that 64-bit pointers, byte counts, and byte offsets may be passed
381     without truncation.
382 
383     We have defined three new event parameter types to provide source compatibility between 32-bit and
384     64-bit applications: typeRefCon, typeByteCount, and typeByteOffset. Use of these types by 32-bit
385     applications is optional; the toolbox provides automatic coercion between the old types and the new
386     types where needed (typeRefCon), so existing apps will continue to run, and you may recompile an
387     existing 32-bit app on Mac OS X 10.5 without modification to use these types. However, you must use
388     these new types in order to work properly with the 64-bit API.
389 
390     The actual value of these constants is dependent on whether you are compiling for a 32-bit or 64-bit
391     target, and in the case of typeRefCon, on the value of the preprocessor macro
392     MAC_OS_X_VERSION_MIN_REQUIRED, which specifies the minimum Mac OS X system version on which your
393     application will run.
394 
395     typeRefCon is always equal to typeVoidPtr for 64-bit targets. It is also equal to typeVoidPtr when
396     compiling 32-bit targets for Mac OS X 10.5 and later, but is equal to typeSInt32 when compiling for
397     earlier versions of Mac OS X. The Carbon Event Manager in Mac OS X 10.5 and later will automatically
398     convert between typeVoidPtr and typeSInt32 for 32-bit apps (but not for 64-bit apps).
399 
400     typeByteCount and typeByteOffset use typeUInt64 for 64-bit targets, and typeUInt32 for 32-bit targets.
401     The parameters that have changed to use these types formerly used typeSInt32 (typeLongInteger), not
402     typeUInt32, but in practice they always refer to positive values which the toolbox will convert
403     automatically to/from typeUInt32, so no binary compatibility problem is introduced by using the new
404     types in an application compiled on Mac OS X 10.5 and run on prior systems.
405 
406     When compiling your code using the Mac OS X 10.5 header files, if you don't care about 64-bit
407     compilation, you may continue to use typeSInt32 or typeLongInteger to extract refcon, byte count,
408     and byte offset parameters; the coercion handlers provided by the toolbox will convert event parameter
409     data using typeVoidPtr, typeByteCount, or typeByteOffset to your requested data type. If you want
410     code that will run cleanly on both 32-bit and 64-bit targets, you should modify your calls to
411     GetEventParameter to use typeRefCon, typeByteCount, or typeByteOffset instead of typeSInt32 or
412     typeLongInteger. Using these preferred types will allow your 32-bit application to run on both pre-10.5
413     and 10.5 systems, and will allow your 64-bit application to run on 10.5 and later.
414 
415     Note that when extracting data from an event parameter of typeRefCon, the data type of the variable to
416     which the parameter data is written should always be pointer-sized; i.e., use void* or SRefCon/URefCon/
417     PRefCon, not SInt32. Using a 32-bit variable will fail on 64-bit targets. Similarly, when extracting data
418     from an event parameter of typeByteCount or typeByteOffset, always use the corresponding basic data type
419     (ByteCount or ByteOffset), and use sizeof(ByteCount) or sizeof(ByteOffset), not sizeof(SInt32) or
420     sizeof(UInt32), to specify the amount of data that you need.
421 
422     typeRefCon is currently used by the following events:
423 
424         kEventTSMDocumentAccessGetLength
425         kEventTSMDocumentAccessGetSelectedRange
426         kEventTSMDocumentAccessGetCharactersPtr
427         kEventTSMDocumentAccessGetCharactersPtrForLargestBuffer
428         kEventTSMDocumentAccessGetCharacters
429         kEventTSMDocumentAccessGetFont
430         kEventTSMDocumentAccessGetGlyphInfo
431         kEventTSMDocumentAccessGetFirstRectForRange
432         kEventTSMDocumentAccessLockDocument
433         kEventTSMDocumentAccessUnlockDocument
434         kEventTextInputUpdateActiveInputArea
435         kEventTextInputUnicodeForKeyEvent
436         kEventTextInputOffsetToPos
437         kEventTextInputPosToOffset
438         kEventTextInputShowHideBottomWindow
439         kEventTextInputGetSelectedText
440         kEventTextInputFilterText
441         kEventAppLaunchNotification
442         kEventControlArbitraryMessage
443 
444     typeByteCount is currently used by the following events:
445 
446         kEventControlSetData
447         kEventControlGetData
448 
449     typeByteOffset is currently used by the following events:
450 
451         kEventTextInputPosToOffset
452 
453     In the case of graphics devices, some event parameters used typeGDHandle prior to Mac OS X 10.5.
454     However, the GDHandle type is not available in 64-bit mode, and on Mac OS X 10.5, these parameters
455     contain CGDirectDisplayIDs instead.
456 
457     We have defined a new event parameter type, typeCGDisplayID, to indicate that the data type of a
458     graphics device event parameter is a CGDirectDisplayID instead of a GDHandle. We are not providing
459     a generic type that changes its value based on the ABI or minimum required system version, because
460     you will need to explicitly choose in your code which type of graphics device identifier you need.
461     Use of typeCGDisplayID by 32-bit applications is optional; the toolbox provides automatic coercion
462     between typeCGDisplayID and typeGDHandle, so existing apps will continue to run, and you may recompile
463     an existing 32-bit app on Mac OS X 10.5 without modification to typeCGDisplayID. However, you must use
464     typeCGDisplayID in order to work properly with the 64-bit API.
465 
466     typeCGDisplayID is currently used by the following events:
467 
468         kEventAppAvailableWindowBoundsChanged
469         kEventWindowConstrain
470         kEventMenuGetFrameBounds
471 }
472 
473 type
474 	typeRefCon = UnivPtr;      // PRefCon
475 
476 
477 {$ifc TARGET_CPU_64}
478 type
479 	typeByteCount = UInt64;           // ByteCount
480 	typeByteOffset = UInt64;           // ByteOffset
481 	typeSignedByteCount = SInt64;           // Size
482 	typeSignedByteOffset = SInt64;            // Size
483 {$elsec} {TARGET_CPU_64}
484 type
485 	typeByteCount = UInt32;          // ByteCount
486 	typeByteOffset = UInt32;          // ByteOffset
487 	typeSignedByteCount = SInt32;          // Size
488 	typeSignedByteOffset = SInt32;           // Size
489 {$endc} {TARGET_CPU_64}
490 
491 
492 { Mouse event parameters and types}
493 
494 const
495 	kEventParamMouseLocation = FourCharCode('mloc'); { typeHIPoint}
496 	kEventParamWindowMouseLocation = FourCharCode('wmou'); { typeHIPoint (Mac OS X 10.1 or later)}
497 	kEventParamMouseButton = FourCharCode('mbtn'); { typeMouseButton}
498 	kEventParamClickCount = FourCharCode('ccnt'); { typeUInt32}
499 	kEventParamMouseWheelAxis = FourCharCode('mwax'); { typeMouseWheelAxis}
500 	kEventParamMouseWheelDelta = FourCharCode('mwdl'); { typeSInt32}
501 	kEventParamMouseWheelSmoothVerticalDelta = FourCharCode('saxy'); { typeSInt32}
502 	kEventParamMouseWheelSmoothHorizontalDelta = FourCharCode('saxx'); { typeSInt32}
503 	kEventParamMouseDelta = FourCharCode('mdta'); { typeHIPoint (10.2 or later) or typeQDPoint}
504 	kEventParamMouseChord = FourCharCode('chor'); { typeUInt32}
505 	kEventParamTabletEventType = FourCharCode('tblt'); { typeUInt32}
506 	kEventParamMouseTrackingRef = FourCharCode('mtrf'); { typeMouseTrackingRef}
507 	typeMouseButton = FourCharCode('mbtn'); { EventMouseButton}
508 	typeMouseWheelAxis = FourCharCode('mwax'); { EventMouseWheelAxis}
509 	typeMouseTrackingRef = FourCharCode('mtrf'); { MouseTrackingRef}
510 
511 { Gesture event parameters}
512 
513 const
514 	kEventParamMagnificationAmount = FourCharCode('magn'); { typeCGFloat}
515 	kEventParamRotationAmount = FourCharCode('rota'); { typeCGFloat}
516 	kEventParamSwipeDirection = FourCharCode('swip'); { typeHIPoint}
517 
518 { Keyboard event parameter and types}
519 
520 const
521 	kEventParamKeyCode = FourCharCode('kcod'); { typeUInt32}
522 	kEventParamKeyMacCharCodes = FourCharCode('kchr'); { typeChar  (DEPRECATED for 64bit on Mac OS X 10.6 and later.)}
523 	kEventParamKeyModifiers = FourCharCode('kmod'); { typeUInt32}
524 	kEventParamKeyUnicodes = FourCharCode('kuni'); { typeUnicodeText}
525 	kEventParamKeyboardType = FourCharCode('kbdt'); { typeUInt32}
526 	typeEventHotKeyID = FourCharCode('hkid'); { EventHotKeyID}
527 
528 { General TSM event parameters}
529 
530 const
531 	kEventParamTSMSendRefCon = FourCharCode('tsrc'); {    typeRefCon}
532 	kEventParamTSMSendComponentInstance = FourCharCode('tsci'); {    typeComponentInstance}
533 
534 { TextInput event parameters}
535 
536 const
537 	kEventParamTextInputSendRefCon = kEventParamTSMSendRefCon; {    typeRefCon}
538 	kEventParamTextInputSendComponentInstance = kEventParamTSMSendComponentInstance; {    typeComponentInstance}
539 	kEventParamTextInputSendSLRec = FourCharCode('tssl'); {    typeIntlWritingCode}
540 	kEventParamTextInputReplySLRec = FourCharCode('trsl'); {    typeIntlWritingCode}
541 	kEventParamTextInputSendText = FourCharCode('tstx'); {    typeUnicodeText (if TSMDocument is Unicode), otherwise typeChar}
542 	kEventParamTextInputReplyText = FourCharCode('trtx'); {    typeUnicodeText (if TSMDocument is Unicode), otherwise typeChar}
543 	kEventParamTextInputSendAttributedString = FourCharCode('tsas'); {    typeCFAttributedStringRef}
544 	kEventParamTextInputReplyAttributedString = FourCharCode('tras'); {    typeCFAttributedStringRef}
545 	kEventParamTextInputSendUpdateRng = FourCharCode('tsup'); {    typeTextRangeArray}
546 	kEventParamTextInputSendHiliteRng = FourCharCode('tshi'); {    typeTextRangeArray}
547 	kEventParamTextInputSendClauseRng = FourCharCode('tscl'); {    typeOffsetArray}
548 	kEventParamTextInputSendPinRng = FourCharCode('tspn'); {    typeTextRange}
549 	kEventParamTextInputSendFixLen = FourCharCode('tsfx'); {    typeSignedByteCount}
550 	kEventParamTextInputSendLeadingEdge = FourCharCode('tsle'); {    typeBoolean}
551 	kEventParamTextInputReplyLeadingEdge = FourCharCode('trle'); {    typeBoolean}
552 	kEventParamTextInputSendTextOffset = FourCharCode('tsto'); {    typeSignedByteOffset}
553 	kEventParamTextInputReplyTextOffset = FourCharCode('trto'); {    typeByteOffset}
554 	kEventParamTextInputReplyRegionClass = FourCharCode('trrg'); {    typeSInt32}
555 	kEventParamTextInputSendCurrentPoint = FourCharCode('tscp'); {    typeHIPoint}
556 	kEventParamTextInputSendDraggingMode = FourCharCode('tsdm'); {    typeBoolean}
557 	kEventParamTextInputReplyPoint = FourCharCode('trpt'); {    typeHIPoint}
558 	kEventParamTextInputReplyFont = FourCharCode('trft'); {    typeSInt32}
559 	kEventParamTextInputReplyFMFont = FourCharCode('trfm'); {    typeUInt32}
560 	kEventParamTextInputReplyPointSize = FourCharCode('trpz'); {    typeCGFloat (originally typeFixed)}
561 	kEventParamTextInputReplyLineHeight = FourCharCode('trlh'); {    typeCGFloat (originally typeSInt16)}
562 	kEventParamTextInputReplyLineAscent = FourCharCode('trla'); {    typeCGFloat (originally typeSInt16)}
563 	kEventParamTextInputReplyCTFontRef = FourCharCode('trcf'); {    typeCTFontRef}
564 	kEventParamTextInputReplyATSFont = FourCharCode('traf'); {    typeATSFontRef}
565 	kEventParamTextInputReplyTextAngle = FourCharCode('trta'); {    typeFixed}
566 	kEventParamTextInputSendShowHide = FourCharCode('tssh'); {    typeBoolean}
567 	kEventParamTextInputReplyShowHide = FourCharCode('trsh'); {    typeBoolean}
568 	kEventParamTextInputSendKeyboardEvent = FourCharCode('tske'); {    typeEventRef}
569 	kEventParamTextInputSendTextServiceEncoding = FourCharCode('tsse'); {    typeUInt32}
570 	kEventParamTextInputSendTextServiceMacEncoding = FourCharCode('tssm'); {    typeUInt32}
571 	kEventParamTextInputReplyMacEncoding = FourCharCode('trme'); {    typeUInt32}
572 	kEventParamTextInputGlyphInfoArray = FourCharCode('glph'); {    typeGlyphInfoArray}
573 	kEventParamTextInputSendGlyphInfoArray = kEventParamTextInputGlyphInfoArray;
574 	kEventParamTextInputReplyGlyphInfoArray = FourCharCode('rgph'); {    typeGlyphInfoArray}
575 	kEventParamTextInputSendReplaceRange = FourCharCode('tsrp'); {    typeCFRange}
576 	kEventParamTextInputSendMouseEvent = FourCharCode('tsme'); {    typeEventRef}
577 
578 { TSMDocumentAccess event parameters and types}
579 
580 const
581 	kEventParamTSMDocAccessSendRefCon = kEventParamTSMSendRefCon; {    typeRefCon}
582 	kEventParamTSMDocAccessSendComponentInstance = kEventParamTSMSendComponentInstance; {    typeComponentInstance}
583 	kEventParamTSMDocAccessCharacterCount = FourCharCode('tdct'); {    typeCFIndex}
584 	kEventParamTSMDocAccessReplyCharacterRange = FourCharCode('tdrr'); {    typeCFRange}
585 	kEventParamTSMDocAccessReplyCharactersPtr = FourCharCode('tdrp'); {    typePtr}
586 	kEventParamTSMDocAccessSendCharacterIndex = FourCharCode('tdsi'); {    typeCFIndex}
587 	kEventParamTSMDocAccessSendCharacterRange = FourCharCode('tdsr'); {    typeCFRange}
588 	kEventParamTSMDocAccessSendCharactersPtr = FourCharCode('tdsp'); {    typePtr}
589 	kEventParamTSMDocAccessRequestedCharacterAttributes = FourCharCode('tdca'); {    typeUInt32}
590 	kEventParamTSMDocAccessReplyCTFontRef = FourCharCode('tdcf'); {    typeCTFontRef}
591 	kEventParamTSMDocAccessReplyATSFont = FourCharCode('tdaf'); {    typeATSFontRef}
592 	kEventParamTSMDocAccessReplyFontSize = FourCharCode('tdrs'); {    typeCGFloat (originally typeFloat)}
593 	kEventParamTSMDocAccessEffectiveRange = FourCharCode('tder'); {    typeRange}
594 	kEventParamTSMDocAccessReplyCTGlyphInfoRef = FourCharCode('tdri'); {    typeCTGlyphInfoRef}
595 	kEventParamTSMDocAccessReplyATSUGlyphSelector = FourCharCode('tdrg'); {    typeGlyphSelector}
596 	kEventParamTSMDocAccessLockCount = FourCharCode('tdlc'); {    typeCFIndex}
597 	kEventParamTSMDocAccessLineBounds = FourCharCode('tdlb'); {  typeHIRect}
598 	kEventParamTSMDocAccessBaselineDelta = FourCharCode('tdbd'); {    typeCGFloat}
599 	typeATSFontRef = FourCharCode('atsf'); {    ATSFontRef}
600 	typeGlyphSelector = FourCharCode('glfs'); {    ATSUGlyphSelector}
601 
602 { Command event parameters and types}
603 
604 const
605 	kEventParamHICommand = FourCharCode('hcmd'); { typeHICommand}
606 	typeHICommand = FourCharCode('hcmd'); { HICommand}
607 
608 { Window event parameters and types}
609 
610 const
611 	kEventParamWindowFeatures = FourCharCode('wftr'); { typeUInt32}
612 	kEventParamWindowDefPart = FourCharCode('wdpc'); { typeWindowDefPartCode}
613 	kEventParamWindowPartCode = FourCharCode('wpar'); { typeWindowPartCode}
614 	kEventParamCurrentBounds = FourCharCode('crct'); { typeQDRectangle}
615 	kEventParamOriginalBounds = FourCharCode('orct'); { typeQDRectangle}
616 	kEventParamPreviousBounds = FourCharCode('prct'); { typeQDRectangle}
617 	kEventParamClickActivation = FourCharCode('clac'); { typeClickActivationResult}
618 	kEventParamWindowRegionCode = FourCharCode('wshp'); { typeWindowRegionCode}
619 	kEventParamWindowContentBounds = FourCharCode('wcbn'); { typeQDRectangle}
620 	kEventParamWindowDragHiliteFlag = FourCharCode('wdhf'); { typeBoolean}
621 	kEventParamWindowModifiedFlag = FourCharCode('wmff'); { typeBoolean}
622 	kEventParamWindowProxyGWorldPtr = FourCharCode('wpgw'); { typeGWorldPtr}
623 	kEventParamWindowProxyImageRgn = FourCharCode('wpir'); { typeQDRgnHandle}
624 	kEventParamWindowProxyOutlineRgn = FourCharCode('wpor'); { typeQDRgnHandle}
625 	kEventParamWindowStateChangedFlags = FourCharCode('wscf'); { typeUInt32 }
626 	kEventParamWindowTitleFullWidth = FourCharCode('wtfw'); { typeSInt16}
627 	kEventParamWindowTitleTextWidth = FourCharCode('wttw'); { typeSInt16}
628 	kEventParamWindowGrowRect = FourCharCode('grct'); { typeQDRectangle}
629 	kEventParamPreviousDockRect = FourCharCode('pdrc'); { typeHIRect}
630 	kEventParamPreviousDockDevice = FourCharCode('pdgd'); { typeGDHandle (10.3 and later), typeCGDisplayID (10.5 and later)}
631 	kEventParamCurrentDockRect = FourCharCode('cdrc'); { typeHIRect}
632 	kEventParamCurrentDockDevice = FourCharCode('cdgd'); { typeGDHandle (10.3 and later), typeCGDisplayID (10.5 and later)}
633 	kEventParamWindowTransitionAction = FourCharCode('wtac'); { typeWindowTransitionAction}
634 	kEventParamWindowTransitionEffect = FourCharCode('wtef'); { typeWindowTransitionEffect}
635 	typeWindowRegionCode = FourCharCode('wshp'); { WindowRegionCode}
636 	typeWindowDefPartCode = FourCharCode('wdpt'); { WindowDefPartCode}
637 	typeWindowPartCode = FourCharCode('wpar'); { WindowPartCode}
638 	typeClickActivationResult = FourCharCode('clac'); { ClickActivationResult}
639 	typeWindowTransitionAction = FourCharCode('wtac'); { WindowTransitionAction}
640 	typeWindowTransitionEffect = FourCharCode('wtef'); { WindowTransitionEffect}
641 
642 { Control event parameters and types}
643 
644 const
645 	kEventParamControlPart = FourCharCode('cprt'); { typeControlPartCode}
646 	kEventParamInitCollection = FourCharCode('icol'); { typeCollection}
647 	kEventParamControlMessage = FourCharCode('cmsg'); { typeSInt16}
648 	kEventParamControlParam = FourCharCode('cprm'); { typeRefCon}
649 	kEventParamControlResult = FourCharCode('crsl'); { typeSInt32}
650 	kEventParamControlRegion = FourCharCode('crgn'); { typeQDRgnHandle}
651 	kEventParamControlAction = FourCharCode('caup'); { typeControlActionUPP}
652 	kEventParamControlIndicatorDragConstraint = FourCharCode('cidc'); { typeIndicatorDragConstraint}
653 	kEventParamControlIndicatorRegion = FourCharCode('cirn'); { typeQDRgnHandle}
654 	kEventParamControlIsGhosting = FourCharCode('cgst'); { typeBoolean}
655 	kEventParamControlIndicatorOffset = FourCharCode('ciof'); { typeQDPoint}
656 	kEventParamControlClickActivationResult = FourCharCode('ccar'); { typeClickActivationResult}
657 	kEventParamControlSubControl = FourCharCode('csub'); { typeControlRef}
658 	kEventParamControlOptimalBounds = FourCharCode('cobn'); { typeQDRectangle}
659 	kEventParamControlOptimalBaselineOffset = FourCharCode('cobo'); { typeSInt16}
660 	kEventParamControlDataTag = FourCharCode('cdtg'); { typeEnumeration}
661 	kEventParamControlDataBuffer = FourCharCode('cdbf'); { typePtr}
662 	kEventParamControlDataBufferSize = FourCharCode('cdbs'); { typeByteCount}
663 	kEventParamControlDrawDepth = FourCharCode('cddp'); { typeSInt16}
664 	kEventParamControlDrawInColor = FourCharCode('cdic'); { typeBoolean}
665 	kEventParamControlDrawEngraved = FourCharCode('cden'); { typeBoolean}
666 	kEventParamControlFeatures = FourCharCode('cftr'); { typeUInt32}
667 	kEventParamControlPartBounds = FourCharCode('cpbd'); { typeQDRectangle}
668 	kEventParamControlOriginalOwningWindow = FourCharCode('coow'); { typeWindowRef}
669 	kEventParamControlCurrentOwningWindow = FourCharCode('ccow'); { typeWindowRef}
670 	kEventParamControlFocusEverything = FourCharCode('cfev'); { typeBoolean}
671 	kEventParamNextControl = FourCharCode('cnxc'); { typeControlRef}
672 	kEventParamStartControl = FourCharCode('cstc'); { typeControlRef}
673 	kEventParamControlSubview = FourCharCode('csvw'); { typeControlRef}
674 	kEventParamControlPreviousPart = FourCharCode('copc'); { typeControlPartCode}
675 	kEventParamControlCurrentPart = FourCharCode('cnpc'); { typeControlPartCode}
676 	kEventParamControlInvalRgn = FourCharCode('civr'); { typeQDRgnHandle}
677 	kEventParamControlValue = FourCharCode('cval'); { typeSInt32}
678 	kEventParamControlHit = FourCharCode('chit'); { typeBoolean}
679 	kEventParamControlPartAutoRepeats = FourCharCode('caur'); { typeBoolean}
680 	kEventParamControlFrameMetrics = FourCharCode('cfmt'); { typeControlFrameMetrics}
681 	kEventParamControlWouldAcceptDrop = FourCharCode('cldg'); { typeBoolean}
682 	kEventParamControlPrefersShape = FourCharCode('cpsh'); { typeBoolean}
683 	typeControlActionUPP = FourCharCode('caup'); { ControlActionUPP}
684 	typeIndicatorDragConstraint = FourCharCode('cidc'); { IndicatorDragConstraint}
685 	typeControlPartCode = FourCharCode('cprt'); { ControlPartCode}
686 	typeControlFrameMetrics = FourCharCode('cins'); { HIViewFrameMetrics}
687 
688 { Menu event parameters and types}
689 
690 const
691 	kEventParamCurrentMenuTrackingMode = FourCharCode('cmtm'); { typeMenuTrackingMode}
692 	kEventParamNewMenuTrackingMode = FourCharCode('nmtm'); { typeMenuTrackingMode}
693 	kEventParamMenuFirstOpen = FourCharCode('1sto'); { typeBoolean}
694 	kEventParamMenuItemIndex = FourCharCode('item'); { typeMenuItemIndex}
695 	kEventParamMenuCommand = FourCharCode('mcmd'); { typeMenuCommand}
696 	kEventParamEnableMenuForKeyEvent = FourCharCode('fork'); { typeBoolean}
697 	kEventParamMenuEventOptions = FourCharCode('meop'); { typeMenuEventOptions}
698 	kEventParamMenuContext = FourCharCode('mctx'); { typeUInt32}
699 	kEventParamMenuDismissed = FourCharCode('mdis'); { typeUInt32}
700 	kEventParamMenuItemBounds = FourCharCode('mitb'); { typeQDRectangle}
701 	kEventParamMenuMarkBounds = FourCharCode('mmkb'); { typeQDRectangle}
702 	kEventParamMenuIconBounds = FourCharCode('micb'); { typeQDRectangle}
703 	kEventParamMenuTextBounds = FourCharCode('mtxb'); { typeQDRectangle}
704 	kEventParamMenuTextBaseline = FourCharCode('mtbl'); { typeSInt16}
705 	kEventParamMenuCommandKeyBounds = FourCharCode('mcmb'); { typeQDRectangle}
706 	kEventParamMenuVirtualTop = FourCharCode('mvrt'); { typeSInt32}
707 	kEventParamMenuVirtualBottom = FourCharCode('mvrb'); { typeSInt32}
708 	kEventParamMenuDrawState = FourCharCode('mdrs'); { typeThemeMenuState}
709 	kEventParamMenuItemType = FourCharCode('mitp'); { typeThemeMenuItemType}
710 	kEventParamMenuItemWidth = FourCharCode('mitw'); { typeSInt16}
711 	kEventParamMenuItemHeight = FourCharCode('mith'); { typeSInt16}
712 	kEventParamMenuFrameView = FourCharCode('mfrv'); { typeControlRef}
713 	kEventParamMenuType = FourCharCode('mtyp'); { typeThemeMenuType}
714 	kEventParamMenuIsPopup = FourCharCode('mpop'); { typeBoolean}
715 	kEventParamMenuDirection = FourCharCode('mdir'); { typeMenuDirection}
716 	kEventParamParentMenu = FourCharCode('mprm'); { typeMenuRef}
717 	kEventParamParentMenuItem = FourCharCode('mpri'); { typeMenuItemIndex}
718 	kEventParamMenuPopupItem = FourCharCode('mpit'); { typeMenuItemIndex}
719 	kEventParamMenuContextHeight = FourCharCode('mcht'); { typeCGFloat}
720 	typeMenuItemIndex = FourCharCode('midx'); { MenuItemIndex}
721 	typeMenuCommand = FourCharCode('mcmd'); { MenuCommand}
722 	typeMenuTrackingMode = FourCharCode('mtmd'); { MenuTrackingMode}
723 	typeMenuEventOptions = FourCharCode('meop'); { MenuEventOptions}
724 	typeThemeMenuState = FourCharCode('tmns'); { ThemeMenuState}
725 	typeThemeMenuItemType = FourCharCode('tmit'); { ThemeMenuItemType}
726 	typeMenuDirection = FourCharCode('mdir'); { UInt32}
727 	typeThemeMenuType = FourCharCode('tmty'); { ThemeMenuType}
728 
729 { Application event parameters}
730 
731 const
732 	kEventParamProcessID = FourCharCode('psn '); { typeProcessSerialNumber}
733 	kEventParamLaunchRefCon = FourCharCode('lref'); { typeRefCon}
734 	kEventParamLaunchErr = FourCharCode('err '); { typeOSStatus}
735 	kEventParamSystemUIMode = FourCharCode('uimd'); { typeUInt32}
736 	kEventParamSystemUIOptions = FourCharCode('uiop'); { typeUInt32}
737 	kEventParamIsInInstantMouser = FourCharCode('imou'); { typeBoolean}
738 	kEventParamPreviousWindow = FourCharCode('prvw'); { typeWindowRef}
739 	kEventParamCurrentWindow = FourCharCode('curw'); { typeWindowRef}
740 
741 { Tablet event parameters and types}
742 
743 const
744 	kEventParamTabletPointRec = FourCharCode('tbrc'); { typeTabletPointRec}
745 	kEventParamTabletProximityRec = FourCharCode('tbpx'); { typeTabletProximityRec}
746 	typeTabletPointRec = FourCharCode('tbrc'); { kEventParamTabletPointRec}
747 	typeTabletProximityRec = FourCharCode('tbpx'); { kEventParamTabletProximityRec}
748 
749 { Appearance event parameters}
750 
751 const
752 	kEventParamNewScrollBarVariant = FourCharCode('nsbv'); { typeSInt16}
753 
754 { Service event parameters}
755 
756 const
757 	kEventParamPasteboardRef = FourCharCode('pbrd'); {    typePasteboardRef}
758 	kEventParamScrapRef = FourCharCode('scrp'); {    typeScrapRef}
759 	kEventParamServiceCopyTypes = FourCharCode('svsd'); {    typeCFMutableArrayRef}
760 	kEventParamServicePasteTypes = FourCharCode('svpt'); {    typeCFMutableArrayRef}
761 	kEventParamServiceMessageName = FourCharCode('svmg'); {    typeCFStringRef}
762 	kEventParamServiceUserData = FourCharCode('svud'); {    typeCFStringRef}
763 	typePasteboardRef = FourCharCode('pbrd'); {    PasteboardRef}
764 	typeScrapRef = FourCharCode('scrp'); {    ScrapRef}
765 
766 { Accessibility event parameters}
767 
768 const
769 	kEventParamAccessibleObject = FourCharCode('aobj'); { typeCFTypeRef with an AXUIElementRef}
770 	kEventParamAccessibleChild = FourCharCode('achl'); { typeCFTypeRef with an AXUIElementRef}
771 	kEventParamAccessibleAttributeName = FourCharCode('atnm'); { typeCFStringRef}
772 	kEventParamAccessibleAttributeNames = FourCharCode('atns'); { typeCFMutableArrayRef of CFStringRefs}
773 	kEventParamAccessibleAttributeValue = FourCharCode('atvl'); { variable}
774 	kEventParamAccessibleAttributeSettable = FourCharCode('atst'); { typeBoolean}
775 	kEventParamAccessibleAttributeParameter = FourCharCode('atpa'); { typeCFTypeRef}
776 	kEventParamAccessibleActionName = FourCharCode('acnm'); { typeCFStringRef}
777 	kEventParamAccessibleActionNames = FourCharCode('acns'); { typeCFMutableArrayRef of CFStringRefs}
778 	kEventParamAccessibleActionDescription = FourCharCode('acds'); { typeCFMutableStringRef}
779 	kEventParamAccessibilityEventQueued = FourCharCode('aequ'); { typeBoolean}
780 
781 { Text field event type}
782 
783 const
784 	typeCFRange = FourCharCode('cfrn'); { CFRange}
785 
786 { AppleEvent event parameters}
787 
788 const
789 	kEventParamAppleEvent = FourCharCode('aevt'); { typeAppleEvent}
790 	kEventParamAppleEventReply = FourCharCode('aerp'); { typeAppleEvent}
791 
792 
793 {--------------------------------------------------------------------------------------}
794 {  � Helpful utilities                                                                 }
795 {--------------------------------------------------------------------------------------}
796 
797 {
798  *  MouseTrackingResult
799  *
800  *  Discussion:
801  *    These constants are returned from calls to TrackMouseLocation,
802  *    TrackMouseLocationWithOptions, TrackMouseRegion,
803  *    HIViewTrackMouseLocation, and HIViewTrackMouseShape. Those
804  *    routines are designed as replacements to calls such as StillDown
805  *    and WaitMouseUp. The advantage over those routines is that the
806  *    tracking APIs will block if the user is not moving the mouse,
807  *    whereas mouse tracking loops based on StillDown and WaitMouseUp
808  *    will spin, chewing up valuable CPU time that could be better
809  *    spent elsewhere. It is highly recommended that any tracking loops
810  *    in your application stop using StillDown and WaitMouseUp and
811  *    start using a tracking API. See the notes on those routines for
812  *    more information.
813  }
814 type
815 	MouseTrackingResult = UInt16;
816 const
817 {
818    * kMouseTrackingMouseDown is returned when the user presses any
819    * mouse button.
820    }
821 	kMouseTrackingMouseDown = 1;
822 
823   {
824    * kMouseTrackingMouseUp is returned when the user releases a mouse
825    * button. Typically you would look for this result in a mouse
826    * tracking loop to know when to exit the loop.
827    }
828 	kMouseTrackingMouseUp = 2;
829 
830   {
831    * kMouseTrackingMouseExited is returned when the user moves the
832    * mouse out of the specified region. This value is only returned
833    * from TrackMouseRegion and HIViewTrackMouseShape.
834    }
835 	kMouseTrackingMouseExited = 3;
836 
837   {
838    * kMouseTrackingMouseEntered is returned when the user moves the
839    * mouse into the specified region. This value is only returned from
840    * TrackMouseRegion and HIViewTrackMouseShape.
841    }
842 	kMouseTrackingMouseEntered = 4;
843 
844   {
845    * kMouseTrackingMouseDragged is returned when the user moves the
846    * mouse while holding down a mouse button. This value is not
847    * returned by TrackMouseRegion or HIViewTrackMouseShape; instead,
848    * when the mouse moves, those APIs check if the mouse has moved into
849    * or out of the specified region, and return
850    * kMouseTrackingMouseEntered/Exited.
851    }
852 	kMouseTrackingMouseDragged = 5;
853 
854   {
855    * kMouseTrackingKeyModifiersChanged is returned when the user
856    * changes the keyboard modifiers. This value is not returned by
857    * TrackMouseRegion. It is returned by all other tracking APIs.
858    }
859 	kMouseTrackingKeyModifiersChanged = 6;
860 
861   {
862    * kMouseTrackingUserCancelled is returned if the user presses the
863    * escape or cmd-period keys during mouse tracking. This value is
864    * returned by TrackMouseRegion in Mac OS X 10.2 and CarbonLib 1.6
865    * and later, and by all versions of all other tracking APIs.
866    }
867 	kMouseTrackingUserCancelled = 7;
868 
869   {
870    * kMouseTrackingTimedOut is returned if the timeout expires. This
871    * value is only returned by APIs that take a timeout parameter.
872    }
873 	kMouseTrackingTimedOut = 8;
874 
875   {
876    * kMouseTrackingMouseMoved is returned when the user moves the mouse
877    * while no mouse button is pressed. It is not returned by
878    * TrackMouseRegion or HIViewTrackMouseShape; instead, when the mouse
879    * moves, those APIs check if the mouse has moved into or out of the
880    * specified region, and return kMouseTrackingMouseEntered/Exited.
881    * Available in Mac OS X 10.2 and CarbonLib 1.6 and later.
882    }
883 	kMouseTrackingMouseMoved = 9;
884 
885   {
886    * kMouseTrackingClientEvent is returned when a caller-specified
887    * event was received during mouse tracking. This value is only
888    * returned by APIs that take a client- specified list of event
889    * parameters. Available in Mac OS X 10.5 and later.
890    }
891 	kMouseTrackingClientEvent = 10;
892 
893   {
894    * kMouseTrackingScrollWheel is returned when the user scrolls a
895    * mouse wheel. This value is only returned when the
896    * kTrackMouseLocationOptionIncludeScrollWheel option bit is
897    * specified in a call to TrackMouseLocationWithOptions,
898    * HIViewTrackMouseLocation, or HIViewTrackMouseShape. Available in
899    * Mac OS X 10.5 and later.
900    }
901 	kMouseTrackingScrollWheel = 11;
902 
903 
904 {
905  *  Summary:
906  *    Constants for use with the OptionBits parameter to
907  *    TrackMouseLocationWithOptions, HIViewTrackMouseLocation, and
908  *    HIViewTrackMouseShape.
909  }
910 const
911 {
912    * Indicates that mouse-up events should be left in the queue.
913    }
914 	kTrackMouseLocationOptionDontConsumeMouseUp = 1 shl 0;
915 
916   {
917    * Indicates that kEventMouseWheelMoved and kEventMouseScroll events
918    * should cause the tracking API to stop tracking and return
919    * kMouseTrackingScrollWheel.
920    }
921 	kTrackMouseLocationOptionIncludeScrollWheel = 1 shl 3;
922 
923 {
924  *  CheckEventQueueForUserCancel()
925  *
926  *  Summary:
927  *    Determines if there is a cancel event in the main thread's event
928  *    queue.
929  *
930  *  Discussion:
931  *    This API supports two cancel events: Escape and Cmd-Period. The
932  *    cancel event itself, as well as mouse or keyboard events in front
933  *    of the cancel event in the event queue, will be removed from the
934  *    queue.
935  *
936  *  Mac OS X threading:
937  *    Not thread safe
938  *
939  *  Availability:
940  *    Mac OS X:         in version 10.0 and later in Carbon.framework
941  *    CarbonLib:        in CarbonLib 1.0.2 and later
942  *    Non-Carbon CFM:   not available
943  }
CheckEventQueueForUserCancelnull944 function CheckEventQueueForUserCancel: Boolean; external name '_CheckEventQueueForUserCancel';
945 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
946 
947 
948 {
949  *  IsUserCancelEventRef()
950  *
951  *  Discussion:
952  *    Tests the event given to see whether the event represents a 'user
953  *    cancel' event. Currently this is defined to be either the escape
954  *    key being pressed, or command-period being pressed.
955  *
956  *  Mac OS X threading:
957  *    Not thread safe
958  *
959  *  Result:
960  *    A boolean value indicating whether the event is a user cancel
961  *    event.
962  *
963  *  Availability:
964  *    Mac OS X:         in version 10.0 and later in Carbon.framework
965  *    CarbonLib:        in CarbonLib 1.1 and later
966  *    Non-Carbon CFM:   not available
967  }
IsUserCancelEventRefnull968 function IsUserCancelEventRef( event: EventRef ): Boolean; external name '_IsUserCancelEventRef';
969 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
970 
971 
972 {$ifc not TARGET_CPU_64}
973 {
974  *  TrackMouseLocation()
975  *
976  *  Discussion:
977  *    Once entered, this routine waits for certain mouse events (move,
978  *    mouse down, mouse up). When one of these events occurs, the
979  *    function returns and tells the caller what happened and where the
980  *    mouse is currently located. While there is no activity, the
981  *    current event loop is run, effectively blocking the current
982  *    thread (save for any timers that fire). This helps to minimize
983  *    CPU usage when there is nothing going on.
984  *
985  *    On Mac OS X 10.1 and earlier, and CarbonLib 1.5 and earlier,
986  *    TrackMouseLocation, TrackMouseLocationWithOptions, and
987  *    TrackMouseRegion only support mouse-tracking when a mouse button
988  *    is pressed. They cannot be used for mouse-tracking when no mouse
989  *    button is pressed; if called when no button is pressed, they will
990  *    simply block until a button is pressed and will not return when
991  *    the mouse is moved. On Mac OS X 10.2 and CarbonLib 1.6 and later,
992  *    TrackMouseLocation, TrackMouseLocationWithOptions, and
993  *    TrackMouseRegion support mouse-tracking without a pressed mouse
994  *    button; TrackMouseLocation and TrackMouseLocationWithOptions
995  *    return kMouseTrackingMouseMoved if the mouse is moved while no
996  *    button is pressed, and TrackMouseRegion returns
997  *    kMouseTrackingMouseEntered/Exited if the mouse moves into or out
998  *    of the specified region while no button is pressed.
999  *
1000  *    For mouse tracking within an HIView, also see
1001  *    HIViewTrackMouseLocation.
1002  *
1003  *  Mac OS X threading:
1004  *    Not thread safe
1005  *
1006  *  Parameters:
1007  *
1008  *    inPort:
1009  *      The grafport to consider for mouse coordinates. You can pass
1010  *      NULL for this parameter to indicate the current port. The mouse
1011  *      location is returned in terms of local coordinates of this
1012  *      port. You can pass -1 for this parameter to indicate that the
1013  *      mouse location should be returned in global coordinates instead
1014  *      of local coordinates.
1015  *
1016  *    outPt:
1017  *      On exit, this parameter receives the mouse location from the
1018  *      last mouse event that caused this function to exit.
1019  *
1020  *    outResult:
1021  *      On exit, this parameter receives a value representing what kind
1022  *      of event was received that cause the function to exit, such as
1023  *      kMouseTrackingMouseUp.
1024  *
1025  *  Result:
1026  *    An operating system result code.
1027  *
1028  *  Availability:
1029  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
1030  *    CarbonLib:        in CarbonLib 1.1 and later
1031  *    Non-Carbon CFM:   not available
1032  }
TrackMouseLocationnull1033 function TrackMouseLocation( inPort: GrafPtr { can be NULL }; var outPt: Point; var outResult: MouseTrackingResult ): OSStatus; external name '_TrackMouseLocation';
1034 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1035 
1036 
1037 {
1038  *  TrackMouseLocationWithOptions()
1039  *
1040  *  Discussion:
1041  *    This routine is largely identical to TrackMouseLocation. Please
1042  *    read the notes on that function as well.
1043  *    TrackMouseLocationWithOptions supports additional parameters for
1044  *    leaving mouse-up events in the event queue, specifying a timeout,
1045  *    and retrieving the current mouse position and keyboard modifiers.
1046  *
1047  *
1048  *    For mouse tracking within an HIView, also see
1049  *    HIViewTrackMouseLocation.
1050  *
1051  *  Mac OS X threading:
1052  *    Not thread safe
1053  *
1054  *  Parameters:
1055  *
1056  *    inPort:
1057  *      The grafport to consider for mouse coordinates. You can pass
1058  *      NULL for this parameter to indicate the current port. The mouse
1059  *      location is returned in terms of local coordinates of this
1060  *      port. You can pass -1 for this parameter to indicate that the
1061  *      mouse location should be returned in global coordinates instead
1062  *      of local coordinates.
1063  *
1064  *    inOptions:
1065  *      The only option supported by this routine at present is
1066  *      kTrackMouseLocationOptionDontConsumeMouseUp, which indicates
1067  *      that the toolbox should leave mouse-up events in the queue. You
1068  *      may also pass zero for this parameter to get the default
1069  *      behavior, which is to remove mouse-up events from the queue
1070  *      before returning.
1071  *
1072  *    inTimeout:
1073  *      The amount of time to wait for an event. If no events arrive
1074  *      within this time, kMouseTrackingTimedOut is returned in
1075  *      outResult. Pass kEventDurationForever to wait indefinitely for
1076  *      the next event.
1077  *
1078  *    outPt:
1079  *      On exit, this parameter receives the mouse location from the
1080  *      last mouse event that caused this function to exit. If a
1081  *      timeout or key modifiers changed event caused this function to
1082  *      exit, the current mouse position at the time is returned.
1083  *
1084  *    outModifiers:
1085  *      On exit, this parameter receives the most recent state of the
1086  *      keyboard modifiers. If a timeout caused this function to exit,
1087  *      the current keyboard modifiers at the time are returned.
1088  *
1089  *    outResult:
1090  *      On exit, this parameter receives a value representing what kind
1091  *      of event was received that cause the function to exit, such as
1092  *      kMouseTrackingMouseUp.
1093  *
1094  *  Result:
1095  *    An operating system result code.
1096  *
1097  *  Availability:
1098  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
1099  *    CarbonLib:        in CarbonLib 1.3 and later
1100  *    Non-Carbon CFM:   not available
1101  }
TrackMouseLocationWithOptionsnull1102 function TrackMouseLocationWithOptions( inPort: GrafPtr { can be NULL }; inOptions: OptionBits; inTimeout: EventTimeout; var outPt: Point; outModifiers: UInt32Ptr { can be NULL }; var outResult: MouseTrackingResult ): OSStatus; external name '_TrackMouseLocationWithOptions';
1103 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1104 
1105 
1106 {
1107  *  TrackMouseRegion()
1108  *
1109  *  Discussion:
1110  *    This routine is largely identical to TrackMouseLocation. Please
1111  *    read the notes on that function as well. TrackMouseRegion differs
1112  *    from TrackMouseLocation by only returning when the mouse enters
1113  *    or exits a specified region that you pass in to the function, as
1114  *    opposed to whenever the mouse moves (it also returns for mouse
1115  *    up/down events). This is useful if you don't need to know
1116  *    intermediate mouse events, but rather just if the mouse enters or
1117  *    leaves an area.
1118  *
1119  *    For mouse tracking within an HIView, also see
1120  *    HIViewTrackMouseShape.
1121  *
1122  *  Mac OS X threading:
1123  *    Not thread safe
1124  *
1125  *  Parameters:
1126  *
1127  *    inPort:
1128  *      The grafport to consider for mouse coordinates. You can pass
1129  *      NULL for this parameter to indicate the current port. You can
1130  *      pass -1 for this parameter to indicate that the mouse region
1131  *      should be interpreted in global coordinates instead of local
1132  *      coordinates.
1133  *
1134  *    inRegion:
1135  *      The region to consider. This should be in the coordinates of
1136  *      the port you passed to inPort, or global coordinates if you
1137  *      passed -1 for the inPort parameter.
1138  *
1139  *    ioWasInRgn:
1140  *      On entry, this parameter should be set to true if the mouse is
1141  *      currently inside the region passed in inRegion, or false if the
1142  *      mouse is currently outside the region. On exit, this parameter
1143  *      is updated to reflect the current reality; e.g., if the
1144  *      outResult parameter returns kMouseTrackingMouseExited,
1145  *      ioWasInRgn will be set to false when this function exits.
1146  *      Because it is updated from within, you should only need to set
1147  *      this yourself before the first call to this function in your
1148  *      tracking loop. Typically, you should set this value to false
1149  *      initially, and TrackMouseRegion will return immediately with
1150  *      kMouseTrackingMouseEntered if your guess was wrong.
1151  *
1152  *    outResult:
1153  *      On exit, this parameter receives a value representing what kind
1154  *      of event was received that cause the function to exit, such as
1155  *      kMouseTrackingMouseEntered.
1156  *
1157  *  Result:
1158  *    An operating system result code.
1159  *
1160  *  Availability:
1161  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
1162  *    CarbonLib:        in CarbonLib 1.1 and later
1163  *    Non-Carbon CFM:   not available
1164  }
TrackMouseRegionnull1165 function TrackMouseRegion( inPort: GrafPtr { can be NULL }; inRegion: RgnHandle; var ioWasInRgn: Boolean; var outResult: MouseTrackingResult ): OSStatus; external name '_TrackMouseRegion';
1166 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1167 
1168 
1169 {$endc} {not TARGET_CPU_64}
1170 
1171 
1172 {
1173  *  Summary:
1174  *    Mouse tracking info selectors for HIMouseTrackingGetParameters.
1175  }
1176 const
1177 {
1178    * Requests the time and distance for determining �sticky� mouse
1179    * tracking. When the mouse is clicked on a menu title, the toolbox
1180    * will enter a sticky mouse-tracking mode depending on the time and
1181    * distance between the mouse-down event and the mouse-up event. In
1182    * this mode, the menu is tracked even though the mouse has already
1183    * been released.
1184    }
1185 	kMouseParamsSticky = FourCharCode('stic');
1186 
1187   {
1188    * Requests the time and distance for initiating the drag of a
1189    * window's proxy icon. After a mouse-down on a proxy icon, if the
1190    * user begins to drag the mouse prior to the specified amount of
1191    * time elapsing, the Window Manager drags the window, but if this
1192    * amount of time elapses before the mouse moves, the Window Manager
1193    * drags the proxy icon. The Window Manager also checks that the
1194    * mouse is within the specified distance from the original
1195    * mouse-down location before beginning the proxy icon drag. This
1196    * selector is available in Mac OS X 10.5 and later.
1197    }
1198 	kMouseParamsProxyIcon = FourCharCode('prox');
1199 
1200   {
1201    * Requests the time for determining when the user intends that a
1202    * mouse-down should invoke some further action. For example, this
1203    * selector is used when the user clicks on a bevel button with an
1204    * attached menu. The bevel button will display the menu after the
1205    * user has held down the mouse for this amount of time. For this
1206    * selector, the distance output parameter is not applicable and is
1207    * set to (0,0), if not NULL. This selector is available in Mac OS X
1208    * 10.5 and later.
1209    }
1210 	kMouseParamsClickAndHold = FourCharCode('clho');
1211 
1212   {
1213    * Requests the distance for determining when the user intends to
1214    * begin a drag of the clicked object. This distance is used by the
1215    * WaitMouseMoved API to determine when the user has moved the mouse
1216    * outside of the drag threshold. For this selector, the time output
1217    * parameter is not applicable and is set to 0, if not NULL. This
1218    * selector is available in Mac OS X 10.5 and later.
1219    }
1220 	kMouseParamsDragInitiation = FourCharCode('drag');
1221 
1222 {
1223  *  HIMouseTrackingGetParameters()
1224  *
1225  *  Summary:
1226  *    Returns information about how mouse tracking loops should behave.
1227  *
1228  *  Discussion:
1229  *    Mouse tracking loops may use different timeouts and wander
1230  *    distances to determine their behavior. This API provides a
1231  *    generic service for requesting this information.
1232  *
1233  *  Mac OS X threading:
1234  *    Not thread safe
1235  *
1236  *  Parameters:
1237  *
1238  *    inSelector:
1239  *      Indicates which type of information should be returned.
1240  *
1241  *    outTime:
1242  *      If selector is kMouseParamsSticky, returns the maximum time
1243  *      between mouse-down and mouse-up. If the time between events is
1244  *      longer than this value, sticky mode should not be invoked. May
1245  *      be NULL if this information is not required.
1246  *
1247  *    outDistance:
1248  *      If selector is kMouseParamsSticky, returns the maximum distance
1249  *      between mouse-down and mouse-up. If the distance between events
1250  *      is longer than this value, sticky mode should not be invoked.
1251  *      May be NULL if this information is not required.
1252  *
1253  *  Availability:
1254  *    Mac OS X:         in version 10.3 and later in Carbon.framework
1255  *    CarbonLib:        not available in CarbonLib 1.x
1256  *    Non-Carbon CFM:   not available
1257  }
HIMouseTrackingGetParametersnull1258 function HIMouseTrackingGetParameters( inSelector: OSType; outTime: EventTimePtr { can be NULL }; outDistance: HISizePtr { can be NULL } ): OSStatus; external name '_HIMouseTrackingGetParameters';
1259 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
1260 
1261 
1262 {$ifc not TARGET_CPU_64}
1263 {
1264  *  ConvertEventRefToEventRecord()
1265  *
1266  *  Discussion:
1267  *    This is a convenience routine to help you if there are places in
1268  *    your application where you need an EventRecord and all you have
1269  *    is an EventRef. If the event can be converted, outEvent is filled
1270  *    in and the function returns true. If not, false is returned and
1271  *    outEvent will contain a nullEvent.
1272  *
1273  *    Currently, the following events can be converted:
1274  *
1275  *    kEventClassMouse: kEventMouseDown, kEventMouseUp,
1276  *    kEventMouseMoved, kEventMouseDragged.
1277  *
1278  *    kEventClassKeyboard: kEventRawKeyDown, kEventRawKeyUp,
1279  *    kEventRawKeyRepeat.
1280  *
1281  *    kEventClassControl: kEventControlTrack (in Mac OS X 10.4 and
1282  *    later; converts to a mouseDown event).
1283  *
1284  *    kEventClassWindow: kEventWindowUpdate, kEventWindowActivate,
1285  *    kEventWindowDeactivate, kEventWindowCursorChange.
1286  *
1287  *    kEventClassApplication: kEventAppActivated, kEventAppDeactivated.
1288  *    <BR><BR> kEventClassAppleEvent: kEventAppleEvent.
1289  *
1290  *  Mac OS X threading:
1291  *    Not thread safe
1292  *
1293  *  Parameters:
1294  *
1295  *    inEvent:
1296  *      The EventRef to convert into an EventRecord.
1297  *
1298  *    outEvent:
1299  *      The EventRecord to fill out.
1300  *
1301  *  Result:
1302  *    A boolean indicating if the conversion was successful (true) or
1303  *    not (false).
1304  *
1305  *  Availability:
1306  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
1307  *    CarbonLib:        in CarbonLib 1.1 and later
1308  *    Non-Carbon CFM:   not available
1309  }
ConvertEventRefToEventRecordnull1310 function ConvertEventRefToEventRecord( inEvent: EventRef; var outEvent: EventRecord ): Boolean; external name '_ConvertEventRefToEventRecord';
1311 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1312 
1313 
1314 {
1315  *  IsEventInMask()
1316  *
1317  *  Discussion:
1318  *    This is a companion function for ConvertEventRefToEventRecord,
1319  *    and is provided as a convenience routine to help you if there are
1320  *    places in your application where you want to check an EventRef to
1321  *    see if it matches a classic EventMask bitfield. If the event
1322  *    matches, the function returns true.
1323  *
1324  *  Mac OS X threading:
1325  *    Not thread safe
1326  *
1327  *  Parameters:
1328  *
1329  *    inEvent:
1330  *      The EventRef to convert into an EventRecord.
1331  *
1332  *    inMask:
1333  *      The mask to consider.
1334  *
1335  *  Result:
1336  *    A boolean indicating if the event was considered to be in the
1337  *    mask provided.
1338  *
1339  *  Availability:
1340  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
1341  *    CarbonLib:        in CarbonLib 1.1 and later
1342  *    Non-Carbon CFM:   not available
1343  }
IsEventInMasknull1344 function IsEventInMask( inEvent: EventRef; inMask: EventMask ): Boolean; external name '_IsEventInMask';
1345 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1346 
1347 
1348 {
1349  *  GetLastUserEventTime()
1350  *
1351  *  Mac OS X threading:
1352  *    Not thread safe
1353  *
1354  *  Availability:
1355  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
1356  *    CarbonLib:        in CarbonLib 1.1 and later
1357  *    Non-Carbon CFM:   not available
1358  }
GetLastUserEventTimenull1359 function GetLastUserEventTime: EventTime; external name '_GetLastUserEventTime';
1360 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1361 
1362 
1363 {--------------------------------------------------------------------------------------}
1364 {  � Mouse Coalescing                                                                  }
1365 {--------------------------------------------------------------------------------------}
1366 {
1367  *  IsMouseCoalescingEnabled()
1368  *
1369  *  Discussion:
1370  *    Returns true if mouse coalescing is current enabled. When
1371  *    enabled, we coalesce mouse moved and mouse dragged events. By
1372  *    default, coalescing is on, but you can use
1373  *    SetMouseCoalescingEnabled to disable it if you want finer-grained
1374  *    mouse movement events, which is useful for drawing with tablets.
1375  *
1376  *  Mac OS X threading:
1377  *    Not thread safe
1378  *
1379  *  Result:
1380  *    A boolean indicating if coalescing is enabled.
1381  *
1382  *  Availability:
1383  *    Mac OS X:         in version 10.1 and later in Carbon.framework [32-bit only]
1384  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
1385  *    Non-Carbon CFM:   not available
1386  }
IsMouseCoalescingEnablednull1387 function IsMouseCoalescingEnabled: Boolean; external name '_IsMouseCoalescingEnabled';
1388 (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
1389 
1390 
1391 {
1392  *  SetMouseCoalescingEnabled()
1393  *
1394  *  Discussion:
1395  *    Allows you to set mouse move/drag event coalescing on or off. By
1396  *    default, coalescing is on, but you can use this function to
1397  *    disable it if you want finer-grained mouse movement events, which
1398  *    is useful for drawing with tablets.
1399  *
1400  *  Mac OS X threading:
1401  *    Not thread safe
1402  *
1403  *  Parameters:
1404  *
1405  *    inNewState:
1406  *      A boolean indicating if coalescing should be enabled (true) or
1407  *      disabled (false).
1408  *
1409  *    outOldState:
1410  *      A boolean which receives the prior state of mouse coalescing
1411  *      for restoration later. You can pass NULL for this parameter if
1412  *      you don't care.
1413  *
1414  *  Result:
1415  *    An operating system result code.
1416  *
1417  *  Availability:
1418  *    Mac OS X:         in version 10.1 and later in Carbon.framework [32-bit only]
1419  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
1420  *    Non-Carbon CFM:   not available
1421  }
SetMouseCoalescingEnablednull1422 function SetMouseCoalescingEnabled( inNewState: Boolean; outOldState: BooleanPtr { can be NULL } ): OSStatus; external name '_SetMouseCoalescingEnabled';
1423 (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
1424 
1425 
1426 {======================================================================================}
1427 {  EVENT CLASSES                                                                       }
1428 {======================================================================================}
1429 {$endc} {not TARGET_CPU_64}
1430 
1431 
1432 {
1433  *  Summary:
1434  *    Event classes
1435  }
1436 const
1437 {
1438    * Events related to the mouse (mouse down/up/moved).
1439    }
1440 	kEventClassMouse = FourCharCode('mous');
1441 
1442   {
1443    * Events related to the keyboard.
1444    }
1445 	kEventClassKeyboard = FourCharCode('keyb');
1446 
1447   {
1448    * Events related to text input (by keyboard, or by input method).
1449    }
1450 	kEventClassTextInput = FourCharCode('text');
1451 
1452   {
1453    * Application-level events (launch, quit, etc.).
1454    }
1455 	kEventClassApplication = FourCharCode('appl');
1456 
1457   {
1458    * Apple Events.
1459    }
1460 	kEventClassAppleEvent = FourCharCode('eppc');
1461 
1462   {
1463    * Events related to menus.
1464    }
1465 	kEventClassMenu = FourCharCode('menu');
1466 
1467   {
1468    * Events related to windows.
1469    }
1470 	kEventClassWindow = FourCharCode('wind');
1471 
1472   {
1473    * Events related to controls.
1474    }
1475 	kEventClassControl = FourCharCode('cntl');
1476 
1477   {
1478    * Events related to commands generated by menu items or controls.
1479    * These events contain HICommand structures.
1480    }
1481 	kEventClassCommand = FourCharCode('cmds');
1482 
1483   {
1484    * Events related to tablets.
1485    }
1486 	kEventClassTablet = FourCharCode('tblt');
1487 
1488   {
1489    * Events related to File Manager volumes.
1490    }
1491 	kEventClassVolume = FourCharCode('vol ');
1492 
1493   {
1494    * Events related to the Appearance Manager.
1495    }
1496 	kEventClassAppearance = FourCharCode('appm');
1497 
1498   {
1499    * Events related to the Services Manager.
1500    }
1501 	kEventClassService = FourCharCode('serv');
1502 
1503   {
1504    * Events related to toolbars.
1505    }
1506 	kEventClassToolbar = FourCharCode('tbar');
1507 
1508   {
1509    * Events related to toolbar items.
1510    }
1511 	kEventClassToolbarItem = FourCharCode('tbit');
1512 
1513   {
1514    * Events related to toolbar item views.
1515    }
1516 	kEventClassToolbarItemView = FourCharCode('tbiv');
1517 
1518   {
1519    * Events related to application accessibility.
1520    }
1521 	kEventClassAccessibility = FourCharCode('acce');
1522 
1523   {
1524    * Events related to the system.
1525    }
1526 	kEventClassSystem = FourCharCode('macs');
1527 
1528   {
1529    * Events related to Ink.
1530    }
1531 	kEventClassInk = FourCharCode('ink ');
1532 	kEventClassTSMDocumentAccess = FourCharCode('tdac');
1533 
1534   {
1535    * Events related to gestures: magnify, swipe, rotate.
1536    }
1537 	kEventClassGesture = FourCharCode('gest');
1538 
1539 {--------------------------------------------------------------------------------------}
1540 { Mouse Events                                                                         }
1541 {--------------------------------------------------------------------------------------}
1542 {
1543     kEventClassMouse quick reference:
1544 
1545     kEventMouseDown                 = 1,
1546     kEventMouseUp                   = 2,
1547     kEventMouseMoved                = 5,
1548     kEventMouseDragged              = 6,
1549     kEventMouseEntered              = 8,
1550     kEventMouseExited               = 9,
1551     kEventMouseWheelMoved           = 10,
1552     kEventMouseScroll               = 11
1553 
1554     NOTE: As of Mac OS X 10.1, mouse events carry more information which allow you
1555           to do less work and gain accuracy of hit testing. First, there is the
1556           kEventParamWindowRef parameter. This parameter tells you over which window
1557           the mouse click/move/etc occurred. In mouse dragged events, this is the
1558           window the mouse went down in, NOT the window the mouse is currently over.
1559           Next, there is the kEventParamWindowMouseLocation parameter. This is the
1560           window-relative position of the mouse in the window given in the
1561           kEventParamWindowRef parameter. 0,0 is at the top left of the structure
1562           of the window.
1563 }
1564 
1565 {
1566  *  EventMouseButton
1567  *
1568  }
1569 type
1570 	EventMouseButton = UInt16;
1571 const
1572 {
1573    * Only button for a one-button mouse (usually left button for
1574    * multi-button mouse)
1575    }
1576 	kEventMouseButtonPrimary = 1;
1577 
1578   {
1579    * Usually right button for a multi-button mouse
1580    }
1581 	kEventMouseButtonSecondary = 2;
1582 
1583   {
1584    * Usually middle button for a three-button mouse
1585    }
1586 	kEventMouseButtonTertiary = 3;
1587 
1588 
1589 {
1590  *  EventMouseWheelAxis
1591  *
1592  }
1593 type
1594 	EventMouseWheelAxis = UInt16;
1595 const
1596 {
1597    * The X axis (left or right)
1598    }
1599 	kEventMouseWheelAxisX = 0;
1600 
1601   {
1602    * The Y axis (up or down)
1603    }
1604 	kEventMouseWheelAxisY = 1;
1605 
1606 {
1607  *  kEventClassMouse / kEventMouseDown
1608  *
1609  *  Summary:
1610  *    A mouse button was pressed.
1611  *
1612  *  Discussion:
1613  *    All windows have a default handler installed on the window target
1614  *    that handles this event by calling SetFrontProcess on the current
1615  *    process if the current process is not already the front process.
1616  *    It is very important that an event handler for this event always
1617  *    return eventNotHandledErr, so that the default handler can run
1618  *    and can activate the current process.
1619  *
1620  *  Mac OS X threading:
1621  *    Not thread safe
1622  *
1623  *  Parameters:
1624  *
1625  *    --> kEventParamMouseLocation (in, typeHIPoint)
1626  *          The mouse location, in global coordinates.
1627  *
1628  *    --> kEventParamWindowRef (in, typeWindowRef)
1629  *          The window under the mouse. Available in Mac OS X 10.1 and
1630  *          later.
1631  *
1632  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
1633  *          The window-relative position of the mouse in the window
1634  *          given in the kEventParamWindowRef parameter. 0,0 is at the
1635  *          top left of the structure of the window. Available in Mac
1636  *          OS X 10.1 and later.
1637  *
1638  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
1639  *          The part code that the mouse location hit in the window.
1640  *          This parameter only exists if the WindowRef parameter
1641  *          exists. This saves you the trouble of calling FindWindow,
1642  *          which is expensive on Mac OS X as it needs to call the
1643  *          Window Server. Available in Mac OS X 10.3 and later.
1644  *
1645  *    --> kEventParamKeyModifiers (in, typeUInt32)
1646  *          The keyboard modifiers that were pressed when the event was
1647  *          generated.
1648  *
1649  *    --> kEventParamMouseButton (in, typeMouseButton)
1650  *          Which mouse button was pressed.
1651  *
1652  *    --> kEventParamClickCount (in, typeUInt32)
1653  *          Whether this is a single click, double click, etc.
1654  *
1655  *    --> kEventParamMouseChord (in, typeUInt32)
1656  *          Which other mouse buttons were pressed when the event was
1657  *          generated. Available on Mac OS X only.
1658  *
1659  *    --> kEventParamTabletEventType (in, typeUInt32)
1660  *          The type of tablet event which generated this mouse event;
1661  *          contains either kEventTabletPoint or kEventTabletProximity.
1662  *          Only present if the event was generated from a tablet.
1663  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
1664  *
1665  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
1666  *          Further information about the tablet event which generated
1667  *          this mouse event. Present if the the
1668  *          kEventParamTabletEventType parameter contains
1669  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
1670  *          1.5, and later.
1671  *
1672  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
1673  *          Further information about the tablet event which generated
1674  *          this mouse event. Present if the the
1675  *          kEventParamTabletEventType parameter contains
1676  *          kEventTabletProximity. Available on Mac OS X 10.1 and
1677  *          CarbonLib 1.5, and later.
1678  *
1679  *  Availability:
1680  *    Mac OS X:         in version 10.0 and later in Carbon.framework
1681  *    CarbonLib:        in CarbonLib 1.1 and later
1682  }
1683 const
1684 	kEventMouseDown = 1;
1685 
1686 {
1687  *  kEventClassMouse / kEventMouseUp
1688  *
1689  *  Summary:
1690  *    A mouse button was released.
1691  *
1692  *  Mac OS X threading:
1693  *    Not thread safe
1694  *
1695  *  Parameters:
1696  *
1697  *    --> kEventParamMouseLocation (in, typeHIPoint)
1698  *          The mouse location, in global coordinates.
1699  *
1700  *    --> kEventParamWindowRef (in, typeWindowRef)
1701  *          The window in which the mouse was original pressed.
1702  *          Available in Mac OS X 10.1 and later.
1703  *
1704  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
1705  *          The window-relative position of the mouse in the window
1706  *          given in the kEventParamWindowRef parameter. 0,0 is at the
1707  *          top left of the structure of the window. Available in Mac
1708  *          OS X 10.1 and later.
1709  *
1710  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
1711  *          The part code that the mouse location hit in the window.
1712  *          This parameter only exists if the WindowRef parameter
1713  *          exists. This saves you the trouble of calling FindWindow,
1714  *          which is expensive on Mac OS X as it needs to call the
1715  *          Window Server. Available in Mac OS X 10.3 and later.
1716  *
1717  *    --> kEventParamKeyModifiers (in, typeUInt32)
1718  *          The keyboard modifiers that were pressed when the event was
1719  *          generated.
1720  *
1721  *    --> kEventParamMouseButton (in, typeMouseButton)
1722  *          Which mouse button was released.
1723  *
1724  *    --> kEventParamClickCount (in, typeUInt32)
1725  *          Whether this is a single click, double click, etc.
1726  *
1727  *    --> kEventParamMouseChord (in, typeUInt32)
1728  *          Which other mouse buttons were pressed when the event was
1729  *          generated. Available on Mac OS X only.
1730  *
1731  *    --> kEventParamTabletEventType (in, typeUInt32)
1732  *          The type of tablet event which generated this mouse event;
1733  *          contains either kEventTabletPoint or kEventTabletProximity.
1734  *          Only present if the event was generated from a tablet.
1735  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
1736  *
1737  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
1738  *          Further information about the tablet event which generated
1739  *          this mouse event. Present if the the
1740  *          kEventParamTabletEventType parameter contains
1741  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
1742  *          1.5, and later.
1743  *
1744  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
1745  *          Further information about the tablet event which generated
1746  *          this mouse event. Present if the the
1747  *          kEventParamTabletEventType parameter contains
1748  *          kEventTabletProximity. Available on Mac OS X 10.1 and
1749  *          CarbonLib 1.5, and later.
1750  *
1751  *  Availability:
1752  *    Mac OS X:         in version 10.0 and later in Carbon.framework
1753  *    CarbonLib:        in CarbonLib 1.1 and later
1754  }
1755 const
1756 	kEventMouseUp = 2;
1757 
1758 {
1759  *  kEventClassMouse / kEventMouseMoved
1760  *
1761  *  Summary:
1762  *    The mouse was moved.
1763  *
1764  *  Mac OS X threading:
1765  *    Not thread safe
1766  *
1767  *  Parameters:
1768  *
1769  *    --> kEventParamMouseLocation (in, typeHIPoint)
1770  *          The mouse location, in global coordinates.
1771  *
1772  *    --> kEventParamWindowRef (in, typeWindowRef)
1773  *          The window under the mouse. Available in Mac OS X 10.3 and
1774  *          later.
1775  *
1776  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
1777  *          The window-relative position of the mouse in the window
1778  *          given in the kEventParamWindowRef parameter. 0,0 is at the
1779  *          top left of the structure of the window. Available in Mac
1780  *          OS X 10.3 and later.
1781  *
1782  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
1783  *          The part code that the mouse location hit in the window.
1784  *          This parameter only exists if the WindowRef parameter
1785  *          exists. This saves you the trouble of calling FindWindow,
1786  *          which is expensive on Mac OS X as it needs to call the
1787  *          Window Server. Available in Mac OS X 10.3 and later.
1788  *
1789  *    --> kEventParamKeyModifiers (in, typeUInt32)
1790  *          The keyboard modifiers that were pressed when the event was
1791  *          generated.
1792  *
1793  *    --> kEventParamMouseDelta (in, typeHIPoint)
1794  *          The change in mouse position, in absolute units, ignoring
1795  *          scaling. Available in Mac OS X only.
1796  *
1797  *    --> kEventParamTabletEventType (in, typeUInt32)
1798  *          The type of tablet event which generated this mouse event;
1799  *          contains either kEventTabletPoint or kEventTabletProximity.
1800  *          Only present if the event was generated from a tablet.
1801  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
1802  *
1803  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
1804  *          Further information about the tablet event which generated
1805  *          this mouse event. Present if the the
1806  *          kEventParamTabletEventType parameter contains
1807  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
1808  *          1.5, and later.
1809  *
1810  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
1811  *          Further information about the tablet event which generated
1812  *          this mouse event. Present if the the
1813  *          kEventParamTabletEventType parameter contains
1814  *          kEventTabletProximity. Available on Mac OS X 10.1 and
1815  *          CarbonLib 1.5, and later.
1816  *
1817  *  Availability:
1818  *    Mac OS X:         in version 10.0 and later in Carbon.framework
1819  *    CarbonLib:        in CarbonLib 1.1 and later
1820  }
1821 const
1822 	kEventMouseMoved = 5;
1823 
1824 {
1825  *  kEventClassMouse / kEventMouseDragged
1826  *
1827  *  Summary:
1828  *    The mouse was moved, and a button was down.
1829  *
1830  *  Mac OS X threading:
1831  *    Not thread safe
1832  *
1833  *  Parameters:
1834  *
1835  *    --> kEventParamMouseLocation (in, typeHIPoint)
1836  *          The mouse location, in global coordinates.
1837  *
1838  *    --> kEventParamWindowRef (in, typeWindowRef)
1839  *          The window in which the mouse was original pressed.
1840  *          Available in Mac OS X 10.1 and later.
1841  *
1842  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
1843  *          The window-relative position of the mouse in the window
1844  *          given in the kEventParamWindowRef parameter. 0,0 is at the
1845  *          top left of the structure of the window. Available in Mac
1846  *          OS X 10.1 and later.
1847  *
1848  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
1849  *          The part code that the mouse location hit in the window.
1850  *          This parameter only exists if the WindowRef parameter
1851  *          exists. This saves you the trouble of calling FindWindow,
1852  *          which is expensive on Mac OS X as it needs to call the
1853  *          Window Server. Available in Mac OS X 10.3 and later.
1854  *
1855  *    --> kEventParamKeyModifiers (in, typeUInt32)
1856  *          The keyboard modifiers that were pressed when the event was
1857  *          generated.
1858  *
1859  *    --> kEventParamMouseDelta (in, typeHIPoint)
1860  *          The change in mouse position, in absolute units, ignoring
1861  *          scaling. Available in Mac OS X only.
1862  *
1863  *    --> kEventParamTabletEventType (in, typeUInt32)
1864  *          The type of tablet event which generated this mouse event;
1865  *          contains either kEventTabletPoint or kEventTabletProximity.
1866  *          Only present if the event was generated from a tablet.
1867  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
1868  *
1869  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
1870  *          Further information about the tablet event which generated
1871  *          this mouse event. Present if the the
1872  *          kEventParamTabletEventType parameter contains
1873  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
1874  *          1.5, and later.
1875  *
1876  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
1877  *          Further information about the tablet event which generated
1878  *          this mouse event. Present if the the
1879  *          kEventParamTabletEventType parameter contains
1880  *          kEventTabletProximity. Available on Mac OS X 10.1 and
1881  *          CarbonLib 1.5, and later.
1882  *
1883  *  Availability:
1884  *    Mac OS X:         in version 10.0 and later in Carbon.framework
1885  *    CarbonLib:        in CarbonLib 1.1 and later
1886  }
1887 const
1888 	kEventMouseDragged = 6;
1889 
1890 {
1891  *  kEventClassMouse / kEventMouseEntered
1892  *
1893  *  Summary:
1894  *    The mouse entered a tracking area.
1895  *
1896  *  Mac OS X threading:
1897  *    Not thread safe
1898  *
1899  *  Parameters:
1900  *
1901  *    --> kEventParamMouseTrackingRef (in, typeMouseTrackingRef)
1902  *          The MouseTrackingRef whose region the mouse has just
1903  *          entered.
1904  *
1905  *    --> kEventParamMouseLocation (in, typeHIPoint)
1906  *          The mouse location, in global coordinates.
1907  *
1908  *    --> kEventParamWindowRef (in, typeWindowRef)
1909  *          The window under the mouse.
1910  *
1911  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
1912  *          The window-relative position of the mouse in the window
1913  *          given in the kEventParamWindowRef parameter. 0,0 is at the
1914  *          top left of the structure of the window.
1915  *
1916  *    --> kEventParamKeyModifiers (in, typeUInt32)
1917  *          The keyboard modifiers that were pressed when the event was
1918  *          generated.
1919  *
1920  *  Availability:
1921  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only]
1922  *    CarbonLib:        not available
1923  }
1924 const
1925 	kEventMouseEntered = 8;
1926 
1927 {
1928  *  kEventClassMouse / kEventMouseExited
1929  *
1930  *  Summary:
1931  *    The mouse exited a tracking area.
1932  *
1933  *  Mac OS X threading:
1934  *    Not thread safe
1935  *
1936  *  Parameters:
1937  *
1938  *    --> kEventParamMouseTrackingRef (in, typeMouseTrackingRef)
1939  *          The MouseTrackingRef whose region the mouse has just exited.
1940  *
1941  *    --> kEventParamMouseLocation (in, typeHIPoint)
1942  *          The mouse location, in global coordinates.
1943  *
1944  *    --> kEventParamWindowRef (in, typeWindowRef)
1945  *          The window under the mouse.
1946  *
1947  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
1948  *          The window-relative position of the mouse in the window
1949  *          given in the kEventParamWindowRef parameter. 0,0 is at the
1950  *          top left of the structure of the window.
1951  *
1952  *    --> kEventParamKeyModifiers (in, typeUInt32)
1953  *          The keyboard modifiers that were pressed when the event was
1954  *          generated.
1955  *
1956  *  Availability:
1957  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only]
1958  *    CarbonLib:        not available
1959  }
1960 const
1961 	kEventMouseExited = 9;
1962 
1963 {
1964  *  kEventClassMouse / kEventMouseWheelMoved
1965  *
1966  *  Summary:
1967  *    The mouse wheel was moved.
1968  *
1969  *  Discussion:
1970  *    This event is sent to the window or view underneath the mouse.
1971  *    The window or view does not need to be active to receive this
1972  *    event, but it must be in the active application; this event is
1973  *    not sent to windows or views in inactive applications. The event
1974  *    is sent first to the window, and if the window does not handle
1975  *    the view, the standard window event handler will send the event
1976  *    to the view under the mouse.
1977  *
1978  *  Mac OS X threading:
1979  *    Not thread safe
1980  *
1981  *  Parameters:
1982  *
1983  *    --> kEventParamMouseLocation (in, typeHIPoint)
1984  *          The mouse location, in global coordinates.
1985  *
1986  *    --> kEventParamWindowRef (in, typeWindowRef)
1987  *          The window under the mouse. Available in Mac OS X 10.1 and
1988  *          later.
1989  *
1990  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
1991  *          The window-relative position of the mouse in the window
1992  *          given in the kEventParamWindowRef parameter. 0,0 is at the
1993  *          top left of the structure of the window. Available in Mac
1994  *          OS X 10.1 and later.
1995  *
1996  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
1997  *          The part code that the mouse location hit in the window.
1998  *          This parameter only exists if the WindowRef parameter
1999  *          exists. This saves you the trouble of calling FindWindow,
2000  *          which is expensive on Mac OS X as it needs to call the
2001  *          Window Server. Available in Mac OS X 10.3 and later.
2002  *
2003  *    --> kEventParamKeyModifiers (in, typeUInt32)
2004  *          The keyboard modifiers that were pressed when the event was
2005  *          generated.
2006  *
2007  *    --> kEventParamMouseWheelAxis (in, typeMouseWheelAxis)
2008  *          The wheel axis which moved. Contains either
2009  *          kEventMouseWheelAxisX or kEventMouseWheelAxisY.
2010  *
2011  *    --> kEventParamMouseWheelDelta (in, typeSInt32)
2012  *          The amount of change in the wheel position. Generally, a
2013  *          positive change should be interpreted as an upward scroll
2014  *          (equivalent to a click in the up arrow of a scrollbar); a
2015  *          negative change should be interpreted as a downward scroll
2016  *          (equivalent to a click in the down arrow of a scrollbar).
2017  *          Applications should not scale the delta value provided in
2018  *          the event; the Mac OS X input device system provides
2019  *          pre-scaling according to the user�s desired mouse wheel
2020  *          speed.
2021  *
2022  *    --> kEventParamDirectionInverted (in, typeBoolean)
2023  *          Indicates that the scroll direction is inverted from the
2024  *          usage on Mac OS X 10.6 and earlier. In other words, if this
2025  *          parameter is true, the scroll direction indicates the
2026  *          direction that the content should move, rather than the
2027  *          scrollbar thumb. Available on Mac OS X 10.7 and later.
2028  *
2029  *  Availability:
2030  *    Mac OS X:         in version 10.0 and later in Carbon.framework
2031  *    CarbonLib:        not available
2032  }
2033 const
2034 	kEventMouseWheelMoved = 10;
2035 
2036 {
2037  *  kEventClassMouse / kEventMouseScroll
2038  *
2039  *  Summary:
2040  *    The user wants to scroll the object underneath the given mouse
2041  *    location by the specified number of pixels.
2042  *
2043  *  Discussion:
2044  *    This event is sent to the window or view underneath the mouse.
2045  *    The window or view does not need to be active to receive this
2046  *    event, but it must be in the active application; this event is
2047  *    not sent to windows or views in inactive applications. The event
2048  *    is sent first to the window, and if the window does not handle
2049  *    the view, the standard window event handler will send the event
2050  *    to the view under the mouse.
2051  *
2052  *  Mac OS X threading:
2053  *    Not thread safe
2054  *
2055  *  Parameters:
2056  *
2057  *    --> kEventParamMouseLocation (in, typeHIPoint)
2058  *          The mouse location, in global coordinates.
2059  *
2060  *    --> kEventParamWindowRef (in, typeWindowRef)
2061  *          The window under the mouse.
2062  *
2063  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
2064  *          The window-relative position of the mouse in the window
2065  *          given in the kEventParamWindowRef parameter. 0,0 is at the
2066  *          top left of the structure of the window.
2067  *
2068  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
2069  *          The part code that the mouse location hit in the window.
2070  *          This parameter only exists if the WindowRef parameter
2071  *          exists. This saves you the trouble of calling FindWindow,
2072  *          which is expensive on Mac OS X as it needs to call the
2073  *          Window Server.
2074  *
2075  *    --> kEventParamKeyModifiers (in, typeUInt32)
2076  *          The keyboard modifiers that were pressed when the event was
2077  *          generated.
2078  *
2079  *    --> kEventParamMouseWheelSmoothVerticalDelta (in, typeSInt32)
2080  *          A typeSInt32 indicating how many pixels to scroll
2081  *          vertically. Do not multiply this by your line height the
2082  *          same way you would for the kEventParamMouseWheelDelta
2083  *          parameter of a kEventMouseWheelMoved event. Both this and
2084  *          the equivalent Horizontal parameter may be present in an
2085  *          event, but are not guaranteed to be present. If both are
2086  *          present, you should scroll both horizontally and vertically
2087  *          if you can. You should be prepared for this parameter to be
2088  *          missing, however.
2089  *
2090  *    --> kEventParamMouseWheelSmoothHorizontalDelta (in, typeSInt32)
2091  *          A typeSInt32 indicating how many pixels to scroll
2092  *          horizontally. Do not multiply this by your line height the
2093  *          same way you would for the kEventParamMouseWheelDelta
2094  *          parameter of a kEventMouseWheelMoved event. Both this and
2095  *          the equivalent Vertical parameter may be present in an
2096  *          event, but are not guaranteed to be present. If both are
2097  *          present, you should scroll both horizontally and vertically
2098  *          if you can. You should be prepared for this parameter to be
2099  *          missing, however.
2100  *
2101  *    --> kEventParamEventRef (in, typeEventRef)
2102  *          A typeEventRef of a compatibility kEventMouseWheelMoved
2103  *          event that corresponds to this event. This parameter may
2104  *          not always be present. This parameter is used by the event
2105  *          dispatching mechanism to make sure that objects which don't
2106  *          register for kEventMouseScroll events can see
2107  *          kEventMouseWheelMoved events instead. You may extract this
2108  *          event and examine its contents if your code requires a
2109  *          kEventMouseWheelMoved event.
2110  *
2111  *    --> kEventParamDirectionInverted (in, typeBoolean)
2112  *          Indicates that the scroll direction is inverted from the
2113  *          usage on Mac OS X 10.6 and earlier. In other words, if this
2114  *          parameter is true, the scroll direction indicates the
2115  *          direction that the content should move, rather than the
2116  *          scrollbar thumb. Available on Mac OS X 10.7 and later.
2117  *
2118  *  Availability:
2119  *    Mac OS X:         in version 10.4 and later in Carbon.framework
2120  *    CarbonLib:        not available
2121  }
2122 const
2123 	kEventMouseScroll = 11;
2124 
2125 {--------------------------------------------------------------------------------------}
2126 { Gesture Events                                                                       }
2127 {--------------------------------------------------------------------------------------}
2128 {
2129     kEventClassGesture quick reference:
2130 
2131     kEventGestureStarted                = 1,
2132     kEventGestureEnded                  = 2,
2133 
2134     kEventGestureMagnify                = 4,
2135     kEventGestureSwipe                  = 5,
2136     kEventGestureRotate                 = 6,
2137 }
2138 {
2139  *  kEventClassGesture / kEventGestureStarted
2140  *
2141  *  Discussion:
2142  *    Sent when a gesture has started.
2143  *
2144  *  Mac OS X threading:
2145  *    Not thread safe
2146  *
2147  *  Parameters:
2148  *
2149  *    --> kEventParamMouseLocation (in, typeHIPoint)
2150  *          The mouse location, in global coordinates.
2151  *
2152  *    --> kEventParamWindowRef (in, typeWindowRef)
2153  *          The window under the mouse.
2154  *
2155  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
2156  *          The window-relative position of the mouse in the window
2157  *          given in the kEventParamWindowRef parameter. 0,0 is at the
2158  *          top left of the structure of the window.
2159  *
2160  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
2161  *          The part code that the mouse location hit in the window.
2162  *          This parameter only exists if the WindowRef parameter
2163  *          exists. This saves you the trouble of calling FindWindow,
2164  *          which is expensive on Mac OS X as it needs to call the
2165  *          Window Server.
2166  *
2167  *    --> kEventParamKeyModifiers (in, typeUInt32)
2168  *          The keyboard modifiers that were pressed when the event was
2169  *          generated.
2170  *
2171  *  Availability:
2172  *    Mac OS X:         in version 10.6 and later in Carbon.framework
2173  *    CarbonLib:        not available
2174  }
2175 const
2176 	kEventGestureStarted = 1;
2177 
2178 {
2179  *  kEventClassGesture / kEventGestureEnded
2180  *
2181  *  Discussion:
2182  *    Sent when a gesture has ended.
2183  *
2184  *  Mac OS X threading:
2185  *    Not thread safe
2186  *
2187  *  Parameters:
2188  *
2189  *    --> kEventParamMouseLocation (in, typeHIPoint)
2190  *          The mouse location, in global coordinates.
2191  *
2192  *    --> kEventParamWindowRef (in, typeWindowRef)
2193  *          The window under the mouse.
2194  *
2195  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
2196  *          The window-relative position of the mouse in the window
2197  *          given in the kEventParamWindowRef parameter. 0,0 is at the
2198  *          top left of the structure of the window.
2199  *
2200  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
2201  *          The part code that the mouse location hit in the window.
2202  *          This parameter only exists if the WindowRef parameter
2203  *          exists. This saves you the trouble of calling FindWindow,
2204  *          which is expensive on Mac OS X as it needs to call the
2205  *          Window Server.
2206  *
2207  *    --> kEventParamKeyModifiers (in, typeUInt32)
2208  *          The keyboard modifiers that were pressed when the event was
2209  *          generated.
2210  *
2211  *  Availability:
2212  *    Mac OS X:         in version 10.6 and later in Carbon.framework
2213  *    CarbonLib:        not available
2214  }
2215 const
2216 	kEventGestureEnded = 2;
2217 
2218 {
2219  *  kEventClassGesture / kEventGestureMagnify
2220  *
2221  *  Discussion:
2222  *    Sent when the user performs a magnify gesture, otherwise known as
2223  *    a zoom gesture, or a pinch.
2224  *
2225  *  Mac OS X threading:
2226  *    Not thread safe
2227  *
2228  *  Parameters:
2229  *
2230  *    --> kEventParamMouseLocation (in, typeHIPoint)
2231  *          The mouse location, in global coordinates.
2232  *
2233  *    --> kEventParamWindowRef (in, typeWindowRef)
2234  *          The window under the mouse.
2235  *
2236  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
2237  *          The window-relative position of the mouse in the window
2238  *          given in the kEventParamWindowRef parameter. 0,0 is at the
2239  *          top left of the structure of the window.
2240  *
2241  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
2242  *          The part code that the mouse location hit in the window.
2243  *          This parameter only exists if the WindowRef parameter
2244  *          exists. This saves you the trouble of calling FindWindow,
2245  *          which is expensive on Mac OS X as it needs to call the
2246  *          Window Server.
2247  *
2248  *    --> kEventParamKeyModifiers (in, typeUInt32)
2249  *          The keyboard modifiers that were pressed when the event was
2250  *          generated.
2251  *
2252  *    --> kEventParamMagnificationAmount (in, typeCGFloat)
2253  *          The desired magnification percentage based on the user's
2254  *          gesture.
2255  *
2256  *  Availability:
2257  *    Mac OS X:         in version 10.6 and later in Carbon.framework
2258  *    CarbonLib:        not available
2259  }
2260 const
2261 	kEventGestureMagnify = 4;
2262 
2263 {
2264  *  kEventClassGesture / kEventGestureSwipe
2265  *
2266  *  Discussion:
2267  *    Sent when the user performs a swipe gesture.
2268  *
2269  *  Mac OS X threading:
2270  *    Not thread safe
2271  *
2272  *  Parameters:
2273  *
2274  *    --> kEventParamMouseLocation (in, typeHIPoint)
2275  *          The mouse location, in global coordinates.
2276  *
2277  *    --> kEventParamWindowRef (in, typeWindowRef)
2278  *          The window under the mouse.
2279  *
2280  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
2281  *          The window-relative position of the mouse in the window
2282  *          given in the kEventParamWindowRef parameter. 0,0 is at the
2283  *          top left of the structure of the window.
2284  *
2285  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
2286  *          The part code that the mouse location hit in the window.
2287  *          This parameter only exists if the WindowRef parameter
2288  *          exists. This saves you the trouble of calling FindWindow,
2289  *          which is expensive on Mac OS X as it needs to call the
2290  *          Window Server.
2291  *
2292  *    --> kEventParamKeyModifiers (in, typeUInt32)
2293  *          The keyboard modifiers that were pressed when the event was
2294  *          generated.
2295  *
2296  *    --> kEventParamSwipeDirection (in, typeHIPoint)
2297  *          A point describing the direction to move the content in
2298  *          respond to the user's gesture. If the y coordinate is -1,
2299  *          move the content up. If the y coordinate is 1, move the
2300  *          content down. If the x coordinate is -1, move the content
2301  *          to the left. If the x coordinate is 1, move the content to
2302  *          the right.
2303  *
2304  *  Availability:
2305  *    Mac OS X:         in version 10.6 and later in Carbon.framework
2306  *    CarbonLib:        not available
2307  }
2308 const
2309 	kEventGestureSwipe = 5;
2310 
2311 {
2312  *  kEventClassGesture / kEventGestureRotate
2313  *
2314  *  Discussion:
2315  *    Sent when the user performs a rotate gesture.
2316  *
2317  *  Mac OS X threading:
2318  *    Not thread safe
2319  *
2320  *  Parameters:
2321  *
2322  *    --> kEventParamMouseLocation (in, typeHIPoint)
2323  *          The mouse location, in global coordinates.
2324  *
2325  *    --> kEventParamWindowRef (in, typeWindowRef)
2326  *          The window under the mouse.
2327  *
2328  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
2329  *          The window-relative position of the mouse in the window
2330  *          given in the kEventParamWindowRef parameter. 0,0 is at the
2331  *          top left of the structure of the window.
2332  *
2333  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
2334  *          The part code that the mouse location hit in the window.
2335  *          This parameter only exists if the WindowRef parameter
2336  *          exists. This saves you the trouble of calling FindWindow,
2337  *          which is expensive on Mac OS X as it needs to call the
2338  *          Window Server.
2339  *
2340  *    --> kEventParamKeyModifiers (in, typeUInt32)
2341  *          The keyboard modifiers that were pressed when the event was
2342  *          generated.
2343  *
2344  *    --> kEventParamRotationAmount (in, typeCGFloat)
2345  *          The desired rotation amount, in degrees in polar
2346  *          coordinates.
2347  *
2348  *  Availability:
2349  *    Mac OS X:         in version 10.6 and later in Carbon.framework
2350  *    CarbonLib:        not available
2351  }
2352 const
2353 	kEventGestureRotate = 6;
2354 
2355 {--------------------------------------------------------------------------------------}
2356 { TSM Document Access Events                                                           }
2357 {--------------------------------------------------------------------------------------}
2358 {
2359     kEventClassTSMDocumentAccess quick reference:
2360 
2361     ** Text Access **
2362     kEventTSMDocumentAccessGetLength                        = 1,
2363     kEventTSMDocumentAccessGetSelectedRange                 = 2,
2364     kEventTSMDocumentAccessGetCharactersPtr                 = 3,
2365     kEventTSMDocumentAccessGetCharactersPtrForLargestBuffer = 4,
2366     kEventTSMDocumentAccessGetCharacters                    = 5,
2367 
2368     ** Text Attribute Access **
2369     kEventTSMDocumentAccessGetFont                          = 6,
2370     kEventTSMDocumentAccessGetGlyphInfo                     = 7,
2371     kEventTSMDocumentAccessGetFirstRectForRange             = 11,
2372 
2373     ** Transaction control **
2374     kEventTSMDocumentAccessLockDocument                     = 8,
2375     kEventTSMDocumentAccessUnlockDocument                   = 9
2376 
2377     These events allow access to a document's content.  They are grouped in the following
2378     categories: text access, text attribute, and transaction related events.
2379 
2380     NOTE:  TSM dispatches events of the TSMDocumentAccess class only as Carbon events.  These
2381             are not converted for TSM clients that still install AppleEvent handlers for TSM events.
2382     NOTE:  Text Services dispatch these Carbon events through TSM's SendTextInputEvent API.
2383             Normally only used for TextInput class TSM events, but this SendTextInputEvent is a bit
2384             of a misnomer.  You should use it for TSMDocumentAccess class events as well.
2385 }
2386 {
2387 
2388     ** Document Access Text events **
2389 
2390     The following Text Access events are very similar in design to the CFString API.
2391     The entire document can be conceived as a flattened Unicode string, and the
2392     events in this interface can access any portion of it.  The GetSelectedRange() method
2393     allow a text service to obtain text near the insertion point (or selection), but access
2394     is by no means restricted to this vicinity.  Use the GetLength() method to obtain the
2395     size of the document.
2396 
2397     Supporting these events effectively provide hooks into the text engine, but it is
2398     understood that access to a document in this way is to be strictly Read-Only.  Where
2399     direct access to a document's content cannot be provided through a pointer, the requested
2400     text can be copied instead.  Situations where a pointer may not be available from the
2401     text engine include the following:
2402 
2403         -A pointer would require conversion of text in Mac encodings to Unicode
2404         -A pointer would require sparse Unicode text blocks to be flattened into a single
2405          buffer.
2406 
2407     The idea is to minimize copying and converting text encodings where possible.  The text
2408     service will typically begin by asking for a document pointer via
2409     kEventTSMDocumentAccessGetCharactersPtr.  If this fails, it will typically fallback to
2410     kEventTSMDocumentAccessGetCharactersPtrForLargestBuffer, specifying a location of interest.
2411     If this fails, it will fallback to kEventTSMDocumentAccessGetCharacters, specifying a range
2412     of interest.  Of course, when requesting small amounts of data such a few characters on either
2413     side of the insertion point, there is no obligation to optimize in this way.  It's valid to
2414     simply use kEventTSMDocumentAccessGetCharacters.
2415 
2416     The text engine is entirely free to deny a request for a text pointer for these or any other
2417     implementation specific reason.
2418 }
2419 {
2420  *  kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetLength
2421  *
2422  *  Summary:
2423  *    Returns the number of 16-bit Unicode characters in the document.
2424  *
2425  *  Discussion:
2426  *    This event is equivalent to calling CFStringGetLength() on the
2427  *    app's document.
2428  *
2429  *  Mac OS X threading:
2430  *    Not thread safe
2431  *
2432  *  Parameters:
2433  *
2434  *    --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
2435  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
2436  *          later.
2437  *
2438  *          This parameter is provided by the input method originating
2439  *          the event. (Required parameter)
2440  *
2441  *    --> kEventParamTSMDocAccessSendRefCon (in, typeRefCon)
2442  *          TSM's SendTextInputEvent, called by an input method,
2443  *          inserts this parameter before dispatching the event to the
2444  *          user focus. (Required Parameter)
2445  *
2446  *          On Mac OS X 10.4 and earlier, this parameter uses
2447  *          typeSInt32, and you must retrieve it using that constant.
2448  *          On Mac OS X 10.5 and later, to support 64-bit refcon
2449  *          values, this parameter uses typeRefCon. For 64-bit
2450  *          compatibility, you must use typeRefCon when retrieving this
2451  *          parameter; for 32-bit targets, however, you may continue to
2452  *          use typeSInt32 if you wish, or switch to typeRefCon.
2453  *
2454  *    <-- kEventParamTSMDocAccessCharacterCount (out, typeCFIndex)
2455  *          The size of the document in UniChar. Required reply
2456  *          parameter.
2457  *
2458  *  Availability:
2459  *    Mac OS X:         in version 10.3 and later in Carbon.framework
2460  *    CarbonLib:        not available
2461  }
2462 const
2463 	kEventTSMDocumentAccessGetLength = 1;
2464 
2465 {
2466  *  kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetSelectedRange
2467  *
2468  *  Summary:
2469  *    Returns the selection range in the document.
2470  *
2471  *  Mac OS X threading:
2472  *    Not thread safe
2473  *
2474  *  Parameters:
2475  *
2476  *    --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
2477  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
2478  *          later.
2479  *
2480  *          This parameter is provided by the input method originating
2481  *          the event. (Required parameter)
2482  *
2483  *    --> kEventParamTSMDocAccessSendRefCon (in, typeRefCon)
2484  *          TSM's SendTextInputEvent, called by an input method,
2485  *          inserts this parameter before dispatching the event to the
2486  *          user focus.  (Required Parameter)
2487  *
2488  *          On Mac OS X 10.4 and earlier, this parameter uses
2489  *          typeSInt32, and you must retrieve it using that constant.
2490  *          On Mac OS X 10.5 and later, to support 64-bit refcon
2491  *          values, this parameter uses typeRefCon. For 64-bit
2492  *          compatibility, you must use typeRefCon when retrieving this
2493  *          parameter; for 32-bit targets, however, you may continue to
2494  *          use typeSInt32 if you wish, or switch to typeRefCon.
2495  *
2496  *    <-- kEventParamTSMDocAccessReplyCharacterRange (out, typeCFRange)
2497  *          The selection range as a CFRange in UniChar.  If the
2498  *          selection is empty, the range identifies the insertion
2499  *          point and the range will specify a length of 0. Required
2500  *          reply parameter.
2501  *
2502  *  Availability:
2503  *    Mac OS X:         in version 10.3 and later in Carbon.framework
2504  *    CarbonLib:        not available
2505  }
2506 const
2507 	kEventTSMDocumentAccessGetSelectedRange = 2;
2508 
2509 {
2510  *  kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetCharactersPtr
2511  *
2512  *  Summary:
2513  *    Returns a Unicode pointer to the entire document content.
2514  *
2515  *  Discussion:
2516  *    This event is equivalent to calling CFStringGetCharactersPtr() on
2517  *    the app's document treated as a CFString. Some text engines may
2518  *    not support this event for reasons that are implementation
2519  *    dependent. For example, a text engine's backing store may consist
2520  *    of legacy encoding runs.  It may also consist of unflattened
2521  *    Unicode, stored as a B-tree of text blocks.  For such reasons, a
2522  *    text engine may reject a request for a pointer to a flattened
2523  *    Unicode buffer. It is also understood that text access through
2524  *    this pointer is to be strictly READ-ONLY.  Any changes to the
2525  *    document should be made through TSM TextInput events, such as
2526  *    kEventTextInputUpdateActiveInputArea or
2527  *    kEventTextInputUnicodeText. NOTE:  This pointer is valid only
2528  *    during a transaction surrounded by document lock/unlock events,
2529  *    or until an event causes the document to change, such as
2530  *    dispatching kEventTextInputUpdateActiveInputArea or
2531  *    kEventTextInputUnicodeText events, whichever occurs first.
2532  *
2533  *  Mac OS X threading:
2534  *    Not thread safe
2535  *
2536  *  Parameters:
2537  *
2538  *    --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
2539  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
2540  *          later.
2541  *
2542  *          This parameter is provided by the input method originating
2543  *          the event. (Required parameter)
2544  *
2545  *    --> kEventParamTSMDocAccessSendRefCon (in, typeRefCon)
2546  *          TSM's SendTextInputEvent, called by an input method,
2547  *          inserts this parameter before dispatching the event to the
2548  *          user focus.  (Required Parameter)
2549  *
2550  *          On Mac OS X 10.4 and earlier, this parameter uses
2551  *          typeSInt32, and you must retrieve it using that constant.
2552  *          On Mac OS X 10.5 and later, to support 64-bit refcon
2553  *          values, this parameter uses typeRefCon. For 64-bit
2554  *          compatibility, you must use typeRefCon when retrieving this
2555  *          parameter; for 32-bit targets, however, you may continue to
2556  *          use typeSInt32 if you wish, or switch to typeRefCon.
2557  *
2558  *    <-- kEventParamTSMDocAccessReplyCharactersPtr (out, typePtr)
2559  *          The UniChar pointer to the document. Required reply
2560  *          parameter, if the event is supported.
2561  *
2562  *  Availability:
2563  *    Mac OS X:         in version 10.3 and later in Carbon.framework
2564  *    CarbonLib:        not available
2565  }
2566 const
2567 	kEventTSMDocumentAccessGetCharactersPtr = 3;
2568 
2569 {
2570  *  kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetCharactersPtrForLargestBuffer
2571  *
2572  *  Summary:
2573  *    Returns a Unicode pointer to a portion of the document.
2574  *
2575  *  Discussion:
2576  *    This event is similar to calling CFStringGetCharactersPtr() on a
2577  *    portion of the app's document treated as a CFString, except that
2578  *    the substring is determined by the text engine. Some text engines
2579  *    may keep text in unflattened Unicode, stored as a B-tree of text
2580  *    blocks, for example.  In some cases, especially near locations
2581  *    such as the insertion point, the text engine may have cached a
2582  *    good chunk of text to which it can readily provide a pointer. A
2583  *    text engine may reject a request for such a pointer. It is also
2584  *    understood that text access through this pointer is to be
2585  *    strictly READ-ONLY.  Any changes to the document should be made
2586  *    through TSM TextInput events, such as
2587  *    kEventTextInputUpdateActiveInputArea or
2588  *    kEventTextInputUnicodeText. NOTE:  This pointer is valid only
2589  *    during a transaction surrounded by document lock/unlock, or until
2590  *    an event causes the document to change, such as dispatching
2591  *    kEventTextInputUpdateActiveInputArea or
2592  *    kEventTextInputUnicodeText events.
2593  *
2594  *  Mac OS X threading:
2595  *    Not thread safe
2596  *
2597  *  Parameters:
2598  *
2599  *    --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
2600  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
2601  *          later.
2602  *
2603  *          This parameter is provided by the input method originating
2604  *          the event. (Required parameter)
2605  *
2606  *    --> kEventParamTSMDocAccessSendRefCon (in, typeRefCon)
2607  *          TSM's SendTextInputEvent, called by an input method,
2608  *          inserts this parameter before dispatching the event to the
2609  *          user focus.  (Required Parameter)
2610  *
2611  *          On Mac OS X 10.4 and earlier, this parameter uses
2612  *          typeSInt32, and you must retrieve it using that constant.
2613  *          On Mac OS X 10.5 and later, to support 64-bit refcon
2614  *          values, this parameter uses typeRefCon. For 64-bit
2615  *          compatibility, you must use typeRefCon when retrieving this
2616  *          parameter; for 32-bit targets, however, you may continue to
2617  *          use typeSInt32 if you wish, or switch to typeRefCon.
2618  *
2619  *    --> kEventParamTSMDocAccessSendCharacterIndex (in, typeCFIndex)
2620  *          The location in the document for which the caller would
2621  *          like a pointer to a buffer of text that includes that
2622  *          location.    This buffer could be available from a cache
2623  *          due to recent interaction near that location, such as the
2624  *          insertion point. Required parameter.
2625  *
2626  *    <-- kEventParamTSMDocAccessReplyCharactersPtr (out, typePtr)
2627  *          The UniChar pointer to a portion of the document text.
2628  *          Required reply parameter, if the event is handled.
2629  *
2630  *    <-- kEventParamTSMDocAccessReplyCharacterRange (out, typeCFRange)
2631  *          The document-relative range of text represented by the
2632  *          returned text pointer. Required reply parameter, if the
2633  *          event is handled.
2634  *
2635  *  Availability:
2636  *    Mac OS X:         in version 10.3 and later in Carbon.framework
2637  *    CarbonLib:        not available
2638  }
2639 const
2640 	kEventTSMDocumentAccessGetCharactersPtrForLargestBuffer = 4;
2641 
2642 {
2643  *  kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetCharacters
2644  *
2645  *  Summary:
2646  *    Fills caller provided buffer with Unicode characters in the
2647  *    specified range.
2648  *
2649  *  Discussion:
2650  *    This event is equivalent to calling CFStringGetCharacters() on
2651  *    the app's document treated as a CFString.
2652  *
2653  *  Mac OS X threading:
2654  *    Not thread safe
2655  *
2656  *  Parameters:
2657  *
2658  *    --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
2659  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
2660  *          later.
2661  *
2662  *          This parameter is provided by the input method originating
2663  *          the event. (Required parameter)
2664  *
2665  *    --> kEventParamTSMDocAccessSendRefCon (in, typeRefCon)
2666  *          TSM's SendTextInputEvent, called by an input method,
2667  *          inserts this parameter before dispatching the event to the
2668  *          user focus.  (Required Parameter)
2669  *
2670  *          On Mac OS X 10.4 and earlier, this parameter uses
2671  *          typeSInt32, and you must retrieve it using that constant.
2672  *          On Mac OS X 10.5 and later, to support 64-bit refcon
2673  *          values, this parameter uses typeRefCon. For 64-bit
2674  *          compatibility, you must use typeRefCon when retrieving this
2675  *          parameter; for 32-bit targets, however, you may continue to
2676  *          use typeSInt32 if you wish, or switch to typeRefCon.
2677  *
2678  *    --> kEventParamTSMDocAccessSendCharacterRange (in, typeCFRange)
2679  *          The range of text that should be copied into the buffer
2680  *          provided by the caller. Required parameter.
2681  *
2682  *    --> kEventParamTSMDocAccessSendCharactersPtr (in, typePtr)
2683  *          A buffer provided by the caller to contain the specified
2684  *          range of UniChars.  This buffer is identical in usage to
2685  *          that of CFStringGetCharacters(). Required parameter.
2686  *
2687  *  Availability:
2688  *    Mac OS X:         in version 10.3 and later in Carbon.framework
2689  *    CarbonLib:        not available
2690  }
2691 const
2692 	kEventTSMDocumentAccessGetCharacters = 5;
2693 
2694 {
2695 
2696     ** Document Access Attribute events **
2697 
2698     The following Text Attribute events define how a text service can obtain certain attributes
2699     at text locations throughout an application's document.
2700 
2701     Currently, the only attributes supported by these events are font (and font size)
2702     via kEventTSMDocumentAccessGetFont and glyphID/CID info via kEventTSMDocumentAccessGetGlyphInfo.
2703 
2704     Where these attributes span multiple characters, effective ranges (over which
2705     the attribute is constant) are returned by the text engine.
2706 }
2707 
2708 {
2709  *  Summary:
2710  *    Values used TSMDocAccessAttributes bit field
2711  *
2712  *  Discussion:
2713  *    The following bit assignments are used for TSMDocAccessAttributes
2714  *    parameters. This parameter is used to specify desired (optional)
2715  *    attributes in the kEventTSMDocumentAccessGetFont and
2716  *    kEventTSMDocumentAccessGetGlyphInfo events. They are specified in
2717  *    the kEventParamTSMDocAccessRequestedCharacterAttributes parameter.
2718  }
2719 const
2720 {
2721    * Font size information is desired.
2722    * On Mac OS 10.5 and later, this attribute is DEPRECATED in favor of
2723    * CTFontRef information contained in the
2724    * kEventParamTSMDocAccessReplyCTFontRef parameter.  Font size is
2725    * accessed through the CTFontRef itself.
2726    * Note:  Text Services Manager will always set this attribute when
2727    * dispatching the kEventTSMDocumentAccessGetFont event to the
2728    * application.  This allows a more meaningful CTFontRef to be
2729    * constructed for the benefit of requesting input methods should the
2730    * application return only compatibility data in the form of
2731    * ATSFontRef and font size.
2732    }
2733 	kTSMDocAccessFontSizeAttributeBit = 0;
2734 
2735   {
2736    * Effective Range information is desired.  Used in
2737    * kEventTSMDocumentAccessGetFont and
2738    * kEventTSMDocumentAccessGetGlyphInfo events.
2739    }
2740 	kTSMDocAccessEffectiveRangeAttributeBit = 1;
2741 
2742 type
2743 	TSMDocAccessAttributes = UInt32;
2744 const
2745 	kTSMDocAccessFontSizeAttribute = 1 shl kTSMDocAccessFontSizeAttributeBit;
2746 	kTSMDocAccessEffectiveRangeAttribute = 1 shl kTSMDocAccessEffectiveRangeAttributeBit; { More attributes may be added in the future}
2747 
2748 
2749 {
2750  *  kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetFont
2751  *
2752  *  Summary:
2753  *    Returns font, font size, and the range over which these
2754  *    attributes are constant.
2755  *
2756  *  Discussion:
2757  *    Where the font/font size attributes span multiple characters, an
2758  *    effective range (over which requested attributes are constant) is
2759  *    returned by the text engine.
2760  *
2761  *  Mac OS X threading:
2762  *    Not thread safe
2763  *
2764  *  Parameters:
2765  *
2766  *    --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
2767  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
2768  *          later.
2769  *
2770  *          This parameter is provided by the input method originating
2771  *          the event. (Required parameter)
2772  *
2773  *    --> kEventParamTSMDocAccessSendRefCon (in, typeRefCon)
2774  *          TSM's SendTextInputEvent, called by an input method,
2775  *          inserts this parameter before dispatching the event to the
2776  *          user focus.  (Required Parameter)
2777  *
2778  *          On Mac OS X 10.4 and earlier, this parameter uses
2779  *          typeSInt32, and you must retrieve it using that constant.
2780  *          On Mac OS X 10.5 and later, to support 64-bit refcon
2781  *          values, this parameter uses typeRefCon. For 64-bit
2782  *          compatibility, you must use typeRefCon when retrieving this
2783  *          parameter; for 32-bit targets, however, you may continue to
2784  *          use typeSInt32 if you wish, or switch to typeRefCon.
2785  *
2786  *    --> kEventParamTSMDocAccessSendCharacterIndex (in, typeCFIndex)
2787  *          The location in the document for which the caller would
2788  *          like font information.<BR> Required parameter.
2789  *
2790  *    --> kEventParamTSMDocAccessRequestedCharacterAttributes (in, typeUInt32)
2791  *          A TSMDocAccessAttributes bit field filled out with the
2792  *          attributes desired.
2793  *          Applicable values for this event are:
2794  *
2795  *          kTSMDocAccessFontSizeAttribute
2796  *          This attribute requests font size information through the
2797  *          kEventParamTSMDocAccessReplyFontSize parameter (only if an
2798  *          ATSFontRef is being returned via
2799  *          kEventParamTSMDocAccessReplyATSFont).
2800  *
2801  *          Note:  On Mac OS X 10.5 and later, Text Services Manager
2802  *          will always set this attribute when dispatching the
2803  *          kEventTSMDocumentAccessGetFont event to the application.
2804  *          This allows a more meaningful CTFontRef to be constructed
2805  *          for the benefit of requesting input methods should the
2806  *          application return only compatibility data in the form of
2807  *          ATSFontRef and font size.
2808  *
2809  *          kTSMDocAccessEffectiveRangeAttribute
2810  *          This attribute requests the text range over which font or
2811  *          font/size is constant.<BR> <BR> Required parameter.
2812  *
2813  *    <-- kEventParamTSMDocAccessReplyCTFontRef (out, typeCTFontRef)
2814  *          The CTFontRef for the location specified  by the caller.
2815  *          This is the PREFERRED method of accessing font info on Mac
2816  *          OS X 10.5 and later.
2817  *
2818  *          Note:  For compatibility with applications that have not
2819  *          yet adopted the CTFont API, the toolbox will automatically
2820  *          coerce this parameter, if not present, from
2821  *          kEventParamTSMDocAccessReplyATSFont and the font size
2822  *          parameter kEventParamTSMDocAccessReplyFontSize.
2823  *
2824  *          Note2:  This parameter is particularly important for input
2825  *          methods to adopt, because it will allow them to reproduce
2826  *          application text with much higher fidelity in its own UI
2827  *          when the application also adopts CTFont.
2828  *
2829  *          Optional reply parameter if
2830  *          kEventParamTSMDocAccessReplyATSFont and
2831  *          kEventParamTSMDocAccessReplyFontSize are provided.
2832  *
2833  *    <-- kEventParamTSMDocAccessReplyATSFont (out, typeATSFontRef)
2834  *          The ATSFontRef for the location specified  by the
2835  *          caller.
2836  *
2837  *          On Mac OS X 10.5 and later, this parameter is part of the
2838  *          compatibility parameter set, and will be deprecated in the
2839  *          future.  For compatibility with existing input methods, if
2840  *          the application returns a CTFontRef (via
2841  *          kEventParamTSMDocAccessReplyCTFontRef), TSM will coerce the
2842  *          CTFontRef to this ATSFontRef parameter and the font size
2843  *          kEventParamTSMDocAccessReplyFontSize parameter.
2844  *          Please use kEventParamTSMDocAccessReplyCTFontRef if at all
2845  *          possible.
2846  *
2847  *          Optional reply parameter if
2848  *          kEventParamTSMDocAccessReplyCTFontRef is provided.
2849  *
2850  *    <-- kEventParamTSMDocAccessReplyFontSize (out, typeCGFloat)
2851  *          The font size for the requested location if an ATSFontRef
2852  *          is being returned via kEventParamTSMDocAccessReplyATSFont
2853  *          and kTSMDocAccessFontSizeAttribute is specified in the bit
2854  *          field passed as the
2855  *          kEventParamTSMDocAccessRequestedCharacterAttributes
2856  *          parameter.
2857  *          Note:  This parameter is not normally used if a CTFontRef
2858  *          is being returned via kEventParamTSMDocAccessReplyCTFontRef
2859  *          (Mac OS X 10.5 and later), but could be helpful if the
2860  *          application is using an affine transform in conjunction
2861  *          with the ATSFontRef and the ideal font size differs enough
2862  *          from the font size that would be derived from the
2863  *          CTFontRef.  However, see comment under
2864  *          kEventParamTSMDocAccessReplyCTFontRef pertaining to the
2865  *          importance of input method adoption of CTFont API.
2866  *           Note2:  This event parameter was originally typed as
2867  *          typeFloat which is also typeIEEE64BitFloatingPoint.
2868  *          However, a 'float' (see MacTypes.h) is really a 32 bit IEEE
2869  *          float.  Clients of this parameter have made the assumption
2870  *          that these types correspond with oneanother, and as long as
2871  *          the same assumption was made everywhere, this caused no
2872  *          problem.
2873  *          In Mac OS X 10.5 and later, this parameter has been
2874  *          re-typed as typeCGFloat, which references a Float32 on
2875  *          32-bit, and a double on 64-bit.  For compatibility, TSM
2876  *          will assume that when data of typeFloat is used in
2877  *          conjunction with this parameter, the data actually contains
2878  *          a 32-bit IEEE float, and will coerce this data accordingly
2879  *          when converting to/from typeCGFloat.
2880  *          NOTE2:  The above special-case coercion to/from typeFloat
2881  *          exists only on 32-bit.  Always use typeCGFloat on
2882  *          64-bit.
2883  *
2884  *          Optional reply parameter if
2885  *          kEventParamTSMDocAccessReplyCTFontRef is provided.
2886  *
2887  *    --> kEventParamTSMDocAccessSendCharacterRange (in, typeCFRange)
2888  *          The maximum range of text the caller cares about.  This is
2889  *          used to "clip" the area of interest to the caller so the
2890  *          text engine doesn't need to process a style run all the way
2891  *          back to, say, the beginning of a line or a document, in
2892  *          order to return an effective range.<BR> Required parameter.
2893  *
2894  *    <-- kEventParamTSMDocAccessEffectiveRange (out, typeCFRange)
2895  *          Optional reply parameter.
2896  *          The range of text over which both font and size are
2897  *          constant, within the bounds of the
2898  *          kEventParamTSMDocAccessSendCharacterRange parameter.
2899  *           Return this information if
2900  *          kTSMDocAccessEffectiveRangeAttribute is specified in the
2901  *          bit field passed as the
2902  *          kEventParamTSMDocAccessRequestedCharacterAttributes
2903  *          parameter.
2904  *
2905  *  Availability:
2906  *    Mac OS X:         in version 10.3 and later in Carbon.framework
2907  *    CarbonLib:        not available
2908  }
2909 const
2910 	kEventTSMDocumentAccessGetFont = 6;
2911 
2912 {
2913  *  kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetGlyphInfo
2914  *
2915  *  Summary:
2916  *    Returns glyph info and the range covered by that glyph.
2917  *
2918  *  Discussion:
2919  *    Where a glyph spans multiple characters, the effective range,
2920  *    represented by the glyph, is returned by the app.
2921  *
2922  *  Mac OS X threading:
2923  *    Not thread safe
2924  *
2925  *  Parameters:
2926  *
2927  *    --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
2928  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
2929  *          later.
2930  *
2931  *          This parameter is provided by the input method originating
2932  *          the event.<BR> Required parameter.
2933  *
2934  *    --> kEventParamTSMDocAccessSendRefCon (in, typeRefCon)
2935  *          TSM's SendTextInputEvent, called by an input method,
2936  *          inserts this parameter before dispatching the event to the
2937  *          user focus.
2938  *          Required Parameter.
2939  *
2940  *          On Mac OS X 10.4 and earlier, this parameter uses
2941  *          typeSInt32, and you must retrieve it using that constant.
2942  *          On Mac OS X 10.5 and later, to support 64-bit refcon
2943  *          values, this parameter uses typeRefCon. For 64-bit
2944  *          compatibility, you must use typeRefCon when retrieving this
2945  *          parameter; for 32-bit targets, however, you may continue to
2946  *          use typeSInt32 if you wish, or switch to typeRefCon.
2947  *
2948  *    --> kEventParamTSMDocAccessSendCharacterIndex (in, typeCFIndex)
2949  *          The location in the document for which the caller would
2950  *          like glyph information.<BR> Required parameter.
2951  *
2952  *    --> kEventParamTSMDocAccessRequestedCharacterAttributes (in, typeUInt32)
2953  *          A TSMDocAccessAttributes bit field filled out with the
2954  *          information desired.
2955  *          Applicable values for this event are :
2956  *          kTSMDocAccessEffectiveRangeAttribute which requests the
2957  *          text range represented by a glyph.<BR> Required parameter.
2958  *
2959  *    <-- kEventParamTSMDocAccessReplyCTGlyphInfoRef (out, typeCTGlyphInfoRef)
2960  *          The CTGlyphInfoRef for the glyph used to display the range
2961  *          of text returned in the
2962  *          kEventParamTSMDocAccessEffectiveRange parameter.  If the
2963  *          glyph used is the one that would normally be derived, this
2964  *          parameter can be omitted.
2965  *          This is the PREFERRED method of accessing glyph info on Mac
2966  *          OS X 10.5 and later.
2967  *
2968  *          For compatibility purposes, this parameter may be requested
2969  *          by an input method even when the application returns glyph
2970  *          information as a ATSUGlyphSelector via the
2971  *          kEventParamTSMDocAccessReplyATSUGlyphSelector event
2972  *          parameter.  The toolbox provides automatic coercion between
2973  *          these two parameters.<BR> <BR> Optional reply parameter.
2974  *
2975  *    <-- kEventParamTSMDocAccessReplyATSUGlyphSelector (out, typeGlyphSelector)
2976  *          The ATSUGlyphSelector for the glyph used to display the
2977  *          range of text returned in the
2978  *          kEventParamTSMDocAccessEffectiveRange parameter.  If the
2979  *          glyph used is the one that ATSUI would normally derive,
2980  *          this parameter can be omitted.  This is the NON PREFERRED
2981  *          way of accessing glyph info on Mac OS X 10.5 and later, and
2982  *          this parameter will be deprecated in the future.  Use
2983  *          kEventParamTSMDocAccessReplyCTGlyphInfoRef instead.
2984  *
2985  *          For compatibility purposes, this parameter may still be
2986  *          requested even when the application returns glyph
2987  *          information via the CTGlyphInfoRef parameter
2988  *          kEventParamTSMDocAccessReplyCTGlyphInfoRef.  The toolbox
2989  *          provides automatic coercion between these two
2990  *          parameters.<BR> <BR> Optional reply parameter.
2991  *
2992  *    <-- kEventParamTSMDocAccessEffectiveRange (out, typeCFRange)
2993  *          The range of text displayed as a glyph ID or CID.
2994  *           Optional reply parameter.
2995  *          Return this information if
2996  *          kTSMDocAccessEffectiveRangeAttribute is specified in the
2997  *          bit field passed as the
2998  *          kEventParamTSMDocAccessRequestedCharacterAttributes
2999  *          parameter.
3000  *
3001  *  Availability:
3002  *    Mac OS X:         in version 10.3 and later in Carbon.framework
3003  *    CarbonLib:        not available
3004  }
3005 const
3006 	kEventTSMDocumentAccessGetGlyphInfo = 7;
3007 
3008 {
3009  *  kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetFirstRectForRange
3010  *
3011  *  Summary:
3012  *    Returns a bounding rectangle on the screen for a specified
3013  *    character range.
3014  *    Where the character range would best be described by multiple
3015  *    logical rectangles, this event should return the first such
3016  *    rectangle and the corresponding character subrange
3017  *
3018  *  Discussion:
3019  *    Input methods have a need to locate the on-screen position of a
3020  *    character range in a document.� The goal may be to�call attention
3021  *    to the user about a range of text by using its bounding rectangle
3022  *    or by�overlaying some text with different font/attributes.
3023  *     The handler of this event should return a�rectangle for the
3024  *    largest character subrange of text, starting from the range
3025  *    beginning, that is drawn on a single line using�similar font,
3026  *    size, and style.
3027  *    If text overlay is desired, the CTFontRef(s) used over the
3028  *    character range can be obtained via
3029  *    the�kEventTSMDocumentAccessGetFont event.� The baseline to be
3030  *    used for drawing is determined by applying the returned
3031  *    BaselineDelta parameter to the bounding rectangle's origin.
3032  *     When the bounding rectangle returned corresponds to only a
3033  *    proper subset of the requested character range, the subrange is
3034  *    specified in the EffectiveRange parameter, allowing the client to
3035  *    iterate over the character range of interest.
3036  *
3037  *  Mac OS X threading:
3038  *    Not thread safe
3039  *
3040  *  Parameters:
3041  *
3042  *    --> kEventParamTSMDocAccessSendRefCon (in, typeRefCon)
3043  *          TSM's SendTextInputEvent, called by an input method,
3044  *          inserts this parameter before dispatching the event to the
3045  *          user focus.  (Required Parameter)
3046  *
3047  *    --> kEventParamTSMDocAccessSendCharacterRange (in, typeCFRange)
3048  *          The range of text for which a bounding rectangle is
3049  *          requested.  (Required Parameter)
3050  *
3051  *    <-- kEventParamTSMDocAccessEffectiveRange (out, typeCFRange)
3052  *          Required reply parameter.
3053  *          The subrange of text, within the bounds of the
3054  *          kEventParamTSMDocAccessSendCharacterRange parameter, over
3055  *          which font/size/style of text are similar and displayed on
3056  *          a single line.
3057  *
3058  *    <-- kEventParamTSMDocAccessLineBounds (out, typeHIRect)
3059  *          Required reply parameter.
3060  *          This parameter contains an HIRect of the visible line area
3061  *          for the text subrange returned in the EffectiveRange
3062  *          parameter.
3063  *          This�HIRect can be accessed using the default typeHIRect to
3064  *          obtain values in global coordinates, or 72dpi virtual
3065  *          coordinate space, or can be accessed�with other parameter
3066  *          types that specify the coordinate space of interest, such
3067  *          as typeHIRectScreenPixel.
3068  *
3069  *    <-- kEventParamTSMDocAccessBaselineDelta (out, typeCGFloat)
3070  *          Required reply parameter.
3071  *          This parameter specifies the delta between the bounding
3072  *          rectangle's origin and the text baseline at the first
3073  *          character in the returned EffectiveRange parameter.
3074  *
3075  *  Availability:
3076  *    Mac OS X:         in version 10.5 and later in Carbon.framework
3077  *    CarbonLib:        not available
3078  }
3079 const
3080 	kEventTSMDocumentAccessGetFirstRectForRange = 11;
3081 
3082 
3083 {
3084 
3085     ** Document Access Lock/Unlock events **
3086 
3087 }
3088 {
3089  *  kEventClassTSMDocumentAccess / kEventTSMDocumentAccessLockDocument
3090  *
3091  *  Summary:
3092  *    Notifies the app that it should not change its document's text
3093  *    content (on its own) while a text service is involved in a
3094  *    transaction.  The app should not allow changes, for example, by
3095  *    its secondary threads.
3096  *
3097  *  Discussion:
3098  *    These events define how a text service can obtain access to a
3099  *    document in a way that ensures data integrity during its
3100  *    transaction.  The primary motivation of these events is to
3101  *    prevent the application from letting its secondary threads modify
3102  *    the document while a text service is busy servicing an event,
3103  *    such as a key event, or some user interaction with text service
3104  *    provided UI such as a menu selection. Also, while the document is
3105  *    locked, a text service is free to request pointer access to the
3106  *    document's text content (if this is supported by the app's text
3107  *    engine.) These lock-related events should be implemented using a
3108  *    ref counting scheme. Most apps will not support this kind of
3109  *    threading, so implementation of these events in the text engine
3110  *    will be optional.   In most text engines, the implementation of
3111  *    these events should be trivial, i.e. just maintain a simple
3112  *    semaphore.  TSM itself will implicitly lock/unlock around normal
3113  *    entry points into a text service, such as when it delivers key
3114  *    events to an input method, but there may be times when document
3115  *    changes can be driven by an input method without TSM involvement,
3116  *    such as the Carbon events involved when the user interacts with
3117  *    some UI.  In this case, the input method must manage locking, if
3118  *    the app supports it.  However, the logic in an input method
3119  *    should not have to care whether TSM is in the call chain or
3120  *    not... and TSM should not have to care whether an input method
3121  *    will do the right thing. This is why the lock mechanism needs to
3122  *    be some kind of refcounting scheme instead of a simple on/off
3123  *    mechanism. This document lock support is completely optional on
3124  *    the part of the text engine (if it is not threaded).  TSM will
3125  *    implicitly lock/unlock the document around delivery of events to
3126  *    input methods, if the app supports it.
3127  *
3128  *  Mac OS X threading:
3129  *    Not thread safe
3130  *
3131  *  Parameters:
3132  *
3133  *    --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
3134  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
3135  *          later.
3136  *
3137  *          This parameter is provided by the input method originating
3138  *          the event. (Required parameter)
3139  *
3140  *    --> kEventParamTSMDocAccessSendRefCon (in, typeRefCon)
3141  *          TSM's SendTextInputEvent, called by an input method,
3142  *          inserts this parameter before dispatching the event to the
3143  *          user focus.  (Required Parameter)
3144  *
3145  *          On Mac OS X 10.4 and earlier, this parameter uses
3146  *          typeSInt32, and you must retrieve it using that constant.
3147  *          On Mac OS X 10.5 and later, to support 64-bit refcon
3148  *          values, this parameter uses typeRefCon. For 64-bit
3149  *          compatibility, you must use typeRefCon when retrieving this
3150  *          parameter; for 32-bit targets, however, you may continue to
3151  *          use typeSInt32 if you wish, or switch to typeRefCon.
3152  *
3153  *    <-- kEventParamTSMDocAccessLockCount (out, typeCFIndex)
3154  *          The resulting refCount of locks on the document. Required
3155  *          reply parameter, if the event is handled.
3156  *
3157  *  Availability:
3158  *    Mac OS X:         in version 10.3 and later in Carbon.framework
3159  *    CarbonLib:        not available
3160  }
3161 const
3162 	kEventTSMDocumentAccessLockDocument = 8;
3163 
3164 
3165 {
3166  *  kEventClassTSMDocumentAccess / kEventTSMDocumentAccessUnlockDocument
3167  *
3168  *  Summary:
3169  *    Unlock the document so the app's text engine is free to initiate
3170  *    changes again.
3171  *
3172  *  Discussion:
3173  *    (see kEventTSMDocumentAccessLockDocument)
3174  *
3175  *  Mac OS X threading:
3176  *    Not thread safe
3177  *
3178  *  Parameters:
3179  *
3180  *    --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
3181  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
3182  *          later.
3183  *
3184  *          This parameter is provided by the input method originating
3185  *          the event. (Required parameter)
3186  *
3187  *    --> kEventParamTSMDocAccessSendRefCon (in, typeRefCon)
3188  *          TSM's SendTextInputEvent, called by an input method,
3189  *          inserts this parameter before dispatching the event to the
3190  *          user focus.  (Required Parameter)
3191  *
3192  *          On Mac OS X 10.4 and earlier, this parameter uses
3193  *          typeSInt32, and you must retrieve it using that constant.
3194  *          On Mac OS X 10.5 and later, to support 64-bit refcon
3195  *          values, this parameter uses typeRefCon. For 64-bit
3196  *          compatibility, you must use typeRefCon when retrieving this
3197  *          parameter; for 32-bit targets, however, you may continue to
3198  *          use typeSInt32 if you wish, or switch to typeRefCon.
3199  *
3200  *    <-- kEventParamTSMDocAccessLockCount (out, typeCFIndex)
3201  *          The resulting refCount of locks on the document. Required
3202  *          reply parameter, if the event is handled.
3203  *
3204  *  Availability:
3205  *    Mac OS X:         in version 10.3 and later in Carbon.framework
3206  *    CarbonLib:        not available
3207  }
3208 const
3209 	kEventTSMDocumentAccessUnlockDocument = 9;
3210 
3211 
3212 {--------------------------------------------------------------------------------------}
3213 { Text Input Events                                                                    }
3214 {--------------------------------------------------------------------------------------}
3215 {
3216     kEventClassTextInput quick reference:
3217 
3218     kEventTextInputUpdateActiveInputArea    = 1,
3219     kEventTextInputUnicodeForKeyEvent       = 2,
3220     kEventTextInputOffsetToPos              = 3,
3221     kEventTextInputPosToOffset              = 4,
3222     kEventTextInputShowHideBottomWindow     = 5,
3223     kEventTextInputGetSelectedText          = 6,
3224     kEventTextInputUnicodeText              = 7,
3225     kEventTextInputFilterText               = 14,
3226     kEventTextInputIsMouseEventInInlineInputArea = 16
3227 
3228     The following TextInput events (UpdateActiveInputArea thru GetSelectedText) reimplement
3229     the AppleEvents defined in Inside Mac Text: Text Services Manager, and provide the benefits
3230     of Carbon Event targeting, dispatching, and propagation to applications that have formerly
3231     handled the TSM suite of AppleEvents.
3232 
3233     TextInput handlers may be installed on controls, windows, or the application event target
3234     (equivalent to AppleEvent-based handling). In all cases, if a given TextInput handler is
3235     not installed, TSM will convert that TextInput to an AppleEvent and redispatch via AESend
3236     to the current process, making adoption as gradual as is desired.
3237 }
3238 {
3239  *  kEventClassTextInput / kEventTextInputUpdateActiveInputArea
3240  *
3241  *  Summary:
3242  *    Tells the application/text engine to initiate/terminate or manage
3243  *    the content of an inline input session.
3244  *
3245  *  Mac OS X threading:
3246  *    Not thread safe
3247  *
3248  *  Parameters:
3249  *
3250  *    --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
3251  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
3252  *          later.
3253  *
3254  *          This parameter is provided by the input method originating
3255  *          the event.  If an invalid value is specified, tsmUnknownErr
3256  *          will be returned.  (Required parameter)
3257  *
3258  *    --> kEventParamTextInputSendRefCon (in, typeRefCon)
3259  *          TSM's SendTextInputEvent, called by an input method,
3260  *          inserts this parameter before dispatching the event to the
3261  *          user focus.  (Required Parameter)
3262  *
3263  *          On Mac OS X 10.4 and earlier, this parameter uses
3264  *          typeSInt32, and you must retrieve it using that constant.
3265  *          On Mac OS X 10.5 and later, to support 64-bit refcon
3266  *          values, this parameter uses typeRefCon. For 64-bit
3267  *          compatibility, you must use typeRefCon when retrieving this
3268  *          parameter; for 32-bit targets, however, you may continue to
3269  *          use typeSInt32 if you wish, or switch to typeRefCon.
3270  *
3271  *    --> kEventParamTextInputSendSLRec (in, typeIntlWritingCode)
3272  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
3273  *          later.
3274  *
3275  *          The ScriptLanguageRecord associated with the contents of an
3276  *          inline input session.  This parameter is normally provided
3277  *          by the input method originating the event.  TSM's
3278  *          SendTextInputEvent will construct this parameter, when
3279  *          missing, based on the input method component description.
3280  *          (Required Parameter)
3281  *
3282  *    --> kEventParamTextInputSendFixLen (in, typeSignedByteCount)
3283  *          This parameter specifies a (signed) byte count of how much
3284  *          text, if any, of the inline input session is being
3285  *          confirmed (or commited) to the application.  A value of -1
3286  *          indicates the entire inline session is being confirmed.  A
3287  *          value of 0 indicates that none of the text is being
3288  *          confirmed (yet), although there may still be some change to
3289  *          the contents of the inline input session.  This parameter
3290  *          is provided by the input method originating the event.
3291  *          (Required Parameter)
3292  *
3293  *          On Mac OS X 10.5 and later, this parameter is typed as
3294  *          typeSignedByteCount.  For all 32bit targets, whether for
3295  *          Mac OS X 10.5 or earlier, you can freely use this new
3296  *          type.
3297  *          For 64bit on Mac OS X 10.5 and later, in order to support
3298  *          64-bit text lengths, you must use typeSignedByteCount.
3299  *
3300  *    --> kEventParamTextInputSendAttributedString (in, typeCFAttributedStringRef)
3301  *          The attributed string to be added to the inline input
3302  *          session.  This is the preferred event parameter on Mac OS X
3303  *          10.5 and later.  The attributes are those defined in
3304  *          CTStringAttributes.h.
3305  *          On Mac OS X 10.5, TSM supports the font attribute and the
3306  *          glyph info attribute. TSM does not (yet) define or support
3307  *          attributes for UpdateRng, HiliteRng, ClauseRng, and PinRng,
3308  *          although this is the intended direction in the future.
3309  *           NOTE:  When a glyph info attribute is set for a particular
3310  *          text range, it is expected that a font attribute covers at
3311  *          least that same text range.  This is also important to
3312  *          allow TSM to coerce attributes to compatibility data
3313  *          structures, such as the
3314  *          kEventParamTextInputSendGlyphInfoArray event parameter.
3315  *           NOTE2:  If this event parameter is missing and requested,
3316  *          it is coerced from the compatibility parameters provided in
3317  *          this event, in particular, kEventParamTextInputSendText and
3318  *          kEventParamTextInputSendGlyphInfoArray.
3319  *          NOTE3:  Even when this parameter is provided by an input
3320  *          method, the kEventParamTextInputSendTextServiceMacEncoding
3321  *          is still needed if the current TSMDocument (as returned by
3322  *          TSMGetActiveDocument) is not of type
3323  *          kUnicodeDocumentInterfaceType and the encoding needed for
3324  *          conversion is a Mac encoding variant.
3325  *
3326  *          Required Parameter if kEventParamTextInputSendText is not
3327  *          provided.
3328  *
3329  *    --> kEventParamTextInputSendText (in, typeUnicodeText)
3330  *          The text to be added to the inline input session. The data
3331  *          type of this parameter actually depends on the TSMDocument
3332  *          type created via NewTSMDocument: it will be typeChar for
3333  *          kTextService documents, or typeUnicodeText for
3334  *          kUnicodeDocument documents.
3335  *          Required Parameter if
3336  *          kEventParamTextInputSendAttributedString is not provided.
3337  *
3338  *    --> kEventParamTextInputSendUpdateRng (in, typeTextRangeArray)
3339  *          An array of text-range records (see TextRangeArray) that
3340  *          indicates how to update (a subrange of) the active input
3341  *          area (aka. inline input session).  The TextRange structures
3342  *          occur in pairs, the first of which identifies a subrange of
3343  *          the existing active input area (in the app's backing store,
3344  *          resulting from a previous UpdateActiveInputArea event) to
3345  *          be replaced by a new subrange of text, identified by the
3346  *          second TextRange in the pair.  The new text subrange is
3347  *          obtained from the contents of the
3348  *          kEventParamTextInputSendText parameter.  In general, the
3349  *          Nth array element, where N is even, specifies the range of
3350  *          old text to be updated and array element N+1 specifies the
3351  *          range of new text to replace the corresponding old text.
3352  *          The fHiliteStyle field of the TextRange records is ignored
3353  *          in this parameter. NOTE:  There are some "loose ends" in
3354  *          the TSM event protocol that were never clearly defined, but
3355  *          which have been introduced over the years by input methods
3356  *          themselves, probably through some trial and error.  The
3357  *          conventions regarding this optional parameter seem to be as
3358  *          follows: If the UpdateRng parameter is missing from the
3359  *          event, the input method is requesting that the entire
3360  *          contents of the existing inline input session (if there is
3361  *          one) is to be replaced "wholesale" by the new text
3362  *          contained in the kEventParamTextInputSendText parameter. If
3363  *          the UpdateRng parameter exists, but contains no ranges
3364  *          (i.e. fNumOfRanges == 0), this seems to be hint from the
3365  *          input method that no text in the active input area is
3366  *          changing.  It may be that the existing active input area is
3367  *          being confirmed "as is", or that the input method is
3368  *          modifying its highlite attributes in some way, due to some
3369  *          user action, such as changing the selected clause or
3370  *          highlited subrange of text in the active input area, or
3371  *          that the input method is changing the caret position in the
3372  *          active input area (if it uses the kTSMHiliteCaretPosition
3373  *          hilite style). Depending on how your text engine draws
3374  *          hilite styles supported in the
3375  *          kEventParamTextInputSendHiliteRng parameter, you may or may
3376  *          not need to redraw the text itself, simply change the
3377  *          hilite. This parameter is optional and may not be present
3378  *          in all instances of this event.
3379  *
3380  *    --> kEventParamTextInputSendHiliteRng (in, typeTextRangeArray)
3381  *          An array of text-range records (see TextRangeArray) that
3382  *          specifies how various subranges of the active input area
3383  *          are to be highlited, and possibly specifies caret position
3384  *          within the active input area. NOTE:  The text offsets used
3385  *          in the HiliteRng parameter are relative to the beginning of
3386  *          the active input area AFTER all text has been updated (per
3387  *          the SendUpdateRng parameter) and any (subrange of) text has
3388  *          been confirmed.  Specifically, if the entire text is being
3389  *          confirmed, it is clear that any contents of this parameter
3390  *          should be ignored, especially non-zero values
3391  *          kTSMHiliteCaretPosition. This parameter is optional and may
3392  *          not be present in all instances of this event.
3393  *
3394  *    --> kEventParamTextInputSendClauseRng (in, typeOffsetArray)
3395  *          An array of offsets (see OffsetArray) used by an input
3396  *          method to specify word or clause boundaries in the
3397  *          resulting active input area.  Offsets are relative to the
3398  *          start of the resulting active input area. This parameter is
3399  *          optional and may not be present in all instances of this
3400  *          event.
3401  *
3402  *    --> kEventParamTextInputSendPinRng (in, typeTextRange)
3403  *          A TextRange record that specifies a start offset and an end
3404  *          offset that should be scrolled into view if the text
3405  *          specified by these offsets is not already in view. The
3406  *          fHiliteStyle field of the TextRange records is ignored in
3407  *          this parameter. This parameter is optional and may not be
3408  *          present in all instances of this event.
3409  *
3410  *    --> kEventParamTextInputSendTextServiceEncoding (in, typeUInt32)
3411  *          The encoding associated with the text sent by an input
3412  *          method. On MacOS X, this parameter is not commonly used
3413  *          because all TSM input methods produce Unicode, but TSM will
3414  *          respect a Unicode encoding variant here, if specified. In
3415  *          CarbonLib, this parameter identifies the Mac encoding
3416  *          (usually an encoding variant) of the text produced by the
3417  *          input method on MacOS, where it is not a requirement that
3418  *          input methods be Unicode-savvy.  On this platform, TSM
3419  *          needs the information to convert text to Unicode from a Mac
3420  *          encoding variant which cannot be derived from the
3421  *          ScriptLanguage record associated with the input method
3422  *          component. This parameter is optional and may not be
3423  *          present in all instances of this event.
3424  *
3425  *    --> kEventParamTextInputSendTextServiceMacEncoding (in, typeUInt32)
3426  *          The Mac encoding (variant) associated with the text sent by
3427  *          an input method. On Mac OS X, this parameter is needed by
3428  *          TSM to convert input method produced Unicodes to a Mac
3429  *          encoding when the application that has focus is not
3430  *          Unicode-savvy in the TSM sense... i.e. the current
3431  *          TSMDocument (as returned by TSMGetActiveDocument) is not of
3432  *          type kUnicodeDocument.  This parameter can also be useful
3433  *          if a Unicode-savvy handler should need to convert from
3434  *          Unicode.
3435  *          This parameter is optional and may not be present in all
3436  *          instances of this event.
3437  *
3438  *    --> kEventParamTextInputSendGlyphInfoArray (in, typeGlyphInfoArray)
3439  *          A TSMGlyphInfoArray structure in which an input method can
3440  *          associate unencoded glyphs IDs and/or fonts with
3441  *          (sub)ranges of text it produces.  The array elements
3442  *          identify non-overlapping ranges of text and the glyph ID
3443  *          (character collection is 0) such as in an OpenType font, or
3444  *          the CID (collection is non-zero) such as in TrueType fonts.
3445  *           If the glyphID itself is 0, only the font specified is to
3446  *          be applied to the text range.  This is useful for
3447  *          characters in Unicode private use area, such as Windings,
3448  *          but note that this capability should be used with care
3449  *          because changing the font of an input text stream can lead
3450  *          to a confusing user interface. An input method will only
3451  *          include this parameter if the text engine has indicated it
3452  *          supports this feature via the
3453  *          kTSMDocumentSupportGlyphInfoPropertyTag TSMDocumentProperty
3454  *          tag. For more information, see the Glyph Access protocol
3455  *          described in Technote TN2079. This parameter is optional
3456  *          and may not be present in all instances of this event.
3457  *
3458  *    --> kEventParamTextInputSendReplaceRange (in, typeCFRange)
3459  *          The CFRange in the application's document that should be
3460  *          replaced by the contents of the inline input session
3461  *          defined by other parameters in this event.  The text
3462  *          service will have obtained and calculated this range by
3463  *          accessing the document's text via events of the
3464  *          TSMDocumentAccess class.  This CFRange parameter refers to
3465  *          text in flat Unicode space (UniChar) offsets, and its
3466  *          location is document relative, not relative to the
3467  *          insertion point or any inline session. A text service may
3468  *          include this parameter only if the text engine has
3469  *          indicated it supports this feature via the
3470  *          kTSMDocumentSupportDocumentAccessPropertyTag
3471  *          TSMDocumentProperty tag. This parameter is optional and may
3472  *          not be present in all instances of this event. NOTE:  This
3473  *          parameter is supported by the TSM Carbon event only, not by
3474  *          TSM's kUpdateActiveInputArea AppleEvent.  If a text engine
3475  *          developer wishes to support this parameter, it must
3476  *          implement a Carbon event handler for this event and set the
3477  *          kTSMDocumentSupportDocumentAccessPropertyTag property tag.
3478  *          NOTE:  Care must be exercised by the app when there is an
3479  *          active inline input session. A text service that sends an a
3480  *          UpdateActiveInputArea event specifying this parameter
3481  *          should not be the same text service that owns the inline
3482  *          input session, since the text engine would need to call
3483  *          FixTSMDocument().  This, in turn, would cause recursion
3484  *          through that same text service via FixTextService().
3485  *          However, the app should be prepared for recursion
3486  *          regardless of which text service owns the inline input
3487  *          session because it will call FixTSMDocument() to confirm
3488  *          the inline input session, and "somebody" will likely send
3489  *          an UpdateActiveInputArea event as a result. Therefore,
3490  *          document state obtained before the call to FixTSMDocument()
3491  *          may not be valid after this call completes.
3492  *
3493  *  Result:
3494  *    TSM will return tsmUnknownErr if the input method has specified
3495  *    an invalid component instance for this event's
3496  *    kEventParamTextInputSendComponentInstance parameter.
3497  *
3498  *  Availability:
3499  *    Mac OS X:         in version 10.0 and later in Carbon.framework
3500  *    CarbonLib:        in CarbonLib 1.1 and later
3501  }
3502 const
3503 	kEventTextInputUpdateActiveInputArea = 1;
3504 
3505 {
3506  *  kEventClassTextInput / kEventTextInputUnicodeForKeyEvent
3507  *
3508  *  Summary:
3509  *    Provides Unicode text input resulting from either a key event
3510  *    (TSM originates the event in this case) or from a
3511  *    kEventTextInputUnicodeText event produced by an input method,
3512  *    such as a Character Palette class input method, or a HandWriting
3513  *    input method.
3514  *
3515  *  Discussion:
3516  *    This is the primary event by which applications should receive
3517  *    text input on Mac OS X. Apple recommends that applications use
3518  *    this event rather than the kEventRawKeyDown event to handle text
3519  *    input.
3520  *
3521  *    A client need not be fully TSM-aware to process or receive this
3522  *    event. You can also get Mac encoding characters from the raw
3523  *    keyboard event contained in this event. If no UnicodeForKeyEvent
3524  *    handler is installed, and no kUnicodeNotFromInputMethod
3525  *    AppleEvent handler is installed (or the application has not
3526  *    created a Unicode TSMDocument), the Mac encoding charCodes (if
3527  *    these can be converted from the Unicodes) are provided to
3528  *    WaitNextEvent.
3529  *
3530  *    This event is generated automatically by TSM when a
3531  *    kEventRawKeyDown event is sent to the application event target.
3532  *    The typical keyboard event flow begins with a kEventRawKeyDown
3533  *    event posted to the event queue. This event is dequeued during
3534  *    WaitNextEvent or RunApplicationEventLoop, and sent to the event
3535  *    dispatcher target. If the keydown event reaches the application
3536  *    target, it is handled by TSM, which generates a
3537  *    kEventTextInputUnicodeForKeyEvent and sends it to the event
3538  *    dispatcher target. The event dispatcher will resend the event to
3539  *    the user focus target, which sends it to the focused control in
3540  *    the focused window.
3541  *
3542  *  Mac OS X threading:
3543  *    Not thread safe
3544  *
3545  *  Parameters:
3546  *
3547  *    --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
3548  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
3549  *          later.
3550  *
3551  *          This parameter is provided by the input method originating
3552  *          the event. (Required parameter)
3553  *
3554  *    --> kEventParamTextInputSendRefCon (in, typeRefCon)
3555  *          TSM's SendTextInputEvent, called by an input method,
3556  *          inserts this parameter before dispatching the event to the
3557  *          user focus.  (Required Parameter)
3558  *
3559  *          On Mac OS X 10.4 and earlier, this parameter uses
3560  *          typeSInt32, and you must retrieve it using that constant.
3561  *          On Mac OS X 10.5 and later, to support 64-bit refcon
3562  *          values, this parameter uses typeRefCon. For 64-bit
3563  *          compatibility, you must use typeRefCon when retrieving this
3564  *          parameter; for 32-bit targets, however, you may continue to
3565  *          use typeSInt32 if you wish, or switch to typeRefCon.
3566  *
3567  *    --> kEventParamTextInputSendSLRec (in, typeIntlWritingCode)
3568  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
3569  *          later.
3570  *
3571  *          The ScriptLanguageRecord associated with the text contained
3572  *          in the event. This parameter is normally provided by the
3573  *          input method originating the event.  TSM's
3574  *          SendTextInputEvent will construct this parameter from
3575  *          current script information as a result of a key event, or
3576  *          using input method provided information when TSM receives a
3577  *          kEventTextInputUnicodeText event.  (Required Parameter)
3578  *
3579  *    --> kEventParamTextInputSendAttributedString (in, typeCFAttributedStringRef)
3580  *          The attributed string entered by the user.  This is the
3581  *          preferred event parameter on Mac OS X 10.5 and later.  The
3582  *          attributes are those defined in CTStringAttributes.h.
3583  *           On Mac OS X 10.5, TSM supports the font attribute and the
3584  *          glyph info attribute.
3585  *          NOTE:  When a glyph info attribute is set for a particular
3586  *          text range, it is expected that a font attribute covers at
3587  *          least that same text range.  This is also important to
3588  *          allow TSM to coerce attributes to compatibility data
3589  *          structures, such as the
3590  *          kEventParamTextInputSendGlyphInfoArray event parameter.
3591  *           NOTE2:  If this event parameter is missing and requested,
3592  *          it is coerced from the compatibility parameters provided in
3593  *          this event, in particular, kEventParamTextInputSendText and
3594  *          kEventParamTextInputSendGlyphInfoArray.
3595  *
3596  *          Required Parameter if kEventParamTextInputSendText is not
3597  *          provided.
3598  *
3599  *    --> kEventParamTextInputSendText (in, typeUnicodeText)
3600  *          The Unicode characters that entered by the user.
3601  *           Required Parameter if
3602  *          kEventParamTextInputSendAttributedString is not provided.
3603  *
3604  *    --> kEventParamTextInputSendKeyboardEvent (in, typeEventRef)
3605  *          This parameter is the original raw keyboard event that
3606  *          produced the text. It enables access to
3607  *          kEventParamKeyModifiers and kEventParamKeyCode parameters.
3608  *          Note that when contents of TSM�s bottom-line input window
3609  *          are confirmed (i.e., during typing of Chinese, Korean, or
3610  *          Japanese), the raw keyboard event�s keyCode and modifiers
3611  *          are set to default values.
3612  *
3613  *          You can also extract from the RawKeyDown event either
3614  *          Unicodes or Mac encoding characters as follows:
3615  *
3616  *          kEventParamKeyUnicodes      typeUnicodeText
3617  *           kEventParamKeyMacCharCodes  typeChar (if available)
3618  *           (DEPRECATED for 64bit on Mac OS X 10.6 and later.)
3619  *
3620  *          The kEventParamKeyUnicodes parameter of the raw keyboard
3621  *          event is identical to the TextInput event�s
3622  *          kEventParamTextInputSendText parameter.
3623  *
3624  *    --> kEventParamTextInputSendGlyphInfoArray (in, typeGlyphInfoArray)
3625  *          A TSMGlyphInfoArray structure in which an input method can
3626  *          associate unencoded glyphs IDs and/or fonts with
3627  *          (sub)ranges of text it produces.  The array elements
3628  *          identify non-overlapping ranges of text and the glyph ID
3629  *          (character collection is 0) such as in an OpenType font, or
3630  *          the CID (collection is non-zero) such as in TrueType fonts.
3631  *           If the glyphID itself is 0, only the font specified is to
3632  *          be applied to the text range.  This is useful for
3633  *          characters in Unicode private use area, such as Windings,
3634  *          but note that this capability should be used with care
3635  *          because changing the font of an input text stream can lead
3636  *          to a confusing user interface. For more information, see
3637  *          the Glyph Access protocol described in Technote TN2079.
3638  *          This parameter is optional and may not be present in all
3639  *          instances of this event.
3640  *
3641  *  Availability:
3642  *    Mac OS X:         in version 10.0 and later in Carbon.framework
3643  *    CarbonLib:        in CarbonLib 1.1 and later
3644  }
3645 const
3646 	kEventTextInputUnicodeForKeyEvent = 2;
3647 
3648 {
3649  *  kEventClassTextInput / kEventTextInputOffsetToPos
3650  *
3651  *  Summary:
3652  *    Requests conversion from inline session text offset to global
3653  *    coordinate.
3654  *
3655  *  Discussion:
3656  *    This event is typically produced by an input method so that it
3657  *    can best position a palette near the text being edited by the
3658  *    user.
3659  *
3660  *  Mac OS X threading:
3661  *    Not thread safe
3662  *
3663  *  Parameters:
3664  *
3665  *    --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
3666  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
3667  *          later.
3668  *
3669  *          This parameter is provided by the input method originating
3670  *          the event. (Required parameter)
3671  *
3672  *    --> kEventParamTextInputSendRefCon (in, typeRefCon)
3673  *          TSM's SendTextInputEvent, called by an input method,
3674  *          inserts this parameter before dispatching the event to the
3675  *          user focus.  (Required Parameter)
3676  *
3677  *          On Mac OS X 10.4 and earlier, this parameter uses
3678  *          typeSInt32, and you must retrieve it using that constant.
3679  *          On Mac OS X 10.5 and later, to support 64-bit refcon
3680  *          values, this parameter uses typeRefCon. For 64-bit
3681  *          compatibility, you must use typeRefCon when retrieving this
3682  *          parameter; for 32-bit targets, however, you may continue to
3683  *          use typeSInt32 if you wish, or switch to typeRefCon.
3684  *
3685  *    --> kEventParamTextInputSendTextOffset (in, typeSignedByteOffset)
3686  *          Specifies a (signed) byte offset in an active input area
3687  *          for which the global position is desired.  Because an
3688  *          inline input session always begins at the insertion point,
3689  *          the offset is always considered relative to the insertion
3690  *          point, even when there is no active input area.  (Required
3691  *          Parameter)
3692  *
3693  *          On Mac OS X 10.5 and later, this parameter is typed as
3694  *          typeSignedByteOffset.  For all 32bit targets, whether for
3695  *          Mac OS X 10.5 or earlier, you can freely use this new
3696  *          type.
3697  *          For 64bit on Mac OS X 10.5 and later, in order to support
3698  *          64-bit text lengths, you must use typeSignedByteOffset.
3699  *
3700  *          If an offset is outside the bounds of the document text,
3701  *          errOffsetInvalid should be returned.  Negative offsets are
3702  *          not valid when an inline input session exists, but are
3703  *          valid when none exists, to allow query of offsets before
3704  *          the insertion point.
3705  *
3706  *          NOTE:  Non-zero offsets in the absence of an active input
3707  *          area can only be specified when the originator of the event
3708  *          is certain that the character encoding used by the target
3709  *          (the current TSMDocument) is the same as its own encoding.
3710  *          When there is no active input area, TSM is unable to
3711  *          convert offsets between different encodings that might be
3712  *          used by the app and an input method (as it normally does)
3713  *          since TSM does not have access to the document text.
3714  *          Practically, this means that both the originator and event
3715  *          target must be Unicode-savvy, i.e. the current TSMDocument
3716  *          was created with kUnicodeDocumentInterfaceType.
3717  *
3718  *          NOTE:  Insertion point relative offsets when there is no
3719  *          active input area is contrary to the original definition of
3720  *          this parameter in IM-Text 7-74 which states that the offset
3721  *          is "relative to the start of the current text body" in this
3722  *          case.  However, most applications and text engines have
3723  *          already implemented the case offset = 0 as being the
3724  *          insertion point.  This allows an input method to display
3725  *          some UI near the the insertion point even before typing
3726  *          takes place.
3727  *
3728  *    --> kEventParamTextInputSendLeadingEdge (in, typeBoolean)
3729  *          Specifies which glyph on either side of the supplied text
3730  *          offset that should be used to compute the on-screen
3731  *          position returned.  This value is similar to the
3732  *          leadingEdge parameter of the QuickDraw PixelToChar
3733  *          function.  If this parameter is true, the location of the
3734  *          character (or characters if the glyph is represented by
3735  *          multiple characters) at the specified text offset is
3736  *          returned.  If this parameter is false, the on-screen
3737  *          position returned should be the trailing edge of the glyph
3738  *          represented by the character (or characters) immediately
3739  *          preceding (in memory order) the supplied text offset.
3740  *           Note also that while the on-screen position for a given
3741  *          offset and leading/trailing edge value is affected by this
3742  *          parameter, it also affects what should be returned for the
3743  *          other optional parameters at style run boundaries, such as
3744  *          script and font information.
3745  *          This parameter is optional and may not be present in all
3746  *          instances of this event.
3747  *          The default value for this parameter is 'true'.
3748  *
3749  *    <-- kEventParamTextInputReplyPoint (out, typeHIPoint)
3750  *          The position on screen of the requested text offset and
3751  *          leading/trailing edge value.
3752  *          By default, this HIPoint is accessed in global coordinates,
3753  *          or 72dpi virtual coordinate Space, but can be accessed as
3754  *          any other type that specifies the desired coordinate
3755  *          space.
3756  *          This parameter was originally typed as typeQDPoint, but on
3757  *          Mac OS X 10.5 and later, it should be accessed as
3758  *          typeHIPoint.  The toolbox provides automatic type coercion
3759  *          between these two types.<BR> Required parameter.
3760  *
3761  *    <-- kEventParamTextInputReplySLRec (out, typeIntlWritingCode)
3762  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
3763  *          later.
3764  *
3765  *          The ScriptLanguageRecord associated with the text at the
3766  *          offset specified in the event, either the
3767  *          ScriptLanguageRecord of the active input area if one
3768  *          exists, or of the text at the specified offset and
3769  *          specified leading/ trailing edge value.  At a script run
3770  *          boundary, such as where a Japanese text run ends, and a
3771  *          Roman begins, a leading edge value of 'true' should return
3772  *          the Roman script/language while a leading edge value of
3773  *          'false' should return the Japanese script/language.
3774  *           This parameter is optional and may not be returned to the
3775  *          caller.
3776  *
3777  *    <-- kEventParamTextInputReplyCTFontRef (out, typeCTFontRef)
3778  *          The CTFontRef associated with the text at the offset
3779  *          specified in the event.  This is the PREFERRED method of
3780  *          accessing font info on Mac OS X 10.5 and later. Use
3781  *          typeCTFontRef as the data type to retrieve this event
3782  *          parameter.
3783  *
3784  *          This is either the font of the active input area if one
3785  *          exists, or of the text at the specified offset and
3786  *          specified leading/trailing edge value.  At a font run
3787  *          boundary, such as where a Japanese text run ends, and a
3788  *          Roman begins, a leading edge value of 'true' should return
3789  *          the font of the Roman text run while a leading edge value
3790  *          of 'false' should return the Japanese font.
3791  *
3792  *          Note:  For compatibility with applications that have not
3793  *          yet adopted the CTFont API, the toolbox will automatically
3794  *          coerce this parameter, if not present, from
3795  *          kEventParamTextInputReplyATSFont (or on 32-bit:
3796  *          kEventParamTextInputReplyFMFont or
3797  *          kEventParamTextInputReplyFont) and the font size parameter
3798  *          kEventParamTextInputReplyPointSize.
3799  *
3800  *          Note2:  This parameter is particularly important for input
3801  *          methods to adopt, because it will allow them to reproduce
3802  *          application text with much higher fidelity in its own UI
3803  *          when the application also adopts CTFont. If the ATSFont and
3804  *          FontSize info do not allow enough fidelity for your needs,
3805  *          that's a sign that your input method should adopt CTFontRef
3806  *          parameters in TSM events.
3807  *
3808  *          If this CTFontRef parameter is provided, the following
3809  *          event parameters are not needed (but see note under
3810  *          kEventParamTextInputReplyPointSize):
3811  *
3812  *          kEventParamTextInputReplyPointSize
3813  *           kEventParamTextInputReplyLineHeight
3814  *           kEventParamTextInputReplyLineAscent
3815  *
3816  *          Optional reply parameter if
3817  *          kEventParamTextInputReplyATSFont (or on 32-bit:
3818  *          kEventParamTextInputReplyFMFont or
3819  *          kEventParamTextInputReplyFont) and
3820  *          kEventParamTextInputReplyPointSize are provided.
3821  *
3822  *    <-- kEventParamTextInputReplyATSFont (out, typeATSFontRef)
3823  *          The ATSFontRef associated with the text at the offset
3824  *          specified in the event. This is either the font of the
3825  *          active input area if one exists, or of the text at the
3826  *          specified offset and specified leading/trailing edge value.
3827  *           At a font run boundary, such as where a Japanese text run
3828  *          ends, and a Roman begins, a leading edge value of 'true'
3829  *          should return the font of the Roman text run while a
3830  *          leading edge value of 'false' should return the Japanese
3831  *          font.
3832  *
3833  *          This is the recommended "compatibility" method of accessing
3834  *          font info on Mac OS X 10.5 and later.  The QD font and
3835  *          FMFont parameters (see kEventParamTextInputReplyFMFont and
3836  *          kEventParamTextInputReplyFont) are deprecated in all cases,
3837  *          and not supported on 64-bit.
3838  *          Note:  For compatibility with applications that have not
3839  *          yet adopted the CTFont API, the toolbox will automatically
3840  *          coerce this parameter, if not present, from
3841  *          kEventParamTextInputReplyCTFontRef (or on 32-bit, from
3842  *          kEventParamTextInputReplyFMFont or
3843  *          kEventParamTextInputReplyFont).
3844  *
3845  *          If this ATSFontRef parameter is provided, the following
3846  *          event parameters should be provided as typeCGFloat (see
3847  *          note under kEventParamTextInputReplyPointSize):
3848  *
3849  *          kEventParamTextInputReplyPointSize
3850  *           kEventParamTextInputReplyLineHeight
3851  *           kEventParamTextInputReplyLineAscent
3852  *
3853  *          Optional reply parameter if
3854  *          kEventParamTextInputReplyCTFontRef (or on 32-bit:
3855  *          kEventParamTextInputReplyFMFont or
3856  *          kEventParamTextInputReplyFont) and
3857  *          kEventParamTextInputReplyPointSize are provided.
3858  *
3859  *    <-- kEventParamTextInputReplyFMFont (out, typeUInt32)
3860  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
3861  *          later.
3862  *
3863  *          The FMFont associated with the text at the offset specified
3864  *          in the event, either the FMFont of the active input area if
3865  *          one exists, or of the text at the specified offset and
3866  *          specified leading/ trailing edge value.  At a font run
3867  *          boundary, such as where a Japanese text run ends, and a
3868  *          Roman begins, a leading edge value of 'true' should return
3869  *          the font of the Roman text run while a leading edge value
3870  *          of 'false' should return the Japanese font.
3871  *          This parameter allows the handler to return an FMFont when
3872  *          a FMFontFamily or FOND would be inconvenient to
3873  *          compute.
3874  *          This parameter is NOT SUPPORTED on 64-bit.
3875  *          This parameter is optional and may not be returned to the
3876  *          caller.
3877  *
3878  *    <-- kEventParamTextInputReplyFont (out, typeSInt32)
3879  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
3880  *          later.
3881  *
3882  *          The QD Font associated with the text at the offset
3883  *          specified in the event, either the QD Font of the active
3884  *          input area if one exists, or of the text at the specified
3885  *          offset and specified leading/ trailing edge value.  At a
3886  *          font run boundary, such as where a Japanese text run ends,
3887  *          and a Roman begins, a leading edge value of 'true' should
3888  *          return the font of the Roman text run while a leading edge
3889  *          value of 'false' should return the Japanese font.
3890  *          This parameter is NOT SUPPORTED on 64-bit.
3891  *          This parameter is optional and may not be returned to the
3892  *          caller.
3893  *
3894  *    <-- kEventParamTextInputReplyPointSize (out, typeCGFloat)
3895  *          If the kEventParamTextInputReplyCTFontRef parameter is
3896  *          accessed using typeCTFontRef, this parameter is not used
3897  *          (Mac OS X 10.5 and later).
3898  *
3899  *          The point size associated with the text at the offset
3900  *          specified in the event, either the point size of the active
3901  *          input area if one exists, or of the text at the specified
3902  *          offset.  At a style run boundary where point size changes,
3903  *          the leadingEdge parameter determines which point size
3904  *          should be returned.
3905  *
3906  *          Note:  This parameter is not normally used if a CTFontRef
3907  *          is being returned via kEventParamTextInputReplyCTFontRef
3908  *          (Mac OS X 10.5 and later), but could be helpful if the
3909  *          context in which the ATSFontRef is used (such as the use of
3910  *          an affine transform) would produce a font size different
3911  *          from the font size that would be derived from the
3912  *          CTFontRef.  However, see comment under
3913  *          kEventParamTextInputReplyCTFontRef pertaining to the
3914  *          importance of input method adoption of CTFont API.
3915  *
3916  *          Note2:  This parameter was originally typed as typeFixed
3917  *          for QD font and FMFont, but should be inserted as
3918  *          typeCGFloat when an ATSFontRef is returned via
3919  *          kEventParamTextInputReplyATSFont.    The toolbox provides
3920  *          automatic type coercion between typeFixed and typeCGFloat
3921  *          on 32-bit.  Always use typeCGFloat on 64-bit.
3922  *          This parameter is optional and may not be returned to the
3923  *          caller.
3924  *
3925  *    <-- kEventParamTextInputReplyLineHeight (out, typeCGFloat)
3926  *          If the kEventParamTextInputReplyCTFontRef parameter is
3927  *          accessed using typeCTFontRef, this parameter is not used
3928  *          (Mac OS X 10.5 and later).
3929  *
3930  *          The line height associated with the text at the offset
3931  *          specified in the event, either the line height of the
3932  *          active input area if one exists, or of the text at the
3933  *          specified offset. At a style run boundary where point size
3934  *          changes, the leadingEdge parameter determines which line
3935  *          height should be returned.
3936  *          By default, this value is accessed in global coordinate
3937  *          space, or 72dpi virtual coordinate Space, but can be
3938  *          accessed as any other type that specifies the desired
3939  *          coordinate space, i.e. in Screen Pixel space.
3940  *
3941  *          NOTE:  This parameter was originally typed as typeSInt16
3942  *          for QD font and FMFont, but should be inserted as
3943  *          typeCGFloat when an ATSFontRef is returned via
3944  *          kEventParamTextInputReplyATSFont.  The toolbox provides
3945  *          automatic type coercion between typeSInt16 and typeCGFloat
3946  *          on 32-bit.  Always use typeCGFloat on 64-bit.
3947  *          This parameter is optional and may not be returned to the
3948  *          caller.
3949  *
3950  *    <-- kEventParamTextInputReplyLineAscent (out, typeCGFloat)
3951  *          If the kEventParamTextInputReplyCTFontRef parameter is
3952  *          accessed using typeCTFontRef, this parameter is not used
3953  *          (Mac OS X 10.5 and later).
3954  *
3955  *          The line ascent associated with the text at the offset
3956  *          specified in the event, either the line ascent of the
3957  *          active input area if one exists, or of the text at the
3958  *          specified offset.  At a style run boundary where point size
3959  *          changes, the leadingEdge parameter determines which line
3960  *          ascent should be returned.
3961  *          By default, this value is accessed in global coordinate
3962  *          space, or 72dpi virtual coordinate Space, but can be
3963  *          accessed as any other type that specifies the desired
3964  *          coordinate space, i.e. in Screen Pixel space.
3965  *
3966  *          NOTE:  This parameter was originally typed as typeSInt16
3967  *          for QD font and FMFont, but should be inserted as
3968  *          typeCGFloat when an ATSFontRef is returned via
3969  *          kEventParamTextInputReplyATSFont.  The toolbox provides
3970  *          automatic type coercion between typeSInt16 and typeCGFloat
3971  *          on 32-bit.  Always use typeCGFloat on 64-bit.
3972  *          This parameter is optional and may not be returned to the
3973  *          caller.
3974  *
3975  *    <-- kEventParamTextInputReplyTextAngle (out, typeFixed)
3976  *          The orientation associated with the text at the offset
3977  *          specified in the event, either the orientation of the
3978  *          active input area if one exists, or of the text at the
3979  *          specified offset.  At a style run boundary where
3980  *          orientation changes, the leadingEdge parameter determines
3981  *          which orientation should be returned.  The value 90
3982  *          specifies a horizontal line direction and 180 specifies a
3983  *          vertical line direction. This parameter is optional and may
3984  *          not be returned to the caller.
3985  *
3986  *  Availability:
3987  *    Mac OS X:         in version 10.0 and later in Carbon.framework
3988  *    CarbonLib:        in CarbonLib 1.1 and later
3989  }
3990 const
3991 	kEventTextInputOffsetToPos = 3;
3992 
3993 {
3994  *  kEventClassTextInput / kEventTextInputPosToOffset
3995  *
3996  *  Summary:
3997  *    Requests conversion from global coordinate to a byte offset in
3998  *    text.
3999  *
4000  *  Discussion:
4001  *    This event is used for mouse tracking.  An input method typically
4002  *    produces this event to perform proper cursor management as the
4003  *    cursor moves over various subranges, or clauses of text (or the
4004  *    boundaries between these) in an inline input session, or moves
4005  *    between an inline input session to the main text body, or even
4006  *    outside of the main text body.
4007  *
4008  *  Mac OS X threading:
4009  *    Not thread safe
4010  *
4011  *  Parameters:
4012  *
4013  *    --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
4014  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
4015  *          later.
4016  *
4017  *          This parameter is provided by the input method originating
4018  *          the event. (Required parameter)
4019  *
4020  *    --> kEventParamTextInputSendRefCon (in, typeRefCon)
4021  *          TSM's SendTextInputEvent, called by an input method,
4022  *          inserts this parameter before dispatching the event to the
4023  *          user focus.  (Required Parameter)
4024  *
4025  *          On Mac OS X 10.4 and earlier, this parameter uses
4026  *          typeSInt32, and you must retrieve it using that constant.
4027  *          On Mac OS X 10.5 and later, to support 64-bit refcon
4028  *          values, this parameter uses typeRefCon. For 64-bit
4029  *          compatibility, you must use typeRefCon when retrieving this
4030  *          parameter; for 32-bit targets, however, you may continue to
4031  *          use typeSInt32 if you wish, or switch to typeRefCon.
4032  *
4033  *    --> kEventParamTextInputSendCurrentPoint (in, typeHIPoint)
4034  *          The point whose text offset (and classification) the input
4035  *          method is requesting. This point is usually the current
4036  *          mouse position.
4037  *          Text offset classifications are defined by
4038  *          kEventParamTextInputReplyRegionClass.
4039  *          By default, this point is accessed in global coordinate
4040  *          space, or 72dpi virtual coordinate Space, but can be
4041  *          accessed as any other type that specifies the desired
4042  *          coordinate space.
4043  *          This parameter was originally typed as typeQDPoint, but on
4044  *          Mac OS X 10.5 and later, it should be accessed as
4045  *          typeHIPoint.  The toolbox provides automatic type coercion
4046  *          between these two types.<BR> <BR> Required parameter.
4047  *
4048  *    --> kEventParamTextInputSendDraggingMode (in, typeBoolean)
4049  *          A Boolean value that indicates whether the input method is
4050  *          currently tracking the mouse -- that is, whether the user
4051  *          is dragging the current selection. If it is TRUE, the
4052  *          application should pin the cursor to the limits of the
4053  *          active input area (to avoid highlighting beyond the limits
4054  *          of the active input area).
4055  *          This parameter is optional and may not be present in all
4056  *          instances of this event.
4057  *
4058  *    <-- kEventParamTextInputReplyTextOffset (out, typeByteOffset)
4059  *          The text offset (ByteOffset) corresponding to the supplied
4060  *          point. If the click is within the limits of the active
4061  *          input area, the offset is relative to the start of the
4062  *          active input area. Otherwise, the offset is relative to the
4063  *          start of the application's text body.  This offset is
4064  *          always a positive value. (Required reply parameter)
4065  *
4066  *          On Mac OS X 10.4 and earlier, this parameter uses
4067  *          typeSInt32, and you must retrieve it using that constant.
4068  *          On Mac OS X 10.5 and later, to support 64-bit offset
4069  *          values, this parameter uses typeByteOffset. For 64-bit
4070  *          compatibility, you must use typeByteOffset when retrieving
4071  *          this parameter; for 32-bit targets, however, you may
4072  *          continue to use typeSInt32 if you wish, or switch to
4073  *          typeByteOffset which is really typeUInt32 to which the
4074  *          toolbox will automatically convert because this parameter
4075  *          always contains positive values.
4076  *
4077  *    <-- kEventParamTextInputReplyRegionClass (out, typeSInt32)
4078  *          The classification of the offset parameter.  The values
4079  *          kTSMOutsideOfBody and kTSMInsideOfBody means that the
4080  *          position is outside or inside of the text body,
4081  *          respectively.  A value of kTSMInsideOfActiveInputArea means
4082  *          that the position is inside of the active input area.
4083  *          (Required reply parameter)
4084  *
4085  *    <-- kEventParamTextInputReplyLeadingEdge (out, typeBoolean)
4086  *          Specifies whether the point supplied corresponds to the
4087  *          leading edge (true) or trailing edge (false) of a glyph.
4088  *          This value is similar to the leadingEdge parameter of the
4089  *          QuickDraw PixelToChar function.
4090  *          If the supplied point is on the leading edge of a glyph,
4091  *          this parameter contains the text offset of the character
4092  *          whose glyph is at the pixel location.  (If the glyph
4093  *          represents multiple characters, it returns the text offset
4094  *          of the first of these characters in memory.)  If the
4095  *          supplied point is on the trailing edge of a glyph, this
4096  *          parameter returns the text offset of the first character in
4097  *          memory following the character or characters represented by
4098  *          the glyph.
4099  *          This parameter is optional and may not be returned to the
4100  *          caller.
4101  *
4102  *    <-- kEventParamTextInputReplySLRec (out, typeIntlWritingCode)
4103  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
4104  *          later.
4105  *
4106  *          The ScriptLanguageRecord of the script run containing the
4107  *          character at the returned text offset and leading/trailing
4108  *          edge value.
4109  *          This parameter is optional and may not be returned to the
4110  *          caller.
4111  *
4112  *  Availability:
4113  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4114  *    CarbonLib:        in CarbonLib 1.1 and later
4115  }
4116 const
4117 	kEventTextInputPosToOffset = 4;
4118 
4119 {
4120  *  kEventClassTextInput / kEventTextInputShowHideBottomWindow
4121  *
4122  *  Summary:
4123  *    Show or hide the bottom-line input window.
4124  *
4125  *  Discussion:
4126  *    This event is produced by input methods to control the Text
4127  *    Services Manager bottom-line input window, and is not normally
4128  *    handled by an application.
4129  *
4130  *  Mac OS X threading:
4131  *    Not thread safe
4132  *
4133  *  Parameters:
4134  *
4135  *    --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
4136  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
4137  *          later.
4138  *
4139  *          This parameter is provided by the input method originating
4140  *          the event.<BR> Required parameter.
4141  *
4142  *    --> kEventParamTextInputSendRefCon (in, typeRefCon)
4143  *          TSM's SendTextInputEvent, called by an input method,
4144  *          inserts this parameter before dispatching the event to the
4145  *          user focus.  (Required Parameter)
4146  *
4147  *          On Mac OS X 10.4 and earlier, this parameter uses
4148  *          typeSInt32, and you must retrieve it using that constant.
4149  *          On Mac OS X 10.5 and later, to support 64-bit refcon
4150  *          values, this parameter uses typeRefCon. For 64-bit
4151  *          compatibility, you must use typeRefCon when retrieving this
4152  *          parameter; for 32-bit targets, however, you may continue to
4153  *          use typeSInt32 if you wish, or switch to typeRefCon.
4154  *
4155  *    --> kEventParamTextInputSendShowHide (in, typeBoolean)
4156  *          If true, the bottomline input window should be shown; if
4157  *          false, it should be hidden. This parameter is not needed if
4158  *          the input method is simply inquiring about the state of the
4159  *          input window.
4160  *          This parameter is optional and may not be present in all
4161  *          instances of this event.
4162  *
4163  *    <-- kEventParamTextInputReplyShowHide (out, typeBoolean)
4164  *          The current state of the input window: true if the window
4165  *          is shown; false if it is hidden. If the optional parameter
4166  *          kEventParamTextInputSendShowHide is included, this return
4167  *          parameter should show the state of the window before it was
4168  *          set to the state requested in the optional parameter.
4169  *           This parameter is optional and may not be returned to the
4170  *          caller.
4171  *
4172  *  Availability:
4173  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4174  *    CarbonLib:        in CarbonLib 1.1 and later
4175  }
4176 const
4177 	kEventTextInputShowHideBottomWindow = 5;
4178 
4179 {
4180  *  kEventClassTextInput / kEventTextInputGetSelectedText
4181  *
4182  *  Summary:
4183  *    Get the selected text (or the character before or after the
4184  *    insertion point, based on the leadingEdge parameter) from the
4185  *    application�s text engine.
4186  *
4187  *  Mac OS X threading:
4188  *    Not thread safe
4189  *
4190  *  Parameters:
4191  *
4192  *    --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
4193  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
4194  *          later.
4195  *
4196  *          This parameter is provided by the input method originating
4197  *          the event.  If an invalid value is specified, tsmUnknownErr
4198  *          will be returned. (Required parameter)
4199  *
4200  *    --> kEventParamTextInputSendRefCon (in, typeRefCon)
4201  *          TSM's SendTextInputEvent, called by an input method,
4202  *          inserts this parameter before dispatching the event to the
4203  *          user focus.  (Required Parameter)
4204  *
4205  *          On Mac OS X 10.4 and earlier, this parameter uses
4206  *          typeSInt32, and you must retrieve it using that constant.
4207  *          On Mac OS X 10.5 and later, to support 64-bit refcon
4208  *          values, this parameter uses typeRefCon. For 64-bit
4209  *          compatibility, you must use typeRefCon when retrieving this
4210  *          parameter; for 32-bit targets, however, you may continue to
4211  *          use typeSInt32 if you wish, or switch to typeRefCon.
4212  *
4213  *    --> kEventParamTextInputSendLeadingEdge (in, typeBoolean)
4214  *          If there is a non-empty selection, this parameter should be
4215  *          ignored.  When the current selection is empty, i.e. an
4216  *          insertion point, and this parameter is NOT supplied, no
4217  *          text should be returned. If the current selection is empty
4218  *          and this parameter is supplied, return the character (or
4219  *          characters) representing the glyph on the side of the
4220  *          insertion point indicated by this leadingEdge parameter.
4221  *          This value is similar to the leadingEdge parameter of the
4222  *          QuickDraw PixelToChar function.  If this parameter is true,
4223  *          the character (or characters) at the insertion point is
4224  *          returned.  If this parameter is false, the character (or
4225  *          characters) immediately preceding (in memory order) the
4226  *          insertion point should be returned. This parameter is
4227  *          optional and may not be present in all instances of this
4228  *          event. This parameter has no default value and no text
4229  *          should be returned when this parameter is ommited and there
4230  *          is no selected text.
4231  *
4232  *    --> kEventParamTextInputSendTextServiceEncoding (in, typeUInt32)
4233  *          The encoding associated with the text sent by an input
4234  *          method. On MacOS X, this parameter is not commonly used
4235  *          because all TSM input methods produce (and request)
4236  *          Unicode, but if specified, this may be a Unicode variant
4237  *          encoding. In CarbonLib on MacOS, this parameter identifies
4238  *          the Mac encoding (usually an encoding variant) of the text
4239  *          produced by the input method on MacOS, where it is not a
4240  *          requirement that input methods be Unicode-savvy.  On this
4241  *          platform, TSM needs the information to convert text to
4242  *          Unicode from a Mac encoding variant which cannot be derived
4243  *          from the ScriptLanguage record associated with the input
4244  *          method component. This parameter is optional and may not be
4245  *          present in all instances of this event.
4246  *
4247  *    --> kEventParamTextInputReplyAttributedString (in, typeCFAttributedStringRef)
4248  *          The attributed string for the text selection.  This is the
4249  *          preferred event parameter on Mac OS X 10.5 and later.  The
4250  *          attributes are those defined in CTStringAttributes.h.
4251  *           On Mac OS X 10.5, TSM supports the font attribute and the
4252  *          glyph info attribute.
4253  *          NOTE:  When a glyph info attribute is set for a particular
4254  *          text range, it is expected that a font attribute covers at
4255  *          least that same text range.  This is also important to
4256  *          allow TSM to coerce attributes to compatibility data
4257  *          structures, such as the kEventParamTextInputGlyphInfoArray
4258  *          event parameter.
4259  *          NOTE2:  If this event parameter is missing and requested,
4260  *          it is coerced from the compatibility parameters provided in
4261  *          this event, in particular, kEventParamTextInputReplyText
4262  *          and kEventParamTextInputGlyphInfoArray.
4263  *
4264  *          This parameter is optional and may not be returned to the
4265  *          caller.
4266  *
4267  *    <-- kEventParamTextInputReplyText (out, typeUnicodeText)
4268  *          The data type of this parameter actually depends on the
4269  *          TSMDocument type created via NewTSMDocument: it should be
4270  *          typeChar for kTextService documents, or typeUnicodeText for
4271  *          kUnicodeDocument documents.
4272  *          This parameter has been deprecated in favor of
4273  *          kEventParamTextInputReplyAttributedString on Mac OS X 10.5
4274  *          and later.
4275  *          This parameter is optional and may not be returned to the
4276  *          caller.
4277  *
4278  *    <-- kEventParamTextInputReplySLRec (out, typeIntlWritingCode)
4279  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
4280  *          later.
4281  *
4282  *          The ScriptLanguageRecord of the script run containing the
4283  *          text being returned to an input method. This parameter is
4284  *          optional and may not be returned to the caller.
4285  *
4286  *    <-- kEventParamTextInputReplyMacEncoding (out, typeUInt32)
4287  *          The Mac encoding (variant) associated with the text
4288  *          returned to the input method. On Mac OS X, this parameter
4289  *          may needed by TSM to convert application produced text from
4290  *          a Mac encoding to Unicodes returned to the input method.
4291  *          This parameter is optional and may not be returned to the
4292  *          caller.
4293  *
4294  *    <-- kEventParamTextInputGlyphInfoArray (out, typeGlyphInfoArray)
4295  *          A TSMGlyphInfoArray structure in which the event handler
4296  *          can associate unencoded glyphs IDs and/or fonts with
4297  *          (sub)ranges of text it returns.  The array elements
4298  *          identify non-overlapping ranges of text and the glyph ID
4299  *          (character collection is 0) such as in an OpenType font, or
4300  *          the CID (collection is non-zero) such as in TrueType fonts.
4301  *           If the glyphID itself is 0, only the font specified is to
4302  *          be applied to the text range.  This is useful for
4303  *          characters in Unicode private use area. For more
4304  *          information, see the Glyph Access protocol described in
4305  *          Technote TN2079. This parameter is optional and may not be
4306  *          returned to the caller. NOTE:  This parameter should really
4307  *          have been kEventParamTextInputReplyGlyphInfoArray, which
4308  *          was introduced after glyphInfo support was added to this
4309  *          event, but we can't change it now without breaking binary
4310  *          compatibility.
4311  *
4312  *  Result:
4313  *    TSM will return tsmUnknownErr if the input method has specified
4314  *    an invalid component instance for this event's
4315  *    kEventParamTextInputSendComponentInstance parameter.
4316  *
4317  *  Availability:
4318  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4319  *    CarbonLib:        in CarbonLib 1.1 and later
4320  }
4321 const
4322 	kEventTextInputGetSelectedText = 6;
4323 
4324 {
4325  *  kEventClassTextInput / kEventTextInputUnicodeText
4326  *
4327  *  Summary:
4328  *    Used by input methods to provide original input text to the Text
4329  *    Services Manager.
4330  *
4331  *  Discussion:
4332  *    This Unicode text event is produced only by input methods or
4333  *    other text services, and is delivered to TSM via
4334  *    SendTextInputEvent(). TSM never dispatches this event to the user
4335  *    focus, so application handlers should NOT install handlers for
4336  *    this event. Instead, TSM chains this event into any active
4337  *    keyboard input method in order to prevent interference with
4338  *    existing inline input sessions. The keyboard input method can
4339  *    either insert the text into the inline session, or it may confirm
4340  *    its session and return the UnicodeText event to TSM unhandled, in
4341  *    which case TSM will convert the event into a UnicodeForKey event
4342  *    (converting the Unicodes to Mac charCodes and synthesizing
4343  *    information where needed) and finally dispatch the resulting
4344  *    event to the user focus as usual.
4345  *
4346  *  Mac OS X threading:
4347  *    Not thread safe
4348  *
4349  *  Parameters:
4350  *
4351  *    --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
4352  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
4353  *          later.
4354  *
4355  *          This parameter is provided by the input method originating
4356  *          the event. (Required parameter)
4357  *
4358  *    --> kEventParamTextInputSendSLRec (in, typeIntlWritingCode)
4359  *          This event parameter is DEPRECATED on Mac OS X 10.5 and
4360  *          later.
4361  *
4362  *          The ScriptLanguageRecord associated with the text contained
4363  *          in the event. This parameter is provided by the input
4364  *          method originating the event. This parameter is optional
4365  *          and may not be present in all instances of this event.
4366  *
4367  *    --> kEventParamTextInputSendAttributedString (in, typeCFAttributedStringRef)
4368  *          The attributed string produced by an input method.  This is
4369  *          the preferred event parameter on Mac OS X 10.5 and later.
4370  *          The attributes are those defined in
4371  *          CTStringAttributes.h.
4372  *          On Mac OS X 10.5, TSM supports the font attribute and the
4373  *          glyph info attribute.
4374  *          NOTE:  When a glyph info attribute is set for a particular
4375  *          text range, it is expected that a font attribute covers at
4376  *          least that same text range.  This is also important to
4377  *          allow TSM to coerce attributes to compatibility data
4378  *          structures, such as the
4379  *          kEventParamTextInputSendGlyphInfoArray event parameter.
4380  *           NOTE2:  If this event parameter is missing and requested,
4381  *          it is coerced from the compatibility parameters provided in
4382  *          this event, in particular, kEventParamTextInputSendText and
4383  *          kEventParamTextInputSendGlyphInfoArray.
4384  *
4385  *          Required Parameter if kEventParamTextInputSendText is not
4386  *          provided.
4387  *
4388  *    --> kEventParamTextInputSendText (in, typeUnicodeText)
4389  *          The Unicode characters produced by an input method.
4390  *           Required Parameter if
4391  *          kEventParamTextInputSendAttributedString is not provided.
4392  *
4393  *    --> kEventParamTextInputSendTextServiceEncoding (in, typeUInt32)
4394  *          The encoding associated with the text sent by an input
4395  *          method. On MacOS X, this parameter is not commonly used
4396  *          because all TSM input methods produce (and request)
4397  *          Unicode, but if specified, this may be a Unicode variant
4398  *          encoding. This parameter is optional and may not be present
4399  *          in all instances of this event.
4400  *
4401  *    --> kEventParamTextInputSendTextServiceMacEncoding (in, typeUInt32)
4402  *          The Mac encoding (variant) associated with the text sent by
4403  *          an input method, should TSM or an event handler need to
4404  *          convert the Unicodes. This parameter is optional and may
4405  *          not be present in all instances of this event.
4406  *
4407  *    --> kEventParamTextInputSendGlyphInfoArray (in, typeGlyphInfoArray)
4408  *          A TSMGlyphInfoArray structure in which an input method can
4409  *          associate unencoded glyphs IDs and/or fonts with
4410  *          (sub)ranges of text it produces.  The array elements
4411  *          identify non-overlapping ranges of text and the glyph ID
4412  *          (character collection is 0) such as in an OpenType font, or
4413  *          the CID (collection is non-zero) such as in TrueType fonts.
4414  *           If the glyphID itself is 0, only the font specified is to
4415  *          be applied to the text range.  This is useful for
4416  *          characters in Unicode private use area, such as Windings,
4417  *          but note that this capability should be used with care
4418  *          because changing the font of an input text stream can lead
4419  *          to a confusing user interface. For more information, see
4420  *          the Glyph Access protocol described in Technote TN2079.
4421  *          This parameter is optional and may not be present in all
4422  *          instances of this event.
4423  *
4424  *  Availability:
4425  *    Mac OS X:         in version 10.2 and later in Carbon.framework
4426  *    CarbonLib:        not available
4427  }
4428 const
4429 	kEventTextInputUnicodeText = 7;
4430 
4431 
4432 {
4433  *  kEventClassTextInput / kEventTextInputFilterText
4434  *
4435  *  Summary:
4436  *    Send text about to be inserted into the user focus to be filtered
4437  *    first.
4438  *
4439  *  Discussion:
4440  *    Sent before any final-form text is sent to the user focus.  Final
4441  *    form text includes text produced by a keyboard layout, Ink input
4442  *    method, Character palette or any other TSM text service, and any
4443  *    text being "confirmed" (or commited) from an inline input
4444  *    session.  In the case of text confirmed from an inline input
4445  *    session, TSM will take the resulting text buffer filtered by the
4446  *    event handler and adjust all parameters in the
4447  *    UpdateActiveInputArea event produced by the input method. The
4448  *    text filtering action will thus be transparent to both the app's
4449  *    UpdateActiveInputArea handler and the input method confirming the
4450  *    text.
4451  *
4452  *  Mac OS X threading:
4453  *    Not thread safe
4454  *
4455  *  Parameters:
4456  *
4457  *    --> kEventParamTextInputSendRefCon (in, typeRefCon)
4458  *          TSM's SendTextInputEvent, called by an input method,
4459  *          inserts this parameter before dispatching the event to the
4460  *          user focus.  (Required Parameter)
4461  *
4462  *          On Mac OS X 10.4 and earlier, this parameter uses
4463  *          typeSInt32, and you must retrieve it using that constant.
4464  *          On Mac OS X 10.5 and later, to support 64-bit refcon
4465  *          values, this parameter uses typeRefCon. For 64-bit
4466  *          compatibility, you must use typeRefCon when retrieving this
4467  *          parameter; for 32-bit targets, however, you may continue to
4468  *          use typeSInt32 if you wish, or switch to typeRefCon.
4469  *
4470  *    --> kEventParamTextInputSendText (in, typeUnicodeText)
4471  *          The Unicode characters that are about to be sent to the
4472  *          user focus, and need to be filtered.  (Required Parameter)
4473  *
4474  *    <-- kEventParamTextInputReplyText (out, typeUnicodeText)
4475  *          The filtered Unicode characters... may be a zero-size
4476  *          parameter.  (Required Parameter)
4477  *
4478  *  Result:
4479  *    Return noErr to indicate that the text needing filtering has been
4480  *    changed, otherwise return eventNotHandledErr.
4481  *
4482  *  Availability:
4483  *    Mac OS X:         in version 10.4 and later in Carbon.framework
4484  *    CarbonLib:        not available
4485  }
4486 const
4487 	kEventTextInputFilterText = 14;
4488 
4489 
4490 {
4491  *  kEventClassTextInput / kEventTextInputIsMouseEventInInlineInputArea
4492  *
4493  *  Summary:
4494  *    Test whether the mouse event's point intersects the on-screen
4495  *    area used for the current inline input session.
4496  *
4497  *  Discussion:
4498  *    When there is a currently active TSMDocument (as returned by
4499  *    TSMGetActiveDocument), and only when there is an active inline
4500  *    input session, TSM will dispatch this event to the event
4501  *    dispatcher target, which sends it to the user focus event target.
4502  *     The intent of this event is to ask the owner of the TSMDocument
4503  *    whether the mouse event specified should be considered to
4504  *    intersect the area (bounds) occupied by the inline input
4505  *    session.
4506  *
4507  *    This event is dispatched for any kEventClassMouse event except
4508  *    kEventMouseEntered and kEventMouseExited.  The entire mouse event
4509  *    is included instead of only the point, in order to allow the
4510  *    event handler to be as light-weight as possible, i.e. leverage
4511  *    the additional content of mouse events, such as
4512  *    kEventParamWindowRef and kEventParamWindowMouseLocation, but it
4513  *    is understood that the mouse event itself will in no way be
4514  *    modified in the event handler.  Because this event is dispatched
4515  *    for kEventMouseMoved events, it should do as little work as
4516  *    possible, such as a call to HIShapeContainsPoint().
4517  *
4518  *    If the owner of the current TSMDocument does not respond to this
4519  *    event, TSM will hit-test the mouse event against the content
4520  *    region of the key focus window (as returned by
4521  *    GetUserFocusWindow).
4522  *
4523  *    When the owner of the current TSMDocument indicates that the
4524  *    mouse event does intersect the inline input session (or the event
4525  *    is not handled and the mouse event intersects the key focus
4526  *    window's content region), the mouse event is delivered to the
4527  *    input method.
4528  *
4529  *    Note:  kEventMouseMoved events are promoted to
4530  *    kEventWindowCursorChange events before being delivered to the
4531  *    input method.
4532  *
4533  *  Mac OS X threading:
4534  *    Not thread safe
4535  *
4536  *  Parameters:
4537  *
4538  *    --> kEventParamTextInputSendRefCon (in, typeRefCon)
4539  *          This RefCon property of the active TSMDocument.
4540  *
4541  *    --> kEventParamTextInputSendMouseEvent (in, typeEventRef)
4542  *          The mouse event being hit-tested against the inline input
4543  *          session.
4544  *
4545  *    <-- kEventParamResult (out, typeBoolean)
4546  *          Whether the mouse event's point intersects the area
4547  *          occupied by the inline input session.
4548  *
4549  *  Availability:
4550  *    Mac OS X:         in version 10.5 and later in Carbon.framework
4551  *    CarbonLib:        not available
4552  }
4553 const
4554 	kEventTextInputIsMouseEventInInlineInputArea = 16;
4555 
4556 
4557 {--------------------------------------------------------------------------------------}
4558 { Raw Keyboard Events                                                                  }
4559 {--------------------------------------------------------------------------------------}
4560 {
4561     kEventClassKeyboard quick reference:
4562 
4563     kEventRawKeyDown                = 1,
4564     kEventRawKeyRepeat              = 2,
4565     kEventRawKeyUp                  = 3,
4566     kEventRawKeyModifiersChanged    = 4,
4567     kEventHotKeyPressed             = 5,
4568     kEventHotKeyReleased            = 6
4569 );
4570 
4571 |*!
4572     @event          kEventRawKeyDown
4573     @abstract       A key was pressed.
4574 
4575     @discussion     This is the lowest-level keyboard input event. When this event is sent, the keyboard
4576                     input has not yet been processed by the Text Services Manager or passed to input methods.
4577                     Usually, you should not handle this event, because doing so may interfere with input
4578                     methods; instead, you should handle the kEventTextInputUnicodeForKeyEvent event, which
4579                     is sent after input methods have handled the raw key event, and contains both Unicode
4580                     and the original keyboard event.
4581 
4582                     This event has a default handler on the application event target. The default handler
4583                     calls the Text Services Manager to pass the event through to input methods. The default
4584                     handler also implements certain standard keyboard equivalents, such as cmd-` for intra-
4585                     process window rotation and the universal keyboard access equivalents for interprocess
4586                     window rotation and document, floating, toolbar, and menubar keyboard focus.
4587 
4588     @param          kEventParamKeyUnicodes
4589                         The Unicode(s) generated by the key that was pressed.<BR>
4590                         This parameter is preferred for obtaining text for a key press and should be
4591                         used instead of kEventParamKeyMacCharCodes, in particular in 64bit.
4592 
4593     @param          kEventParamKeyMacCharCodes
4594                         This event parameter is DEPRECATED for 64bit on Mac OS X 10.6 and later.<BR>
4595                         <BR>
4596                         The character generated by the key that was pressed. The character�s encoding
4597                         is determined by the current keyboard script.
4598 
4599     @param          kEventParamKeyCode
4600                         The virtual keycode of the key that was pressed.
4601 
4602     @param          kEventParamKeyModifiers
4603                         The keyboard modifiers that were down when the key was pressed.
4604 
4605     @param          kEventParamKeyboardType
4606                         The type of keyboard on which the key was pressed.
4607 }
4608 {
4609  *  kEventClassKeyboard / kEventRawKeyDown
4610  *
4611  *  Mac OS X threading:
4612  *    Not thread safe
4613  *
4614  *  Availability:
4615  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4616  *    CarbonLib:        in CarbonLib 1.1 and later
4617  }
4618 const
4619 	kEventRawKeyDown = 1;
4620 
4621 {
4622  *  kEventClassKeyboard / kEventRawKeyRepeat
4623  *
4624  *  Summary:
4625  *    Sent periodically as a key is held down by the user.
4626  *
4627  *  Discussion:
4628  *    Usually, you should not handle this event, because doing so may
4629  *    interfere with input methods; instead, you should handle the
4630  *    kEventTextInputUnicodeForKeyEvent event, which is sent after
4631  *    input methods have handled the raw key event, and contains both
4632  *    Unicode and the original keyboard event.
4633  *
4634  *  Mac OS X threading:
4635  *    Not thread safe
4636  *
4637  *  Parameters:
4638  *
4639  *    --> kEventParamKeyUnicodes (in, typeUnicodeText)
4640  *          The Unicode(s) generated by the key that was pressed.
4641  *           This parameter is preferred for obtaining text for a key
4642  *          press and should be used instead of
4643  *          kEventParamKeyMacCharCodes, in particular in 64bit.
4644  *
4645  *    --> kEventParamKeyMacCharCodes (in, typeChar)
4646  *          This event parameter is DEPRECATED for 64bit on Mac OS X
4647  *          10.6 and later.
4648  *
4649  *          The character generated by the key that was pressed. The
4650  *          character�s encoding is determined by the current keyboard
4651  *          script.
4652  *
4653  *    --> kEventParamKeyCode (in, typeUInt32)
4654  *          The virtual keycode of the key that was pressed.
4655  *
4656  *    --> kEventParamKeyModifiers (in, typeUInt32)
4657  *          The keyboard modifiers that were down when the key was
4658  *          pressed.
4659  *
4660  *    --> kEventParamKeyboardType (in, typeUInt32)
4661  *          The type of keyboard on which the key was pressed.
4662  *
4663  *  Availability:
4664  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4665  *    CarbonLib:        in CarbonLib 1.1 and later
4666  }
4667 const
4668 	kEventRawKeyRepeat = 2;
4669 
4670 {
4671  *  kEventClassKeyboard / kEventRawKeyUp
4672  *
4673  *  Summary:
4674  *    A key was released.
4675  *
4676  *  Mac OS X threading:
4677  *    Not thread safe
4678  *
4679  *  Parameters:
4680  *
4681  *    --> kEventParamKeyUnicodes (in, typeUnicodeText)
4682  *          The Unicode(s) generated by the key that was released.
4683  *           This parameter is preferred for obtaining text for a key
4684  *          press and should be used instead of
4685  *          kEventParamKeyMacCharCodes, in particular in 64bit.
4686  *
4687  *    --> kEventParamKeyMacCharCodes (in, typeChar)
4688  *          This event parameter is DEPRECATED for 64bit on Mac OS X
4689  *          10.6 and later.
4690  *
4691  *          The character generated by the key that was released. The
4692  *          character�s encoding is determined by the current keyboard
4693  *          script.
4694  *
4695  *    --> kEventParamKeyCode (in, typeUInt32)
4696  *          The virtual keycode of the key that was released.
4697  *
4698  *    --> kEventParamKeyModifiers (in, typeUInt32)
4699  *          The keyboard modifiers that were down when the key was
4700  *          released.
4701  *
4702  *    --> kEventParamKeyboardType (in, typeUInt32)
4703  *          The type of keyboard on which the key was released.
4704  *
4705  *  Availability:
4706  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4707  *    CarbonLib:        in CarbonLib 1.1 and later
4708  }
4709 const
4710 	kEventRawKeyUp = 3;
4711 
4712 {
4713  *  kEventClassKeyboard / kEventRawKeyModifiersChanged
4714  *
4715  *  Summary:
4716  *    The keyboard modifiers have changed.
4717  *
4718  *  Discussion:
4719  *    This event is sent to all handlers registered for it.
4720  *
4721  *  Mac OS X threading:
4722  *    Not thread safe
4723  *
4724  *  Parameters:
4725  *
4726  *    --> kEventParamKeyModifiers (in, typeUInt32)
4727  *          The keyboard modifiers that are now pressed. This is the
4728  *          current state of the modifiers, not a delta state; it
4729  *          includes modifiers that were pressed before the latest
4730  *          change to modifier state.
4731  *
4732  *  Availability:
4733  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4734  *    CarbonLib:        in CarbonLib 1.1 and later
4735  }
4736 const
4737 	kEventRawKeyModifiersChanged = 4;
4738 
4739 {
4740  *  kEventClassKeyboard / kEventHotKeyPressed
4741  *
4742  *  Summary:
4743  *    A registered hot key was pressed.
4744  *
4745  *  Mac OS X threading:
4746  *    Not thread safe
4747  *
4748  *  Parameters:
4749  *
4750  *    --> kEventParamDirectObject (in, typeEventHotKeyID)
4751  *          The ID of the hot key that was pressed.
4752  *
4753  *  Availability:
4754  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4755  *    CarbonLib:        in CarbonLib 1.3 and later
4756  }
4757 const
4758 	kEventHotKeyPressed = 5;
4759 
4760 {
4761  *  kEventClassKeyboard / kEventHotKeyReleased
4762  *
4763  *  Summary:
4764  *    A registered hot key was released.
4765  *
4766  *  Mac OS X threading:
4767  *    Not thread safe
4768  *
4769  *  Parameters:
4770  *
4771  *    --> kEventParamDirectObject (in, typeEventHotKeyID)
4772  *          The ID of the hot key that was released.
4773  *
4774  *  Availability:
4775  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4776  *    CarbonLib:        in CarbonLib 1.3 and later
4777  }
4778 const
4779 	kEventHotKeyReleased = 6;
4780 
4781 
4782 {
4783  *  Summary:
4784  *    Key modifier change event bits and masks
4785  *
4786  *  Discussion:
4787  *    From bit 8, cmdKeyBit, to bit 15, rightControlKeyBit, are
4788  *    compatible with Event Manager modifiers.
4789  }
4790 const
4791 {
4792    * Indicates that this keyboard event was generated either on the
4793    * numeric keypad, or in the numeric section of an iBook or PowerBook
4794    * keyboard with the NumLock key pressed. This state bit does not
4795    * provide an indication of the NumLock state on non-portable
4796    * keyboards. This bit is only set on Mac OS X.
4797    }
4798 	kEventKeyModifierNumLockBit = 16;
4799 
4800   {
4801    * Indicates that the Fn key was pressed when this keyboard event was
4802    * generated. This bit is only set on Mac OS X.
4803    }
4804 	kEventKeyModifierFnBit = 17;
4805 
4806 const
4807 	kEventKeyModifierNumLockMask = 1 shl kEventKeyModifierNumLockBit;
4808 	kEventKeyModifierFnMask = 1 shl kEventKeyModifierFnBit;
4809 
4810 
4811 {--------------------------------------------------------------------------------------}
4812 { Application Events                                                                   }
4813 {--------------------------------------------------------------------------------------}
4814 
4815 {
4816     kEventClassApplication quick reference:
4817 
4818     kEventAppActivated                      = 1,
4819     kEventAppDeactivated                    = 2,
4820     kEventAppQuit                           = 3,
4821     kEventAppLaunchNotification             = 4,
4822     kEventAppLaunched                       = 5,
4823     kEventAppTerminated                     = 6,
4824     kEventAppFrontSwitched                  = 7,
4825 
4826     kEventAppFocusMenuBar                   = 8,
4827     kEventAppFocusNextDocumentWindow        = 9,
4828     kEventAppFocusNextFloatingWindow        = 10,
4829     kEventAppFocusToolbar                   = 11,
4830     kEventAppFocusDrawer                    = 12,
4831 
4832     kEventAppGetDockTileMenu                = 20,
4833     kEventAppUpdateDockTile                 = 21,
4834 
4835     kEventAppIsEventInInstantMouser         = 104,
4836 
4837     kEventAppHidden                         = 107,
4838     kEventAppShown                          = 108,
4839     kEventAppSystemUIModeChanged            = 109,
4840     kEventAppAvailableWindowBoundsChanged   = 110,
4841     kEventAppActiveWindowChanged            = 111
4842 }
4843 
4844 {
4845  *  kEventClassApplication / kEventAppActivated
4846  *
4847  *  Summary:
4848  *    This application has been activated.
4849  *
4850  *  Discussion:
4851  *    This event is sent to all handlers registered for it.
4852  *
4853  *  Mac OS X threading:
4854  *    Not thread safe
4855  *
4856  *  Parameters:
4857  *
4858  *    --> kEventParamWindowRef (in, typeWindowRef)
4859  *          This parameter is present if a click on an application
4860  *          window was the cause of the app activation; it contains the
4861  *          window that was clicked. This parameter is not provided if
4862  *          the application was activated for some other reason.
4863  *
4864  *  Availability:
4865  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4866  *    CarbonLib:        in CarbonLib 1.1 and later
4867  }
4868 const
4869 	kEventAppActivated = 1;
4870 
4871 {
4872  *  kEventClassApplication / kEventAppDeactivated
4873  *
4874  *  Summary:
4875  *    This application has been deactivated.
4876  *
4877  *  Discussion:
4878  *    This event is sent to all handlers registered for it.
4879  *
4880  *  Mac OS X threading:
4881  *    Not thread safe
4882  *
4883  *  Availability:
4884  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4885  *    CarbonLib:        in CarbonLib 1.1 and later
4886  }
4887 const
4888 	kEventAppDeactivated = 2;
4889 
4890 {
4891  *  kEventClassApplication / kEventAppQuit
4892  *
4893  *  Summary:
4894  *    A request to quit. Sent by QuitApplicationEventLoop to the
4895  *    application target.
4896  *
4897  *  Discussion:
4898  *    The RunApplicationEventLoop API installs a default handler on the
4899  *    application target for this event while the event loop is
4900  *    running. The handler is removed before RunApplicationEventLoop
4901  *    returns.
4902  *
4903  *    The event handler installed by RunApplicationEventLoop will cause
4904  *    RunApplicationEventLoop to exit. Most applications will not need
4905  *    to handle this event; instead, an application should install an
4906  *    AppleEvent handler for the kAEQuitApplication event handler if it
4907  *    needs to check for unsaved documents or do other cleanup before
4908  *    quitting.
4909  *
4910  *  Mac OS X threading:
4911  *    Not thread safe
4912  *
4913  *  Availability:
4914  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4915  *    CarbonLib:        in CarbonLib 1.1 and later
4916  }
4917 const
4918 	kEventAppQuit = 3;
4919 
4920 {
4921  *  kEventClassApplication / kEventAppLaunchNotification
4922  *
4923  *  Summary:
4924  *    Notification that an asynchronous process launch has completed.
4925  *
4926  *  Discussion:
4927  *    This event is received when you use LaunchServices to launch a
4928  *    process asynchronously. Your application only receives this event
4929  *    for processes that you launch; it is not sent for process
4930  *    launches from other applications (such as the Finder).
4931  *
4932  *  Mac OS X threading:
4933  *    Not thread safe
4934  *
4935  *  Parameters:
4936  *
4937  *    --> kEventParamProcessID (in, typeProcessSerialNumber)
4938  *          The ProcessSerialNumber of the process that was launched.
4939  *
4940  *    --> kEventParamLaunchRefCon (in, typeRefCon)
4941  *          Contains the value in the asyncRefCon field of the LSLaunch
4942  *          structure that was used to launch the process.
4943  *
4944  *          On Mac OS X 10.4 and earlier, this parameter uses
4945  *          typeUInt32, and you must retrieve it using that constant.
4946  *          On Mac OS X 10.5 and later, to support 64-bit refcon
4947  *          values, this parameter uses typeRefCon. For 64-bit
4948  *          compatibility, you must use typeRefCon when retrieving this
4949  *          parameter; for 32-bit targets, however, you may continue to
4950  *          use typeUInt32 if you wish, or switch to typeRefCon.
4951  *
4952  *    --> kEventParamLaunchErr (in, typeOSStatus)
4953  *          A result code indicating success or failure of the launch.
4954  *
4955  *  Availability:
4956  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4957  *    CarbonLib:        not available
4958  }
4959 const
4960 	kEventAppLaunchNotification = 4;
4961 
4962 {
4963  *  kEventClassApplication / kEventAppLaunched
4964  *
4965  *  Summary:
4966  *    Another app was launched.
4967  *
4968  *  Discussion:
4969  *    This event is sent to all handlers registered for it.
4970  *
4971  *  Mac OS X threading:
4972  *    Not thread safe
4973  *
4974  *  Parameters:
4975  *
4976  *    --> kEventParamProcessID (in, typeProcessSerialNumber)
4977  *          The ProcessSerialNumber of the process that was launched.
4978  *
4979  *  Availability:
4980  *    Mac OS X:         in version 10.0 and later in Carbon.framework
4981  *    CarbonLib:        in CarbonLib 1.3.1 and later
4982  }
4983 const
4984 	kEventAppLaunched = 5;
4985 
4986 {
4987  *  kEventClassApplication / kEventAppTerminated
4988  *
4989  *  Summary:
4990  *    Another app terminated.
4991  *
4992  *  Discussion:
4993  *    This event is sent to all handlers registered for it.
4994  *
4995  *  Mac OS X threading:
4996  *    Not thread safe
4997  *
4998  *  Parameters:
4999  *
5000  *    --> kEventParamProcessID (in, typeProcessSerialNumber)
5001  *          The ProcessSerialNumber of the process that terminated.
5002  *
5003  *  Availability:
5004  *    Mac OS X:         in version 10.0 and later in Carbon.framework
5005  *    CarbonLib:        in CarbonLib 1.3.1 and later
5006  }
5007 const
5008 	kEventAppTerminated = 6;
5009 
5010 {
5011  *  kEventClassApplication / kEventAppFrontSwitched
5012  *
5013  *  Summary:
5014  *    The front (active) application has changed.
5015  *
5016  *  Discussion:
5017  *    This event is sent to all handlers registered for it.
5018  *
5019  *  Mac OS X threading:
5020  *    Not thread safe
5021  *
5022  *  Parameters:
5023  *
5024  *    --> kEventParamProcessID (in, typeProcessSerialNumber)
5025  *          The ProcessSerialNumber of the process that became
5026  *          frontmost.
5027  *
5028  *  Availability:
5029  *    Mac OS X:         in version 10.0 and later in Carbon.framework
5030  *    CarbonLib:        in CarbonLib 1.3.1 and later
5031  }
5032 const
5033 	kEventAppFrontSwitched = 7;
5034 
5035 {
5036  *  kEventClassApplication / kEventAppHidden
5037  *
5038  *  Summary:
5039  *    The current application has been hidden.
5040  *
5041  *  Discussion:
5042  *    This event is sent to all handlers registered for it.
5043  *
5044  *  Mac OS X threading:
5045  *    Not thread safe
5046  *
5047  *  Availability:
5048  *    Mac OS X:         in version 10.2 and later in Carbon.framework
5049  *    CarbonLib:        not available
5050  }
5051 const
5052 	kEventAppHidden = 107;
5053 
5054 {
5055  *  kEventClassApplication / kEventAppShown
5056  *
5057  *  Summary:
5058  *    The current application has been shown.
5059  *
5060  *  Discussion:
5061  *    This event is sent to all handlers registered for it.
5062  *
5063  *  Mac OS X threading:
5064  *    Not thread safe
5065  *
5066  *  Availability:
5067  *    Mac OS X:         in version 10.2 and later in Carbon.framework
5068  *    CarbonLib:        not available
5069  }
5070 const
5071 	kEventAppShown = 108;
5072 
5073 {
5074  *  kEventClassApplication / kEventAppSystemUIModeChanged
5075  *
5076  *  Summary:
5077  *    The system UI mode or options of the frontmost application have
5078  *    changed.
5079  *
5080  *  Discussion:
5081  *    On Mac OS X 10.6 and later, this event is sent if the UI options
5082  *    of the frontmost application change, even if the mode remains the
5083  *    same. Prior to Mac OS X 10.6, this event is only sent if the UI
5084  *    mode changes. This event is sent to all handlers registered for
5085  *    it.
5086  *
5087  *  Mac OS X threading:
5088  *    Not thread safe
5089  *
5090  *  Parameters:
5091  *
5092  *    --> kEventParamSystemUIMode (in, typeUInt32)
5093  *          The new system UI mode. Contains a kUIMode constant from
5094  *          MacApplication.h.
5095  *
5096  *    --> kEventParamSystemUIOptions (in, typeUInt32)
5097  *          The new system UI options. Contains a bitmask of kUIOption
5098  *          constants from MacApplication.h. This parameter is
5099  *          available on Mac OS X 10.6 and later.
5100  *
5101  *  Availability:
5102  *    Mac OS X:         in version 10.2 and later in Carbon.framework
5103  *    CarbonLib:        not available
5104  }
5105 const
5106 	kEventAppSystemUIModeChanged = 109;
5107 
5108 
5109 const
5110 {
5111    * Indicates that a device�s available window positioning bounds have
5112    * changed because of a change in Dock position or size.
5113    }
5114 	kAvailBoundsChangedForDock = 1 shl 0;
5115 
5116   {
5117    * Indicates that a device�s available window positioning bounds have
5118    * changed because of a change in display configuration.
5119    }
5120 	kAvailBoundsChangedForDisplay = 1 shl 1;
5121 
5122 {
5123  *  kEventClassApplication / kEventAppAvailableWindowBoundsChanged
5124  *
5125  *  Summary:
5126  *    The available window positioning bounds have changed.
5127  *
5128  *  Discussion:
5129  *    This event is sent to all handlers registered for it.
5130  *
5131  *    This event is currently sent in two circumstances: when the Dock
5132  *    has changed position or size, and when the display configuration
5133  *    has changed. A separate copy of this event is sent to each
5134  *    affected GDevice.
5135  *
5136  *    All applications have a default handler installed on the
5137  *    application target that responds to this event by sending
5138  *    kEventWindowConstrain events to each window on the specified
5139  *    device. It is not possible to prevent this handler from running,
5140  *    since this event is sent to all registered handlers. However,
5141  *    applications that would like to do their own window layout may
5142  *    install a handler for this event, and also set the
5143  *    kWindowNoConstrainAttribute on their windows, which will cause
5144  *    the basic window handler to ignore kEventWindowConstrain. An
5145  *    application may also install its own kEventWindowConstrain
5146  *    handler and selectively return a value other than
5147  *    eventNotHandledErr, which will prevent the event from being sent
5148  *    to the basic window handler.
5149  *
5150  *  Mac OS X threading:
5151  *    Not thread safe
5152  *
5153  *  Parameters:
5154  *
5155  *    --> kEventParamDisplayDevice (in, typeCGDisplayID)
5156  *          The display device whose available positioning bounds have
5157  *          changed. On Mac OS X 10.3 and later, this parameter is
5158  *          available as a GDHandle using typeGDHandle; on Mac OS X
5159  *          10.5 and later, this parameter is also available as a
5160  *          CGDirectDisplayID using typeCGDisplayID.
5161  *
5162  *    --> kEventParamReason (in, typeUInt32)
5163  *          The reasons why the available positioning bounds have
5164  *          changed. This parameter contains one or more of the
5165  *          kAvailBoundsChangedFor constants.
5166  *
5167  *    --> kEventParamTransactionID (in, typeUInt32)
5168  *          An integer which is the same for all instances of this
5169  *          event that are produced by the same configuration change.
5170  *          For example, if multiple displays are attached, then this
5171  *          event is sent once for each display after a display
5172  *          configuration change; however, the transaction ID parameter
5173  *          will the same for each event, so a handler for this event
5174  *          can choose to ignore all but the first event by correlating
5175  *          the the transaction IDs.
5176  *
5177  *    --> kEventParamPreviousDockRect (in, typeHIRect)
5178  *          The Dock�s previous bounds, in global coordinates. This
5179  *          parameter is optional and may not be present in all
5180  *          instances of this event. It is present in events with a
5181  *          kEventParamReason parameter containing
5182  *          kAvailBoundsChangedForDock.
5183  *
5184  *    --> kEventParamPreviousDockDevice (in, typeCGDisplayID)
5185  *          The display device on which the Dock was previously
5186  *          positioned. This parameter is optional and may not be
5187  *          present in all instances of this event. It is present in
5188  *          events with a kEventParamReason parameter containing
5189  *          kAvailBoundsChangedForDock. On Mac OS X 10.3 and later,
5190  *          this parameter is available as a GDHandle using
5191  *          typeGDHandle; on Mac OS X 10.5 and later, this parameter is
5192  *          also available as a CGDirectDisplayID using typeCGDisplayID.
5193  *
5194  *    --> kEventParamCurrentDockRect (in, typeHIRect)
5195  *          The Dock�s current bounds, in global coordinates. This
5196  *          parameter is optional and may not be present in all
5197  *          instances of this event. It is present in events with a
5198  *          kEventParamReason parameter containing
5199  *          kAvailBoundsChangedForDock.
5200  *
5201  *    --> kEventParamCurrentDockDevice (in, typeCGDisplayID)
5202  *          The display device on which the Dock is currently
5203  *          positioned. This parameter is optional and may not be
5204  *          present in all instances of this event. It is present in
5205  *          events with a kEventParamReason parameter containing
5206  *          kAvailBoundsChangedForDock. On Mac OS X 10.3 and later,
5207  *          this parameter is available as a GDHandle using
5208  *          typeGDHandle; on Mac OS X 10.5 and later, this parameter is
5209  *          also available as a CGDirectDisplayID using typeCGDisplayID.
5210  *
5211  *    --> kEventParamRgnHandle (in, typeQDRgnHandle)
5212  *          The GrayRgn before the configuration change. This parameter
5213  *          is optional and may not be present in all instances of this
5214  *          event. It is present in events with a kEventParamReason
5215  *          parameter containing kAvailBoundsChangedForDisplay. To get
5216  *          the GrayRgn after the configuration change, just call the
5217  *          GetGrayRgn API.
5218  *
5219  *  Availability:
5220  *    Mac OS X:         in version 10.3 and later in Carbon.framework
5221  *    CarbonLib:        not available
5222  }
5223 const
5224 	kEventAppAvailableWindowBoundsChanged = 110;
5225 
5226 {
5227  *  kEventClassApplication / kEventAppActiveWindowChanged
5228  *
5229  *  Summary:
5230  *    Notification that the active window in the current process has
5231  *    changed.
5232  *
5233  *  Discussion:
5234  *    The Window Manager internally tracks the active window, which is
5235  *    the window that is returned by ActiveNonFloatingWindow. When
5236  *    SelectWindow is called on a window, that window is made the new
5237  *    active window. At that time, the Window Manager also posts a
5238  *    kEventAppActiveWindowChanged event to the main event
5239  *    queue.
5240  *
5241  *    The ActivateWindow API also causes this event to be
5242  *    posted.
5243  *
5244  *    If more than one window is activated sequentially before the
5245  *    event loop is run, only a single kEventAppActiveWindowChanged
5246  *    event will be left in the event queue, its PreviousActiveWindow
5247  *    parameter will be the window that was originally active, and its
5248  *    CurrentActiveWindow parameter will be the window that was finally
5249  *    active.
5250  *
5251  *    This event only reports changes to the current process. It does
5252  *    not report activation changes in other processes.
5253  *    <BR> This event is sent to all handlers registered for it.
5254  *
5255  *  Mac OS X threading:
5256  *    Not thread safe
5257  *
5258  *  Parameters:
5259  *
5260  *    --> kEventParamPreviousWindow (in, typeWindowRef)
5261  *          The window that was previously active.
5262  *
5263  *    --> kEventParamCurrentWindow (in, typeWindowRef)
5264  *          The window that is now active.
5265  *
5266  *  Availability:
5267  *    Mac OS X:         in version 10.3 and later in Carbon.framework
5268  *    CarbonLib:        not available
5269  }
5270 const
5271 	kEventAppActiveWindowChanged = 111;
5272 
5273 {
5274  *  kEventClassApplication / kEventAppGetDockTileMenu
5275  *
5276  *  Summary:
5277  *    A request for a menu to be displayed by the application�s dock
5278  *    tile.
5279  *
5280  *  Discussion:
5281  *    This event has a default handler on the application target. The
5282  *    default handler will return the menu, if any, that was provided
5283  *    by the SetApplicationDockTileMenu API. The sender of this event
5284  *    will release the menu after the Dock has displayed it, so if you
5285  *    return a permanently allocated MenuRef, you should call
5286  *    RetainMenu on it before returning from your event handler. For
5287  *    most applications, it will be easier to use the
5288  *    SetApplicationDockTileMenu API directly rather than installing a
5289  *    handler for this event.
5290  *
5291  *  Mac OS X threading:
5292  *    Not thread safe
5293  *
5294  *  Parameters:
5295  *
5296  *    <-- kEventParamMenuRef (out, typeMenuRef)
5297  *          A MenuRef to be displayed in the Dock is returned by the
5298  *          handler in this parameter.
5299  *
5300  *  Availability:
5301  *    Mac OS X:         in version 10.1 and later in Carbon.framework
5302  *    CarbonLib:        not available
5303  }
5304 const
5305 	kEventAppGetDockTileMenu = 20;
5306 
5307 {
5308  *  kEventClassApplication / kEventAppUpdateDockTile
5309  *
5310  *  Summary:
5311  *    Indicates that your application should redraw its custom
5312  *    application Dock tile, if appropriate.
5313  *
5314  *  Discussion:
5315  *    This event is sent when your application has customized either
5316  *    its application Dock tile or a collapsed window Dock tile. If
5317  *    your app customizes its application Dock tile appearance using
5318  *    SetApplicationDockTileImage, OverlayApplicationDockTileImage,
5319  *    BeginCGContextForApplicationDockTile,
5320  *    BeginQDContextForApplicationDockTile, or
5321  *    HIApplicationCreateDockTileContext, then your application should
5322  *    redraw its Dock tile in response to this event. This event is not
5323  *    sent if your application has not customized any of its Dock
5324  *    tiles.
5325  *
5326  *    This event is currently sent in two cases: when the Dock tile
5327  *    changes size (typically in response to a change in the user
5328  *    interface scale factor), or when the Dock process is restarted.
5329  *    In either case, any customization that your application has
5330  *    previously performed is lost.
5331  *
5332  *    If your application only customizes its collapsed window Dock
5333  *    tiles, but not its application Dock tile, then you can ignore
5334  *    this event.
5335  *
5336  *    This event is sent to all handlers registered for it on the
5337  *    application event target. The default application event handler
5338  *    for this event sends kEventWindowUpdateDockTile events to any
5339  *    collapsed windows that have customized their Dock tiles.
5340  *
5341  *  Mac OS X threading:
5342  *    Not thread safe
5343  *
5344  *  Availability:
5345  *    Mac OS X:         in version 10.5 and later in Carbon.framework
5346  *    CarbonLib:        not available
5347  }
5348 const
5349 	kEventAppUpdateDockTile = 21;
5350 
5351 {
5352  *  kEventClassApplication / kEventAppFocusMenuBar
5353  *
5354  *  Summary:
5355  *    The user has requested keyboard focus on the menubar.
5356  *
5357  *  Discussion:
5358  *    This event is handled automatically by the default application
5359  *    event handler. A handler for this event should switch the
5360  *    keyboard focus to the menubar. Applications may install handlers
5361  *    for this event to track keyboard focus, but should not prevent
5362  *    the event from being handled by the default application handler.
5363  *
5364  *  Mac OS X threading:
5365  *    Not thread safe
5366  *
5367  *  Parameters:
5368  *
5369  *    --> kEventParamKeyModifiers (in, typeUInt32)
5370  *          The keyboard modifiers that were pressed when the user
5371  *          requested a focus switch.
5372  *
5373  *  Availability:
5374  *    Mac OS X:         in version 10.2 and later in Carbon.framework
5375  *    CarbonLib:        not available
5376  }
5377 const
5378 	kEventAppFocusMenuBar = 8;
5379 
5380 {
5381  *  kEventClassApplication / kEventAppFocusNextDocumentWindow
5382  *
5383  *  Summary:
5384  *    The user has requested keyboard focus on a document window.
5385  *
5386  *  Discussion:
5387  *    This event is handled automatically by the default application
5388  *    event handler. A handler for this event should cycle to the next
5389  *    (or previous, if the shift key is down) document window, or if
5390  *    there are no more windows to activate in the application�s window
5391  *    list, to the next or previous document window in the next or
5392  *    previous process. User focus (see SetUserFocusWindow) should be
5393  *    applied to the new front document window. If something other than
5394  *    a document window has the focus at the time you receive this
5395  *    event, the frontmost document window should be given the user
5396  *    focus instead, and no z-order change should be made.
5397  *    Additionally, the keyboard focus should be moved to the main
5398  *    control in the newly focused window if no keyboard focus exists
5399  *    within the window.
5400  *
5401  *    A handler for this event should never override it entirely; if
5402  *    necessary, it should only check if the user focus is somewhere
5403  *    other than a document window, and if so, set the focus on the
5404  *    active document window. If the focus is already on a document
5405  *    window, a handler for this event should always return
5406  *    eventNotHandledErr so that the default handler can rotate to the
5407  *    next window across all processes.
5408  *
5409  *  Mac OS X threading:
5410  *    Not thread safe
5411  *
5412  *  Parameters:
5413  *
5414  *    --> kEventParamKeyModifiers (in, typeUInt32)
5415  *          The keyboard modifiers that were pressed when the user
5416  *          requested a focus switch.
5417  *
5418  *  Availability:
5419  *    Mac OS X:         in version 10.2 and later in Carbon.framework
5420  *    CarbonLib:        not available
5421  }
5422 const
5423 	kEventAppFocusNextDocumentWindow = 9;
5424 
5425 {
5426  *  kEventClassApplication / kEventAppFocusNextFloatingWindow
5427  *
5428  *  Summary:
5429  *    The user has requested keyboard focus on a floating window.
5430  *
5431  *  Discussion:
5432  *    This event is handled automatically by the default application
5433  *    event handler. A handler for this event should cycle to the next
5434  *    (or previous, if the shift key is down) floating window in the
5435  *    application. User focus (see SetUserFocusWindow) should be
5436  *    applied to the new front floating window. If something other than
5437  *    a floating window has the focus at the time you receive this
5438  *    event, the frontmost floating window should be given the user
5439  *    focus instead, and no z-order change should be made.
5440  *    Additionally, the keyboard focus should be moved to the main
5441  *    control in the newly focused window if no keyboard focus exists
5442  *    within the window. The default handler sends a
5443  *    kEventCommandProcess event containing
5444  *    kHICommandRotateFloatingWindowsForward/Backward when it detects
5445  *    that floating windows should be cycled.
5446  *
5447  *  Mac OS X threading:
5448  *    Not thread safe
5449  *
5450  *  Parameters:
5451  *
5452  *    --> kEventParamKeyModifiers (in, typeUInt32)
5453  *          The keyboard modifiers that were pressed when the user
5454  *          requested a focus switch.
5455  *
5456  *  Availability:
5457  *    Mac OS X:         in version 10.2 and later in Carbon.framework
5458  *    CarbonLib:        not available
5459  }
5460 const
5461 	kEventAppFocusNextFloatingWindow = 10;
5462 
5463 {
5464  *  kEventClassApplication / kEventAppFocusToolbar
5465  *
5466  *  Summary:
5467  *    The user has requested keyboard focus on the toolbar in the
5468  *    focused window.
5469  *
5470  *  Discussion:
5471  *    For windows that use the standard HIToolbar control, this event
5472  *    is handled automatically by the default application event
5473  *    handler. A handler for this event should put focus on the first
5474  *    control in the toolbar in the focused window, if a toolbar is
5475  *    present.
5476  *
5477  *  Mac OS X threading:
5478  *    Not thread safe
5479  *
5480  *  Parameters:
5481  *
5482  *    --> kEventParamKeyModifiers (in, typeUInt32)
5483  *          The keyboard modifiers that were pressed when the user
5484  *          requested a focus switch.
5485  *
5486  *  Availability:
5487  *    Mac OS X:         in version 10.2 and later in Carbon.framework
5488  *    CarbonLib:        not available
5489  }
5490 const
5491 	kEventAppFocusToolbar = 11;
5492 
5493 {
5494  *  kEventClassApplication / kEventAppFocusDrawer
5495  *
5496  *  Summary:
5497  *    The user has requested keyboard focus on the drawer in the
5498  *    focused window.
5499  *
5500  *  Discussion:
5501  *    This event is handled automatically by the default application
5502  *    event handler. A handler for this event should put focus on the
5503  *    first control in the drawer in the focused window, if a drawer is
5504  *    present. If multiple drawers are present, focus is moved in
5505  *    clockwise order from one drawer to the next, starting with the
5506  *    top drawer, if any. If the modifiers parameter contains the shift
5507  *    key, then focus should be moved in reverse (counterclockwise)
5508  *    order.
5509  *
5510  *  Mac OS X threading:
5511  *    Not thread safe
5512  *
5513  *  Parameters:
5514  *
5515  *    --> kEventParamKeyModifiers (in, typeUInt32)
5516  *          The keyboard modifiers that were pressed when the user
5517  *          requested a focus switch.
5518  *
5519  *  Availability:
5520  *    Mac OS X:         in version 10.4 and later in Carbon.framework
5521  *    CarbonLib:        not available
5522  }
5523 const
5524 	kEventAppFocusDrawer = 12;
5525 
5526 {
5527  *  kEventClassApplication / kEventAppIsEventInInstantMouser
5528  *
5529  *  Summary:
5530  *    Sent when the system needs to determine if the given event's
5531  *    global mouse location is over an "instant mousing" area. An
5532  *    instant mousing area is an area where a mouse down should not
5533  *    generate ink, but should only be interpreted as a click.
5534  *
5535  *  Mac OS X threading:
5536  *    Not thread safe
5537  *
5538  *  Parameters:
5539  *
5540  *    --> kEventParamEventRef (in, typeEventRef)
5541  *          The Event to check.
5542  *
5543  *    <-- kEventParamIsInInstantMouser (out, typeBoolean)
5544  *          True if event was in an "instant mousing" area, false
5545  *          otherwise.
5546  *
5547  *  Availability:
5548  *    Mac OS X:         in version 10.2 and later in Carbon.framework
5549  *    CarbonLib:        not available
5550  }
5551 const
5552 	kEventAppIsEventInInstantMouser = 104;
5553 
5554 
5555 {--------------------------------------------------------------------------------------}
5556 {  Apple Events                                                                        }
5557 {--------------------------------------------------------------------------------------}
5558 {
5559     kEventClassAppleEvent quick reference:
5560 
5561     kEventAppleEvent            = 1
5562 }
5563 {
5564  *  kEventClassAppleEvent / kEventAppleEvent
5565  *
5566  *  Summary:
5567  *    Sent when a high-level event is received.
5568  *
5569  *  Discussion:
5570  *    The RunApplicationEventLoop API installs a default handler on the
5571  *    application target for this event while the event loop is
5572  *    running. The handler is removed before RunApplicationEventLoop
5573  *    returns.
5574  *
5575  *    The handler installed by RunApplicationEventLoop will call
5576  *    AEProcessAppleEvent.
5577  *
5578  *    It is not possible to get the AppleEvent itself from this Carbon
5579  *    event; only its event class and kind are available. To inspect
5580  *    the AppleEvent parameters, the event must actually be dispatched
5581  *    using AEProcessAppleEvent.
5582  *
5583  *    If you need to handle this Carbon event yourself, on Mac OS X
5584  *    10.5 and later you may simply call the AEProcessEvent API. On Mac
5585  *    OS X 10.4 and earlier, the necessary steps are: (1) remove the
5586  *    Carbon event from the queue. The AppleEvent requires some special
5587  *    preparation before it can be processed, and this preparation only
5588  *    occurs when the event is dequeued. You may choose to ignore the
5589  *    return value from RemoveEventFromQueue, since in some cases the
5590  *    event will have already been removed from the queue. In those
5591  *    cases, calling RemoveEventFromQueue is unnecessary, and will
5592  *    return an error, but is also harmless. (2) Use
5593  *    ConvertEventRefToEventRecord to get an EventRecord from the
5594  *    Carbon event. (3) Call AEProcessAppleEvent on the EventRecord.
5595  *
5596  *  Mac OS X threading:
5597  *    Not thread safe
5598  *
5599  *  Parameters:
5600  *
5601  *    --> kEventParamAEEventClass (in, typeType)
5602  *          The event class of the Apple event.
5603  *
5604  *    --> kEventParamAEEventID (in, typeType)
5605  *          The event ID of the Apple event.
5606  *
5607  *  Availability:
5608  *    Mac OS X:         in version 10.0 and later in Carbon.framework
5609  *    CarbonLib:        in CarbonLib 1.1 and later
5610  }
5611 const
5612 	kEventAppleEvent = 1;
5613 
5614 {--------------------------------------------------------------------------------------}
5615 {  Window Events                                                                       }
5616 {--------------------------------------------------------------------------------------}
5617 {
5618     kEventClassWindow quick reference:
5619 
5620     -- window refresh events --
5621 
5622     kEventWindowUpdate                  = 1,
5623     kEventWindowDrawContent             = 2,
5624 
5625     -- window activation events --
5626 
5627     kEventWindowActivated               = 5,
5628     kEventWindowDeactivated             = 6,
5629     kEventWindowHandleActivate          = 91,
5630     kEventWindowHandleDeactivate        = 92,
5631     kEventWindowGetClickActivation      = 7,
5632     kEventWindowGetClickModality        = 8,
5633 
5634     -- window state change events --
5635 
5636     kEventWindowShowing                 = 22,
5637     kEventWindowHiding                  = 23,
5638     kEventWindowShown                   = 24,
5639     kEventWindowHidden                  = 25,
5640     kEventWindowCollapsing              = 86,
5641     kEventWindowCollapsed               = 67,
5642     kEventWindowExpanding               = 87,
5643     kEventWindowExpanded                = 70,
5644     kEventWindowZoomed                  = 76,
5645     kEventWindowBoundsChanging          = 26,
5646     kEventWindowBoundsChanged           = 27,
5647     kEventWindowResizeStarted           = 28,
5648     kEventWindowResizeCompleted         = 29,
5649     kEventWindowDragStarted             = 30,
5650     kEventWindowDragCompleted           = 31,
5651     kEventWindowClosed                  = 73,
5652     kEventWindowTransitionStarted       = 88,
5653     kEventWindowTransitionCompleted     = 89,
5654 
5655     -- window click events --
5656 
5657     kEventWindowClickDragRgn            = 32,
5658     kEventWindowClickResizeRgn          = 33,
5659     kEventWindowClickCollapseRgn        = 34,
5660     kEventWindowClickCloseRgn           = 35,
5661     kEventWindowClickZoomRgn            = 36,
5662     kEventWindowClickContentRgn         = 37,
5663     kEventWindowClickProxyIconRgn       = 38,
5664     kEventWindowClickToolbarButtonRgn   = 41,
5665     kEventWindowClickStructureRgn       = 42,
5666 
5667     -- window cursor change events --
5668 
5669     kEventWindowCursorChange            = 40,
5670 
5671     -- window action events --
5672 
5673     kEventWindowCollapse                = 66,
5674     (kEventWindowCollapsed              = 67)
5675     kEventWindowCollapseAll             = 68,
5676     kEventWindowExpand                  = 69,
5677     (kEventWindowExpanded               = 70)
5678     kEventWindowExpandAll               = 71,
5679     kEventWindowClose                   = 72,
5680     (kEventWindowClosed                 = 73)
5681     kEventWindowCloseAll                = 74,
5682     kEventWindowZoom                    = 75,
5683     (kEventWindowZoomed                 = 76)
5684     kEventWindowZoomAll                 = 77,
5685     kEventWindowContextualMenuSelect    = 78,
5686     kEventWindowPathSelect              = 79,
5687     kEventWindowGetIdealSize            = 80,
5688     kEventWindowGetMinimumSize          = 81,
5689     kEventWindowGetMaximumSize          = 82,
5690     kEventWindowConstrain               = 83,
5691     kEventWindowRestoreFromDock         = 84,
5692     kEventWindowHandleContentClick      = 85,
5693     (kEventWindowCollapsing             = 86)
5694     (kEventWindowExpanding              = 87)
5695     (kEventWindowTransitionStarted      = 88)
5696     (kEventWindowTransitionCompleted    = 89)
5697     kEventWindowGetDockTileMenu         = 90,
5698     (kEventWindowHandleActivate         = 91)
5699     (kEventWindowHandleDeactivate       = 92)
5700     kEventWindowGetIdealStandardState   = 93,
5701     kEventWindowUpdateDockTile          = 94,
5702     kEventWindowColorSpaceChanged       = 95,
5703     kEventWindowRestoredAfterRelaunch   = 96,
5704     kEventWindowProxyBeginDrag          = 128,
5705     kEventWindowProxyEndDrag            = 129,
5706     kEventWindowToolbarSwitchMode       = 150,
5707 
5708     -- window focus events --
5709 
5710     kEventWindowFocusAcquired           = 200,
5711     kEventWindowFocusRelinquish         = 201,
5712     kEventWindowFocusContent            = 202,
5713     kEventWindowFocusToolbar            = 203,
5714     kEventWindowFocusDrawer             = 204,
5715     kEventWindowFocusLost               = 205,
5716     kEventWindowFocusRestored           = 206,
5717 
5718     -- sheet events --
5719 
5720     kEventWindowSheetOpening,           = 210,
5721     kEventWindowSheetOpened             = 211,
5722     kEventWindowSheetClosing            = 212,
5723     kEventWindowSheetClosed             = 213,
5724 
5725     -- drawer events --
5726 
5727     kEventWindowDrawerOpening           = 220,
5728     kEventWindowDrawerOpened            = 221,
5729     kEventWindowDrawerClosing           = 222,
5730     kEventWindowDrawerClosed            = 223,
5731 
5732     -- full screen events --
5733 
5734     kEventWindowGetFullScreenContentSize    = 240,
5735     kEventWindowFullScreenEnterStarted      = 241,
5736     kEventWindowFullScreenEnterCompleted    = 242,
5737     kEventWindowFullScreenExitStarted       = 243,
5738     kEventWindowFullScreenExitCompleted     = 244,
5739 
5740     -- window definition events --
5741 
5742     kEventWindowDrawFrame               = 1000,
5743     kEventWindowDrawPart                = 1001,
5744     kEventWindowGetRegion               = 1002,
5745     kEventWindowHitTest                 = 1003,
5746     kEventWindowInit                    = 1004,
5747     kEventWindowDispose                 = 1005,
5748     kEventWindowDragHilite              = 1006,
5749     kEventWindowModified                = 1007,
5750     kEventWindowSetupProxyDragImage     = 1008,
5751     kEventWindowStateChanged            = 1009,
5752     kEventWindowMeasureTitle            = 1010,
5753     kEventWindowDrawGrowBox             = 1011,
5754     kEventWindowGetGrowImageRegion      = 1012,
5755     kEventWindowPaint                   = 1013,
5756     kEventWindowAttributesChanged       = 1019,
5757     kEventWindowTitleChanged            = 1020
5758 
5759     On window handlers:
5760 
5761     All windows have a handler installed called the �basic window handler.� This handler provides certain
5762     basic services for all windows; for example, it handles clicks in the collapse and toolbar buttons,
5763     since these buttons were handled automatically for WaitNextEvent-based applications in the classic
5764     Mac OS toolbox, and so are still be handled automatically in Carbon by the basic window handler. The
5765     basic window handler also implements the HICommands that are sent by the standard window menu to minimize,
5766     maximize, or zoom a window (kHICommandMinimize/Maximize/ZoomWindow), and the window-class events that are
5767     generated by those commands (kEventWindowCollapse/Expand/Zoom).
5768 
5769     When the window is created with, or has added, the kWindowStandardHandlerAttribute, the window also has
5770     installed the �standard window handler.� The standard handler provides much more advanced behavior than
5771     the basic window handler; a window using the standard handler generally requires no other extra handlers
5772     to move, resize, redraw, or track user clicks in controls. Applications will generally add extra handlers
5773     to respond to command events generated by controls in the window.
5774 }
5775 {$ifc not TARGET_CPU_64}
5776 {
5777  *  kEventClassWindow / kEventWindowUpdate
5778  *
5779  *  Summary:
5780  *    The lowest-level window update event.
5781  *
5782  *  Discussion:
5783  *    Posted to the event queue for any window that needs updating
5784  *    regardless of whether the window has the standard handler
5785  *    installed. The standard window handler responds to this event by
5786  *    calling BeginUpdate and SetPort, sending a
5787  *    kEventWindowDrawContent event, and calling EndUpdate. An
5788  *    application handler for this event that does not call through to
5789  *    the standard handler must itself call BeginUpdate and
5790  *    EndUpdate.
5791  *
5792  *    If all handlers for this event return eventNotHandledErr, and the
5793  *    application is calling WaitNextEvent or GetNextEvent, then a
5794  *    kEventWindowUpdate event will be returned as a classic updateEvt.
5795  *
5796  *
5797  *    This event is only sent to non-compositing windows. To draw the
5798  *    contents of a compositing window, use a kEventControlDraw handler
5799  *    on an HIView in the window.
5800  *
5801  *  Mac OS X threading:
5802  *    Not thread safe
5803  *
5804  *  Parameters:
5805  *
5806  *    --> kEventParamDirectObject (in, typeWindowRef)
5807  *          The window that requires updating.
5808  *
5809  *  Availability:
5810  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
5811  *    CarbonLib:        in CarbonLib 1.1 and later
5812  }
5813 const
5814 	kEventWindowUpdate = 1;
5815 
5816 {
5817  *  kEventClassWindow / kEventWindowDrawContent
5818  *
5819  *  Summary:
5820  *    A request to update a window�s content.
5821  *
5822  *  Discussion:
5823  *    This event is sent by the standard window handler when it
5824  *    receives a kEventWindowUpdate event. BeginUpdate, SetPort, and
5825  *    EndUpdate are called by the standard handler inside its
5826  *    kEventWindowUpdate handler; your handler for the
5827  *    kEventWindowDrawContent event only needs to draw into the current
5828  *    port.
5829  *
5830  *    The standard window handler responds to this event by calling
5831  *    UpdateControls.
5832  *
5833  *    Regardless of whether the window uses the standard window event
5834  *    handler, you will also receive this event right before a window
5835  *    is made visible, to allow you to draw the window�s initial
5836  *    contents; you can implement this event to avoid flicker when the
5837  *    window is first shown.
5838  *
5839  *    This event is only sent to non-compositing windows. To draw the
5840  *    contents of a compositing window, use a kEventControlDraw handler
5841  *    on an HIView in the window.
5842  *
5843  *  Mac OS X threading:
5844  *    Not thread safe
5845  *
5846  *  Parameters:
5847  *
5848  *    --> kEventParamDirectObject (in, typeWindowRef)
5849  *          The window that requires updating.
5850  *
5851  *  Availability:
5852  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
5853  *    CarbonLib:        in CarbonLib 1.1 and later
5854  }
5855 const
5856 	kEventWindowDrawContent = 2;
5857 
5858 {$endc} {not TARGET_CPU_64}
5859 
5860 {
5861  *  kEventClassWindow / kEventWindowActivated
5862  *
5863  *  Summary:
5864  *    Notification that a window has been activated.
5865  *
5866  *  Discussion:
5867  *    This event is sent to all handlers registered for it. It is sent
5868  *    to any window that is activated, regardless of whether the window
5869  *    has the standard handler installed. On Mac OS X 10.3 and later,
5870  *    the standard window event handler responds to this event by
5871  *    sending a kEventWindowHandleActivate event to the window; on
5872  *    CarbonLib and earlier releases of Mac OS X, the standard window
5873  *    handler calls ActivateControl on the window�s root
5874  *    control.
5875  *
5876  *    If all handlers for this event return eventNotHandledErr, then
5877  *    the Window Manager posts the event to the event queue, where it
5878  *    will later be returned from WaitNextEvent as a classic
5879  *    activateEvt. If any handler returns an error code other than
5880  *    eventNotHandledErr, then the event will not be posted to the
5881  *    event queue.
5882  *
5883  *  Mac OS X threading:
5884  *    Not thread safe
5885  *
5886  *  Parameters:
5887  *
5888  *    --> kEventParamDirectObject (in, typeWindowRef)
5889  *          The window that is now active.
5890  *
5891  *  Availability:
5892  *    Mac OS X:         in version 10.0 and later in Carbon.framework
5893  *    CarbonLib:        in CarbonLib 1.1 and later
5894  }
5895 const
5896 	kEventWindowActivated = 5;
5897 
5898 {
5899  *  kEventClassWindow / kEventWindowDeactivated
5900  *
5901  *  Summary:
5902  *    Notification that a window has been deactivated.
5903  *
5904  *  Discussion:
5905  *    This event is sent to all handlers registered for it. It is sent
5906  *    to any window that is deactivated, regardless of whether the
5907  *    window has the standard handler installed. On Mac OS X 10.3 and
5908  *    later, the standard window event handler responds to this event
5909  *    by sending a kEventWindowHandleDeactivate event to the window; on
5910  *    CarbonLib and earlier releases of Mac OS X, the standard window
5911  *    handler calls DeactivateControl on the window�s root
5912  *    control.
5913  *
5914  *    If all handlers for this event return eventNotHandledErr, then
5915  *    the Window Manager posts the event to the event queue, where it
5916  *    will later be returned from WaitNextEvent as a classic
5917  *    activateEvt. If any handler returns an error code other than
5918  *    eventNotHandledErr, then the event will not be posted to the
5919  *    event queue.
5920  *
5921  *  Mac OS X threading:
5922  *    Not thread safe
5923  *
5924  *  Parameters:
5925  *
5926  *    --> kEventParamDirectObject (in, typeWindowRef)
5927  *          The window that is now inactive.
5928  *
5929  *  Availability:
5930  *    Mac OS X:         in version 10.0 and later in Carbon.framework
5931  *    CarbonLib:        in CarbonLib 1.1 and later
5932  }
5933 const
5934 	kEventWindowDeactivated = 6;
5935 
5936 {
5937  *  kEventClassWindow / kEventWindowHandleActivate
5938  *
5939  *  Summary:
5940  *    The window has received a kEventWindowActivated event, and its
5941  *    contents should become active.
5942  *
5943  *  Discussion:
5944  *    This event is generated by the standard window handler in
5945  *    response to a kEventWindowActivated event. An application may
5946  *    handle this event by activating its content appropriately. The
5947  *    standard window handler responds to this event by calling
5948  *    ActivateControl on the window's root control.
5949  *
5950  *  Mac OS X threading:
5951  *    Not thread safe
5952  *
5953  *  Parameters:
5954  *
5955  *    --> kEventParamDirectObject (in, typeWindowRef)
5956  *          The window that was activated.
5957  *
5958  *  Availability:
5959  *    Mac OS X:         in version 10.3 and later in Carbon.framework
5960  *    CarbonLib:        not available
5961  }
5962 const
5963 	kEventWindowHandleActivate = 91;
5964 
5965 {
5966  *  kEventClassWindow / kEventWindowHandleDeactivate
5967  *
5968  *  Summary:
5969  *    The window has received a kEventWindowDeactivated event, and its
5970  *    contents should become inactive.
5971  *
5972  *  Discussion:
5973  *    This event is generated by the standard window handler in
5974  *    response to a kEventWindowDeactivated event. An application may
5975  *    handle this event by deactivating its content appropriately. The
5976  *    standard window handler responds to this event by calling
5977  *    DeactivateControl on the window's root control.
5978  *
5979  *  Mac OS X threading:
5980  *    Not thread safe
5981  *
5982  *  Parameters:
5983  *
5984  *    --> kEventParamDirectObject (in, typeWindowRef)
5985  *          The window that was deactivated.
5986  *
5987  *  Availability:
5988  *    Mac OS X:         in version 10.3 and later in Carbon.framework
5989  *    CarbonLib:        not available
5990  }
5991 const
5992 	kEventWindowHandleDeactivate = 92;
5993 
5994 {
5995  *  kEventClassWindow / kEventWindowGetClickActivation
5996  *
5997  *  Summary:
5998  *    Sent when a click occurs in a window. Allows the window to
5999  *    determine whether the window should be activated and whether the
6000  *    click should be handled.
6001  *
6002  *  Discussion:
6003  *    This event is sent when a click occurs in a window that is not
6004  *    frontmost in its window group.
6005  *
6006  *    For all windows, it is sent to a clicked window when the window's
6007  *    process is inactive. For windows that use the standard window
6008  *    event handler, this event is also sent to clicked windows when
6009  *    the window's process is active.
6010  *
6011  *    A handler for this event can determine whether the window is
6012  *    activated and whether the click is handled or ignored by setting
6013  *    the kEventParamClickActivation parameter to one of the
6014  *    ClickActivationResult constants in Controls.h.
6015  *
6016  *    The default behavior varies according to the window state and the
6017  *    click location:
6018  *    - if the click falls on the window widgets in the window
6019  *    structure, then the default window event handler usually returns
6020  *    kDoNotActivateAndHandleClick.
6021  *    - otherwise, the standard window event handler returns
6022  *    kActivateAndIgnoreClick.
6023  *    You have the option of overriding the behavior to support
6024  *    click-through or select-and-click.
6025  *
6026  *  Mac OS X threading:
6027  *    Not thread safe
6028  *
6029  *  Parameters:
6030  *
6031  *    --> kEventParamDirectObject (in, typeWindowRef)
6032  *          The window that was clicked.
6033  *
6034  *    --> kEventParamMouseLocation (in, typeQDPoint)
6035  *          The location of the click, in global coordinates.
6036  *
6037  *    --> kEventParamKeyModifiers (in, typeUInt32)
6038  *          The keyboard modifiers that were pressed when the mouse was
6039  *          clicked.
6040  *
6041  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
6042  *          The window part that was clicked. Available in Mac OS X
6043  *          10.3 and later.
6044  *
6045  *    --> kEventParamWindowDefPart (in, typeWindowDefPartCode)
6046  *          The window part that was clicked. This is really a window
6047  *          part code, not a window def part code, despite the
6048  *          parameter name; this parameter is available in all versions
6049  *          of Mac OS X and CarbonLib 1.1 and later, but use
6050  *          kEventParamWindowPartCode when available instead for
6051  *          clarity.
6052  *
6053  *    --> kEventParamControlRef (in, typeControlRef)
6054  *          The control that was clicked. Only present if the click was
6055  *          on a control.
6056  *
6057  *    <-- kEventParamClickActivation (out, typeClickActivationResult)
6058  *          On exit, indicates how the click should be handled. Should
6059  *          be set a ClickActivationResult constant from Controls.h.
6060  *
6061  *  Availability:
6062  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6063  *    CarbonLib:        in CarbonLib 1.1 and later
6064  }
6065 const
6066 	kEventWindowGetClickActivation = 7;
6067 
6068 
6069 {
6070  *  Summary:
6071  *    Responses to the kEventWindowGetClickModality event.
6072  }
6073 const
6074 {
6075    * Indicates whether a modal window prevents the mouse event from
6076    * being passed to the clicked window. If this bit is set, the
6077    * kEventParamModalWindow and kEventParamWindowModality parameters
6078    * should be set before the event handler returns. If this bit is
6079    * clear, normal event handling will occur; the clicked window will
6080    * typically be z-ordered to the top of its window group, activated,
6081    * become the user focus window, and receive the mouse event for
6082    * further processing.
6083    }
6084 	kHIModalClickIsModal = 1 shl 0;
6085 
6086   {
6087    * If kHIModalClickIsModal is set, this flag indicates whether the
6088    * click event should be allowed to pass to the clicked window. If
6089    * kHIModalClickIsModal is not set, this flag is ignored.
6090    }
6091 	kHIModalClickAllowEvent = 1 shl 1;
6092 
6093   {
6094    * If kHIModalClickIsModal is set and kHIModalClickAllowEvent is not
6095    * set, this flag indicates whether the caller should announce that
6096    * the click has been blocked by a modal window using appropriate UI
6097    * (typically, by calling AudioServicesPlayAlertSound). If
6098    * kHIModalClickIsModal is not set, or if kHIModalClickAllowEvent is
6099    * set, this flag is ignored.
6100    }
6101 	kHIModalClickAnnounce = 1 shl 2;
6102 
6103   {
6104    * If both kHIModalClickIsModal and kHIModalClickAllowEvent are set,
6105    * this flag indicates whether the clicked window should be z-ordered
6106    * to the top of its window group. The window will not, however, be
6107    * activated or become the user focus window. If either of
6108    * kHIModalClickIsModal or kHIModalClickAllowEvent is not set, this
6109    * flag is ignored.
6110    }
6111 	kHIModalClickRaiseWindow = 1 shl 3;
6112 
6113 type
6114 	HIModalClickResult = UInt32;
6115 const
6116 	typeModalClickResult = FourCharCode('wmcr'); { HIModalClickResult}
6117 	typeWindowModality = FourCharCode('wmod'); { WindowModality}
6118 	kEventParamModalClickResult = typeModalClickResult; { typeModalClickResult}
6119 	kEventParamModalWindow = FourCharCode('mwin'); { typeWindowRef}
6120 	kEventParamWindowModality = typeWindowModality; { typeWindowModality}
6121 
6122 {
6123  *  kEventClassWindow / kEventWindowGetClickModality
6124  *
6125  *  Summary:
6126  *    Determines whether a mouse-down or mouse-up event is blocked by a
6127  *    modal window.
6128  *
6129  *  Discussion:
6130  *    This event is sent to a window by the event dispatcher target
6131  *    prior to dispatching a mouse-down or mouse-up event to the
6132  *    clicked window. A handler for this event may examine application
6133  *    state to determine whether this click should be allowed.
6134  *
6135  *    This event may also be sent in other circumstances besides a
6136  *    mouse event. The toolbox currently sends this event in the
6137  *    following other cases:
6138  *
6139  *    - in SelectWindow
6140  *    - when handling the cmd-~ key sequence
6141  *    - when restoring a collapsed window from the Dock
6142  *    - when handling the kHICommandSelectWindow command
6143  *    - during application activation, when activating a clicked
6144  *    window
6145  *
6146  *    In each case, the result of this event is used to determine
6147  *    whether z-ordering, activation, and hiliting of the window should
6148  *    be allowed.
6149  *
6150  *    This event contains an optional EventRef parameter that is the
6151  *    original mouse event. This parameter is not always present; if
6152  *    not present, the handler should generally assume that the click
6153  *    was a single click.
6154  *
6155  *    There is a default handler for this event installed on the
6156  *    application target. The default behavior is to determine whether
6157  *    this is a modal click by examining the modality of the visible,
6158  *    uncollapsed windows in front of the clicked window, the location
6159  *    of the click, and the keyboard modifiers. A custom handler may,
6160  *    of course, entirely ignore window z-order or modality, and
6161  *    determine modality in any way it deems necessary.
6162  *
6163  *  Mac OS X threading:
6164  *    Not thread safe
6165  *
6166  *  Parameters:
6167  *
6168  *    --> kEventParamDirectObject (in, typeWindowRef)
6169  *          The window that was clicked.
6170  *
6171  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
6172  *          The window part that was clicked.
6173  *
6174  *    --> kEventParamKeyModifiers (in, typeUInt32)
6175  *          The keyboard modifiers that were pressed when the mouse
6176  *          button was pressed.
6177  *
6178  *    --> kEventParamEventRef (in, typeEventRef)
6179  *          The original mouse event. This parameter is optional and
6180  *          may not be present in all instances of this event. If this
6181  *          parameter is not present, the handler should assume that
6182  *          the click was a single click, with the window part and
6183  *          keyboard modifiers specified by the other parameters in the
6184  *          kEventWindowGetClickModality event.
6185  *
6186  *    <-- kEventParamModalClickResult (out, typeModalClickResult)
6187  *          On exit, this parameter should contain an
6188  *          HIModalClickResult value indicating how the click should be
6189  *          handled.
6190  *
6191  *    <-- kEventParamModalWindow (out, typeWindowRef)
6192  *          On exit, this parameter should contain the modal window
6193  *          that caused the click to be blocked, if any. The sender of
6194  *          this event uses this information to determine which window
6195  *          should be activated if the application is inactive.
6196  *
6197  *
6198  *          This parameter is only required if the
6199  *          kEventParamModalClickResult parameter contains
6200  *          kHIModalClickIsModal. If an event handler wants to report
6201  *          that a click has been blocked by modality, but cannot
6202  *          determine which window blocked the click, it is acceptable
6203  *          to either not add this parameter to the event, or to set
6204  *          the parameter to a NULL WindowRef.
6205  *
6206  *    <-- kEventParamWindowModality (out, typeWindowModality)
6207  *          On exit, this parameter should contain the modality of the
6208  *          modal window that is in front of the clicked window, if
6209  *          any. This parameter is only required if the
6210  *          kEventParamModalClickResult parameter contains
6211  *          kHIModalClickIsModal. The modality values you may add here
6212  *          are from the WindowModality enumeration in MacWindows.h.
6213  *
6214  *  Availability:
6215  *    Mac OS X:         in version 10.4 and later in Carbon.framework
6216  *    CarbonLib:        not available
6217  }
6218 const
6219 	kEventWindowGetClickModality = 8;
6220 
6221 
6222 {
6223  *  Summary:
6224  *    Window bounds change event attributes
6225  *
6226  *  Discussion:
6227  *    When the toolbox sends out a kEventWindowBoundsChanging or
6228  *    kEventWindowBoundsChanged event, it also sends along a parameter
6229  *    containing attributes of the event. These attributes can be used
6230  *    to determine what aspect of the window changed (origin, size, or
6231  *    both), and whether or not some user action is driving the change
6232  *    (drag or resize).
6233  }
6234 const
6235 {
6236    * The bounds is changing because the user is dragging the window
6237    * around.
6238    }
6239 	kWindowBoundsChangeUserDrag = 1 shl 0;
6240 
6241   {
6242    * The bounds is changing because the user is resizing the window.
6243    }
6244 	kWindowBoundsChangeUserResize = 1 shl 1;
6245 
6246   {
6247    * The dimensions (width and height) of the window content area are
6248    * changing.
6249    }
6250 	kWindowBoundsChangeSizeChanged = 1 shl 2;
6251 
6252   {
6253    * The top left corner (origin) of the window content is changing.
6254    }
6255 	kWindowBoundsChangeOriginChanged = 1 shl 3;
6256 
6257   {
6258    * The bounds is changing because ZoomWindow or ZoomWindowIdeal was
6259    * called. Note that this flag does not imply any user interaction;
6260    * if the application calls ZoomWindow itself without user request,
6261    * this flag will still be set. Available in Mac OS X 10.2 and
6262    * CarbonLib 1.6, and later.
6263    }
6264 	kWindowBoundsChangeZoom = 1 shl 4;
6265 
6266 {
6267  *  kEventClassWindow / kEventWindowShowing
6268  *
6269  *  Summary:
6270  *    Notification that a window is being shown.
6271  *
6272  *  Discussion:
6273  *    This event is sent to all handlers registered for it.
6274  *
6275  *  Mac OS X threading:
6276  *    Not thread safe
6277  *
6278  *  Parameters:
6279  *
6280  *    --> kEventParamDirectObject (in, typeWindowRef)
6281  *          The window being shown.
6282  *
6283  *  Availability:
6284  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6285  *    CarbonLib:        in CarbonLib 1.1 and later
6286  }
6287 const
6288 	kEventWindowShowing = 22;
6289 
6290 {
6291  *  kEventClassWindow / kEventWindowHiding
6292  *
6293  *  Summary:
6294  *    Notification that a window is being hidden.
6295  *
6296  *  Discussion:
6297  *    This event is sent to all handlers registered for it.
6298  *
6299  *  Mac OS X threading:
6300  *    Not thread safe
6301  *
6302  *  Parameters:
6303  *
6304  *    --> kEventParamDirectObject (in, typeWindowRef)
6305  *          The window being hidden.
6306  *
6307  *  Availability:
6308  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6309  *    CarbonLib:        in CarbonLib 1.1 and later
6310  }
6311 const
6312 	kEventWindowHiding = 23;
6313 
6314 {
6315  *  kEventClassWindow / kEventWindowShown
6316  *
6317  *  Summary:
6318  *    Notification that a window has been shown.
6319  *
6320  *  Discussion:
6321  *    This event is sent to all handlers registered for it.
6322  *
6323  *  Mac OS X threading:
6324  *    Not thread safe
6325  *
6326  *  Parameters:
6327  *
6328  *    --> kEventParamDirectObject (in, typeWindowRef)
6329  *          The window that was shown.
6330  *
6331  *  Availability:
6332  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6333  *    CarbonLib:        in CarbonLib 1.1 and later
6334  }
6335 const
6336 	kEventWindowShown = 24;
6337 
6338 {
6339  *  kEventClassWindow / kEventWindowHidden
6340  *
6341  *  Summary:
6342  *    Notification that a window has been hidden.
6343  *
6344  *  Discussion:
6345  *    This event is sent to all handlers registered for it. Prior to
6346  *    Mac OS X 10.2 and CarbonLib 1.6, kEventWindowClosed and
6347  *    kEventWindowHidden were sent in that order by the Window Manager
6348  *    to a window being destroyed. This was problematic if you had a
6349  *    Hidden handler which used data that was destroyed by the Closed
6350  *    handler. The Window Manager in Mac OS X 10.2 and CarbonLib 1.6
6351  *    and later now sends these events in the reverse order:
6352  *    kEventWindowHidden first, followed by kEventWindowClosed. The
6353  *    last event sent to a window remains kEventWindowDispose.
6354  *
6355  *  Mac OS X threading:
6356  *    Not thread safe
6357  *
6358  *  Parameters:
6359  *
6360  *    --> kEventParamDirectObject (in, typeWindowRef)
6361  *          The window that was hidden.
6362  *
6363  *  Availability:
6364  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6365  *    CarbonLib:        in CarbonLib 1.1 and later
6366  }
6367 const
6368 	kEventWindowHidden = 25;
6369 
6370 {
6371  *  kEventClassWindow / kEventWindowCollapsing
6372  *
6373  *  Summary:
6374  *    Notification that a window is about to collapse.
6375  *
6376  *  Discussion:
6377  *    This event is sent to all handlers registered for it.
6378  *
6379  *  Mac OS X threading:
6380  *    Not thread safe
6381  *
6382  *  Parameters:
6383  *
6384  *    --> kEventParamDirectObject (in, typeWindowRef)
6385  *          The window being collapsed.
6386  *
6387  *  Availability:
6388  *    Mac OS X:         in version 10.1 and later in Carbon.framework
6389  *    CarbonLib:        in CarbonLib 1.6 and later
6390  }
6391 const
6392 	kEventWindowCollapsing = 86;
6393 
6394 {
6395  *  kEventClassWindow / kEventWindowCollapsed
6396  *
6397  *  Summary:
6398  *    Notification that a window has successfully collapsed.
6399  *
6400  *  Discussion:
6401  *    This event is sent to all handlers registered for it.
6402  *
6403  *  Mac OS X threading:
6404  *    Not thread safe
6405  *
6406  *  Parameters:
6407  *
6408  *    --> kEventParamDirectObject (in, typeWindowRef)
6409  *          The window that was collapsed.
6410  *
6411  *  Availability:
6412  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6413  *    CarbonLib:        in CarbonLib 1.1 and later
6414  }
6415 const
6416 	kEventWindowCollapsed = 67;
6417 
6418 {
6419  *  kEventClassWindow / kEventWindowExpanding
6420  *
6421  *  Summary:
6422  *    Notification that a window is about to expand.
6423  *
6424  *  Discussion:
6425  *    This event is sent to all handlers registered for it.
6426  *
6427  *  Mac OS X threading:
6428  *    Not thread safe
6429  *
6430  *  Parameters:
6431  *
6432  *    --> kEventParamDirectObject (in, typeWindowRef)
6433  *          The window being expanded.
6434  *
6435  *  Availability:
6436  *    Mac OS X:         in version 10.1 and later in Carbon.framework
6437  *    CarbonLib:        in CarbonLib 1.6 and later
6438  }
6439 const
6440 	kEventWindowExpanding = 87;
6441 
6442 {
6443  *  kEventClassWindow / kEventWindowExpanded
6444  *
6445  *  Summary:
6446  *    Notification that a window has successfully expanded.
6447  *
6448  *  Discussion:
6449  *    This event is sent to all handlers registered for it.
6450  *
6451  *  Mac OS X threading:
6452  *    Not thread safe
6453  *
6454  *  Parameters:
6455  *
6456  *    --> kEventParamDirectObject (in, typeWindowRef)
6457  *          The window that was expanded.
6458  *
6459  *  Availability:
6460  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6461  *    CarbonLib:        in CarbonLib 1.1 and later
6462  }
6463 const
6464 	kEventWindowExpanded = 70;
6465 
6466 {
6467  *  kEventClassWindow / kEventWindowZoomed
6468  *
6469  *  Summary:
6470  *    Notification that a window has been successfully zoomed.
6471  *
6472  *  Discussion:
6473  *    This event is sent to all handlers registered for it. In
6474  *    CarbonLib 1.1 through CarbonLib 1.4, and Mac OS X 10.0 and 10.1,
6475  *    this event is only sent by the standard window event handler
6476  *    after handling kEventWindowZoom; starting with CarbonLib 1.5 and
6477  *    Mac OS X 10.2, this event is sent by ZoomWindow and
6478  *    ZoomWindowIdeal.
6479  *
6480  *  Mac OS X threading:
6481  *    Not thread safe
6482  *
6483  *  Parameters:
6484  *
6485  *    --> kEventParamDirectObject (in, typeWindowRef)
6486  *          The window that was zoomed.
6487  *
6488  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
6489  *          The part code (inZoomIn or inZoomOut) that was passed to
6490  *          ZoomWindow or ZoomWindowIdeal. This parameter is available
6491  *          in Mac OS X 10.4 and later.
6492  *
6493  *  Availability:
6494  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6495  *    CarbonLib:        in CarbonLib 1.1 and later
6496  }
6497 const
6498 	kEventWindowZoomed = 76;
6499 
6500 {
6501  *  kEventClassWindow / kEventWindowBoundsChanging
6502  *
6503  *  Summary:
6504  *    Notification that a window�s bounds are about to be changed.
6505  *
6506  *  Discussion:
6507  *    Sent during DragWindow or ResizeWindow, before the window is
6508  *    actually moved or resized, and also during programmatic
6509  *    bounds-changing APIs such as SetWindowBounds and ZoomWindow. An
6510  *    event handler may alter the kEventParamCurrentBounds parameter in
6511  *    the event to change the eventual location of the window. You may
6512  *    change the size, origin, or both of the window�s bounds. Do not,
6513  *    however, call SizeWindow or SetWindowBounds yourself from inside
6514  *    a handler for this event.
6515  *
6516  *    In Mac OS X 10.1 and later, kEventWindowBoundsChanging is sent
6517  *    before all changes to a window�s bounds, regardless of whether
6518  *    the change is initiated by the user or by a direct call to a
6519  *    Window Manager API. Applications may intercept the event and
6520  *    modify the bounds. When the event is sent because of a direct
6521  *    call to the Window Manager, the
6522  *    kWindowBoundsChangeUserDrag/Resize attribute bits will not be set.
6523  *
6524  *  Mac OS X threading:
6525  *    Not thread safe
6526  *
6527  *  Parameters:
6528  *
6529  *    --> kEventParamDirectObject (in, typeWindowRef)
6530  *          The window being shown.
6531  *
6532  *    --> kEventParamAttributes (in, typeUInt32)
6533  *          The bounds-changing attributes indicating whether the
6534  *          window is being resized, moved, or both.
6535  *
6536  *    --> kEventParamOriginalBounds (in, typeQDRectangle)
6537  *          The window�s original content bounds before the window
6538  *          resize or drag began.
6539  *
6540  *    --> kEventParamPreviousBounds (in, typeQDRectangle)
6541  *          The window�s content bounds before the current bounds
6542  *          change.
6543  *
6544  *    <-> kEventParamCurrentBounds (in/out, typeQDRectangle)
6545  *          On entry, the window�s proposed new content bounds; on
6546  *          exit, the content bounds that are desired by the event
6547  *          handler.
6548  *
6549  *  Result:
6550  *    Return noErr to indicate that the Window Manager should use the
6551  *    kEventParamCurrentBounds parameter as the window�s new content
6552  *    bounds.
6553  *
6554  *  Availability:
6555  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6556  *    CarbonLib:        in CarbonLib 1.1 and later
6557  }
6558 const
6559 	kEventWindowBoundsChanging = 26;
6560 
6561 {
6562  *  kEventClassWindow / kEventWindowBoundsChanged
6563  *
6564  *  Summary:
6565  *    Notification that a window�s bounds have been changed.
6566  *
6567  *  Discussion:
6568  *    This event is sent to all handlers registered for it. Do not call
6569  *    SizeWindow or SetWindowBounds from inside a handler for this
6570  *    event; if you need to enforce a certain window bounds, install a
6571  *    kEventWindowBoundsChanging handler instead.
6572  *
6573  *  Mac OS X threading:
6574  *    Not thread safe
6575  *
6576  *  Parameters:
6577  *
6578  *    --> kEventParamDirectObject (in, typeWindowRef)
6579  *          The window whose bounds were changed.
6580  *
6581  *    --> kEventParamAttributes (in, typeUInt32)
6582  *          The bounds-changing attributes indicating whether the
6583  *          window was resized, moved, or both.
6584  *
6585  *    --> kEventParamOriginalBounds (in, typeQDRectangle)
6586  *          The window�s original content bounds before the window
6587  *          resize or drag began.
6588  *
6589  *    --> kEventParamPreviousBounds (in, typeQDRectangle)
6590  *          The window�s content bounds before the current bounds
6591  *          change.
6592  *
6593  *    --> kEventParamCurrentBounds (in, typeQDRectangle)
6594  *          The window�s new content bounds.
6595  *
6596  *  Availability:
6597  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6598  *    CarbonLib:        in CarbonLib 1.1 and later
6599  }
6600 const
6601 	kEventWindowBoundsChanged = 27;
6602 
6603 {
6604  *  kEventClassWindow / kEventWindowResizeStarted
6605  *
6606  *  Summary:
6607  *    Notification that the user has just started to resize a window.
6608  *
6609  *  Discussion:
6610  *    This event is sent to all handlers registered for it.
6611  *
6612  *  Mac OS X threading:
6613  *    Not thread safe
6614  *
6615  *  Parameters:
6616  *
6617  *    --> kEventParamDirectObject (in, typeWindowRef)
6618  *          The window being resized.
6619  *
6620  *  Availability:
6621  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6622  *    CarbonLib:        in CarbonLib 1.1 and later
6623  }
6624 const
6625 	kEventWindowResizeStarted = 28;
6626 
6627 {
6628  *  kEventClassWindow / kEventWindowResizeCompleted
6629  *
6630  *  Summary:
6631  *    Notification that the user has just finished resizing a window.
6632  *
6633  *  Discussion:
6634  *    This event is sent to all handlers registered for it.
6635  *
6636  *  Mac OS X threading:
6637  *    Not thread safe
6638  *
6639  *  Parameters:
6640  *
6641  *    --> kEventParamDirectObject (in, typeWindowRef)
6642  *          The window that was resized.
6643  *
6644  *  Availability:
6645  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6646  *    CarbonLib:        in CarbonLib 1.1 and later
6647  }
6648 const
6649 	kEventWindowResizeCompleted = 29;
6650 
6651 {
6652  *  kEventClassWindow / kEventWindowDragStarted
6653  *
6654  *  Summary:
6655  *    Notification that the user has just started to drag a window.
6656  *
6657  *  Discussion:
6658  *    This event is sent to all handlers registered for it.
6659  *
6660  *  Mac OS X threading:
6661  *    Not thread safe
6662  *
6663  *  Parameters:
6664  *
6665  *    --> kEventParamDirectObject (in, typeWindowRef)
6666  *          The window being dragged.
6667  *
6668  *  Availability:
6669  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6670  *    CarbonLib:        in CarbonLib 1.1 and later
6671  }
6672 const
6673 	kEventWindowDragStarted = 30;
6674 
6675 {
6676  *  kEventClassWindow / kEventWindowDragCompleted
6677  *
6678  *  Summary:
6679  *    Notification that the user has just finished dragging a window.
6680  *
6681  *  Discussion:
6682  *    This event is sent to all handlers registered for it.
6683  *
6684  *  Mac OS X threading:
6685  *    Not thread safe
6686  *
6687  *  Parameters:
6688  *
6689  *    --> kEventParamDirectObject (in, typeWindowRef)
6690  *          The window that was dragged.
6691  *
6692  *  Availability:
6693  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6694  *    CarbonLib:        in CarbonLib 1.1 and later
6695  }
6696 const
6697 	kEventWindowDragCompleted = 31;
6698 
6699 {
6700  *  kEventClassWindow / kEventWindowClosed
6701  *
6702  *  Summary:
6703  *    Notification that a window is being destroyed.
6704  *
6705  *  Discussion:
6706  *    This event is sent to all handlers registered for it. Prior to
6707  *    Mac OS X 10.2 and CarbonLib 1.6, kEventWindowClosed and
6708  *    kEventWindowHidden were sent in that order by the Window Manager
6709  *    to a window being destroyed. This was problematic if you had a
6710  *    Hidden handler which used data that was destroyed by the Closed
6711  *    handler. The Window Manager in Mac OS X 10.2 and CarbonLib 1.6
6712  *    and later now sends these events in the reverse order:
6713  *    kEventWindowHidden first, followed by kEventWindowClosed. The
6714  *    last event sent to a window remains kEventWindowDispose.
6715  *
6716  *  Mac OS X threading:
6717  *    Not thread safe
6718  *
6719  *  Parameters:
6720  *
6721  *    --> kEventParamDirectObject (in, typeWindowRef)
6722  *          The window being destroyed.
6723  *
6724  *  Availability:
6725  *    Mac OS X:         in version 10.0 and later in Carbon.framework
6726  *    CarbonLib:        in CarbonLib 1.1 and later
6727  }
6728 const
6729 	kEventWindowClosed = 73;
6730 
6731 {
6732  *  kEventClassWindow / kEventWindowTransitionStarted
6733  *
6734  *  Summary:
6735  *    Notification that a window transition has started.
6736  *
6737  *  Discussion:
6738  *    This event is sent to all handlers registered for it. It is sent
6739  *    by the TransitionWindow, TransitionWindowAndParent, and
6740  *    TransitionWindowWithOptions APIs just before the first frame of
6741  *    the transition animation.
6742  *
6743  *  Mac OS X threading:
6744  *    Not thread safe
6745  *
6746  *  Parameters:
6747  *
6748  *    --> kEventParamDirectObject (in, typeWindowRef)
6749  *          The window that will be transitioning.
6750  *
6751  *    --> kEventParamUserData (in, typeVoidPtr)
6752  *          The user data that was specified in the
6753  *          TransitionWindowOptions.userData field. If no user data was
6754  *          specified, this parameter will still be present, but its
6755  *          value will be NULL.
6756  *
6757  *    --> kEventParamWindowTransitionAction (in, typeWindowTransitionAction)
6758  *          The transition action that is starting.
6759  *
6760  *    --> kEventParamWindowTransitionEffect (in, typeWindowTransitionEffect)
6761  *          The transition effect that is starting.
6762  *
6763  *  Availability:
6764  *    Mac OS X:         in version 10.3 and later in Carbon.framework
6765  *    CarbonLib:        not available
6766  }
6767 const
6768 	kEventWindowTransitionStarted = 88;
6769 
6770 {
6771  *  kEventClassWindow / kEventWindowTransitionCompleted
6772  *
6773  *  Summary:
6774  *    Notification that a window transition has completed.
6775  *
6776  *  Discussion:
6777  *    This event is sent to all handlers registered for it. It is sent
6778  *    by the TransitionWindow, TransitionWindowAndParent, and
6779  *    TransitionWindowWithOptions APIs just after the last frame of the
6780  *    transition animation.
6781  *
6782  *  Mac OS X threading:
6783  *    Not thread safe
6784  *
6785  *  Parameters:
6786  *
6787  *    --> kEventParamDirectObject (in, typeWindowRef)
6788  *          The window that was transitioning.
6789  *
6790  *    --> kEventParamUserData (in, typeVoidPtr)
6791  *          The user data that was specified in the
6792  *          TransitionWindowOptions.userData field. If no user data was
6793  *          specified, this parameter will still be present, but its
6794  *          value will be NULL.
6795  *
6796  *    --> kEventParamWindowTransitionAction (in, typeWindowTransitionAction)
6797  *          The transition action that has completed.
6798  *
6799  *    --> kEventParamWindowTransitionEffect (in, typeWindowTransitionEffect)
6800  *          The transition effect that has completed.
6801  *
6802  *  Availability:
6803  *    Mac OS X:         in version 10.3 and later in Carbon.framework
6804  *    CarbonLib:        not available
6805  }
6806 const
6807 	kEventWindowTransitionCompleted = 89;
6808 
6809 {$ifc not TARGET_CPU_64}
6810 {
6811  *  kEventClassWindow / kEventWindowClickDragRgn
6812  *
6813  *  Summary:
6814  *    Sent when the mouse is clicked in the drag region.
6815  *
6816  *  Discussion:
6817  *    The standard window handler responds to this event by checking if
6818  *    the click is a window path-select click; if so, it sends
6819  *    kEventWindowPathSelect to allow customization of the path-select
6820  *    menu, and then calls WindowPathSelect. If the click is not a
6821  *    path-select click, the standard window handler calls DragWindow.
6822  *    Note that this event is not sent for composited windows; the
6823  *    window frame view handles the mouse-down event directly. To
6824  *    intercept a drag region click in a composited window, install a
6825  *    kEventControlClick handler on the window�s root view.
6826  *
6827  *  Mac OS X threading:
6828  *    Not thread safe
6829  *
6830  *  Parameters:
6831  *
6832  *    --> kEventParamDirectObject (in, typeWindowRef)
6833  *          The window that was clicked.
6834  *
6835  *    --> kEventParamMouseLocation (in, typeHIPoint)
6836  *          The mouse location, in global coordinates.
6837  *
6838  *    --> kEventParamWindowRef (in, typeWindowRef)
6839  *          The window under the mouse. Available in Mac OS X 10.1 and
6840  *          later.
6841  *
6842  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
6843  *          The window-relative position of the mouse in the window
6844  *          given in the kEventParamWindowRef parameter. 0,0 is at the
6845  *          top left of the structure of the window. Available in Mac
6846  *          OS X 10.1 and later.
6847  *
6848  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
6849  *          The part code that the mouse location hit in the window.
6850  *          This parameter only exists if the WindowRef parameter
6851  *          exists. This saves you the trouble of calling FindWindow,
6852  *          which is expensive on Mac OS X as it needs to call the
6853  *          Window Server. Available in Mac OS X 10.3 and later.
6854  *
6855  *    --> kEventParamKeyModifiers (in, typeUInt32)
6856  *          The keyboard modifiers that were pressed when the event was
6857  *          generated.
6858  *
6859  *    --> kEventParamMouseButton (in, typeMouseButton)
6860  *          Which mouse button was pressed.
6861  *
6862  *    --> kEventParamClickCount (in, typeUInt32)
6863  *          Whether this is a single click, double click, etc.
6864  *
6865  *    --> kEventParamMouseChord (in, typeUInt32)
6866  *          Which other mouse buttons were pressed when the event was
6867  *          generated. Available on Mac OS X only.
6868  *
6869  *    --> kEventParamTabletEventType (in, typeUInt32)
6870  *          The type of tablet event which generated this mouse event;
6871  *          contains either kEventTabletPoint or kEventTabletProximity.
6872  *          Only present if the event was generated from a tablet.
6873  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
6874  *
6875  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
6876  *          Further information about the tablet event which generated
6877  *          this mouse event. Present if the the
6878  *          kEventParamTabletEventType parameter contains
6879  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
6880  *          1.5, and later.
6881  *
6882  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
6883  *          Further information about the tablet event which generated
6884  *          this mouse event. Present if the the
6885  *          kEventParamTabletEventType parameter contains
6886  *          kEventTabletProximity. Available on Mac OS X 10.1 and
6887  *          CarbonLib 1.5, and later.
6888  *
6889  *  Availability:
6890  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
6891  *    CarbonLib:        in CarbonLib 1.1 and later
6892  }
6893 const
6894 	kEventWindowClickDragRgn = 32;
6895 
6896 {
6897  *  kEventClassWindow / kEventWindowClickResizeRgn
6898  *
6899  *  Summary:
6900  *    Sent when the mouse is clicked in the resize area.
6901  *
6902  *  Discussion:
6903  *    The standard window handler responds to this event by calling
6904  *    ResizeWindow. Note that this event is not sent for composited
6905  *    windows; the window resize view handles the mouse-down event
6906  *    directly. To intercept a resize region click in a composited
6907  *    window, install a kEventControlClick handler on the window�s
6908  *    resize view.
6909  *
6910  *  Mac OS X threading:
6911  *    Not thread safe
6912  *
6913  *  Parameters:
6914  *
6915  *    --> kEventParamDirectObject (in, typeWindowRef)
6916  *          The window that was clicked.
6917  *
6918  *    --> kEventParamMouseLocation (in, typeHIPoint)
6919  *          The mouse location, in global coordinates.
6920  *
6921  *    --> kEventParamWindowRef (in, typeWindowRef)
6922  *          The window under the mouse. Available in Mac OS X 10.1 and
6923  *          later.
6924  *
6925  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
6926  *          The window-relative position of the mouse in the window
6927  *          given in the kEventParamWindowRef parameter. 0,0 is at the
6928  *          top left of the structure of the window. Available in Mac
6929  *          OS X 10.1 and later.
6930  *
6931  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
6932  *          The part code that the mouse location hit in the window.
6933  *          This parameter only exists if the WindowRef parameter
6934  *          exists. This saves you the trouble of calling FindWindow,
6935  *          which is expensive on Mac OS X as it needs to call the
6936  *          Window Server. Available in Mac OS X 10.3 and later.
6937  *
6938  *    --> kEventParamKeyModifiers (in, typeUInt32)
6939  *          The keyboard modifiers that were pressed when the event was
6940  *          generated.
6941  *
6942  *    --> kEventParamMouseButton (in, typeMouseButton)
6943  *          Which mouse button was pressed.
6944  *
6945  *    --> kEventParamClickCount (in, typeUInt32)
6946  *          Whether this is a single click, double click, etc.
6947  *
6948  *    --> kEventParamMouseChord (in, typeUInt32)
6949  *          Which other mouse buttons were pressed when the event was
6950  *          generated. Available on Mac OS X only.
6951  *
6952  *    --> kEventParamTabletEventType (in, typeUInt32)
6953  *          The type of tablet event which generated this mouse event;
6954  *          contains either kEventTabletPoint or kEventTabletProximity.
6955  *          Only present if the event was generated from a tablet.
6956  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
6957  *
6958  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
6959  *          Further information about the tablet event which generated
6960  *          this mouse event. Present if the the
6961  *          kEventParamTabletEventType parameter contains
6962  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
6963  *          1.5, and later.
6964  *
6965  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
6966  *          Further information about the tablet event which generated
6967  *          this mouse event. Present if the the
6968  *          kEventParamTabletEventType parameter contains
6969  *          kEventTabletProximity. Available on Mac OS X 10.1 and
6970  *          CarbonLib 1.5, and later.
6971  *
6972  *  Availability:
6973  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
6974  *    CarbonLib:        in CarbonLib 1.1 and later
6975  }
6976 const
6977 	kEventWindowClickResizeRgn = 33;
6978 
6979 {
6980  *  kEventClassWindow / kEventWindowClickCollapseRgn
6981  *
6982  *  Summary:
6983  *    Sent when the mouse is clicked in the collapse button.
6984  *
6985  *  Discussion:
6986  *    For all windows, the basic window handler responds to this event
6987  *    by tracking the click in the collapse button. If the mouse is
6988  *    released while still in the button, the basic window handler
6989  *    generates one of the kEventWindowCollapse,
6990  *    kEventWindowCollapseAll, kEventWindowExpand, or
6991  *    kEventWindowExpandAll events, depending on the window�s original
6992  *    collapse state and whether the option key was pressed. Note that
6993  *    this event is not sent for composited windows; the window
6994  *    collapse button view handles the mouse-down event directly. To
6995  *    intercept a collapse region click in a composited window, install
6996  *    a kEventControlClick handler on the window�s collapse button view.
6997  *
6998  *  Mac OS X threading:
6999  *    Not thread safe
7000  *
7001  *  Parameters:
7002  *
7003  *    --> kEventParamDirectObject (in, typeWindowRef)
7004  *          The window that was clicked.
7005  *
7006  *    --> kEventParamMouseLocation (in, typeHIPoint)
7007  *          The mouse location, in global coordinates.
7008  *
7009  *    --> kEventParamWindowRef (in, typeWindowRef)
7010  *          The window under the mouse. Available in Mac OS X 10.1 and
7011  *          later.
7012  *
7013  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
7014  *          The window-relative position of the mouse in the window
7015  *          given in the kEventParamWindowRef parameter. 0,0 is at the
7016  *          top left of the structure of the window. Available in Mac
7017  *          OS X 10.1 and later.
7018  *
7019  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
7020  *          The part code that the mouse location hit in the window.
7021  *          This parameter only exists if the WindowRef parameter
7022  *          exists. This saves you the trouble of calling FindWindow,
7023  *          which is expensive on Mac OS X as it needs to call the
7024  *          Window Server. Available in Mac OS X 10.3 and later.
7025  *
7026  *    --> kEventParamKeyModifiers (in, typeUInt32)
7027  *          The keyboard modifiers that were pressed when the event was
7028  *          generated.
7029  *
7030  *    --> kEventParamMouseButton (in, typeMouseButton)
7031  *          Which mouse button was pressed.
7032  *
7033  *    --> kEventParamClickCount (in, typeUInt32)
7034  *          Whether this is a single click, double click, etc.
7035  *
7036  *    --> kEventParamMouseChord (in, typeUInt32)
7037  *          Which other mouse buttons were pressed when the event was
7038  *          generated. Available on Mac OS X only.
7039  *
7040  *    --> kEventParamTabletEventType (in, typeUInt32)
7041  *          The type of tablet event which generated this mouse event;
7042  *          contains either kEventTabletPoint or kEventTabletProximity.
7043  *          Only present if the event was generated from a tablet.
7044  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
7045  *
7046  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
7047  *          Further information about the tablet event which generated
7048  *          this mouse event. Present if the the
7049  *          kEventParamTabletEventType parameter contains
7050  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
7051  *          1.5, and later.
7052  *
7053  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
7054  *          Further information about the tablet event which generated
7055  *          this mouse event. Present if the the
7056  *          kEventParamTabletEventType parameter contains
7057  *          kEventTabletProximity. Available on Mac OS X 10.1 and
7058  *          CarbonLib 1.5, and later.
7059  *
7060  *  Availability:
7061  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
7062  *    CarbonLib:        in CarbonLib 1.1 and later
7063  }
7064 const
7065 	kEventWindowClickCollapseRgn = 34;
7066 
7067 {
7068  *  kEventClassWindow / kEventWindowClickCloseRgn
7069  *
7070  *  Summary:
7071  *    Sent when the mouse is clicked in the close button.
7072  *
7073  *  Discussion:
7074  *    The standard window handler responds to this event by tracking
7075  *    the click in the close button. If the mouse is released while
7076  *    still in the button, the standard window handler generates one of
7077  *    the kEventWindowClose or kEventWindowCloseAll events, depending
7078  *    on whether the option key was pressed. Note that this event is
7079  *    not sent for composited windows; the window close button view
7080  *    handles the mouse-down event directly. To intercept a close
7081  *    region click in a composited window, install a kEventControlClick
7082  *    handler on the window�s close button view.
7083  *
7084  *  Mac OS X threading:
7085  *    Not thread safe
7086  *
7087  *  Parameters:
7088  *
7089  *    --> kEventParamDirectObject (in, typeWindowRef)
7090  *          The window that was clicked.
7091  *
7092  *    --> kEventParamMouseLocation (in, typeHIPoint)
7093  *          The mouse location, in global coordinates.
7094  *
7095  *    --> kEventParamWindowRef (in, typeWindowRef)
7096  *          The window under the mouse. Available in Mac OS X 10.1 and
7097  *          later.
7098  *
7099  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
7100  *          The window-relative position of the mouse in the window
7101  *          given in the kEventParamWindowRef parameter. 0,0 is at the
7102  *          top left of the structure of the window. Available in Mac
7103  *          OS X 10.1 and later.
7104  *
7105  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
7106  *          The part code that the mouse location hit in the window.
7107  *          This parameter only exists if the WindowRef parameter
7108  *          exists. This saves you the trouble of calling FindWindow,
7109  *          which is expensive on Mac OS X as it needs to call the
7110  *          Window Server. Available in Mac OS X 10.3 and later.
7111  *
7112  *    --> kEventParamKeyModifiers (in, typeUInt32)
7113  *          The keyboard modifiers that were pressed when the event was
7114  *          generated.
7115  *
7116  *    --> kEventParamMouseButton (in, typeMouseButton)
7117  *          Which mouse button was pressed.
7118  *
7119  *    --> kEventParamClickCount (in, typeUInt32)
7120  *          Whether this is a single click, double click, etc.
7121  *
7122  *    --> kEventParamMouseChord (in, typeUInt32)
7123  *          Which other mouse buttons were pressed when the event was
7124  *          generated. Available on Mac OS X only.
7125  *
7126  *    --> kEventParamTabletEventType (in, typeUInt32)
7127  *          The type of tablet event which generated this mouse event;
7128  *          contains either kEventTabletPoint or kEventTabletProximity.
7129  *          Only present if the event was generated from a tablet.
7130  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
7131  *
7132  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
7133  *          Further information about the tablet event which generated
7134  *          this mouse event. Present if the the
7135  *          kEventParamTabletEventType parameter contains
7136  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
7137  *          1.5, and later.
7138  *
7139  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
7140  *          Further information about the tablet event which generated
7141  *          this mouse event. Present if the the
7142  *          kEventParamTabletEventType parameter contains
7143  *          kEventTabletProximity. Available on Mac OS X 10.1 and
7144  *          CarbonLib 1.5, and later.
7145  *
7146  *  Availability:
7147  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
7148  *    CarbonLib:        in CarbonLib 1.1 and later
7149  }
7150 const
7151 	kEventWindowClickCloseRgn = 35;
7152 
7153 {
7154  *  kEventClassWindow / kEventWindowClickZoomRgn
7155  *
7156  *  Summary:
7157  *    Sent when the mouse is clicked in the zoom button.
7158  *
7159  *  Discussion:
7160  *    The standard window handler responds to this event by tracking
7161  *    the click in the zoom button. If the mouse is released while
7162  *    still in the button, the standard window handler generates one of
7163  *    the kEventWindowZoom or kEventWindowZoomAll events, depending on
7164  *    whether the option key was pressed. Note that this event is not
7165  *    sent for composited windows; the window zoom button view handles
7166  *    the mouse-down event directly. To intercept a zoom region click
7167  *    in a composited window, install a kEventControlClick handler on
7168  *    the window�s zoom region view.
7169  *
7170  *  Mac OS X threading:
7171  *    Not thread safe
7172  *
7173  *  Parameters:
7174  *
7175  *    --> kEventParamDirectObject (in, typeWindowRef)
7176  *          The window that was clicked.
7177  *
7178  *    --> kEventParamMouseLocation (in, typeHIPoint)
7179  *          The mouse location, in global coordinates.
7180  *
7181  *    --> kEventParamWindowRef (in, typeWindowRef)
7182  *          The window under the mouse. Available in Mac OS X 10.1 and
7183  *          later.
7184  *
7185  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
7186  *          The window-relative position of the mouse in the window
7187  *          given in the kEventParamWindowRef parameter. 0,0 is at the
7188  *          top left of the structure of the window. Available in Mac
7189  *          OS X 10.1 and later.
7190  *
7191  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
7192  *          The part code that the mouse location hit in the window.
7193  *          This parameter only exists if the WindowRef parameter
7194  *          exists. This saves you the trouble of calling FindWindow,
7195  *          which is expensive on Mac OS X as it needs to call the
7196  *          Window Server. Available in Mac OS X 10.3 and later.
7197  *
7198  *    --> kEventParamKeyModifiers (in, typeUInt32)
7199  *          The keyboard modifiers that were pressed when the event was
7200  *          generated.
7201  *
7202  *    --> kEventParamMouseButton (in, typeMouseButton)
7203  *          Which mouse button was pressed.
7204  *
7205  *    --> kEventParamClickCount (in, typeUInt32)
7206  *          Whether this is a single click, double click, etc.
7207  *
7208  *    --> kEventParamMouseChord (in, typeUInt32)
7209  *          Which other mouse buttons were pressed when the event was
7210  *          generated. Available on Mac OS X only.
7211  *
7212  *    --> kEventParamTabletEventType (in, typeUInt32)
7213  *          The type of tablet event which generated this mouse event;
7214  *          contains either kEventTabletPoint or kEventTabletProximity.
7215  *          Only present if the event was generated from a tablet.
7216  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
7217  *
7218  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
7219  *          Further information about the tablet event which generated
7220  *          this mouse event. Present if the the
7221  *          kEventParamTabletEventType parameter contains
7222  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
7223  *          1.5, and later.
7224  *
7225  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
7226  *          Further information about the tablet event which generated
7227  *          this mouse event. Present if the the
7228  *          kEventParamTabletEventType parameter contains
7229  *          kEventTabletProximity. Available on Mac OS X 10.1 and
7230  *          CarbonLib 1.5, and later.
7231  *
7232  *  Availability:
7233  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
7234  *    CarbonLib:        in CarbonLib 1.1 and later
7235  }
7236 const
7237 	kEventWindowClickZoomRgn = 36;
7238 
7239 {
7240  *  kEventClassWindow / kEventWindowClickContentRgn
7241  *
7242  *  Summary:
7243  *    Sent when the mouse is clicked in the content region.
7244  *
7245  *  Discussion:
7246  *    The standard window handler responds to this event by checking if
7247  *    the click should display a contextual menu; if so, and if the
7248  *    click was in an enabled control, it calls
7249  *    HandleControlContextualMenuClick. If the click was not in a
7250  *    control, or if the control does not display a contextual menu,
7251  *    the standard window handler sends a
7252  *    kEventWindowContextualMenuSelect event to the window.
7253  *
7254  *    If the click was not a contextual menu click, then the standard
7255  *    window handler uses HIViewGetViewForMouseEvent to determine the
7256  *    HIView containing the click. If a view is found, the standard
7257  *    window handler calls HIViewClick, which will generate a
7258  *    kEventControlClick event.
7259  *
7260  *    If no view is found that contains the click, or if the containing
7261  *    view does not handle the click, then the standard window handler
7262  *    sends a kEventWindowHandleContentClick event.
7263  *
7264  *    Note that this event is not sent for composited windows; all
7265  *    mouse-downs in a composited window are handled by a view, and
7266  *    there is no �content region� in a composited window. To intercept
7267  *    a content region click in a composited window, install a
7268  *    kEventControlClick handler on the window�s content view, or
7269  *    provide your own HIView subclass.
7270  *
7271  *  Mac OS X threading:
7272  *    Not thread safe
7273  *
7274  *  Parameters:
7275  *
7276  *    --> kEventParamDirectObject (in, typeWindowRef)
7277  *          The window that was clicked.
7278  *
7279  *    --> kEventParamMouseLocation (in, typeHIPoint)
7280  *          The mouse location, in global coordinates.
7281  *
7282  *    --> kEventParamWindowRef (in, typeWindowRef)
7283  *          The window under the mouse. Available in Mac OS X 10.1 and
7284  *          later.
7285  *
7286  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
7287  *          The window-relative position of the mouse in the window
7288  *          given in the kEventParamWindowRef parameter. 0,0 is at the
7289  *          top left of the structure of the window. Available in Mac
7290  *          OS X 10.1 and later.
7291  *
7292  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
7293  *          The part code that the mouse location hit in the window.
7294  *          This parameter only exists if the WindowRef parameter
7295  *          exists. This saves you the trouble of calling FindWindow,
7296  *          which is expensive on Mac OS X as it needs to call the
7297  *          Window Server. Available in Mac OS X 10.3 and later.
7298  *
7299  *    --> kEventParamKeyModifiers (in, typeUInt32)
7300  *          The keyboard modifiers that were pressed when the event was
7301  *          generated.
7302  *
7303  *    --> kEventParamMouseButton (in, typeMouseButton)
7304  *          Which mouse button was pressed.
7305  *
7306  *    --> kEventParamClickCount (in, typeUInt32)
7307  *          Whether this is a single click, double click, etc.
7308  *
7309  *    --> kEventParamMouseChord (in, typeUInt32)
7310  *          Which other mouse buttons were pressed when the event was
7311  *          generated. Available on Mac OS X only.
7312  *
7313  *    --> kEventParamTabletEventType (in, typeUInt32)
7314  *          The type of tablet event which generated this mouse event;
7315  *          contains either kEventTabletPoint or kEventTabletProximity.
7316  *          Only present if the event was generated from a tablet.
7317  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
7318  *
7319  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
7320  *          Further information about the tablet event which generated
7321  *          this mouse event. Present if the the
7322  *          kEventParamTabletEventType parameter contains
7323  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
7324  *          1.5, and later.
7325  *
7326  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
7327  *          Further information about the tablet event which generated
7328  *          this mouse event. Present if the the
7329  *          kEventParamTabletEventType parameter contains
7330  *          kEventTabletProximity. Available on Mac OS X 10.1 and
7331  *          CarbonLib 1.5, and later.
7332  *
7333  *  Availability:
7334  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
7335  *    CarbonLib:        in CarbonLib 1.1 and later
7336  }
7337 const
7338 	kEventWindowClickContentRgn = 37;
7339 
7340 {
7341  *  kEventClassWindow / kEventWindowClickProxyIconRgn
7342  *
7343  *  Summary:
7344  *    Sent when the mouse is clicked in the proxy icon.
7345  *
7346  *  Discussion:
7347  *    The standard window handler responds to this event by handling
7348  *    proxy icon dragging. It first sends a kEventWindowProxyBeginDrag
7349  *    event to allow customization of the DragRef, and then calls
7350  *    TrackWindowProxyFromExistingDrag. Finally, the standard window
7351  *    handler sends a kEventWindowProxyEndDrag event. Note that this
7352  *    event is not sent for composited windows; the window title view
7353  *    handles the mouse-down event directly. To intercept a proxy icon
7354  *    region click in a composited window, install a kEventControlClick
7355  *    handler on the window�s title view.
7356  *
7357  *  Mac OS X threading:
7358  *    Not thread safe
7359  *
7360  *  Parameters:
7361  *
7362  *    --> kEventParamDirectObject (in, typeWindowRef)
7363  *          The window that was clicked.
7364  *
7365  *    --> kEventParamMouseLocation (in, typeHIPoint)
7366  *          The mouse location, in global coordinates.
7367  *
7368  *    --> kEventParamWindowRef (in, typeWindowRef)
7369  *          The window under the mouse. Available in Mac OS X 10.1 and
7370  *          later.
7371  *
7372  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
7373  *          The window-relative position of the mouse in the window
7374  *          given in the kEventParamWindowRef parameter. 0,0 is at the
7375  *          top left of the structure of the window. Available in Mac
7376  *          OS X 10.1 and later.
7377  *
7378  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
7379  *          The part code that the mouse location hit in the window.
7380  *          This parameter only exists if the WindowRef parameter
7381  *          exists. This saves you the trouble of calling FindWindow,
7382  *          which is expensive on Mac OS X as it needs to call the
7383  *          Window Server. Available in Mac OS X 10.3 and later.
7384  *
7385  *    --> kEventParamKeyModifiers (in, typeUInt32)
7386  *          The keyboard modifiers that were pressed when the event was
7387  *          generated.
7388  *
7389  *    --> kEventParamMouseButton (in, typeMouseButton)
7390  *          Which mouse button was pressed.
7391  *
7392  *    --> kEventParamClickCount (in, typeUInt32)
7393  *          Whether this is a single click, double click, etc.
7394  *
7395  *    --> kEventParamMouseChord (in, typeUInt32)
7396  *          Which other mouse buttons were pressed when the event was
7397  *          generated. Available on Mac OS X only.
7398  *
7399  *    --> kEventParamTabletEventType (in, typeUInt32)
7400  *          The type of tablet event which generated this mouse event;
7401  *          contains either kEventTabletPoint or kEventTabletProximity.
7402  *          Only present if the event was generated from a tablet.
7403  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
7404  *
7405  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
7406  *          Further information about the tablet event which generated
7407  *          this mouse event. Present if the the
7408  *          kEventParamTabletEventType parameter contains
7409  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
7410  *          1.5, and later.
7411  *
7412  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
7413  *          Further information about the tablet event which generated
7414  *          this mouse event. Present if the the
7415  *          kEventParamTabletEventType parameter contains
7416  *          kEventTabletProximity. Available on Mac OS X 10.1 and
7417  *          CarbonLib 1.5, and later.
7418  *
7419  *  Availability:
7420  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
7421  *    CarbonLib:        in CarbonLib 1.1 and later
7422  }
7423 const
7424 	kEventWindowClickProxyIconRgn = 38;
7425 
7426 {
7427  *  kEventClassWindow / kEventWindowClickToolbarButtonRgn
7428  *
7429  *  Summary:
7430  *    Sent when the mouse is clicked in the toolbar button.
7431  *
7432  *  Discussion:
7433  *    For all windows, the basic window handler responds to this event
7434  *    by tracking the click in the toolbar button. If the mouse is
7435  *    released while still in the button, the basic window handler
7436  *    sends a kEventWindowToolbarSwitchMode event. Note that this event
7437  *    is not sent for composited windows; the window toolbar button
7438  *    view handles the mouse-down event directly. To intercept a
7439  *    toolbar button region click in a composited window, install a
7440  *    kEventControlClick handler on the window�s toolbar button view.
7441  *
7442  *  Mac OS X threading:
7443  *    Not thread safe
7444  *
7445  *  Parameters:
7446  *
7447  *    --> kEventParamDirectObject (in, typeWindowRef)
7448  *          The window that was clicked.
7449  *
7450  *    --> kEventParamMouseLocation (in, typeHIPoint)
7451  *          The mouse location, in global coordinates.
7452  *
7453  *    --> kEventParamWindowRef (in, typeWindowRef)
7454  *          The window under the mouse. Available in Mac OS X 10.1 and
7455  *          later.
7456  *
7457  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
7458  *          The window-relative position of the mouse in the window
7459  *          given in the kEventParamWindowRef parameter. 0,0 is at the
7460  *          top left of the structure of the window. Available in Mac
7461  *          OS X 10.1 and later.
7462  *
7463  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
7464  *          The part code that the mouse location hit in the window.
7465  *          This parameter only exists if the WindowRef parameter
7466  *          exists. This saves you the trouble of calling FindWindow,
7467  *          which is expensive on Mac OS X as it needs to call the
7468  *          Window Server. Available in Mac OS X 10.3 and later.
7469  *
7470  *    --> kEventParamKeyModifiers (in, typeUInt32)
7471  *          The keyboard modifiers that were pressed when the event was
7472  *          generated.
7473  *
7474  *    --> kEventParamMouseButton (in, typeMouseButton)
7475  *          Which mouse button was pressed.
7476  *
7477  *    --> kEventParamClickCount (in, typeUInt32)
7478  *          Whether this is a single click, double click, etc.
7479  *
7480  *    --> kEventParamMouseChord (in, typeUInt32)
7481  *          Which other mouse buttons were pressed when the event was
7482  *          generated. Available on Mac OS X only.
7483  *
7484  *    --> kEventParamTabletEventType (in, typeUInt32)
7485  *          The type of tablet event which generated this mouse event;
7486  *          contains either kEventTabletPoint or kEventTabletProximity.
7487  *          Only present if the event was generated from a tablet.
7488  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
7489  *
7490  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
7491  *          Further information about the tablet event which generated
7492  *          this mouse event. Present if the the
7493  *          kEventParamTabletEventType parameter contains
7494  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
7495  *          1.5, and later.
7496  *
7497  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
7498  *          Further information about the tablet event which generated
7499  *          this mouse event. Present if the the
7500  *          kEventParamTabletEventType parameter contains
7501  *          kEventTabletProximity. Available on Mac OS X 10.1 and
7502  *          CarbonLib 1.5, and later.
7503  *
7504  *  Availability:
7505  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
7506  *    CarbonLib:        not available
7507  }
7508 const
7509 	kEventWindowClickToolbarButtonRgn = 41;
7510 
7511 {
7512  *  kEventClassWindow / kEventWindowClickStructureRgn
7513  *
7514  *  Summary:
7515  *    Sent when the mouse is clicked in some part of the window
7516  *    structure other than the window widgets, drag region, or resize
7517  *    region.
7518  *
7519  *  Discussion:
7520  *    The standard window handler responds to this event by calling
7521  *    HIViewGetViewForMouseEvent to determine the HIView containing the
7522  *    click. If a view is found, the standard window handler calls
7523  *    HIViewClick, which will generate a kEventControlClick event. Note
7524  *    that this event is not sent for composited windows; all parts of
7525  *    the window frame are built from views, and the mouse will never
7526  *    land outside of a view.
7527  *
7528  *  Mac OS X threading:
7529  *    Not thread safe
7530  *
7531  *  Parameters:
7532  *
7533  *    --> kEventParamDirectObject (in, typeWindowRef)
7534  *          The window that was clicked.
7535  *
7536  *    --> kEventParamMouseLocation (in, typeHIPoint)
7537  *          The mouse location, in global coordinates.
7538  *
7539  *    --> kEventParamWindowRef (in, typeWindowRef)
7540  *          The window under the mouse. Available in Mac OS X 10.1 and
7541  *          later.
7542  *
7543  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
7544  *          The window-relative position of the mouse in the window
7545  *          given in the kEventParamWindowRef parameter. 0,0 is at the
7546  *          top left of the structure of the window. Available in Mac
7547  *          OS X 10.1 and later.
7548  *
7549  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
7550  *          The part code that the mouse location hit in the window.
7551  *          This parameter only exists if the WindowRef parameter
7552  *          exists. This saves you the trouble of calling FindWindow,
7553  *          which is expensive on Mac OS X as it needs to call the
7554  *          Window Server. Available in Mac OS X 10.3 and later.
7555  *
7556  *    --> kEventParamKeyModifiers (in, typeUInt32)
7557  *          The keyboard modifiers that were pressed when the event was
7558  *          generated.
7559  *
7560  *    --> kEventParamMouseButton (in, typeMouseButton)
7561  *          Which mouse button was pressed.
7562  *
7563  *    --> kEventParamClickCount (in, typeUInt32)
7564  *          Whether this is a single click, double click, etc.
7565  *
7566  *    --> kEventParamMouseChord (in, typeUInt32)
7567  *          Which other mouse buttons were pressed when the event was
7568  *          generated. Available on Mac OS X only.
7569  *
7570  *    --> kEventParamTabletEventType (in, typeUInt32)
7571  *          The type of tablet event which generated this mouse event;
7572  *          contains either kEventTabletPoint or kEventTabletProximity.
7573  *          Only present if the event was generated from a tablet.
7574  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
7575  *
7576  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
7577  *          Further information about the tablet event which generated
7578  *          this mouse event. Present if the the
7579  *          kEventParamTabletEventType parameter contains
7580  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
7581  *          1.5, and later.
7582  *
7583  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
7584  *          Further information about the tablet event which generated
7585  *          this mouse event. Present if the the
7586  *          kEventParamTabletEventType parameter contains
7587  *          kEventTabletProximity. Available on Mac OS X 10.1 and
7588  *          CarbonLib 1.5, and later.
7589  *
7590  *  Availability:
7591  *    Mac OS X:         in version 10.1 and later in Carbon.framework [32-bit only]
7592  *    CarbonLib:        not available
7593  }
7594 const
7595 	kEventWindowClickStructureRgn = 42;
7596 
7597 {$endc} {not TARGET_CPU_64}
7598 
7599 {
7600  *  kEventClassWindow / kEventWindowCursorChange
7601  *
7602  *  Summary:
7603  *    Sent when the mouse is moving over the content region of a window.
7604  *
7605  *  Discussion:
7606  *    This event is used to manage ownership of the cursor. You should
7607  *    only change the cursor if you receive this event; otherwise,
7608  *    someone else needed to adjust the cursor and handled the event
7609  *    (e.g., a TSM Input Method when the mouse is over an inline input
7610  *    region). This event is only sent to the window itself; it is not
7611  *    propagated to controls in the window.
7612  *
7613  *  Mac OS X threading:
7614  *    Not thread safe
7615  *
7616  *  Parameters:
7617  *
7618  *    --> kEventParamDirectObject (in, typeWindowRef)
7619  *          The window under the mouse.
7620  *
7621  *    --> kEventParamMouseLocation (in, typeQDPoint)
7622  *          The mouse location in global coordinates.
7623  *
7624  *    --> kEventParamKeyModifiers (in, typeUInt32)
7625  *          The current keyboard modifiers.
7626  *
7627  *  Availability:
7628  *    Mac OS X:         in version 10.0 and later in Carbon.framework
7629  *    CarbonLib:        in CarbonLib 1.5 and later
7630  }
7631 const
7632 	kEventWindowCursorChange = 40;
7633 
7634 {
7635  *  kEventClassWindow / kEventWindowCollapse
7636  *
7637  *  Summary:
7638  *    A request to collapse a window.
7639  *
7640  *  Discussion:
7641  *    For all windows, the basic window handler responds to this event
7642  *    by calling CollapseWindow, passing true for the collapse
7643  *    parameter, which sends kEventWindowCollapsing and
7644  *    kEventWindowCollapsed events. This event is generated by the
7645  *    standard window handler in response to a click in a window�s
7646  *    collapse button. It is also generated by the basic window handler
7647  *    when Minimize or Collapse is selected from the standard window
7648  *    menu.
7649  *
7650  *  Mac OS X threading:
7651  *    Not thread safe
7652  *
7653  *  Parameters:
7654  *
7655  *    --> kEventParamDirectObject (in, typeWindowRef)
7656  *          The window that should collapse.
7657  *
7658  *  Availability:
7659  *    Mac OS X:         in version 10.0 and later in Carbon.framework
7660  *    CarbonLib:        in CarbonLib 1.1 and later
7661  }
7662 const
7663 	kEventWindowCollapse = 66;
7664 
7665 {
7666  *  kEventClassWindow / kEventWindowCollapseAll
7667  *
7668  *  Summary:
7669  *    A request to collapse all windows.
7670  *
7671  *  Discussion:
7672  *    For all windows, the basic window handler responds to this event
7673  *    by calling CollapseAllWindows, passing true for the collapse
7674  *    parameter. CollapseAllWindows simply calls CollapseWindow on each
7675  *    window; it does not send a kEventWindowCollapse to each window.
7676  *    This event is generated by the standard window handler in
7677  *    response to an option-click in a window�s collapse button. It is
7678  *    also generated by the basic window handler when Minimize All or
7679  *    Collapse All is selected from the standard window menu.
7680  *
7681  *  Mac OS X threading:
7682  *    Not thread safe
7683  *
7684  *  Parameters:
7685  *
7686  *    --> kEventParamDirectObject (in, typeWindowRef)
7687  *          The window whose collapse button was clicked.
7688  *
7689  *  Availability:
7690  *    Mac OS X:         in version 10.0 and later in Carbon.framework
7691  *    CarbonLib:        in CarbonLib 1.1 and later
7692  }
7693 const
7694 	kEventWindowCollapseAll = 68;
7695 
7696 {
7697  *  kEventClassWindow / kEventWindowExpand
7698  *
7699  *  Summary:
7700  *    A request to expand a window.
7701  *
7702  *  Discussion:
7703  *    For all windows, the basic window handler responds to this event
7704  *    by calling CollapseWindow, passing false for the collapse
7705  *    parameter, which sends kEventWindowExpanding and
7706  *    kEventWindowExpanded events. This event is generated by the
7707  *    standard window handler in responds to a click in a collapsed
7708  *    window�s collapse button. It is also generated by the basic
7709  *    window handler when Uncollapse is selected from from the standard
7710  *    window menu provided by CarbonLib.
7711  *
7712  *    Note that you will not receive this event on Mac OS X before a
7713  *    window is expanded from the Dock, since minimized windows in the
7714  *    dock don�t uses collapse buttons to unminimize. However, you will
7715  *    still receive kEventWindowExpanding and kEventWindowExpanded in
7716  *    that case. You will receive this event on Mac OS 8 and 9 using
7717  *    CarbonLib since collapsed windows do have a collapse button there.
7718  *
7719  *  Mac OS X threading:
7720  *    Not thread safe
7721  *
7722  *  Parameters:
7723  *
7724  *    --> kEventParamDirectObject (in, typeWindowRef)
7725  *          The window that should expand.
7726  *
7727  *  Availability:
7728  *    Mac OS X:         in version 10.0 and later in Carbon.framework
7729  *    CarbonLib:        in CarbonLib 1.1 and later
7730  }
7731 const
7732 	kEventWindowExpand = 69;
7733 
7734 {
7735  *  kEventClassWindow / kEventWindowExpandAll
7736  *
7737  *  Summary:
7738  *    A request to expand all windows.
7739  *
7740  *  Discussion:
7741  *    For all windows, the basic window handler responds to this event
7742  *    by calling CollapseAllWindows, passing false for the collapse
7743  *    parameter. On Mac OS X 10.3 and later, CollapseAllWindows sends a
7744  *    kEventWindowExpand event to each window; on earlier version of
7745  *    Mac OS X, and in CarbonLib, it simply calls CollapseWindow on
7746  *    each window. This event is generated by the standard window
7747  *    handler in response to an option-click in a window�s collapse
7748  *    button. It is also generated by the basic window handler when
7749  *    Uncollapse All is selected from the standard window menu provided
7750  *    by CarbonLib.
7751  *
7752  *  Mac OS X threading:
7753  *    Not thread safe
7754  *
7755  *  Parameters:
7756  *
7757  *    --> kEventParamDirectObject (in, typeWindowRef)
7758  *          The window whose collapse button was clicked.
7759  *
7760  *  Availability:
7761  *    Mac OS X:         in version 10.0 and later in Carbon.framework
7762  *    CarbonLib:        in CarbonLib 1.1 and later
7763  }
7764 const
7765 	kEventWindowExpandAll = 71;
7766 
7767 {
7768  *  kEventClassWindow / kEventWindowClose
7769  *
7770  *  Summary:
7771  *    A request to close a window.
7772  *
7773  *  Discussion:
7774  *    The standard window handler responds to this event by calling
7775  *    DisposeWindow. This event is generated by the standard window
7776  *    handler in response to a click in a window�s close button. On Mac
7777  *    OS X 10.3 and later, it is also generated when the Close menu
7778  *    item is selected from the Dock menu of a minimized window.
7779  *
7780  *
7781  *    Your application would typically intercept this event to check if
7782  *    the window�s document is dirty, and display a Save Changes alert
7783  *    if so.
7784  *
7785  *    In order to support closing minimized windows from the Dock, your
7786  *    application must provide an event hander for this event,
7787  *    installed on the window�s event target, even if your application
7788  *    does not use the standard window handler or otherwise use Carbon
7789  *    events.
7790  *
7791  *  Mac OS X threading:
7792  *    Not thread safe
7793  *
7794  *  Parameters:
7795  *
7796  *    --> kEventParamDirectObject (in, typeWindowRef)
7797  *          The window that should close.
7798  *
7799  *  Availability:
7800  *    Mac OS X:         in version 10.0 and later in Carbon.framework
7801  *    CarbonLib:        in CarbonLib 1.1 and later
7802  }
7803 const
7804 	kEventWindowClose = 72;
7805 
7806 {
7807  *  kEventClassWindow / kEventWindowCloseAll
7808  *
7809  *  Summary:
7810  *    A request to close all windows.
7811  *
7812  *  Discussion:
7813  *    The standard window handler responds to this event by sending a
7814  *    kEventWindowClose event to all visible windows of the same window
7815  *    class as the target window. This event is generated by the
7816  *    standard window handler in response to an option-click in a
7817  *    window�s close button.
7818  *
7819  *    In Mac OS X 10.7, it is particularly important to handle this
7820  *    event (rather than relying on the default window event handler)
7821  *    if your application adopts the automatic termination capability.
7822  *    In that case, the OS will automatically add a Close All menu item
7823  *    to your application's File menu that will generate this event. We
7824  *    recommend that you handle this event yourself so that you can
7825  *    implement appropriate UI for closing documents that have unsaved
7826  *    changes. Since the default handler simply generates a
7827  *    kEventWindowClose event for each window, if there are multiple
7828  *    documents with unsaved changes, the result will be multiple
7829  *    sheets opening at once. This is not the recommended UI for this
7830  *    case. Instead, your application should allow the user to review
7831  *    unsaved changes in each document singly.
7832  *
7833  *  Mac OS X threading:
7834  *    Not thread safe
7835  *
7836  *  Parameters:
7837  *
7838  *    --> kEventParamDirectObject (in, typeWindowRef)
7839  *          The window whose close button was clicked.
7840  *
7841  *  Availability:
7842  *    Mac OS X:         in version 10.0 and later in Carbon.framework
7843  *    CarbonLib:        in CarbonLib 1.1 and later
7844  }
7845 const
7846 	kEventWindowCloseAll = 74;
7847 
7848 {
7849  *  kEventClassWindow / kEventWindowZoom
7850  *
7851  *  Summary:
7852  *    A request to zoom a window.
7853  *
7854  *  Discussion:
7855  *    For all windows, the basic window handler responds to this event
7856  *    by sending a kEventWindowGetIdealSize event to get the window�s
7857  *    ideal size, and then calling ZoomWindowIdeal. This event is
7858  *    generated by the standard window handler in response to a click
7859  *    in the window�s zoom button. It is also generated by the basic
7860  *    window handler when Zoom is selected from the standard window
7861  *    menu.
7862  *
7863  *  Mac OS X threading:
7864  *    Not thread safe
7865  *
7866  *  Parameters:
7867  *
7868  *    --> kEventParamDirectObject (in, typeWindowRef)
7869  *          The window that should zoom.
7870  *
7871  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
7872  *          The part code (inZoomIn or inZoomOut) that should be passed
7873  *          to ZoomWindow or ZoomWindowIdeal. This parameter is
7874  *          optional and may not be present in all instances of this
7875  *          event. If present, the event handler should determine if
7876  *          the window is already in the requested state (i.e., if the
7877  *          part code is inZoomOut and the window is already in the
7878  *          standard state), and if so, the event handler should not
7879  *          zoom the window at all. If this parameter is not present,
7880  *          the event handler should zoom the window based on its
7881  *          current state. This parameter is available in Mac OS X 10.3
7882  *          and later.
7883  *
7884  *  Availability:
7885  *    Mac OS X:         in version 10.0 and later in Carbon.framework
7886  *    CarbonLib:        in CarbonLib 1.1 and later
7887  }
7888 const
7889 	kEventWindowZoom = 75;
7890 
7891 {
7892  *  kEventClassWindow / kEventWindowZoomAll
7893  *
7894  *  Summary:
7895  *    A request to zoom all windows.
7896  *
7897  *  Discussion:
7898  *    The standard window handler responds to this event by zooming all
7899  *    visible windows of the same window class as the target window. On
7900  *    Mac OS X 10.3 and later, it causes each window to zoom by sending
7901  *    a kEventWindowZoom event to the window; on earlier versions of
7902  *    Mac OS X, and in CarbonLib, it simply calls ZoomWindowIdeal on
7903  *    each window. This event is generated by the standard window
7904  *    handler in response to an option-click on a window�s zoom button.
7905  *
7906  *
7907  *    After zooming all of the windows, if the windows are being zoomed
7908  *    out and the window class of the target window is
7909  *    kDocumentWindowClass, the windows are cascaded by sending a
7910  *    kEventCommandProcess event with the kHICommandArrangeInFront
7911  *    command to the target window.
7912  *
7913  *  Mac OS X threading:
7914  *    Not thread safe
7915  *
7916  *  Parameters:
7917  *
7918  *    --> kEventParamDirectObject (in, typeWindowRef)
7919  *          The window whose zoom button was clicked.
7920  *
7921  *  Availability:
7922  *    Mac OS X:         in version 10.0 and later in Carbon.framework
7923  *    CarbonLib:        in CarbonLib 1.1 and later
7924  }
7925 const
7926 	kEventWindowZoomAll = 77;
7927 
7928 {
7929  *  kEventClassWindow / kEventWindowContextualMenuSelect
7930  *
7931  *  Summary:
7932  *    A request to display a contextual menu.
7933  *
7934  *  Discussion:
7935  *    This event is generated by the standard window handler in
7936  *    response to a contextual menu click in the content area of a
7937  *    window. In response to such an event, the standard window handler
7938  *    first checks if the click is on a control, and if so, calls
7939  *    HandleControlContextualMenuClick. If the click was not on a
7940  *    control, or if HandleControlContextualMenuClick returned that it
7941  *    did not handle the click, then the standard window handler sends
7942  *    kEventWindowContextualMenuSelect to allow the application to
7943  *    provide its own customized contextual menu. The standard window
7944  *    handler does not respond to this event itself.
7945  *
7946  *  Mac OS X threading:
7947  *    Not thread safe
7948  *
7949  *  Parameters:
7950  *
7951  *    --> kEventParamDirectObject (in, typeWindowRef)
7952  *          The window that should collapse.
7953  *
7954  *    --> kEventParamMouseLocation (in, typeHIPoint)
7955  *          The mouse location, in global coordinates.
7956  *
7957  *    --> kEventParamWindowRef (in, typeWindowRef)
7958  *          The window under the mouse. Available in Mac OS X 10.1 and
7959  *          later.
7960  *
7961  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
7962  *          The window-relative position of the mouse in the window
7963  *          given in the kEventParamWindowRef parameter. 0,0 is at the
7964  *          top left of the structure of the window. Available in Mac
7965  *          OS X 10.1 and later.
7966  *
7967  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
7968  *          The part code that the mouse location hit in the window.
7969  *          This parameter only exists if the WindowRef parameter
7970  *          exists. This saves you the trouble of calling FindWindow,
7971  *          which is expensive on Mac OS X as it needs to call the
7972  *          Window Server. Available in Mac OS X 10.3 and later.
7973  *
7974  *    --> kEventParamKeyModifiers (in, typeUInt32)
7975  *          The keyboard modifiers that were pressed when the event was
7976  *          generated.
7977  *
7978  *    --> kEventParamMouseButton (in, typeMouseButton)
7979  *          Which mouse button was pressed.
7980  *
7981  *    --> kEventParamClickCount (in, typeUInt32)
7982  *          Whether this is a single click, double click, etc.
7983  *
7984  *    --> kEventParamMouseChord (in, typeUInt32)
7985  *          Which other mouse buttons were pressed when the event was
7986  *          generated. Available on Mac OS X only.
7987  *
7988  *    --> kEventParamTabletEventType (in, typeUInt32)
7989  *          The type of tablet event which generated this mouse event;
7990  *          contains either kEventTabletPoint or kEventTabletProximity.
7991  *          Only present if the event was generated from a tablet.
7992  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
7993  *
7994  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
7995  *          Further information about the tablet event which generated
7996  *          this mouse event. Present if the the
7997  *          kEventParamTabletEventType parameter contains
7998  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
7999  *          1.5, and later.
8000  *
8001  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
8002  *          Further information about the tablet event which generated
8003  *          this mouse event. Present if the the
8004  *          kEventParamTabletEventType parameter contains
8005  *          kEventTabletProximity. Available on Mac OS X 10.1 and
8006  *          CarbonLib 1.5, and later.
8007  *
8008  *  Availability:
8009  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8010  *    CarbonLib:        in CarbonLib 1.1 and later
8011  }
8012 const
8013 	kEventWindowContextualMenuSelect = 78;
8014 
8015 {
8016  *  kEventClassWindow / kEventWindowPathSelect
8017  *
8018  *  Summary:
8019  *    Allows customization of the path-selection popup menu displayed
8020  *    over a window�s title.
8021  *
8022  *  Discussion:
8023  *    This event is generated by the standard window handler in
8024  *    response to a click in a window�s drag region. In response to
8025  *    such an event, the standard window handler first calls
8026  *    IsWindowPathSelectEvent to determine if the click should cause a
8027  *    path-selection popup menu to be displayed. If so, and if the
8028  *    window is also hilited and has a proxy icon, the standard window
8029  *    handler sends a kEventWindowPathSelect event to the window.
8030  *
8031  *
8032  *    A handler for this event should put a MenuRef into the event and
8033  *    return noErr to cause the menu to be displayed as the path
8034  *    selection popup menu. The menu will not be released by the
8035  *    standard window handler; however, in Mac OS X 10.4 and later, it
8036  *    will be retained by the EventRef when added to the event, and
8037  *    released when the event is destroyed, so a handler for this event
8038  *    may, on Mac OS X 10.4 and later, release the menu after adding it
8039  *    to the menu.
8040  *
8041  *    Note! The standard window handler's use of this event was broken
8042  *    in all releases of CarbonLib and Mac OS X before Mac OS X 10.4;
8043  *    the MenuRef added to this event was not used to display the path
8044  *    selection menu. Therefore, this event is effectively useless
8045  *    before Mac OS X 10.4.
8046  *
8047  *  Mac OS X threading:
8048  *    Not thread safe
8049  *
8050  *  Parameters:
8051  *
8052  *    --> kEventParamDirectObject (in, typeWindowRef)
8053  *          The window that will display the path-selection popup menu.
8054  *
8055  *    <-- kEventParamMenuRef (out, typeMenuRef)
8056  *          On exit, contains the menu that should be displayed.
8057  *
8058  *  Availability:
8059  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8060  *    CarbonLib:        in CarbonLib 1.1 and later
8061  }
8062 const
8063 	kEventWindowPathSelect = 79;
8064 
8065 {
8066  *  kEventClassWindow / kEventWindowGetIdealSize
8067  *
8068  *  Summary:
8069  *    A request for the ideal size of a window�s content region, for
8070  *    use during window zooming.
8071  *
8072  *  Discussion:
8073  *    This event is generated by the basic window handler in response
8074  *    to kEventWindowZoom. The basic window handler sends this event to
8075  *    the window to get the window�s ideal size, and passes the
8076  *    resulting size to ZoomWindowIdeal.
8077  *
8078  *    This event is not handled by either the basic or standard window
8079  *    handlers. If no handler responds to this event, the basic window
8080  *    handler uses an ideal size based on the size of the monitor on
8081  *    which the window is located.
8082  *
8083  *    Prior to Mac OS X Mac OS X 10.4, the ZoomWindowIdeal API
8084  *    malfunctioned if passed an idealSize that was large enough to
8085  *    cause 16-bit integer overflow when added to the window's current
8086  *    position. Therefore, when providing an ideal size in response to
8087  *    this event, you should generally not return values that are close
8088  *    to 32767. It is better to limit your ideal size to, say, 16K.
8089  *
8090  *  Mac OS X threading:
8091  *    Not thread safe
8092  *
8093  *  Parameters:
8094  *
8095  *    --> kEventParamDirectObject (in, typeWindowRef)
8096  *          The window being zoomed.
8097  *
8098  *    <-- kEventParamDimensions (out, typeQDPoint)
8099  *          On exit, contains the window�s ideal size.
8100  *
8101  *  Availability:
8102  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8103  *    CarbonLib:        in CarbonLib 1.1 and later
8104  }
8105 const
8106 	kEventWindowGetIdealSize = 80;
8107 
8108 {
8109  *  kEventClassWindow / kEventWindowGetIdealStandardState
8110  *
8111  *  Summary:
8112  *    Calculates the ideal standard state of a window, given its ideal
8113  *    size.
8114  *
8115  *  Discussion:
8116  *    This event is generated by IsWindowInStandardState and
8117  *    ZoomWindowIdeal. The bounding rect returned by the event handler
8118  *    is, respectively, compared against the window's current bounds to
8119  *    determine if the window is in its standard state, and used as the
8120  *    new window bounds when zooming out.
8121  *
8122  *    The basic window event handler implements this event by computing
8123  *    an ideal window bounds that fits the window onscreen, given the
8124  *    desired ideal size.
8125  *
8126  *    An application might handle this event in order to customize the
8127  *    standard state bounds of a window. For example, if the
8128  *    application has tool palettes around the edges of a display, it
8129  *    could handle this event and calculate its own standard state
8130  *    bounds for a window that prevents the window from zooming under
8131  *    the tool palettes.
8132  *
8133  *  Mac OS X threading:
8134  *    Not thread safe
8135  *
8136  *  Parameters:
8137  *
8138  *    --> kEventParamDirectObject (in, typeWindowRef)
8139  *          The window whose ideal standard state to return.
8140  *
8141  *    --> kEventParamDimensions (in, typeHISize)
8142  *          The window's ideal content size. This is the size that was
8143  *          passed by the caller to IsWindowInStandardState or
8144  *          ZoomWindowIdeal.
8145  *
8146  *    <-- kEventParamBounds (out, typeHIRect)
8147  *          On exit, contains the content bounds for the window's ideal
8148  *          standard state.
8149  *
8150  *  Availability:
8151  *    Mac OS X:         in version 10.4 and later in Carbon.framework
8152  *    CarbonLib:        not available
8153  }
8154 const
8155 	kEventWindowGetIdealStandardState = 93;
8156 
8157 
8158 {
8159  *  kEventClassWindow / kEventWindowGetMinimumSize
8160  *
8161  *  Summary:
8162  *    A request for the minimum size of a window�s content region, for
8163  *    use during window resizing.
8164  *
8165  *  Discussion:
8166  *    This event is generated by the standard window handler before
8167  *    resizing a window. On Mac OS X 10.2 and later, the basic window
8168  *    handler responds to this event by calling GetWindowResizeLimits
8169  *    and returning the minimum size in the event; on earlier versions
8170  *    of Mac OS X and CarbonLib, this event is not handled by the basic
8171  *    or standard window handlers.
8172  *
8173  *    On Mac OS X 10.2 and CarbonLib 1.6 and later, this event is also
8174  *    generated by ResizeWindow and GrowWindow if the sizeConstraints
8175  *    parameter is NULL.
8176  *
8177  *  Mac OS X threading:
8178  *    Not thread safe
8179  *
8180  *  Parameters:
8181  *
8182  *    --> kEventParamDirectObject (in, typeWindowRef)
8183  *          The window being resized.
8184  *
8185  *    <-- kEventParamDimensions (out, typeQDPoint)
8186  *          On exit, contains the window�s minimum size.
8187  *
8188  *  Availability:
8189  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8190  *    CarbonLib:        in CarbonLib 1.1 and later
8191  }
8192 const
8193 	kEventWindowGetMinimumSize = 81;
8194 
8195 {
8196  *  kEventClassWindow / kEventWindowGetMaximumSize
8197  *
8198  *  Summary:
8199  *    A request for the maximum size of a window�s content region, for
8200  *    use during window resizing.
8201  *
8202  *  Discussion:
8203  *    This event is generated by the standard window handler before
8204  *    resizing a window. On Mac OS X 10.2 and later, the basic window
8205  *    handler responds to this event by calling GetWindowResizeLimits
8206  *    and returning the maximum size in the event; on earlier versions
8207  *    of Mac OS X and CarbonLib, this event is not handled by the basic
8208  *    or standard window handlers.
8209  *
8210  *    On Mac OS X 10.2 and CarbonLib 1.6 and later, this event is also
8211  *    generated by ResizeWindow and GrowWindow if the sizeConstraints
8212  *    parameter is NULL.
8213  *
8214  *  Mac OS X threading:
8215  *    Not thread safe
8216  *
8217  *  Parameters:
8218  *
8219  *    --> kEventParamDirectObject (in, typeWindowRef)
8220  *          The window being resized.
8221  *
8222  *    <-- kEventParamDimensions (out, typeQDPoint)
8223  *          On exit, contains the window�s minimum size.
8224  *
8225  *  Availability:
8226  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8227  *    CarbonLib:        in CarbonLib 1.1 and later
8228  }
8229 const
8230 	kEventWindowGetMaximumSize = 82;
8231 
8232 {
8233  *  kEventClassWindow / kEventWindowConstrain
8234  *
8235  *  Summary:
8236  *    Requests that a window�s position be constrained to the available
8237  *    window positioning bounds.
8238  *
8239  *  Discussion:
8240  *    The basic window handler responds to this event by calling
8241  *    ConstrainWindowToScreen. This event is generated in three
8242  *    situations: changes in graphics device configuration, changes to
8243  *    Dock size, and (in Mac OS X 10.6 and later) after a window has
8244  *    been dragged. In each of these cases, a window which was
8245  *    previously visible onscreen may become obscured or be totally
8246  *    offscreen, and should be repositioned back inside the available
8247  *    window positioning bounds.
8248  *
8249  *    The behavior of the basic window handler may be customized by
8250  *    modifying the parameters to the event and then allowing the event
8251  *    to pass through to the basic handler, or an application may
8252  *    choose to override the event entirely and perform its own window
8253  *    constraining.
8254  *
8255  *    Applications may also use the
8256  *    kEventAppAvailableWindowBoundsChanged event to be notified of
8257  *    changes to a device�s available bounds.
8258  *
8259  *  Mac OS X threading:
8260  *    Not thread safe
8261  *
8262  *  Parameters:
8263  *
8264  *    --> kEventParamDirectObject (in, typeWindowRef)
8265  *          The window being constrained.
8266  *
8267  *    --> kEventParamReason (in, typeUInt32)
8268  *          The reasons why the window is being constrained. This
8269  *          parameter contains one or more of the
8270  *          kAvailBoundsChangedFor constants. This parameter is
8271  *          available only on Mac OS X 10.3 and later. This parameter
8272  *          is not present on Mac OS X 10.6 and later if the event is
8273  *          being sent after a window drag.
8274  *
8275  *    --> kEventParamTransactionID (in, typeUInt32)
8276  *          An integer which is the same for all instances of this
8277  *          event that are produced by the same configuration change.
8278  *          For example, if multiple displays are attached, then this
8279  *          event is sent once for each window on each affected display
8280  *          after a display configuration change; however, the
8281  *          transaction ID parameter will the same for each event, so a
8282  *          handler for this event can correlate events by observing
8283  *          the transaction ID. This parameter is available only on Mac
8284  *          OS X 10.3 and later.
8285  *
8286  *    --> kEventParamAvailableBounds (in, typeQDRectangle)
8287  *          The available window positioning bounds in which the window
8288  *          should be positioned. Event handlers may change the value
8289  *          in this parameter and then return eventNotHandledErr to
8290  *          allow the basic window handler to constrain the window to
8291  *          the new bounding rect.
8292  *
8293  *          This parameter is used by the basic window handler on Mac
8294  *          OS X 10.1 and later; on earlier versions of Mac OS X, the
8295  *          basic window handler always constrains the window to the
8296  *          rect returned by GetAvailableWindowPositioningBounds for
8297  *          the window�s device.
8298  *
8299  *    --> kEventParamAttributes (in, typeUInt32)
8300  *          Window constraint options that should be passed to
8301  *          ConstrainWindowToScreen. This parameter is optional and may
8302  *          not be present in all instances of this event. If present,
8303  *          this parameter should be formed from constants in the
8304  *          WindowConstrainOptions enumeration.
8305  *
8306  *          This parameter is used by the basic window handler on Mac
8307  *          OS X 10.2 and later; on earlier versions of Mac OS X, or if
8308  *          this parameter is missing, the basic window handler passes
8309  *          kWindowConstrainMoveRegardlessOfFit to
8310  *          ConstrainWindowToScreen in Mac OS X 10.0, and
8311  *          kWindowConstrainMoveRegardlessOfFit |
8312  *          kWindowConstrainAllowPartial in Mac OS 10.1 and later.
8313  *
8314  *    --> kEventParamWindowRegionCode (in, typeWindowRegionCode)
8315  *          A WindowRegionCode that should be passed to
8316  *          ConstrainWindowToScreen. This parameter is optional and may
8317  *          not be present in all instances of this event.
8318  *
8319  *          This parameter is used by the basic window handler on Mac
8320  *          OS X 10.2 and later. On earlier versions of Mac OS X, or if
8321  *          this parameter is missing, the basic window handler passes
8322  *          kWindowDragRgn to ConstrainWindowToScreen.
8323  *
8324  *    --> kEventParamRgnHandle (in, typeQDRgnHandle)
8325  *          The GrayRgn before a graphics device configuration change.
8326  *          This parameter is optional and may not be present in all
8327  *          instances of this event. It is present in events generated
8328  *          on Mac OS X 10.2 and later.
8329  *
8330  *          An event handler may compare this region with the current
8331  *          GrayRgn to more intelligently determine whether the window
8332  *          should be constrained to the current GrayRgn. The basic
8333  *          window handler in Mac OS X 10.2 will not constrain windows
8334  *          that were not onscreen before the device configuration
8335  *          change.
8336  *
8337  *    --> kEventParamPreviousDockRect (in, typeHIRect)
8338  *          The Dock bounding rect before a Dock size change. This
8339  *          parameter is optional and may not be present in all
8340  *          instances of this event. It is present in events in events
8341  *          generated on Mac OS X 10.2 and later.
8342  *
8343  *    --> kEventParamPreviousDockDevice (in, typeCGDisplayID)
8344  *          The display device on which the Dock was previously
8345  *          positioned. This parameter is optional and may not be
8346  *          present in all instances of this event. It is present in
8347  *          events generated on Mac OS X 10.3 and later. On Mac OS X
8348  *          10.3 and later, this parameter is available as a GDHandle
8349  *          using typeGDHandle; on Mac OS X 10.5 and later, this
8350  *          parameter is also available as a CGDirectDisplayID using
8351  *          typeCGDisplayID.
8352  *
8353  *    --> kEventParamCurrentDockRect (in, typeHIRect)
8354  *          The Dock bounding rect after a Dock size change. This
8355  *          parameter is optional and may not be present in all
8356  *          instances of this event. It is present in events in events
8357  *          generated on Mac OS X 10.2 and later.
8358  *
8359  *    --> kEventParamCurrentDockDevice (in, typeCGDisplayID)
8360  *          The display device on which the Dock is currently
8361  *          positioned. This parameter is optional and may not be
8362  *          present in all instances of this event. It is present in
8363  *          events generated on Mac OS X 10.3 and later. On Mac OS X
8364  *          10.3 and later, this parameter is available as a GDHandle
8365  *          using typeGDHandle; on Mac OS X 10.5 and later, this
8366  *          parameter is also available as a CGDirectDisplayID using
8367  *          typeCGDisplayID.
8368  *
8369  *  Availability:
8370  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8371  *    CarbonLib:        in CarbonLib 1.5 and later
8372  }
8373 const
8374 	kEventWindowConstrain = 83;
8375 
8376 {
8377  *  kEventClassWindow / kEventWindowRestoreFromDock
8378  *
8379  *  Summary:
8380  *    Requests that a collapsed window be restored from the Dock.
8381  *
8382  *  Discussion:
8383  *    The basic window handler responds to this event by calling
8384  *    SelectWindow or CollapseWindow(false), depending on whether the
8385  *    window should be made active. Your application may handle this
8386  *    event to be notified before a window is restored from the Dock. A
8387  *    handler for this event should generally either return noErr to
8388  *    prevent a window from being restored from the Dock, or
8389  *    eventNotHandledErr to allow the basic handler to restore the
8390  *    window from the Dock.
8391  *
8392  *    In Mac OS X 10.7 and later, this event cannot be used to prevent
8393  *    a window from being restored from the Dock. Window restoration is
8394  *    done asynchronously in Mac OS X 10.7 and later, and this event is
8395  *    sent as a notification, not a request.
8396  *
8397  *    This event is sent only to the window, and is not propagated past
8398  *    it.
8399  *
8400  *  Mac OS X threading:
8401  *    Not thread safe
8402  *
8403  *  Parameters:
8404  *
8405  *    --> kEventParamDirectObject (in, typeWindowRef)
8406  *          The window to be restored from the Dock.
8407  *
8408  *  Availability:
8409  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8410  *    CarbonLib:        not available
8411  }
8412 const
8413 	kEventWindowRestoreFromDock = 84;
8414 
8415 {
8416  *  kEventClassWindow / kEventWindowProxyBeginDrag
8417  *
8418  *  Summary:
8419  *    Notification that a proxy icon drag is beginning.
8420  *
8421  *  Discussion:
8422  *    This event includes the DragRef that will be used for the proxy
8423  *    icon drag. An application handler may attach its own data to the
8424  *    DragRef as appropriate for the document content.
8425  *
8426  *  Mac OS X threading:
8427  *    Not thread safe
8428  *
8429  *  Parameters:
8430  *
8431  *    --> kEventParamDirectObject (in, typeWindowRef)
8432  *          The window whose proxy icon is being dragged.
8433  *
8434  *    --> kEventParamDragRef (in, typeDragRef)
8435  *          The DragRef that will be used for the proxy icon drag.
8436  *
8437  *  Availability:
8438  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8439  *    CarbonLib:        in CarbonLib 1.1 and later
8440  }
8441 const
8442 	kEventWindowProxyBeginDrag = 128;
8443 
8444 {
8445  *  kEventClassWindow / kEventWindowProxyEndDrag
8446  *
8447  *  Summary:
8448  *    Notification that a proxy icon drag has ended.
8449  *
8450  *  Discussion:
8451  *    This event is sent regardless of whether the drag completed
8452  *    successfully, or was canceled by the user.
8453  *
8454  *  Mac OS X threading:
8455  *    Not thread safe
8456  *
8457  *  Parameters:
8458  *
8459  *    --> kEventParamDirectObject (in, typeWindowRef)
8460  *          The window whose proxy icon is being dragged.
8461  *
8462  *    --> kEventParamDragRef (in, typeDragRef)
8463  *          The DragRef that was used for the proxy icon drag.
8464  *
8465  *  Availability:
8466  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8467  *    CarbonLib:        in CarbonLib 1.1 and later
8468  }
8469 const
8470 	kEventWindowProxyEndDrag = 129;
8471 
8472 {$ifc not TARGET_CPU_64}
8473 {
8474  *  kEventClassWindow / kEventWindowHandleContentClick
8475  *
8476  *  Summary:
8477  *    The mouse has been clicked in the content region of a window, but
8478  *    the click is not a contextual menu invocation or a click on a
8479  *    control.
8480  *
8481  *  Discussion:
8482  *    This event is generated by the standard window handler in
8483  *    response to a kEventWindowClickContentRgn event. An application
8484  *    may handle this event by checking if the mouse click was on a
8485  *    portion of its own user interface, and responding appropriately
8486  *    if so.
8487  *
8488  *    Note that this event is not sent for composited windows; all
8489  *    mouse-downs in a composited window are handled by a view, and
8490  *    there is no �content region� in a composited window. To intercept
8491  *    a content region click in a composited window, install a
8492  *    kEventControlClick handler on the window�s content view, or
8493  *    provide your own HIView subclass.
8494  *
8495  *  Mac OS X threading:
8496  *    Not thread safe
8497  *
8498  *  Parameters:
8499  *
8500  *    --> kEventParamDirectObject (in, typeWindowRef)
8501  *          The window that was clicked.
8502  *
8503  *    --> kEventParamMouseLocation (in, typeHIPoint)
8504  *          The mouse location, in global coordinates.
8505  *
8506  *    --> kEventParamWindowRef (in, typeWindowRef)
8507  *          The window under the mouse. Available in Mac OS X 10.1 and
8508  *          later.
8509  *
8510  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
8511  *          The window-relative position of the mouse in the window
8512  *          given in the kEventParamWindowRef parameter. 0,0 is at the
8513  *          top left of the structure of the window. Available in Mac
8514  *          OS X 10.1 and later.
8515  *
8516  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
8517  *          The part code that the mouse location hit in the window.
8518  *          This parameter only exists if the WindowRef parameter
8519  *          exists. This saves you the trouble of calling FindWindow,
8520  *          which is expensive on Mac OS X as it needs to call the
8521  *          Window Server. Available in Mac OS X 10.3 and later.
8522  *
8523  *    --> kEventParamKeyModifiers (in, typeUInt32)
8524  *          The keyboard modifiers that were pressed when the event was
8525  *          generated.
8526  *
8527  *    --> kEventParamMouseButton (in, typeMouseButton)
8528  *          Which mouse button was pressed.
8529  *
8530  *    --> kEventParamClickCount (in, typeUInt32)
8531  *          Whether this is a single click, double click, etc.
8532  *
8533  *    --> kEventParamMouseChord (in, typeUInt32)
8534  *          Which other mouse buttons were pressed when the event was
8535  *          generated. Available on Mac OS X only.
8536  *
8537  *    --> kEventParamTabletEventType (in, typeUInt32)
8538  *          The type of tablet event which generated this mouse event;
8539  *          contains either kEventTabletPoint or kEventTabletProximity.
8540  *          Only present if the event was generated from a tablet.
8541  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
8542  *
8543  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
8544  *          Further information about the tablet event which generated
8545  *          this mouse event. Present if the the
8546  *          kEventParamTabletEventType parameter contains
8547  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
8548  *          1.5, and later.
8549  *
8550  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
8551  *          Further information about the tablet event which generated
8552  *          this mouse event. Present if the the
8553  *          kEventParamTabletEventType parameter contains
8554  *          kEventTabletProximity. Available on Mac OS X 10.1 and
8555  *          CarbonLib 1.5, and later.
8556  *
8557  *  Availability:
8558  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
8559  *    CarbonLib:        in CarbonLib 1.3.1 and later
8560  }
8561 const
8562 	kEventWindowHandleContentClick = 85;
8563 
8564 {$endc} {not TARGET_CPU_64}
8565 
8566 {
8567  *  kEventClassWindow / kEventWindowGetDockTileMenu
8568  *
8569  *  Summary:
8570  *    A request for a menu to be displayed by a window�s dock tile.
8571  *
8572  *  Discussion:
8573  *    The basic window handler responds to this event by returning the
8574  *    menu, if any, that was provided by the SetWindowDockTileMenu API.
8575  *    For most applications, it will be easier to use the
8576  *    SetWindowDockTileMenu API directly rather than installing a
8577  *    handler for this event.
8578  *
8579  *  Mac OS X threading:
8580  *    Not thread safe
8581  *
8582  *  Parameters:
8583  *
8584  *    --> kEventParamDirectObject (in, typeWindowRef)
8585  *          The window that should collapse.
8586  *
8587  *    <-- kEventParamMenuRef (out, typeMenuRef)
8588  *          On exit, contains the menu that should be displayed for the
8589  *          window�s Dock tile. The sender of this event will release
8590  *          the menu after the Dock has displayed it, so if you return
8591  *          a permanently allocated MenuRef, you should call RetainMenu
8592  *          on it before returning from your event handler.
8593  *
8594  *  Availability:
8595  *    Mac OS X:         in version 10.2 and later in Carbon.framework
8596  *    CarbonLib:        not available
8597  }
8598 const
8599 	kEventWindowGetDockTileMenu = 90;
8600 
8601 {
8602  *  kEventClassWindow / kEventWindowUpdateDockTile
8603  *
8604  *  Summary:
8605  *    Indicates that your application should redraw its custom
8606  *    collapsed window Dock tile.
8607  *
8608  *  Discussion:
8609  *    This event is sent when your application has customized a
8610  *    collapsed window Dock tile. If your app customizes its window
8611  *    Dock tile appearance using
8612  *    CreateQDContextForCollapsedWindowDockTile or
8613  *    HIWindowCreateCollapsedDockTileContext, then your application
8614  *    should redraw its window Dock tile in response to this event.
8615  *    This event is not sent if your application has not customized a
8616  *    window's Dock tile.
8617  *
8618  *    This event is currently sent in two cases: when the Dock tile
8619  *    changes size (typically in response to a change in the user
8620  *    interface scale factor), or when the Dock process is restarted.
8621  *    In either case, any customization that your application has
8622  *    previously performed is lost.
8623  *
8624  *  Parameters:
8625  *
8626  *    --> kEventParamDirectObject (in, typeWindowRef)
8627  *          The window whose Dock tile should be updated.
8628  *
8629  *  Availability:
8630  *    Mac OS X:         not available
8631  *    CarbonLib:        not available
8632  }
8633 const
8634 	kEventWindowUpdateDockTile = 94;
8635 
8636 {
8637  *  kEventClassWindow / kEventWindowColorSpaceChanged
8638  *
8639  *  Summary:
8640  *    Notification that the color space of the window has changed.
8641  *
8642  *  Discussion:
8643  *    When the kHIWindowBitAutoCalibration attribute is set, this event
8644  *    is sent when the window's colorspace is changed by the Window
8645  *    Manager. The standard window handler's response is to paint the
8646  *    entire window.
8647  *
8648  *  Mac OS X threading:
8649  *    Not thread safe
8650  *
8651  *  Parameters:
8652  *
8653  *    --> kEventParamDirectObject (in, typeWindowRef)
8654  *          The window with the updated color space.
8655  *
8656  *  Availability:
8657  *    Mac OS X:         in version 10.6 and later in Carbon.framework
8658  *    CarbonLib:        not available
8659  }
8660 const
8661 	kEventWindowColorSpaceChanged = 95;
8662 
8663 {
8664  *  kEventClassWindow / kEventWindowRestoredAfterRelaunch
8665  *
8666  *  Summary:
8667  *    Notification that a window has been restored after application
8668  *    relaunch.
8669  *
8670  *  Discussion:
8671  *    This event is sent by the Window Manager when the system caused
8672  *    your application to be quit and relaunched. Your application will
8673  *    receive a kAEOpenDocuments Apple Event containing documents that
8674  *    were open when your application was quit, if it had any.
8675  *
8676  *    For each reopened document, this event will be sent to the
8677  *    document's window, after it has been restored to its previous
8678  *    size and position. If your application uses the
8679  *    ChangeWindowPropertyAttributes API to set the
8680  *    kWindowPropertyPersistent attribute for a window property, the
8681  *    property will have been restored to its previous value when your
8682  *    application receives this event. This event is sent to all
8683  *    handlers registered for it.
8684  *
8685  *  Mac OS X threading:
8686  *    Not thread safe
8687  *
8688  *  Parameters:
8689  *
8690  *    --> kEventParamDirectObject (in, typeWindowRef)
8691  *          The window that was restored.
8692  *
8693  *  Availability:
8694  *    Mac OS X:         in version 10.7 and later in Carbon.framework
8695  *    CarbonLib:        not available
8696  }
8697 const
8698 	kEventWindowRestoredAfterRelaunch = 96;
8699 
8700 {
8701  *  kEventClassWindow / kEventWindowToolbarSwitchMode
8702  *
8703  *  Summary:
8704  *    A request that the window�s toolbar change its display mode.
8705  *
8706  *  Discussion:
8707  *    For all windows, the basic window handler responds to this event
8708  *    by changing the display mode of the window�s HIToolbar, if any.
8709  *    If the application uses its own custom toolbar implementation, it
8710  *    should handle this event itself and respond appropriately. This
8711  *    event is generated by the basic window handler in response to a
8712  *    click in the window�s toolbar button.
8713  *
8714  *  Mac OS X threading:
8715  *    Not thread safe
8716  *
8717  *  Parameters:
8718  *
8719  *    --> kEventParamDirectObject (in, typeWindowRef)
8720  *          The window whose toolbar button was clicked.
8721  *
8722  *    --> kEventParamMouseLocation (in, typeHIPoint)
8723  *          The mouse location, in global coordinates.
8724  *
8725  *    --> kEventParamWindowRef (in, typeWindowRef)
8726  *          The window under the mouse. Available in Mac OS X 10.1 and
8727  *          later. This parameter may not be present in all instances
8728  *          of this event, even on Mac OS X 10.1 and later.
8729  *
8730  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
8731  *          The window-relative position of the mouse in the window
8732  *          given in the kEventParamWindowRef parameter. 0,0 is at the
8733  *          top left of the structure of the window. Available in Mac
8734  *          OS X 10.1 and later. This parameter may not be present in
8735  *          all instances of this event, even on Mac OS X 10.1 and
8736  *          later.
8737  *
8738  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
8739  *          The part code that the mouse location hit in the window.
8740  *          This parameter may not be present in all instances of this
8741  *          event. This saves you the trouble of calling FindWindow,
8742  *          which is expensive on Mac OS X as it needs to call the
8743  *          Window Server. Available in Mac OS X 10.3 and later. This
8744  *          parameter may not be present in all instances of this
8745  *          event, even on Mac OS X 10.3 and later.
8746  *
8747  *    --> kEventParamKeyModifiers (in, typeUInt32)
8748  *          The keyboard modifiers that were pressed when the event was
8749  *          generated.
8750  *
8751  *    --> kEventParamMouseButton (in, typeMouseButton)
8752  *          Which mouse button was pressed. This parameter may not be
8753  *          present in all instances of this event.
8754  *
8755  *    --> kEventParamClickCount (in, typeUInt32)
8756  *          Whether this is a single click, double click, etc. This
8757  *          parameter may not be present in all instances of this event.
8758  *
8759  *    --> kEventParamMouseChord (in, typeUInt32)
8760  *          Which other mouse buttons were pressed when the event was
8761  *          generated. Available on Mac OS X only. This parameter may
8762  *          not be present in all instances of this event, even on Mac
8763  *          OS X.
8764  *
8765  *    --> kEventParamTabletEventType (in, typeUInt32)
8766  *          The type of tablet event which generated this mouse event;
8767  *          contains either kEventTabletPoint or kEventTabletProximity.
8768  *          Only present if the event was generated from a tablet.
8769  *          Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
8770  *          This parameter may not be present in all instances of this
8771  *          event, even on the previously mentioned platforms.
8772  *
8773  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
8774  *          Further information about the tablet event which generated
8775  *          this mouse event. Present if the the
8776  *          kEventParamTabletEventType parameter contains
8777  *          kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
8778  *          1.5, and later. This parameter may not be present in all
8779  *          instances of this event, even on the previously mentioned
8780  *          platforms.
8781  *
8782  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
8783  *          Further information about the tablet event which generated
8784  *          this mouse event. Present if the the
8785  *          kEventParamTabletEventType parameter contains
8786  *          kEventTabletProximity. Available on Mac OS X 10.1 and
8787  *          CarbonLib 1.5, and later. This parameter may not be present
8788  *          in all instances of this event, even on the previously
8789  *          mentioned platforms.
8790  *
8791  *  Availability:
8792  *    Mac OS X:         in version 10.1 and later in Carbon.framework
8793  *    CarbonLib:        not available
8794  }
8795 const
8796 	kEventWindowToolbarSwitchMode = 150;
8797 
8798 {
8799  *  kEventClassWindow / kEventWindowFocusAcquired
8800  *
8801  *  Summary:
8802  *    Notification that the user (or some other action) has caused the
8803  *    focus to shift to your window.
8804  *
8805  *  Discussion:
8806  *    This event is sent to all handlers registered for it.
8807  *
8808  *    The basic window handler responds to this event by forwarding the
8809  *    event to the focused control in the specified window. This allows
8810  *    the focused control to invalidate or redraw itself as necessary;
8811  *    for example, the standard edit-text control responds to this
8812  *    event by enabling its blinking insertion point. An application
8813  *    handler may choose to set the focus to custom application content
8814  *    instead.
8815  *
8816  *  Mac OS X threading:
8817  *    Not thread safe
8818  *
8819  *  Parameters:
8820  *
8821  *    --> kEventParamDirectObject (in, typeWindowRef)
8822  *          The window that is gaining focus.
8823  *
8824  *  Availability:
8825  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8826  *    CarbonLib:        in CarbonLib 1.1 and later
8827  }
8828 const
8829 	kEventWindowFocusAcquired = 200;
8830 
8831 {
8832  *  kEventClassWindow / kEventWindowFocusRelinquish
8833  *
8834  *  Summary:
8835  *    Notification that a window has lost user focus.
8836  *
8837  *  Discussion:
8838  *    This event is sent to all handlers registered for it.
8839  *
8840  *    The basic window handler responds to this event by forwarding the
8841  *    event to the focused control in the specified window. This allows
8842  *    the focused control to invalidate or redraw itself as necessary;
8843  *    for example, the standard edit-text control responds to this
8844  *    event by disabling its blinking insertion point. An application
8845  *    handler should remove the focus from custom application content
8846  *    and ensure that the content is redrawn without the focus
8847  *    highlight.
8848  *
8849  *  Mac OS X threading:
8850  *    Not thread safe
8851  *
8852  *  Parameters:
8853  *
8854  *    --> kEventParamDirectObject (in, typeWindowRef)
8855  *          The window that is losing focus.
8856  *
8857  *  Availability:
8858  *    Mac OS X:         in version 10.0 and later in Carbon.framework
8859  *    CarbonLib:        in CarbonLib 1.1 and later
8860  }
8861 const
8862 	kEventWindowFocusRelinquish = 201;
8863 
8864 
8865 {
8866  *  kEventClassWindow / kEventWindowFocusLost
8867  *
8868  *  Summary:
8869  *    Notification that a focused window has lost focus due to a change
8870  *    in the modal focus stack.
8871  *
8872  *  Discussion:
8873  *    This event is sent to a focused window when another window is
8874  *    pushed onto the modal focus stack. When this happens, the pushed
8875  *    window becomes the effective focus, and this window ceases to
8876  *    have the focus.
8877  *
8878  *    This event is sent to all handlers registered for it on the
8879  *    window. The basic window handler automatically sends this event
8880  *    to the focused view in the window. The basic view handler
8881  *    automatically invalidates a view when it receives this event.
8882  *
8883  *  Mac OS X threading:
8884  *    Not thread safe
8885  *
8886  *  Parameters:
8887  *
8888  *    --> kEventParamDirectObject (in, typeWindowRef)
8889  *          The window that is losing focus.
8890  *
8891  *  Availability:
8892  *    Mac OS X:         in version 10.5 and later in Carbon.framework
8893  *    CarbonLib:        not available
8894  }
8895 const
8896 	kEventWindowFocusLost = 205;
8897 
8898 {
8899  *  kEventClassWindow / kEventWindowFocusRestored
8900  *
8901  *  Summary:
8902  *    Notification that a window has regained focus due to a change in
8903  *    the modal focus stack.
8904  *
8905  *  Discussion:
8906  *    This event is sent to a window (window A) when the removal of
8907  *    another window (window B) from the modal focus stack causes
8908  *    window A to become the effective focus. Typically, window A is
8909  *    either the modeless focus (the window that was most recently
8910  *    passed to SetUserFocusWindow), or another window in the modal
8911  *    focus stack that was underneath window B, and is now topmost on
8912  *    the stack.
8913  *
8914  *    This event is sent to all handlers registered for it on the
8915  *    window. The basic window handler automatically sends this event
8916  *    to the focused view in the window. The basic view handler
8917  *    automatically invalidates a view when it receives this event.
8918  *
8919  *  Mac OS X threading:
8920  *    Not thread safe
8921  *
8922  *  Parameters:
8923  *
8924  *    --> kEventParamDirectObject (in, typeWindowRef)
8925  *          The window that is regaining focus.
8926  *
8927  *  Availability:
8928  *    Mac OS X:         in version 10.5 and later in Carbon.framework
8929  *    CarbonLib:        not available
8930  }
8931 const
8932 	kEventWindowFocusRestored = 206;
8933 
8934 {
8935  *  kEventClassWindow / kEventWindowFocusContent
8936  *
8937  *  Summary:
8938  *    A request to set the focus to the content area of a window.
8939  *
8940  *  Discussion:
8941  *    If the content area of your window is not already focused, you
8942  *    should set the focus to the main part/control/view of the window.
8943  *    If the content area of your window is already focused, do
8944  *    nothing. The standard window handler responds to this event by
8945  *    calling HIViewAdvanceFocus on the window�s root control, if the
8946  *    focus is not already contained within the content root.
8947  *
8948  *  Mac OS X threading:
8949  *    Not thread safe
8950  *
8951  *  Parameters:
8952  *
8953  *    --> kEventParamDirectObject (in, typeWindowRef)
8954  *          The window whose content should be focused.
8955  *
8956  *  Availability:
8957  *    Mac OS X:         in version 10.2 and later in Carbon.framework
8958  *    CarbonLib:        not available
8959  }
8960 const
8961 	kEventWindowFocusContent = 202;
8962 
8963 {
8964  *  kEventClassWindow / kEventWindowFocusToolbar
8965  *
8966  *  Summary:
8967  *    A request to set the focus to the toolbar of a window.
8968  *
8969  *  Discussion:
8970  *    If your window�s toolbar is not already focused, you should set
8971  *    the focus to the first item in the toolbar. If your window�s
8972  *    toolbar is already focused, do nothing. The basic window handler
8973  *    responds to this event by calling HIViewAdvanceFocus on the
8974  *    toolbar control, if the focus is not already contained within the
8975  *    toolbar.
8976  *
8977  *  Mac OS X threading:
8978  *    Not thread safe
8979  *
8980  *  Parameters:
8981  *
8982  *    --> kEventParamDirectObject (in, typeWindowRef)
8983  *          The window whose toolbar should be focused.
8984  *
8985  *  Availability:
8986  *    Mac OS X:         in version 10.2 and later in Carbon.framework
8987  *    CarbonLib:        not available
8988  }
8989 const
8990 	kEventWindowFocusToolbar = 203;
8991 
8992 {
8993  *  kEventClassWindow / kEventWindowFocusDrawer
8994  *
8995  *  Summary:
8996  *    A request to set the focus to the drawer of a window.
8997  *
8998  *  Discussion:
8999  *    If your window�s drawer is not already focused, you should set
9000  *    the focus to the first item in the drawer. If your window�s
9001  *    drawer is already focused, you should move the focus to the next
9002  *    or previous drawer, if any, depending on whether the modifiers
9003  *    parameter contains the shift key modifier. The basic window
9004  *    handler responds to this event by calling SetUserFocusWindow on,
9005  *    and sending a kEventWindowFocusContent event to, the appropriate
9006  *    drawer, if the focus is not already contained within the drawer.
9007  *
9008  *  Mac OS X threading:
9009  *    Not thread safe
9010  *
9011  *  Parameters:
9012  *
9013  *    --> kEventParamDirectObject (in, typeWindowRef)
9014  *          The window whose drawer should be focused.
9015  *
9016  *    --> kEventParamKeyModifiers (in, typeUInt32)
9017  *          The keyboard modifiers that were pressed when the user
9018  *          requested a focus switch.
9019  *
9020  *  Availability:
9021  *    Mac OS X:         in version 10.4 and later in Carbon.framework
9022  *    CarbonLib:        not available
9023  }
9024 const
9025 	kEventWindowFocusDrawer = 204;
9026 
9027 {
9028  *  kEventClassWindow / kEventWindowSheetOpening
9029  *
9030  *  Summary:
9031  *    Notification that a sheet is opening.
9032  *
9033  *  Discussion:
9034  *    This event is sent to all handlers registered for it. This event
9035  *    is sent to the sheet, its parent window, and the application
9036  *    target before the sheet begins opening.
9037  *
9038  *  Mac OS X threading:
9039  *    Not thread safe
9040  *
9041  *  Parameters:
9042  *
9043  *    --> kEventParamDirectObject (in, typeWindowRef)
9044  *          The sheet that is opening.
9045  *
9046  *  Result:
9047  *    An event handler for this event may return userCanceledErr if the
9048  *    sheet should not open. Any other return value is ignored and will
9049  *    still allow the sheet to open.
9050  *
9051  *  Availability:
9052  *    Mac OS X:         in version 10.4 and later in Carbon.framework
9053  *    CarbonLib:        not available
9054  }
9055 const
9056 	kEventWindowSheetOpening = 210;
9057 
9058 {
9059  *  kEventClassWindow / kEventWindowSheetOpened
9060  *
9061  *  Summary:
9062  *    Notification that a sheet is open.
9063  *
9064  *  Discussion:
9065  *    This event is sent to all handlers registered for it. This event
9066  *    is sent to the sheet, its parent window, and the application
9067  *    target after the sheet is fully open.
9068  *
9069  *  Mac OS X threading:
9070  *    Not thread safe
9071  *
9072  *  Parameters:
9073  *
9074  *    --> kEventParamDirectObject (in, typeWindowRef)
9075  *          The sheet that opened.
9076  *
9077  *  Availability:
9078  *    Mac OS X:         in version 10.4 and later in Carbon.framework
9079  *    CarbonLib:        not available
9080  }
9081 const
9082 	kEventWindowSheetOpened = 211;
9083 
9084 {
9085  *  kEventClassWindow / kEventWindowSheetClosing
9086  *
9087  *  Summary:
9088  *    Notification that a sheet is closing.
9089  *
9090  *  Discussion:
9091  *    This event is sent to all handlers registered for it. This event
9092  *    is sent to the sheet, its parent window, and the application
9093  *    target before the sheet begins closing.
9094  *
9095  *  Mac OS X threading:
9096  *    Not thread safe
9097  *
9098  *  Parameters:
9099  *
9100  *    --> kEventParamDirectObject (in, typeWindowRef)
9101  *          The sheet that is opening.
9102  *
9103  *  Result:
9104  *    An event handler for this event may return userCanceledErr if the
9105  *    sheet should not close. Any other return value is ignored and
9106  *    will still allow the sheet to close.
9107  *
9108  *  Availability:
9109  *    Mac OS X:         in version 10.4 and later in Carbon.framework
9110  *    CarbonLib:        not available
9111  }
9112 const
9113 	kEventWindowSheetClosing = 212;
9114 
9115 {
9116  *  kEventClassWindow / kEventWindowSheetClosed
9117  *
9118  *  Summary:
9119  *    Notification that a sheet is closed.
9120  *
9121  *  Discussion:
9122  *    This event is sent to all handlers registered for it. This event
9123  *    is sent to the sheet, its parent window, and the application
9124  *    target after the sheet is fully closed.
9125  *
9126  *  Mac OS X threading:
9127  *    Not thread safe
9128  *
9129  *  Parameters:
9130  *
9131  *    --> kEventParamDirectObject (in, typeWindowRef)
9132  *          The sheet that closed.
9133  *
9134  *  Availability:
9135  *    Mac OS X:         in version 10.4 and later in Carbon.framework
9136  *    CarbonLib:        not available
9137  }
9138 const
9139 	kEventWindowSheetClosed = 213;
9140 
9141 {
9142  *  kEventClassWindow / kEventWindowDrawerOpening
9143  *
9144  *  Summary:
9145  *    Notification that a drawer is opening.
9146  *
9147  *  Discussion:
9148  *    This event is sent to all handlers registered for it. This event
9149  *    is sent to the drawer, its parent window, and the application
9150  *    target before the drawer begins opening.
9151  *
9152  *  Mac OS X threading:
9153  *    Not thread safe
9154  *
9155  *  Parameters:
9156  *
9157  *    --> kEventParamDirectObject (in, typeWindowRef)
9158  *          The drawer that is opening.
9159  *
9160  *  Result:
9161  *    An event handler for this event may return userCanceledErr if the
9162  *    drawer should not open. Any other return value is ignored and
9163  *    will still allow the drawer to open.
9164  *
9165  *  Availability:
9166  *    Mac OS X:         in version 10.2 and later in Carbon.framework
9167  *    CarbonLib:        not available
9168  }
9169 const
9170 	kEventWindowDrawerOpening = 220;
9171 
9172 {
9173  *  kEventClassWindow / kEventWindowDrawerOpened
9174  *
9175  *  Summary:
9176  *    Notification that a drawer is open.
9177  *
9178  *  Discussion:
9179  *    This event is sent to all handlers registered for it. This event
9180  *    is sent to the drawer, its parent window, and the application
9181  *    target after the drawer is fully open.
9182  *
9183  *  Mac OS X threading:
9184  *    Not thread safe
9185  *
9186  *  Parameters:
9187  *
9188  *    --> kEventParamDirectObject (in, typeWindowRef)
9189  *          The drawer that opened.
9190  *
9191  *  Availability:
9192  *    Mac OS X:         in version 10.2 and later in Carbon.framework
9193  *    CarbonLib:        not available
9194  }
9195 const
9196 	kEventWindowDrawerOpened = 221;
9197 
9198 {
9199  *  kEventClassWindow / kEventWindowDrawerClosing
9200  *
9201  *  Summary:
9202  *    Notification that a drawer is closing.
9203  *
9204  *  Discussion:
9205  *    This event is sent to all handlers registered for it. This event
9206  *    is sent to the drawer, its parent window, and the application
9207  *    target before the drawer begins closing.
9208  *
9209  *  Mac OS X threading:
9210  *    Not thread safe
9211  *
9212  *  Parameters:
9213  *
9214  *    --> kEventParamDirectObject (in, typeWindowRef)
9215  *          The drawer that is opening.
9216  *
9217  *  Result:
9218  *    An event handler for this event may return userCanceledErr if the
9219  *    drawer should not close. Any other return value is ignored and
9220  *    will still allow the drawer to close.
9221  *
9222  *  Availability:
9223  *    Mac OS X:         in version 10.2 and later in Carbon.framework
9224  *    CarbonLib:        not available
9225  }
9226 const
9227 	kEventWindowDrawerClosing = 222;
9228 
9229 {
9230  *  kEventClassWindow / kEventWindowDrawerClosed
9231  *
9232  *  Summary:
9233  *    Notification that a drawer is closed.
9234  *
9235  *  Discussion:
9236  *    This event is sent to all handlers registered for it. This event
9237  *    is sent to the drawer, its parent window, and the application
9238  *    target after the drawer is fully closed.
9239  *
9240  *  Mac OS X threading:
9241  *    Not thread safe
9242  *
9243  *  Parameters:
9244  *
9245  *    --> kEventParamDirectObject (in, typeWindowRef)
9246  *          The drawer that closed.
9247  *
9248  *  Availability:
9249  *    Mac OS X:         in version 10.2 and later in Carbon.framework
9250  *    CarbonLib:        not available
9251  }
9252 const
9253 	kEventWindowDrawerClosed = 223;
9254 
9255 {
9256  *  kEventClassWindow / kEventWindowDrawFrame
9257  *
9258  *  Summary:
9259  *    Sent by the Window Manager when it�s time to draw a window�s
9260  *    structure.
9261  *
9262  *  Discussion:
9263  *    This is the replacement to the old wDraw defProc message (though
9264  *    it is a special case of the 0 part code indicating to draw the
9265  *    entire window frame).
9266  *
9267  *  Mac OS X threading:
9268  *    Not thread safe
9269  *
9270  *  Parameters:
9271  *
9272  *    --> kEventParamDirectObject (in, typeWindowRef)
9273  *          The window to draw.
9274  *
9275  *  Availability:
9276  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9277  *    CarbonLib:        in CarbonLib 1.1 and later
9278  }
9279 const
9280 	kEventWindowDrawFrame = 1000;
9281 
9282 {
9283  *  kEventClassWindow / kEventWindowDrawPart
9284  *
9285  *  Summary:
9286  *    Sent by the Window Manager when it�s time to draw a specific part
9287  *    of a window�s structure, such as the close button.
9288  *
9289  *  Discussion:
9290  *    This is typically sent during window widget tracking.
9291  *
9292  *  Mac OS X threading:
9293  *    Not thread safe
9294  *
9295  *  Parameters:
9296  *
9297  *    --> kEventParamDirectObject (in, typeWindowRef)
9298  *          The window to draw.
9299  *
9300  *    --> kEventParamWindowDefPart (in, typeWindowDefPartCode)
9301  *          The part to draw.
9302  *
9303  *  Availability:
9304  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9305  *    CarbonLib:        in CarbonLib 1.1 and later
9306  }
9307 const
9308 	kEventWindowDrawPart = 1001;
9309 
9310 {
9311  *  kEventClassWindow / kEventWindowGetRegion
9312  *
9313  *  Summary:
9314  *    Sent by the Window Manager when it needs to get a specific region
9315  *    from a window, or when the GetWindowRegion API is called.
9316  *
9317  *  Discussion:
9318  *    Note that the Window Manager caches a window's structure and
9319  *    content region once they have been calculated. If your window's
9320  *    structure or content region changes without the window size
9321  *    changing, you should use ReshapeCustomWindow to force the Window
9322  *    Manager to request the new structure and content regions.
9323  *
9324  *  Mac OS X threading:
9325  *    Not thread safe
9326  *
9327  *  Parameters:
9328  *
9329  *    --> kEventParamDirectObject (in, typeWindowRef)
9330  *          The window whose region to return.
9331  *
9332  *    --> kEventParamWindowRegionCode (in, typeWindowRegionCode)
9333  *          The region to return.
9334  *
9335  *    --> kEventParamWindowContentBounds (in, typeQDRectangle)
9336  *          The global bounds of the window's content area. Available
9337  *          in Mac OS X 10.1 and later. An event handler can use this
9338  *          parameter to calculate the requested region. Alternately, a
9339  *          handler can call GetWindowBounds( window,
9340  *          kWindowGlobalPortRgn ), and work from that rectangle.
9341  *
9342  *    --> kEventParamRgnHandle (in, typeQDRgnHandle)
9343  *          On entry, contains a valid but empty RgnHandle; you should
9344  *          place the window region in this RgnHandle.
9345  *
9346  *          The window region should be in either global coordinates or
9347  *          window coordinates, depending on whether the window uses a
9348  *          WindowDefProcPtr or HIView to draw its window frame. Prior
9349  *          to Mac OS X 10.2, all windows used WindowDefProcPtrs. In
9350  *          Mac OS X 10.2 and later, you can determine at runtime
9351  *          whether a particular window uses a WindowDefProcPtr-based
9352  *          window frame by calling HIViewGetKind on the window's root
9353  *          view (returned by HIViewGetRoot). If the kind field of the
9354  *          HIViewKind is 'cont', then the window uses a
9355  *          WindowDefProcPtr to draw its window frame; otherwise, the
9356  *          window uses an HIView.
9357  *
9358  *  Availability:
9359  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9360  *    CarbonLib:        in CarbonLib 1.1 and later
9361  }
9362 const
9363 	kEventWindowGetRegion = 1002;
9364 
9365 {
9366  *  kEventClassWindow / kEventWindowHitTest
9367  *
9368  *  Summary:
9369  *    Sent when the Window Manager needs to determine what part of a
9370  *    window would be 'hit' with a given mouse location in global
9371  *    coordinates.
9372  *
9373  *  Mac OS X threading:
9374  *    Not thread safe
9375  *
9376  *  Parameters:
9377  *
9378  *    --> kEventParamDirectObject (in, typeWindowRef)
9379  *          The window to hit-test.
9380  *
9381  *    --> kEventParamMouseLocation (in, typeQDPoint)
9382  *          The mouse location.
9383  *
9384  *    <-- kEventParamWindowDefPart (out, typeWindowDefPartCode)
9385  *          On exit, contains the window part that was hit.
9386  *
9387  *  Availability:
9388  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9389  *    CarbonLib:        in CarbonLib 1.1 and later
9390  }
9391 const
9392 	kEventWindowHitTest = 1003;
9393 
9394 {
9395  *  kEventClassWindow / kEventWindowInit
9396  *
9397  *  Summary:
9398  *    Sent by the Window Manager when the window is being created. This
9399  *    is a hook to allow your window definition to do any
9400  *    initialization you might need to do.
9401  *
9402  *  Discussion:
9403  *    This event can be sent more than once to a window if the window
9404  *    definition function for the window is changed; see the note under
9405  *    kEventWindowDispose.
9406  *
9407  *  Mac OS X threading:
9408  *    Not thread safe
9409  *
9410  *  Parameters:
9411  *
9412  *    --> kEventParamDirectObject (in, typeWindowRef)
9413  *          The window being created.
9414  *
9415  *    <-- kEventParamWindowFeatures (out, typeUInt32)
9416  *          On exit, your event handler should store the window
9417  *          features in this parameter.
9418  *
9419  *  Availability:
9420  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9421  *    CarbonLib:        in CarbonLib 1.1 and later
9422  }
9423 const
9424 	kEventWindowInit = 1004;
9425 
9426 {
9427  *  kEventClassWindow / kEventWindowDispose
9428  *
9429  *  Summary:
9430  *    Sent by the Window Manager to notify the window definition that
9431  *    it should dispose of any private data structures attached to the
9432  *    window.
9433  *
9434  *  Discussion:
9435  *    Note that this event does not directly correspond with
9436  *    destruction of the window; the Window Manager occasionally needs
9437  *    to change the window definition of a window (for example, when
9438  *    ChangeWindowAttributes is used to change the visual appearance of
9439  *    a window), and in that case, the window will receive a
9440  *    kEventWindowDispose followed by a kEventWindowInit so that the
9441  *    old and new window definitions can disconnect and connect to the
9442  *    window. If you need to know when a window is really being
9443  *    destroyed, install a handler for kEventWindowClosed.
9444  *
9445  *  Mac OS X threading:
9446  *    Not thread safe
9447  *
9448  *  Parameters:
9449  *
9450  *    --> kEventParamDirectObject (in, typeWindowRef)
9451  *          The window being destroyed.
9452  *
9453  *  Availability:
9454  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9455  *    CarbonLib:        in CarbonLib 1.1 and later
9456  }
9457 const
9458 	kEventWindowDispose = 1005;
9459 
9460 {
9461  *  kEventClassWindow / kEventWindowDragHilite
9462  *
9463  *  Summary:
9464  *    Sent by the Window Manager when it is time to draw/erase any drag
9465  *    hilite in the window structure.
9466  *
9467  *  Discussion:
9468  *    This is typically sent from within HiliteWindowFrameForDrag.
9469  *
9470  *  Mac OS X threading:
9471  *    Not thread safe
9472  *
9473  *  Parameters:
9474  *
9475  *    --> kEventParamDirectObject (in, typeWindowRef)
9476  *          The window being hilited.
9477  *
9478  *    --> kEventParamWindowDragHiliteFlag (in, typeBoolean)
9479  *          Whether to draw (true) or erase (false) the hilite.
9480  *
9481  *  Availability:
9482  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9483  *    CarbonLib:        in CarbonLib 1.1 and later
9484  }
9485 const
9486 	kEventWindowDragHilite = 1006;
9487 
9488 {
9489  *  kEventClassWindow / kEventWindowModified
9490  *
9491  *  Summary:
9492  *    Sent by the Window Manager when it is time to redraw window
9493  *    structure to account for a change in the document modified state.
9494  *
9495  *  Discussion:
9496  *    This is typically sent from within SetWindowModified.
9497  *
9498  *  Mac OS X threading:
9499  *    Not thread safe
9500  *
9501  *  Parameters:
9502  *
9503  *    --> kEventParamDirectObject (in, typeWindowRef)
9504  *          The window that was modified.
9505  *
9506  *    --> kEventParamWindowModifiedFlag (in, typeBoolean)
9507  *          The new modified state.
9508  *
9509  *  Availability:
9510  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9511  *    CarbonLib:        in CarbonLib 1.1 and later
9512  }
9513 const
9514 	kEventWindowModified = 1007;
9515 
9516 {
9517  *  kEventClassWindow / kEventWindowSetupProxyDragImage
9518  *
9519  *  Summary:
9520  *    Sent by the Window Manager when it is time to generate a drag
9521  *    image for the window proxy.
9522  *
9523  *  Discussion:
9524  *    This is typically sent from within BeginWindowProxyDrag.
9525  *
9526  *  Mac OS X threading:
9527  *    Not thread safe
9528  *
9529  *  Parameters:
9530  *
9531  *    --> kEventParamDirectObject (in, typeWindowRef)
9532  *          The window whose proxy is being dragged.
9533  *
9534  *    <-- kEventParamWindowProxyGWorldPtr (out, typeGWorldPtr)
9535  *          On exit, contains a GWorld you allocate which contains the
9536  *          drag image. This parameter is required on Mac OS X 10.0 and
9537  *          Mac OS X 10.1. On Mac OS X 10.2 and later, you may
9538  *          optionally omit this parameter and instead provide a drag
9539  *          image using a CGImageRef stored in the
9540  *          kEventParamCGImageRef parameter. If both parameters are
9541  *          provided, the contents of kEventParamCGImageRef will
9542  *          override this parameter. If this parameter is provided, the
9543  *          toolbox will free the GWorld inside EndWindowProxyDrag.
9544  *
9545  *    <-- kEventParamCGImageRef (out, typeCGImageRef)
9546  *          On exit, contains a CGImageRef you allocate which contains
9547  *          the drag image. This parameter is supported on Mac OS X
9548  *          10.2 and later. You may optionally omit this parameter and
9549  *          instead provide a drag image using a GWorld stored in the
9550  *          kEventParamWindowProxyGWorldPtr parameter. If both
9551  *          parameters are provided, this parameter will override the
9552  *          contents of kEventParamWindowProxyGWorldPtr. If this
9553  *          parameter is provided, the toolbox will free the CGImageRef
9554  *          inside EndWindowProxyDrag.
9555  *
9556  *    --> kEventParamWindowProxyImageRgn (in, typeQDRgnHandle)
9557  *          The region you modify to contain the clip region for the
9558  *          GWorld.
9559  *
9560  *    --> kEventParamWindowProxyOutlineRgn (in, typeQDRgnHandle)
9561  *          The region you modify to contain the drag outline used when
9562  *          the GWorld cannot be used.
9563  *
9564  *  Availability:
9565  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9566  *    CarbonLib:        in CarbonLib 1.1 and later
9567  }
9568 const
9569 	kEventWindowSetupProxyDragImage = 1008;
9570 
9571 {
9572  *  kEventClassWindow / kEventWindowStateChanged
9573  *
9574  *  Summary:
9575  *    Sent by the Window Manager when a particular window state changes.
9576  *
9577  *  Discussion:
9578  *    See the state-change flags in MacWindows.h.
9579  *
9580  *  Mac OS X threading:
9581  *    Not thread safe
9582  *
9583  *  Parameters:
9584  *
9585  *    --> kEventParamDirectObject (in, typeWindowRef)
9586  *          The window whose state was changed.
9587  *
9588  *    --> kEventParamWindowStateChangedFlags (in, typeUInt32)
9589  *          The state change flags
9590  *
9591  *  Availability:
9592  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9593  *    CarbonLib:        in CarbonLib 1.1 and later
9594  }
9595 const
9596 	kEventWindowStateChanged = 1009;
9597 
9598 {
9599  *  kEventClassWindow / kEventWindowMeasureTitle
9600  *
9601  *  Summary:
9602  *    Sent when the Window Manager needs to know how much space the
9603  *    window�s title area takes up.
9604  *
9605  *  Mac OS X threading:
9606  *    Not thread safe
9607  *
9608  *  Parameters:
9609  *
9610  *    --> kEventParamDirectObject (in, typeWindowRef)
9611  *          The window whose title to measure.
9612  *
9613  *    <-- kEventParamWindowTitleFullWidth (out, typeSInt16)
9614  *          On exit, contains the length of the whole title area.
9615  *
9616  *    <-- kEventParamWindowTitleTextWidth (out, typeSInt16)
9617  *          On exit, contains the length just the title text.
9618  *
9619  *  Availability:
9620  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9621  *    CarbonLib:        in CarbonLib 1.1 and later
9622  }
9623 const
9624 	kEventWindowMeasureTitle = 1010;
9625 
9626 {
9627  *  kEventClassWindow / kEventWindowDrawGrowBox
9628  *
9629  *  Summary:
9630  *    When the DrawGrowIcon API is called, this event is sent to the
9631  *    window to tell it to draw the grow box.
9632  *
9633  *  Discussion:
9634  *    This is a compatibility event harkening back to the old days
9635  *    before Mac OS 8. Not very useful these days. This is only really
9636  *    needed for windows that do not have the grow box integrated into
9637  *    the window frame. Scroll bar delimiter lines are also drawn.
9638  *
9639  *  Mac OS X threading:
9640  *    Not thread safe
9641  *
9642  *  Parameters:
9643  *
9644  *    --> kEventParamDirectObject (in, typeWindowRef)
9645  *          The window whose grow box to draw.
9646  *
9647  *  Availability:
9648  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9649  *    CarbonLib:        in CarbonLib 1.1 and later
9650  }
9651 const
9652 	kEventWindowDrawGrowBox = 1011;
9653 
9654 {
9655  *  kEventClassWindow / kEventWindowGetGrowImageRegion
9656  *
9657  *  Summary:
9658  *    This is a special way for a window to override the standard
9659  *    resize outline for windows that do not do live resizing.
9660  *
9661  *  Discussion:
9662  *    As the user resizes the window, this event is sent with the
9663  *    current size the user has chosen expressed as a rectangle. You
9664  *    should calculate your window outline and modify the
9665  *    kEventParamRgnHandle parameter to reflect your desired outline.
9666  *
9667  *  Mac OS X threading:
9668  *    Not thread safe
9669  *
9670  *  Parameters:
9671  *
9672  *    --> kEventParamDirectObject (in, typeWindowRef)
9673  *          The window whose grow image to return.
9674  *
9675  *    --> kEventParamWindowGrowRect (in, typeQDRectangle)
9676  *          The window�s global port bounds.
9677  *
9678  *    --> kEventParamRgnHandle (in, typeQDRgnHandle)
9679  *          The region to modify.
9680  *
9681  *  Availability:
9682  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9683  *    CarbonLib:        in CarbonLib 1.1 and later
9684  }
9685 const
9686 	kEventWindowGetGrowImageRegion = 1012;
9687 
9688 {
9689  *  kEventClassWindow / kEventWindowPaint
9690  *
9691  *  Summary:
9692  *    When the Window Manager needs to paint a window (e.g, when a
9693  *    window is first displayed), the kEventWindowPaint event is sent
9694  *    to allow the window to control all aspect of painting, including
9695  *    the window frame.
9696  *
9697  *  Discussion:
9698  *    If a window does not respond to this event, the Window Manager
9699  *    ends up sending kEventWindowDrawFrame and then erasing the window
9700  *    to the window content color as usual. This is mostly used for
9701  *    specialty windows, such as help tags or appliance apps might have.
9702  *
9703  *  Mac OS X threading:
9704  *    Not thread safe
9705  *
9706  *  Parameters:
9707  *
9708  *    --> kEventParamDirectObject (in, typeWindowRef)
9709  *          The window to paint.
9710  *
9711  *  Availability:
9712  *    Mac OS X:         in version 10.0 and later in Carbon.framework
9713  *    CarbonLib:        not available
9714  }
9715 const
9716 	kEventWindowPaint = 1013;
9717 
9718 {
9719  *  kEventClassWindow / kEventWindowAttributesChanged
9720  *
9721  *  Summary:
9722  *    Sent by the Window Manager when a window�s attributes have
9723  *    changed.
9724  *
9725  *  Discussion:
9726  *    This event is only sent to windows that use an HIView-based
9727  *    window frame. It is not sent to windows that use a WDEF-based
9728  *    window frame. At the time that the event is sent, the window's
9729  *    attributes have already been changed, so an event hander for this
9730  *    event can simply call GetWindowAttributes to get the new
9731  *    attributes. This event is sent to all handlers registered for it
9732  *    on the window event target. It does not propagate past the window.
9733  *
9734  *  Mac OS X threading:
9735  *    Not thread safe
9736  *
9737  *  Parameters:
9738  *
9739  *    --> kEventParamDirectObject (in, typeWindowRef)
9740  *          The window whose attributes have changed.
9741  *
9742  *  Availability:
9743  *    Mac OS X:         in version 10.2 and later in Carbon.framework
9744  *    CarbonLib:        not available
9745  }
9746 const
9747 	kEventWindowAttributesChanged = 1019;
9748 
9749 {
9750  *  kEventClassWindow / kEventWindowTitleChanged
9751  *
9752  *  Summary:
9753  *    Sent by the Window Manager when a window�s title changes.
9754  *
9755  *  Discussion:
9756  *    In Mac OS X 10.2 through 10.4, this event is only sent to windows
9757  *    that use an HIView to draw their window frames. Windows that use
9758  *    a WDEF to draw their frames do not receive this event on those
9759  *    versions of Mac OS X. In Mac OS X 10.5 and later, this event is
9760  *    always sent when a window�s title changes, regardless of whether
9761  *    the window uses an HIView or WDEF to draw its frame. This event
9762  *    is sent to all handlers registered for it on the window event
9763  *    target. It does not propagate past the window.
9764  *
9765  *  Mac OS X threading:
9766  *    Not thread safe
9767  *
9768  *  Parameters:
9769  *
9770  *    --> kEventParamDirectObject (in, typeWindowRef)
9771  *          The window whose title was changed.
9772  *
9773  *  Availability:
9774  *    Mac OS X:         in version 10.2 and later in Carbon.framework
9775  *    CarbonLib:        not available
9776  }
9777 const
9778 	kEventWindowTitleChanged = 1020;
9779 
9780 
9781 {
9782  *  kEventClassWindow / kEventWindowGetFullScreenContentSize
9783  *
9784  *  Summary:
9785  *    Allows a window to customize its fullscreen size.
9786  *
9787  *  Discussion:
9788  *    Sent to a window prior to that window entering fullscreen. A
9789  *    default fullscreen content size will already be present in the
9790  *    kEventParamDimensions parameter. A handler may override this
9791  *    value with a custom content size. The window's actual fullscreen
9792  *    size is subject to various constraints HIToolbox might impose due
9793  *    to screen limitations or other reasons, so the window must be
9794  *    prepared for the window to be resized to a size different than
9795  *    the one specified via this event.
9796  *
9797  *  Mac OS X threading:
9798  *    Not thread safe
9799  *
9800  *  Parameters:
9801  *
9802  *    --> kEventParamDirectObject (in, typeWindowRef)
9803  *          The window whose fullscreen content size is being fetched.
9804  *
9805  *    --> kEventParamDimensions (in, typeHISize)
9806  *          On entry, the window's proposed fullscreen content size; on
9807  *          exit, the fullscreen content size that is desired by the
9808  *          event handler.
9809  *
9810  *  Availability:
9811  *    Mac OS X:         in version 10.7 and later in Carbon.framework
9812  *    CarbonLib:        not available
9813  }
9814 const
9815 	kEventWindowGetFullScreenContentSize = 240;
9816 
9817 {
9818  *  kEventClassWindow / kEventWindowFullScreenEnterStarted
9819  *
9820  *  Summary:
9821  *    Notification sent to a window prior to starting its enter
9822  *    fullscreen animation.
9823  *
9824  *  Mac OS X threading:
9825  *    Not thread safe
9826  *
9827  *  Parameters:
9828  *
9829  *    --> kEventParamDirectObject (in, typeWindowRef)
9830  *          The window about to enter fullscreen.
9831  *
9832  *  Availability:
9833  *    Mac OS X:         in version 10.7 and later in Carbon.framework
9834  *    CarbonLib:        not available
9835  }
9836 const
9837 	kEventWindowFullScreenEnterStarted = 241;
9838 
9839 {
9840  *  kEventClassWindow / kEventWindowFullScreenEnterCompleted
9841  *
9842  *  Summary:
9843  *    Notification sent to a window after finishing its enter
9844  *    fullscreen animation.
9845  *
9846  *  Mac OS X threading:
9847  *    Not thread safe
9848  *
9849  *  Parameters:
9850  *
9851  *    --> kEventParamDirectObject (in, typeWindowRef)
9852  *          The window that just entered fullscreen.
9853  *
9854  *  Availability:
9855  *    Mac OS X:         in version 10.7 and later in Carbon.framework
9856  *    CarbonLib:        not available
9857  }
9858 const
9859 	kEventWindowFullScreenEnterCompleted = 242;
9860 
9861 {
9862  *  kEventClassWindow / kEventWindowFullScreenExitStarted
9863  *
9864  *  Summary:
9865  *    Notification sent to a window prior to starting its exit
9866  *    fullscreen animation.
9867  *
9868  *  Mac OS X threading:
9869  *    Not thread safe
9870  *
9871  *  Parameters:
9872  *
9873  *    --> kEventParamDirectObject (in, typeWindowRef)
9874  *          The window about to exit fullscreen.
9875  *
9876  *  Availability:
9877  *    Mac OS X:         in version 10.7 and later in Carbon.framework
9878  *    CarbonLib:        not available
9879  }
9880 const
9881 	kEventWindowFullScreenExitStarted = 243;
9882 
9883 {
9884  *  kEventClassWindow / kEventWindowFullScreenExitCompleted
9885  *
9886  *  Summary:
9887  *    Notification sent to a window after finishing its exit fullscreen
9888  *    animation OR after failing to enter fullscreen.
9889  *
9890  *  Discussion:
9891  *    In addition to the normal case of a fullscreen window that
9892  *    animates out of fullscreen, this event is also sent if there's a
9893  *    failure when attempting to enter full screen. That is, it's
9894  *    possible for a window to receive this event very soon after
9895  *    kEventWindowFullScreenEnterStarted, and a handler should be
9896  *    prepared to deal with this possibility.
9897  *
9898  *  Mac OS X threading:
9899  *    Not thread safe
9900  *
9901  *  Parameters:
9902  *
9903  *    --> kEventParamDirectObject (in, typeWindowRef)
9904  *          The window that just exited fullscreen.
9905  *
9906  *  Availability:
9907  *    Mac OS X:         in version 10.7 and later in Carbon.framework
9908  *    CarbonLib:        not available
9909  }
9910 const
9911 	kEventWindowFullScreenExitCompleted = 244;
9912 
9913 {--------------------------------------------------------------------------------------}
9914 {  Menu Events                                                                         }
9915 {--------------------------------------------------------------------------------------}
9916 {
9917     kEventClassMenu quick reference:
9918 
9919     kEventMenuBeginTracking         = 1,
9920     kEventMenuEndTracking           = 2,
9921     kEventMenuChangeTrackingMode    = 3,
9922     kEventMenuOpening               = 4,
9923     kEventMenuClosed                = 5,
9924     kEventMenuTargetItem            = 6,
9925     kEventMenuMatchKey              = 7,
9926     kEventMenuEnableItems           = 8,
9927     kEventMenuPopulate              = 9,
9928 
9929     kEventMenuMeasureItemWidth      = 100,
9930     kEventMenuMeasureItemHeight     = 101,
9931     kEventMenuDrawItem              = 102,
9932     kEventMenuDrawItemContent       = 103,
9933 
9934     kEventMenuDispose               = 1001,
9935     kEventMenuCalculateSize         = 1004,
9936 
9937     -- menu content view events --
9938 
9939     kEventMenuCreateFrameView       = 1005,
9940     kEventMenuGetFrameBounds        = 1006,
9941     kEventMenuBecomeScrollable      = 1007,
9942     kEventMenuCeaseToBeScrollable   = 1008,
9943 
9944     -- menu bar visibility events --
9945 
9946     kEventMenuBarShown              = 2000,
9947     kEventMenuBarHidden             = 2001
9948 }
9949 
9950 {
9951  *  Menu context location flags
9952  *
9953  *  Discussion:
9954  *    Menu context location flags indicate the location of a menu in a
9955  *    menu-related Carbon event.
9956  }
9957 const
9958 {
9959    * Indicates that this menu is inserted in the menubar, or is a
9960    * (directly or indirectly) a submenu of a menu that is inserted in
9961    * the menubar. If this flag is not set, the menu is a popup menu or
9962    * submenu of a popup.
9963    }
9964 	kMenuContextMenuBar = 1 shl 0;
9965 
9966 
9967 {
9968  *  Menu context type flags
9969  *
9970  *  Discussion:
9971  *    Menu context type flags indicate the type of a menu in a
9972  *    menu-related Carbon event.
9973  }
9974 const
9975 {
9976    * Indicates that this menu is a pull-down menu inserted in the
9977    * menubar.
9978    }
9979 	kMenuContextPullDown = 1 shl 8;
9980 
9981   {
9982    * Indicates that this menu is a popup menu being displayed by
9983    * PopUpMenuSelect.
9984    }
9985 	kMenuContextPopUp = 1 shl 9;
9986 
9987   {
9988    * Indicates that this menu is a submenu of some other pull-down or
9989    * popup menu.
9990    }
9991 	kMenuContextSubmenu = 1 shl 10;
9992 
9993 
9994 {
9995  *  Menu context usage flags
9996  *
9997  *  Discussion:
9998  *    Menu context usage flags indicate the reason why a menu-related
9999  *    Carbon event is being sent.
10000  }
10001 const
10002 {
10003    * Indicates that this Carbon event has been sent during a menubar
10004    * tracking session.
10005    }
10006 	kMenuContextMenuBarTracking = 1 shl 16;
10007 
10008   {
10009    * Indicates that this Carbon event has been sent during a popup menu
10010    * tracking session. In Mac OS X 10.6 and later,
10011    * kMenuContextContextualMenu may also be set if the popup menu is a
10012    * contextual menu.
10013    }
10014 	kMenuContextPopUpTracking = 1 shl 17;
10015 
10016   {
10017    * Indicates that this Carbon event has been sent during command key
10018    * matching. When this context flag is set, an event handler only
10019    * needs to update the command keys and enable state of its menu
10020    * items; it does not need to update menu item text or icons.
10021    }
10022 	kMenuContextKeyMatching = 1 shl 18;
10023 
10024   {
10025    * Indicates that this Carbon event has been sent at idle time to
10026    * update the enabled state of the menus. Available on Mac OS X 10.1
10027    * and later, and in CarbonLib 1.5 and later; on earlier releases,
10028    * the kMenuContextKeyMatching flag is set when an event is sent
10029    * during menu enabling.
10030    }
10031 	kMenuContextMenuEnabling = 1 shl 19;
10032 
10033   {
10034    * Indicates that this Carbon event has been sent during during a
10035    * search for a menu item command ID by the
10036    * CountMenuItemsWithCommandID or GetIndMenuItemWithCommandID APIs.
10037    * When this context flag is set, an event handler only needs to
10038    * update the command IDs of its menu items; it does not need to
10039    * update menu item text, command keys, icons, or enable state.
10040    * Available on Mac OS X 10.2 and CarbonLib 1.6.
10041    }
10042 	kMenuContextCommandIDSearch = 1 shl 20;
10043 
10044   {
10045    * Indicates that this Carbon event has been sent prior to inspection
10046    * of the menu contents. When this context flag is set, the menu is
10047    * not going to be displayed. Typically, this context flag is used
10048    * when a menu is inspected by the accessibility API or by the
10049    * Spotlight Help system. When this context flag is set, an event
10050    * handler may check the menu context content-update flags to
10051    * determine if any menu item content does not need to be updated.
10052    * Available on Mac OS X 10.5 and later.
10053    }
10054 	kMenuContextInspection = 1 shl 22;
10055 
10056   {
10057    * Indicates that this Carbon event has been sent during display of a
10058    * contextual menu. When this flag is set, the
10059    * kMenuContextPopUpTracking flag will also be set (since contextual
10060    * menus are always also popup menus). Available in Mac OS X 10.6 and
10061    * later.
10062    }
10063 	kMenuContextContextualMenu = 1 shl 23;
10064 
10065 
10066 {
10067  *  Menu context content-update flags
10068  *
10069  *  Discussion:
10070  *    Menu context content-update flags indicate which parts of a
10071  *    menu's content do not need to be updated in response to a
10072  *    menu-related Carbon event. A Carbon event handler may use these
10073  *    flags to avoid unnecessary work and optimize its handling of the
10074  *    event. If a flag is not set, the event handler should generally
10075  *    update the relevant state unless it knows from other menu context
10076  *    flags that updating certain state is unnecessary (see comments
10077  *    for menu context usage flags about which state can be ignored for
10078  *    certain usages). These flags are available on Mac OS X 10.5 and
10079  *    later.
10080  }
10081 const
10082 {
10083    * Indicates that the sender of the Carbon event does not need the
10084    * menu item text to be updated.
10085    }
10086 	kMenuContextDontUpdateText = 1 shl 24;
10087 
10088   {
10089    * Indicates that the sender of the Carbon event does not need the
10090    * menu item command key to be updated.
10091    }
10092 	kMenuContextDontUpdateKey = 1 shl 25;
10093 
10094   {
10095    * Indicates that the sender of the Carbon event does not need the
10096    * menu item icon to be updated.
10097    }
10098 	kMenuContextDontUpdateIcon = 1 shl 26;
10099 
10100   {
10101    * Indicates that the sender of the Carbon event does not need the
10102    * menu item to be properly enabled or disabled.
10103    }
10104 	kMenuContextDontUpdateEnabled = 1 shl 27;
10105 
10106 
10107 {
10108  *  Summary:
10109  *    Menu direction
10110  }
10111 const
10112 {
10113    * Indicates that the menu should be placed to the right of its
10114    * parent.
10115    }
10116 	kHIMenuRightDirection = 0;
10117 
10118   {
10119    * Indicates that the menu should be placed to the left of its parent.
10120    }
10121 	kHIMenuLeftDirection = 1;
10122 
10123   {
10124    * Indicates that the menu should be centered on its parent.
10125    }
10126 	kHIMenuCenterDirection = 2;
10127 
10128 {
10129  *  kEventClassMenu / kEventMenuBeginTracking
10130  *
10131  *  Summary:
10132  *    The user has begun tracking the menubar or a pop-up menu.
10133  *
10134  *  Discussion:
10135  *    This event is sent to all handlers registered for it. It is sent
10136  *    first to the menu specified in the direct object parameter, if
10137  *    any, and then to the user focus target.
10138  *
10139  *  Mac OS X threading:
10140  *    Not thread safe
10141  *
10142  *  Parameters:
10143  *
10144  *    --> kEventParamDirectObject (in, typeMenuRef)
10145  *          The root of the menu hierarchy being tracked. If tracking a
10146  *          popup menu, this parameter is the popup; if tracking the
10147  *          menubar, this parameter is the root menu on Mac OS X, but
10148  *          is NULL in CarbonLib.
10149  *
10150  *    --> kEventParamCurrentMenuTrackingMode (in, typeMenuTrackingMode)
10151  *          Indicates whether the user is tracking the menus using the
10152  *          mouse or the keyboard. Contains either
10153  *          kMenuTrackingModeMouse or kMenuTrackingModeKeyboard.
10154  *
10155  *    --> kEventParamMenuContext (in, typeUInt32)
10156  *          Menu context flags indicating what type of menu is being
10157  *          tracked. This parameter is available on Mac OS X 10.1 and
10158  *          later, and CarbonLib 1.5 and later.
10159  *
10160  *  Result:
10161  *    The handler may return userCanceledErr to stop menu tracking.
10162  *
10163  *  Availability:
10164  *    Mac OS X:         in version 10.0 and later in Carbon.framework
10165  *    CarbonLib:        in CarbonLib 1.1 and later
10166  }
10167 const
10168 	kEventMenuBeginTracking = 1;
10169 
10170 {
10171  *  kEventClassMenu / kEventMenuEndTracking
10172  *
10173  *  Summary:
10174  *    The user has finished tracking the menubar or a popup menu
10175  *
10176  *  Discussion:
10177  *    This event is sent to all handlers registered for it. It is sent
10178  *    first to the menu specified in the direct object parameter, if
10179  *    any, and then to the user focus target.
10180  *
10181  *    In Mac OS X 10.3 and later, when a menu tracking session ends,
10182  *    the Menu Manager now sends kEventMenuEndTracking to every menu
10183  *    that was opened during the session, in addition to the root menu.
10184  *    This is done to allow menus with dynamic content to remove that
10185  *    content at the end of menu tracking; for example, a menu
10186  *    containing many IconRefs might wish to load the IconRefs
10187  *    dynamically in response to a kEventMenuPopulate, and remove them
10188  *    in response to kEventMenuEndTracking, to avoid the memory
10189  *    overhead of keeping the IconRef data in memory while the menu is
10190  *    not being displayed.
10191  *
10192  *  Mac OS X threading:
10193  *    Not thread safe
10194  *
10195  *  Parameters:
10196  *
10197  *    --> kEventParamDirectObject (in, typeMenuRef)
10198  *          The root of the menu hierarchy being tracked. If tracking a
10199  *          popup menu, this parameter is the popup; if tracking the
10200  *          menubar, this parameter is the root menu on Mac OS X, but
10201  *          is NULL in CarbonLib.
10202  *
10203  *    --> kEventParamMenuContext (in, typeUInt32)
10204  *          Menu context flags indicating what type of menu was being
10205  *          tracked. This parameter is available on Mac OS X 10.1 and
10206  *          later, and CarbonLib 1.5 and later.
10207  *
10208  *    --> kEventParamMenuDismissed (in, typeUInt32)
10209  *          Contains an indication of why menu tracking ended; this
10210  *          will be one of the kHIMenuDismissedBy constants in Menus.h.
10211  *          This parameter is available on Mac OS X 10.3 and later.
10212  *
10213  *    --> kEventParamEventRef (in, typeEventRef)
10214  *          Contains the event that caused the menu tracking session to
10215  *          end (typically, a keyboard or mouse event, but potentially
10216  *          other events as well). This parameter is available in Mac
10217  *          OS X 10.5 and later, but is not guaranteed to be present in
10218  *          all cases; check your return value from GetEventParameter,
10219  *          and do not assume that the parameter is always available.
10220  *
10221  *  Availability:
10222  *    Mac OS X:         in version 10.0 and later in Carbon.framework
10223  *    CarbonLib:        in CarbonLib 1.1 and later
10224  }
10225 const
10226 	kEventMenuEndTracking = 2;
10227 
10228 {
10229  *  kEventClassMenu / kEventMenuChangeTrackingMode
10230  *
10231  *  Summary:
10232  *    The user has switched from selecting a menu with the mouse to
10233  *    selecting with the keyboard, or from selecting with the keyboard
10234  *    to selecting with the mouse.
10235  *
10236  *  Discussion:
10237  *    This event is sent to all handlers registered for it. It is sent
10238  *    first to the menu specified in the direct object parameter, and
10239  *    then to the user focus target.
10240  *
10241  *  Mac OS X threading:
10242  *    Not thread safe
10243  *
10244  *  Parameters:
10245  *
10246  *    --> kEventParamDirectObject (in, typeMenuRef)
10247  *          The root of the menu hierarchy being tracked. If tracking a
10248  *          popup menu, this parameter is the popup; if tracking the
10249  *          menubar, this parameter is the root menu.
10250  *
10251  *    --> kEventParamCurrentMenuTrackingMode (in, typeMenuTrackingMode)
10252  *          Indicates whether the user was previously tracking the
10253  *          menus using the mouse or the keyboard. Contains either
10254  *          kMenuTrackingModeMouse or kMenuTrackingModeKeyboard.
10255  *
10256  *    --> kEventParamNewMenuTrackingMode (in, typeMenuTrackingMode)
10257  *          Indicates whether the user is now tracking the menus using
10258  *          the mouse or the keyboard. Contains either
10259  *          kMenuTrackingModeMouse or kMenuTrackingModeKeyboard.
10260  *
10261  *    --> kEventParamMenuContext (in, typeUInt32)
10262  *          Menu context flags indicating what type of menu is being
10263  *          tracked.
10264  *
10265  *  Availability:
10266  *    Mac OS X:         in version 10.1 and later in Carbon.framework
10267  *    CarbonLib:        not available
10268  }
10269 const
10270 	kEventMenuChangeTrackingMode = 3;
10271 
10272 {
10273  *  kEventClassMenu / kEventMenuOpening
10274  *
10275  *  Summary:
10276  *    A menu is opening.
10277  *
10278  *  Discussion:
10279  *    This event is sent to all handlers registered for it. It is sent
10280  *    each time that the menu is opened (i.e., more than once during a
10281  *    given tracking session if the user opens the menu multiple
10282  *    times). It is sent before the menu is actually drawn, so you can
10283  *    update the menu contents (including making changes that will
10284  *    alter the menu size) and the new contents will be drawn correctly.
10285  *
10286  *  Mac OS X threading:
10287  *    Not thread safe
10288  *
10289  *  Parameters:
10290  *
10291  *    --> kEventParamDirectObject (in, typeMenuRef)
10292  *          The menu being opened.
10293  *
10294  *    --> kEventParamMenuFirstOpen (in, typeBoolean)
10295  *          Whether this is the first time this menu has been opened
10296  *          during this menu tracking session.
10297  *
10298  *    --> kEventParamMenuContext (in, typeUInt32)
10299  *          The context in which this menu is opening. Available on Mac
10300  *          OS X and CarbonLib 1.5 and later.
10301  *
10302  *  Result:
10303  *    On Mac OS X, the handler may return userCanceledErr to prevent
10304  *    this menu from opening
10305  *
10306  *  Availability:
10307  *    Mac OS X:         in version 10.0 and later in Carbon.framework
10308  *    CarbonLib:        in CarbonLib 1.1 and later
10309  }
10310 const
10311 	kEventMenuOpening = 4;
10312 
10313 {
10314  *  kEventClassMenu / kEventMenuClosed
10315  *
10316  *  Summary:
10317  *    A menu has been closed.
10318  *
10319  *  Discussion:
10320  *    This event is sent to all handlers registered for it. It is sent
10321  *    after the menu is hidden.
10322  *
10323  *  Mac OS X threading:
10324  *    Not thread safe
10325  *
10326  *  Parameters:
10327  *
10328  *    --> kEventParamDirectObject (in, typeMenuRef)
10329  *          The menu being closed.
10330  *
10331  *    --> kEventParamMenuContext (in, typeUInt32)
10332  *          The context in which this menu is closing. Available on Mac
10333  *          OS X 10.1 and later, and CarbonLib 1.5 and later.
10334  *
10335  *  Availability:
10336  *    Mac OS X:         in version 10.0 and later in Carbon.framework
10337  *    CarbonLib:        in CarbonLib 1.1 and later
10338  }
10339 const
10340 	kEventMenuClosed = 5;
10341 
10342 {
10343  *  kEventClassMenu / kEventMenuTargetItem
10344  *
10345  *  Summary:
10346  *    The mouse is moving over a particular menu item.
10347  *
10348  *  Discussion:
10349  *    This event is sent to all handlers registered for it. It is sent
10350  *    for both enabled and disabled items.
10351  *
10352  *  Mac OS X threading:
10353  *    Not thread safe
10354  *
10355  *  Parameters:
10356  *
10357  *    --> kEventParamDirectObject (in, typeMenuRef)
10358  *          The menu being tracked.
10359  *
10360  *    --> kEventParamMenuItemIndex (in, typeMenuItemIndex)
10361  *          The menu item under the mouse.
10362  *
10363  *    --> kEventParamMenuCommand (in, typeMenuCommand)
10364  *          The command ID associated with this menu item.
10365  *
10366  *    --> kEventParamMenuContext (in, typeUInt32)
10367  *          The context in which this menu being tracked. Available on
10368  *          Mac OS X 10.1 and later, and CarbonLib 1.5 and later.
10369  *
10370  *  Availability:
10371  *    Mac OS X:         in version 10.0 and later in Carbon.framework
10372  *    CarbonLib:        in CarbonLib 1.1 and later
10373  }
10374 const
10375 	kEventMenuTargetItem = 6;
10376 
10377 
10378 {
10379  *  kEventClassMenu / kEventMenuMatchKey
10380  *
10381  *  Summary:
10382  *    A menu is about to be examined for items that match a command key
10383  *    event.
10384  *
10385  *  Discussion:
10386  *    A handler for this event may perform its own command key matching
10387  *    and override the Menu Manager�s default matching algorithms.
10388  *    Returning noErr from your handler indicates that you have found a
10389  *    match. The handler for this event should not examine submenus of
10390  *    this menu for a match; a separate event will be sent for each
10391  *    submenu.
10392  *
10393  *    Handlers for this event must be installed directly on the menu
10394  *    containing the item to be matched. To improve performance of
10395  *    command key matching, the Menu Manager only sends this event if
10396  *    the menu itself has a handler; if a handler for this event is
10397  *    installed on any other event target, it will not receive the
10398  *    event.
10399  *
10400  *    In CarbonLib and Mac OS X through version 10.3, the Menu Manager
10401  *    sends a kEventMenuEnableItems event to the menu before sending
10402  *    kEventMenuMatchKey. In Mac OS X 10.4 and later, the Menu Manager
10403  *    no longer sends kEventMenuEnableItems (or the resulting
10404  *    kEventCommandUpdateStatus events) to the menu; a handler for
10405  *    kEventMenuMatchKey is expected to determine on its own whether a
10406  *    matching menu item is enabled.
10407  *
10408  *  Mac OS X threading:
10409  *    Not thread safe
10410  *
10411  *  Parameters:
10412  *
10413  *    --> kEventParamDirectObject (in, typeMenuRef)
10414  *          The menu being searched for a command key match.
10415  *
10416  *    --> kEventParamEventRef (in, typeEventRef)
10417  *          The keyboard input event that should be checked for a
10418  *          match. Currently this event is always kEventRawKeyDown, but
10419  *          in the future it may be kEventTextInputUnicodeForKeyEvent.
10420  *          When called from IsMenuKeyEvent, this parameter contains
10421  *          the EventRef that was passed to IsMenuKeyEvent; when called
10422  *          from MenuKey or MenuEvent, this parameter contains an event
10423  *          created from the information passed to MenuKey or
10424  *          MenuEvent. Note that in the MenuKey case, no virtual
10425  *          keycode (kEventParamKeyCode) or key modifiers
10426  *          (kEventParamKeyModifiers) will be available.
10427  *
10428  *    --> kEventParamMenuEventOptions (in, typeMenuEventOptions)
10429  *          Options from the MenuEventOptions enum that control how the
10430  *          menu should be searched for a command key. This parameter
10431  *          contains the options that were passed to IsMenuKeyEvent, or
10432  *          0 if called from MenuKey or MenuEvent. The only option that
10433  *          your handler will need to obey is
10434  *          kMenuEventIncludeDisabledItems; other options are
10435  *          irrelevant for an event handler.
10436  *
10437  *    --> kEventParamMenuContext (in, typeUInt32)
10438  *          The context in which this menu is being searched for a
10439  *          command key. Available on Mac OS X 10.1 and later, and
10440  *          CarbonLib 1.5 and later.
10441  *
10442  *    <-- kEventParamMenuItemIndex (out, typeMenuItemIndex)
10443  *          On exit, contains the menu item index that matched the
10444  *          event.
10445  *
10446  *  Result:
10447  *    If your handler finds a match, it should set the
10448  *    kEventParamMenuItemIndex parameter to contain the item index of
10449  *    the matching item, and return noErr. If it does not find a match,
10450  *    it should return menuItemNotFoundErr. Any other return value will
10451  *    cause the Menu Manager to use its default command key matching
10452  *    algorithm for this menu.
10453  *
10454  *  Availability:
10455  *    Mac OS X:         in version 10.0 and later in Carbon.framework
10456  *    CarbonLib:        in CarbonLib 1.1 and later
10457  }
10458 const
10459 	kEventMenuMatchKey = 7;
10460 
10461 
10462 {
10463  *  kEventClassMenu / kEventMenuEnableItems
10464  *
10465  *  Summary:
10466  *    A request that the items in the menu be properly enabled or
10467  *    disabled according to the current state of the application.
10468  *
10469  *  Discussion:
10470  *    This event is sent from inside MenuKey, MenuEvent, and
10471  *    IsMenuKeyEvent before those APIs examine the menu for an item
10472  *    that matches a keyboard event. It is also sent during menu
10473  *    tracking before a menu is first made visible; it is sent
10474  *    immediately after kEventMenuOpening, once per menu per menu
10475  *    tracking session. It is also sent to the top-level menus in the
10476  *    menubar when the application is idle after user input has
10477  *    occurred, to allow the menu titles to be enabled or disabled
10478  *    appropriately according to the current user focus. You can
10479  *    distinquish between all these cases by examining the contents of
10480  *    the kEventParamMenuContext parameter.
10481  *
10482  *    If you install an event handler for kEventCommandProcess, you
10483  *    should also install a handler for either kEventMenuEnableItems or
10484  *    kEventCommandUpdateStatus. This is necessary because the Carbon
10485  *    event system will attempt to match command keys against the
10486  *    available menus before returning the keyboard event to your
10487  *    application via WaitNextEvent. If you have menu command event
10488  *    handlers installed for your menu items, your handlers will be
10489  *    called without your ever receiving the keyboard event or calling
10490  *    MenuKey/MenuEvent/IsMenuKeyEvent yourself. Therefore, you have no
10491  *    opportunity to enable your menu items properly other than from a
10492  *    kEventMenuEnableItems or kEventCommandUpdateStatus handler.
10493  *
10494  *
10495  *    It is not necessary to handle this event if you do not install
10496  *    kEventCommandProcess handlers for your menu items; in that case,
10497  *    the command key event will be returned from WaitNextEvent or
10498  *    ReceiveNextEvent as normal, and you can set up your menus before
10499  *    calling MenuKey/MenuEvent/ IsMenuKeyEvent.
10500  *
10501  *    This event is sent first to the target menu, and then to the user
10502  *    focus target.
10503  *
10504  *  Mac OS X threading:
10505  *    Not thread safe
10506  *
10507  *  Parameters:
10508  *
10509  *    --> kEventParamDirectObject (in, typeMenuRef)
10510  *          The menu being enabled.
10511  *
10512  *    --> kEventParamEnableMenuForKeyEvent (in, typeBoolean)
10513  *          Indicates whether this menu should be enabled for key event
10514  *          matching (true) or because the menu itself is about to
10515  *          become visible (false). If true, only the item enable
10516  *          state, command key, command key modifiers, and (optionally)
10517  *          the command key glyph need to be correct. If false, the
10518  *          entire menu item contents must be correct. This may be
10519  *          useful if you have custom menu content that is expensive to
10520  *          prepare.
10521  *
10522  *    --> kEventParamMenuContext (in, typeUInt32)
10523  *          The context in which this menu is being enabled. Available
10524  *          on Mac OS X and CarbonLib 1.3.1 and later.
10525  *
10526  *  Availability:
10527  *    Mac OS X:         in version 10.0 and later in Carbon.framework
10528  *    CarbonLib:        in CarbonLib 1.1 and later
10529  }
10530 const
10531 	kEventMenuEnableItems = 8;
10532 
10533 
10534 {
10535  *  kEventClassMenu / kEventMenuPopulate
10536  *
10537  *  Summary:
10538  *    kEventMenuPopulate is intended to be handled by applications that
10539  *    dynamically create their menu contents just-in-time before the
10540  *    menu is displayed. A handler for this event can add items to tbe
10541  *    menu that will be displayed or searched for a command key.
10542  *
10543  *  Discussion:
10544  *    This event is sent to all handlers registered for it. Previously,
10545  *    kEventMenuOpening was recommended for the purpose of dynamically
10546  *    updating menu content. kEventMenuPopulate is now recommended
10547  *    because it will be sent by the Menu Manager before it searches a
10548  *    menu for a matching command key, to allow a handler to
10549  *    dynamically add menu items that may have command key equivalents
10550  *    to the menu; kEventMenuOpening is only sent before the menu is
10551  *    displayed. kEventMenuPopulate is also sent just before
10552  *    kEventMenuOpening as a menu is being displayed. Finally,
10553  *    kEventMenuPopulate is only sent once per menu tracking session
10554  *    for a given menu, even if that menu is closed and opened multiple
10555  *    times by the user; kEventMenuOpening is sent each time that the
10556  *    menu is displayed.
10557  *
10558  *    You can distinguish the command-key case from the
10559  *    menu-being-displayed case by examining the contents of the
10560  *    kEventParamMenuContext parameter; the kMenuContextKeyMatching
10561  *    flag will be set if the event is sent during command key
10562  *    matching, and either the kMenuContextMenuBarTracking or
10563  *    kMenuContextPopUpTracking flags will be sent if the event is sent
10564  *    before actual display of the menu.
10565  *
10566  *    In Mac OS X 10.2 and CarbonLib 1.6, kEventMenuPopulate is also
10567  *    sent to menus before the menu is searched for a command ID by the
10568  *    CountMenuItemsWithCommandID and GetIndMenuItemWithCommandID APIs.
10569  *    You can distinguish this case by checking for the
10570  *    kMenuContextCommandIDSearch flag in the kEventParamMenuContext
10571  *    parameter. In this case, the event also includes a
10572  *    kEventParamMenuCommand parameter with the command ID being
10573  *    searched for as the event parameter data.
10574  *
10575  *  Mac OS X threading:
10576  *    Not thread safe
10577  *
10578  *  Parameters:
10579  *
10580  *    --> kEventParamDirectObject (in, typeMenuRef)
10581  *          The menu to be populated.
10582  *
10583  *    --> kEventParamMenuContext (in, typeUInt32)
10584  *          The context in which this menu is being populated.
10585  *
10586  *    --> kEventParamMenuCommand (in, typeMenuCommand)
10587  *          If this event is sent by CountMenuItemsWithCommandID or
10588  *          GetIndMenuItemWithCommandID, this parameter contains the
10589  *          command ID for which the API is searching. Available on Mac
10590  *          OS X 10.2 and CarbonLib 1.6.
10591  *
10592  *  Availability:
10593  *    Mac OS X:         in version 10.1 and later in Carbon.framework
10594  *    CarbonLib:        in CarbonLib 1.5 and later
10595  }
10596 const
10597 	kEventMenuPopulate = 9;
10598 
10599 
10600 {
10601  *  kEventClassMenu / kEventMenuDispose
10602  *
10603  *  Summary:
10604  *    Sent when a menu definition should disconnect itself from a menu.
10605  *
10606  *  Discussion:
10607  *    This event is sent to all handlers registered for it.
10608  *
10609  *  Mac OS X threading:
10610  *    Not thread safe
10611  *
10612  *  Parameters:
10613  *
10614  *    --> kEventParamDirectObject (in, typeMenuRef)
10615  *          The menu being destroyed.
10616  *
10617  *  Availability:
10618  *    Mac OS X:         in version 10.0 and later in Carbon.framework
10619  *    CarbonLib:        in CarbonLib 1.1 and later
10620  }
10621 const
10622 	kEventMenuDispose = 1001;
10623 
10624 {
10625  *  kEventClassMenu / kEventMenuMeasureItemWidth
10626  *
10627  *  Summary:
10628  *    Requests measurement of the width of a menu item.
10629  *
10630  *  Discussion:
10631  *    Sent by the standard menu definition when a menu item has the
10632  *    kMenuItemAttrCustomDraw attribute. Handlers for this event should
10633  *    be installed directly on the menu. A handler for this event may
10634  *    respond by providing a customized width for the menu item. If no
10635  *    handler is installed, the standard menu definition provides a
10636  *    default handler that will return the standard width for the item.
10637  *
10638  *  Mac OS X threading:
10639  *    Not thread safe
10640  *
10641  *  Parameters:
10642  *
10643  *    --> kEventParamDirectObject (in, typeMenuRef)
10644  *          The menu that is being measured.
10645  *
10646  *    --> kEventParamMenuItemIndex (in, typeMenuItemIndex)
10647  *          The menu item that is being measured.
10648  *
10649  *    <-- kEventParamMenuItemWidth (out, typeSInt16)
10650  *          On exit, contains the menu item width.
10651  *
10652  *  Availability:
10653  *    Mac OS X:         in version 10.1 and later in Carbon.framework
10654  *    CarbonLib:        in CarbonLib 1.5 and later
10655  }
10656 const
10657 	kEventMenuMeasureItemWidth = 100;
10658 
10659 
10660 {
10661  *  kEventClassMenu / kEventMenuMeasureItemHeight
10662  *
10663  *  Summary:
10664  *    Requests measurement of the height of a menu item.
10665  *
10666  *  Discussion:
10667  *    Sent by the standard menu definition when a menu item has the
10668  *    kMenuItemAttrCustomDraw attribute. Handlers for this event should
10669  *    be installed directly on the menu. A handler for this event may
10670  *    respond by providing a customized height for the menu item. If no
10671  *    handler is installed, the standard menu definition provides a
10672  *    default handler that will return the standard height for the item.
10673  *
10674  *  Mac OS X threading:
10675  *    Not thread safe
10676  *
10677  *  Parameters:
10678  *
10679  *    --> kEventParamDirectObject (in, typeMenuRef)
10680  *          The menu that is being measured.
10681  *
10682  *    --> kEventParamMenuItemIndex (in, typeMenuItemIndex)
10683  *          The menu item that is being measured.
10684  *
10685  *    <-- kEventParamMenuItemHeight (out, typeSInt16)
10686  *          On exit, contains the menu item height.
10687  *
10688  *  Availability:
10689  *    Mac OS X:         in version 10.1 and later in Carbon.framework
10690  *    CarbonLib:        in CarbonLib 1.5 and later
10691  }
10692 const
10693 	kEventMenuMeasureItemHeight = 101;
10694 
10695 
10696 {
10697  *  kEventClassMenu / kEventMenuDrawItem
10698  *
10699  *  Summary:
10700  *    Requests drawing of an entire menu item, including its background.
10701  *
10702  *  Discussion:
10703  *    Sent by the standard menu definition when a menu item has the
10704  *    kMenuItemAttrCustomDraw attribute. Handlers for this event should
10705  *    be installed directly on the menu. A handler for this event may
10706  *    respond by completely overriding the drawing of the menu item.
10707  *    The item should be drawn into the current port if using
10708  *    QuickDraw, or into the provided CGContextRef if using
10709  *    CoreGraphics. If no handler is installed, the standard menu
10710  *    definition provides a default handler that calls
10711  *    DrawThemeMenuItem to draw the menu item background and content.
10712  *
10713  *  Mac OS X threading:
10714  *    Not thread safe
10715  *
10716  *  Parameters:
10717  *
10718  *    --> kEventParamDirectObject (in, typeMenuRef)
10719  *          The menu being drawn.
10720  *
10721  *    --> kEventParamCurrentBounds (in, typeQDRectangle)
10722  *          The bounds of the menu, in global coordinates
10723  *
10724  *    --> kEventParamMenuItemIndex (in, typeMenuItemIndex)
10725  *          The menu item being drawn.
10726  *
10727  *    --> kEventParamMenuItemBounds (in, typeQDRectangle)
10728  *          The bounds of the menu item, in local coordinates of the
10729  *          current port.
10730  *
10731  *    --> kEventParamMenuVirtualTop (in, typeSInt32)
10732  *          The virtual top coordinate of the menu, in global
10733  *          coordinates.
10734  *
10735  *    --> kEventParamMenuVirtualBottom (in, typeSInt32)
10736  *          The virtual bottom coordinate of the menu, in global
10737  *          coordinates.
10738  *
10739  *    --> kEventParamMenuDrawState (in, typeThemeMenuState)
10740  *          The ThemeMenuState of the menu.
10741  *
10742  *    --> kEventParamMenuItemType (in, typeThemeMenuItemType)
10743  *          The type of menu item.
10744  *
10745  *    --> kEventParamCGContextRef (in, typeCGContextRef)
10746  *          The CG context in which the menu item should be drawn. Note
10747  *          that this context has Cartesian coordinates, with (0,0) at
10748  *          the bottom left, while the item bounds passed in the event
10749  *          has QuickDraw coordinates, with (0,0) at the top left. To
10750  *          align the context coordinates with the item bounds, use the
10751  *          value stored in the kEventParamMenuContextHeight parameter
10752  *          (if available), or else the height of the current port to
10753  *          flip the context with CGContextTranslateCTM( context, 0,
10754  *          height ) and CGContextScaleCTM( context, 1, -1 ).
10755  *
10756  *    --> kEventParamMenuContextHeight (in, typeCGFloat)
10757  *          The height of the drawing surface to which the CGContext
10758  *          draws. You can use the value in this parameter to flip the
10759  *          orientation of the context, or to adjust the coordinates of
10760  *          the rectangle parameters in this event. This parameter is
10761  *          available on Mac OS X 10.5 and later.
10762  *
10763  *    <-- kEventParamMenuMarkBounds (out, typeQDRectangle)
10764  *          On exit, contains the bounds of the menu item mark
10765  *          character. Not present if the item has no mark. Added to
10766  *          the event by the standard menu definition�s handler, if the
10767  *          event is allowed to pass through.
10768  *
10769  *    <-- kEventParamMenuIconBounds (out, typeQDRectangle)
10770  *          On exit, contains the bounds of the menu item icon. Not
10771  *          present if the item has no icon. Added to the event by the
10772  *          standard menu definition�s handler, if the event is allowed
10773  *          to pass through.
10774  *
10775  *    <-- kEventParamMenuTextBounds (out, typeQDRectangle)
10776  *          On exit, contains the bounds of the menu item�s text. Added
10777  *          to the event by the standard menu definition�s handler, if
10778  *          the event is allowed to pass through.
10779  *
10780  *    <-- kEventParamMenuTextBaseline (out, typeSInt16)
10781  *          On exit, contains the baseline of the menu item�s text.
10782  *          Added to the event by the standard menu definition�s
10783  *          handler, if the event is allowed to pass through.
10784  *
10785  *    <-- kEventParamMenuCommandKeyBounds (out, typeQDRectangle)
10786  *          On exit, contains the bounds of the menu item command key.
10787  *          Not present if the item has no command key. Added to the
10788  *          event by the standard menu definition�s handler, if the
10789  *          event is allowed to pass through.
10790  *
10791  *  Availability:
10792  *    Mac OS X:         in version 10.1 and later in Carbon.framework
10793  *    CarbonLib:        in CarbonLib 1.5 and later
10794  }
10795 const
10796 	kEventMenuDrawItem = 102;
10797 
10798 
10799 {
10800  *  kEventClassMenu / kEventMenuDrawItemContent
10801  *
10802  *  Summary:
10803  *    Requests drawing of a menu item�s content: its text, command key,
10804  *    icon, etc.
10805  *
10806  *  Discussion:
10807  *    Sent by the standard menu definition when a menu item has the
10808  *    kMenuItemAttrCustomDraw attribute. Handlers for this event should
10809  *    be installed directly on the menu. A handler for this event may
10810  *    respond by overriding the drawing of the menu item content: the
10811  *    mark character, icon, text, and command key information. At the
10812  *    time when this event is sent, the background of the menu item has
10813  *    already been drawn using the standard system appearance, and if
10814  *    the item is selected, the background is drawn with a hilite. The
10815  *    item should be drawn into the current port if using QuickDraw, or
10816  *    into the provided CGContextRef if using CoreGraphics. If no
10817  *    handler is installed, the standard menu definition provides a
10818  *    default handler that draws the standard menu item content. The
10819  *    standard handler also adds event parameters to the event
10820  *    indicating the bounding boxes of the different portions of the
10821  *    menu item content (mark, icon, text, and command keys), and an
10822  *    event parameter with the baseline of the menu item text; this
10823  *    allows handlers to use CallNextEventHandler to call through to
10824  *    the standard system handler, and then modify the system
10825  *    appearance by drawing on top of the standard content.
10826  *
10827  *  Mac OS X threading:
10828  *    Not thread safe
10829  *
10830  *  Parameters:
10831  *
10832  *    --> kEventParamDirectObject (in, typeMenuRef)
10833  *          The menu being drawn.
10834  *
10835  *    --> kEventParamMenuItemIndex (in, typeMenuItemIndex)
10836  *          The menu item being drawn.
10837  *
10838  *    --> kEventParamMenuItemBounds (in, typeQDRectangle)
10839  *          The bounds of the menu item, in local coordinates of the
10840  *          current port.
10841  *
10842  *    --> kEventParamDeviceDepth (in, typeSInt16)
10843  *          The bit depth of the GDevice on which the menu is being
10844  *          drawn.
10845  *
10846  *    --> kEventParamDeviceColor (in, typeBoolean)
10847  *          Whether the GDevice on which the menu is being drawn is in
10848  *          black&white or color mode.
10849  *
10850  *    --> kEventParamCGContextRef (in, typeCGContextRef)
10851  *          The CG context in which the menu item should be drawn. Note
10852  *          that this context has Cartesian coordinates, with (0,0) at
10853  *          the bottom left, while the item bounds passed in the event
10854  *          has QuickDraw coordinates, with (0,0) at the top left. To
10855  *          align the context coordinates with the item bounds, use the
10856  *          value stored in the kEventParamMenuContextHeight parameter
10857  *          (if available), or else the height of the current port to
10858  *          flip the context with CGContextTranslateCTM( context, 0,
10859  *          height ) and CGContextScaleCTM( context, 1, -1 ).
10860  *
10861  *    --> kEventParamMenuContextHeight (in, typeCGFloat)
10862  *          The height of the drawing surface to which the CGContext
10863  *          draws. You can use the value in this parameter to flip the
10864  *          orientation of the context, or to adjust the coordinates of
10865  *          the rectangle parameters in this event. This parameter is
10866  *          available on Mac OS X 10.5 and later.
10867  *
10868  *    <-- kEventParamMenuMarkBounds (out, typeQDRectangle)
10869  *          On exit, contains the bounds of the menu item mark
10870  *          character. Not present if the item has no mark. Added to
10871  *          the event by the standard menu definition�s handler, if the
10872  *          event is allowed to pass through.
10873  *
10874  *    <-- kEventParamMenuIconBounds (out, typeQDRectangle)
10875  *          On exit, contains the bounds of the menu item icon. Not
10876  *          present if the item has no icon. Added to the event by the
10877  *          standard menu definition�s handler, if the event is allowed
10878  *          to pass through.
10879  *
10880  *    <-- kEventParamMenuTextBounds (out, typeQDRectangle)
10881  *          On exit, contains the bounds of the menu item�s text. Added
10882  *          to the event by the standard menu definition�s handler, if
10883  *          the event is allowed to pass through.
10884  *
10885  *    <-- kEventParamMenuTextBaseline (out, typeSInt16)
10886  *          On exit, contains the baseline of the menu item�s text.
10887  *          Added to the event by the standard menu definition�s
10888  *          handler, if the event is allowed to pass through.
10889  *
10890  *    <-- kEventParamMenuCommandKeyBounds (out, typeQDRectangle)
10891  *          On exit, contains the bounds of the menu item command key.
10892  *          Not present if the item has no command key. Added to the
10893  *          event by the standard menu definition�s handler, if the
10894  *          event is allowed to pass through.
10895  *
10896  *  Availability:
10897  *    Mac OS X:         in version 10.1 and later in Carbon.framework
10898  *    CarbonLib:        in CarbonLib 1.5 and later
10899  }
10900 const
10901 	kEventMenuDrawItemContent = 103;
10902 
10903 {
10904  *  kEventClassMenu / kEventMenuCalculateSize
10905  *
10906  *  Summary:
10907  *    Requests that a menu calculate its total size.
10908  *
10909  *  Discussion:
10910  *    Sent by CalcMenuSize to request that the menu calculate its size.
10911  *    The Menu Manager provides a default handler for all menus that
10912  *    calls the menu's MDEF or menu content view to determine the menu
10913  *    size. Applications will typically not need to handle this event;
10914  *    a custom menu definition or menu content view should use
10915  *    kMenuSizeMsg or kEventControlGetOptimalBounds to calculate its
10916  *    size.
10917  *
10918  *    Note that if the menu uses an MDEF, the MDEF will set the menu's
10919  *    width and height in response to kMenuSizeMsg. The default handler
10920  *    for this event saves the old width and height before calling the
10921  *    MDEF and restores them afterwards. CalcMenuSize will set the
10922  *    final menu width and height based on the dimensions returned from
10923  *    this event; applications may override this event to customize the
10924  *    width or height of a menu by modifying the kEventParamDimensions
10925  *    parameter.
10926  *
10927  *    This event is sent only to the menu, and is not propagated past
10928  *    it.
10929  *
10930  *  Mac OS X threading:
10931  *    Not thread safe
10932  *
10933  *  Parameters:
10934  *
10935  *    --> kEventParamDirectObject (in, typeMenuRef)
10936  *          The menu being measured.
10937  *
10938  *    --> kEventParamControlRef (in, typeControlRef)
10939  *          If the menu uses a content view, this parameter contains
10940  *          the HIViewRef that should calculate the menu's size. This
10941  *          parameter will not be present if the menu uses an MDEF.
10942  *
10943  *    --> kEventParamGDevice (in, typeGDHandle)
10944  *          If the menu uses an MDEF, this parameter contains the
10945  *          GDevice on which the menu will be displayed. This parameter
10946  *          will not be present if the menu uses a content view.
10947  *
10948  *    --> kEventParamAvailableBounds (in, typeQDRectangle)
10949  *          If the menu uses an MDEF, this parameter contains a
10950  *          bounding rect in global coordinates inside of which the
10951  *          menu should be displayed. This parameter is optional and
10952  *          may not be present in all instances of this event; if not
10953  *          present, the GDevice's bounds should be used instead. This
10954  *          parameter will not be present if the menu uses a content
10955  *          view.
10956  *
10957  *    <-- kEventParamDimensions (out, typeHISize)
10958  *          On exit, contains the menu's size.
10959  *
10960  *  Availability:
10961  *    Mac OS X:         in version 10.3 and later in Carbon.framework
10962  *    CarbonLib:        not available
10963  }
10964 const
10965 	kEventMenuCalculateSize = 1004;
10966 
10967 {
10968  *  kEventClassMenu / kEventMenuCreateFrameView
10969  *
10970  *  Summary:
10971  *    Requests that a menu content view create the HIView that will
10972  *    used to draw the menu window frame.
10973  *
10974  *  Discussion:
10975  *    The HIMenuView class provides a default handler for this event
10976  *    that creates an instance of the standard menu window frame view.
10977  *
10978  *
10979  *    This event is sent only to the menu content view, and is not
10980  *    propagated past the view.
10981  *
10982  *  Mac OS X threading:
10983  *    Not thread safe
10984  *
10985  *  Parameters:
10986  *
10987  *    --> kEventParamEventRef (in, typeEventRef)
10988  *          The initialization event that should be used to create the
10989  *          view. A handler for this event may add its own parameters
10990  *          to this event.
10991  *
10992  *    --> kEventParamMenuType (in, typeThemeMenuType)
10993  *          The type of menu frame (pull-down, popup, or hierarchical)
10994  *          that is needed.
10995  *
10996  *    <-- kEventParamMenuFrameView (out, typeControlRef)
10997  *          On exit, contains the newly created menu frame view.
10998  *
10999  *  Availability:
11000  *    Mac OS X:         in version 10.3 and later in Carbon.framework
11001  *    CarbonLib:        not available
11002  }
11003 const
11004 	kEventMenuCreateFrameView = 1005;
11005 
11006 {
11007  *  kEventClassMenu / kEventMenuGetFrameBounds
11008  *
11009  *  Summary:
11010  *    Requests that a menu content view calculate the bounding rect, in
11011  *    global coordinates, of the menu window frame that should contain
11012  *    the menu.
11013  *
11014  *  Discussion:
11015  *    This event is sent by the Menu Manager before displaying
11016  *    pull-down, popup, and hierarchical menus. It provides an
11017  *    opportunity for the menu content view to determine the position
11018  *    of the menu frame based on the position of the menu title, parent
11019  *    menu item, or popup menu location.
11020  *
11021  *    The HIMenuView class provides a default handler for this event
11022  *    that calculates an appropriate location based on the bounds of
11023  *    the menu, the available screen space, and the frame metrics of
11024  *    the menu window content view.
11025  *
11026  *    This event is sent only to the menu content view, and is not
11027  *    propagated past the view.
11028  *
11029  *  Mac OS X threading:
11030  *    Not thread safe
11031  *
11032  *  Parameters:
11033  *
11034  *    --> kEventParamMenuType (in, typeThemeMenuType)
11035  *          The type of menu (pull-down, popup, or hierarchical) that
11036  *          is being displayed.
11037  *
11038  *    --> kEventParamMenuIsPopup (in, typeBoolean)
11039  *          Whether this menu originated from a popup menu. Primarily
11040  *          useful to distinguish between hierarchical menus that are
11041  *          submenus of pull-down menus, and hierarchical menus that
11042  *          are submenus of popup menus.
11043  *
11044  *    --> kEventParamMenuFrameView (in, typeControlRef)
11045  *          The menu window frame view.
11046  *
11047  *    --> kEventParamMenuDirection (in, typeMenuDirection)
11048  *          The suggested direction (left or right) which the view
11049  *          should attempt to use when positioning the menu window. For
11050  *          pull-down menus, this will typically be
11051  *          kHIMenuRightDirection; for hierarchical menus, it will be
11052  *          the same direction as the parent menu.
11053  *
11054  *    --> kEventParamMenuItemBounds (in, typeHIRect)
11055  *          The bounds, in global coordinates, of the parent menu title
11056  *          (for pull-down menus), the parent menu item (for
11057  *          hierarchical menus), or the popup location (for popup
11058  *          menus).
11059  *
11060  *    --> kEventParamDisplayDevice (in, typeCGDisplayID)
11061  *          The display device on which the menu should be displayed.
11062  *          On Mac OS X 10.3 and later, this parameter is available as
11063  *          a GDHandle using typeGDHandle; on Mac OS X 10.5 and later,
11064  *          this parameter is also available as a CGDirectDisplayID
11065  *          using typeCGDisplayID.
11066  *
11067  *    --> kEventParamAvailableBounds (in, typeHIRect)
11068  *          The available bounds, in global coordinates, inside which
11069  *          the menu should be displayed. The menu should not extend
11070  *          outside of these bounds.
11071  *
11072  *    --> kEventParamParentMenu (in, typeMenuRef)
11073  *          Only available when kEventParamMenuType is
11074  *          kThemeMenuTypeHierarchical. The parent menu of this menu.
11075  *
11076  *    --> kEventParamParentMenuItem (in, typeMenuItemIndex)
11077  *          Only available when kEventParamMenuType is
11078  *          kThemeMenuTypeHierarchical. The parent menu item of this
11079  *          menu.
11080  *
11081  *    --> kEventParamMenuPopupItem (in, typeMenuItemIndex)
11082  *          Only available when kEventParamMenuType is
11083  *          kThemeMenuTypePopUp. The item in the menu that should be
11084  *          positioned at the popup location, or zero if no item should
11085  *          be positioned there.
11086  *
11087  *    <-- kEventParamBounds (out, typeHIRect)
11088  *          On exit, contains the bounding rect, in global coordinates,
11089  *          of the menu window. The handler should add this parameter
11090  *          to the event.
11091  *
11092  *    <-- kEventParamOrigin (out, typeHIPoint)
11093  *          On exit, contains the origin to which the menu content view
11094  *          should be scrolled before the menu is displayed.
11095  *
11096  *  Availability:
11097  *    Mac OS X:         in version 10.3 and later in Carbon.framework
11098  *    CarbonLib:        not available
11099  }
11100 const
11101 	kEventMenuGetFrameBounds = 1006;
11102 
11103 {
11104  *  kEventClassMenu / kEventMenuBecomeScrollable
11105  *
11106  *  Summary:
11107  *    Requests that a menu content view prepare to be scrollable, by
11108  *    installing the appropriate event handlers, timers, etc.
11109  *
11110  *  Discussion:
11111  *    This event is sent by the Menu Manager when a menu becomes the
11112  *    most recently opened menu in the menu hierarchy. It is an
11113  *    indication that this menu content view is now a candidate for
11114  *    scrolling.
11115  *
11116  *    The Menu Manager provides a default handler for this event that
11117  *    installs event handlers to provide automatic scrolling behavior
11118  *    for HIView-based menus.
11119  *
11120  *    If a menu content view does not wish to use the Menu Manager's
11121  *    default scrolling support, it can override this event and return
11122  *    noErr to prevent the event from being propagated to the Menu
11123  *    Manager's default handler.
11124  *
11125  *    This event is sent only to the menu content view, and is not
11126  *    propagated past the view.
11127  *
11128  *  Mac OS X threading:
11129  *    Not thread safe
11130  *
11131  *  Availability:
11132  *    Mac OS X:         in version 10.3 and later in Carbon.framework
11133  *    CarbonLib:        not available
11134  }
11135 const
11136 	kEventMenuBecomeScrollable = 1007;
11137 
11138 {
11139  *  kEventClassMenu / kEventMenuCeaseToBeScrollable
11140  *
11141  *  Summary:
11142  *    Requests that a menu content view cease to be scrollable.
11143  *
11144  *  Discussion:
11145  *    This event is sent by the Menu Manager when a menu ceases to be
11146  *    the most recently opened menu. This occurs when the menu is
11147  *    closed, or when a submenu of the most recently opened menu is
11148  *    opened. It is an indication that this menu content view is no
11149  *    longer a candidate for scrolling.
11150  *
11151  *    The Menu Manager provides a default handler for this event that
11152  *    removes event handlers installed in response to
11153  *    kEventMenuBecomeScrollable.
11154  *
11155  *    This event is sent only to the menu content view, and is not
11156  *    propagated past the view.
11157  *
11158  *  Mac OS X threading:
11159  *    Not thread safe
11160  *
11161  *  Availability:
11162  *    Mac OS X:         in version 10.3 and later in Carbon.framework
11163  *    CarbonLib:        not available
11164  }
11165 const
11166 	kEventMenuCeaseToBeScrollable = 1008;
11167 
11168 {
11169  *  kEventClassMenu / kEventMenuBarShown
11170  *
11171  *  Summary:
11172  *    Notification that the menubar in the frontmost process has been
11173  *    shown.
11174  *
11175  *  Discussion:
11176  *    This event is sent to all handlers registered for it. This event
11177  *    will be sent to registered handlers in all processes when the
11178  *    front process shows its menubar. This event is sent only to the
11179  *    application target.
11180  *
11181  *  Mac OS X threading:
11182  *    Not thread safe
11183  *
11184  *  Availability:
11185  *    Mac OS X:         in version 10.3 and later in Carbon.framework
11186  *    CarbonLib:        not available
11187  }
11188 const
11189 	kEventMenuBarShown = 2000;
11190 
11191 {
11192  *  kEventClassMenu / kEventMenuBarHidden
11193  *
11194  *  Summary:
11195  *    Notification that the menubar in the frontmost process has been
11196  *    hidden.
11197  *
11198  *  Discussion:
11199  *    This event is sent to all handlers registered for it. This event
11200  *    will be sent to registered handlers in all processes when the
11201  *    front process hides its menubar. This event is sent only to the
11202  *    application target.
11203  *
11204  *  Mac OS X threading:
11205  *    Not thread safe
11206  *
11207  *  Availability:
11208  *    Mac OS X:         in version 10.3 and later in Carbon.framework
11209  *    CarbonLib:        not available
11210  }
11211 const
11212 	kEventMenuBarHidden = 2001;
11213 
11214 {--------------------------------------------------------------------------------------}
11215 {  Command Events                                                                      }
11216 {--------------------------------------------------------------------------------------}
11217 {
11218     kEventClassCommand quick reference:
11219 
11220     kEventCommandProcess        = 1,
11221     kEventCommandUpdateStatus   = 2
11222 }
11223 {
11224  *  kEventClassCommand / kEventCommandProcess
11225  *
11226  *  Summary:
11227  *    A command has been invoked and the application should handle it.
11228  *
11229  *  Discussion:
11230  *    This event is sent when the user chooses a menu item or clicks a
11231  *    control. Any menu item selection, from either the menubar, a
11232  *    popup or contextual menu, or a popup or bevel button control,
11233  *    will cause this event to be sent; if the menu item does not have
11234  *    a command ID, the commandID field of the HICommand parameter will
11235  *    be zero, but the event will still contain a valid MenuRef and
11236  *    MenuItemIndex. Controls will send this event only if the control
11237  *    has a non-zero command ID set with SetControlCommandID.
11238  *
11239  *    Some senders of this event will also include the modifier keys
11240  *    that were pressed by the user when the command was invoked, but
11241  *    this parameter is optional and may not be present in all
11242  *    instances of this event.
11243  *
11244  *    When a command event is sent from a menu, a MenuContext parameter
11245  *    will be included on Mac OS X 10.2 and CarbonLib 1.6, indicating
11246  *    whether the command was sent from a menu in the menubar
11247  *    (kMenuContextMenuBar will be set) or from a popup menu
11248  *    (kMenuContextMenuBar will not be set). The MenuContext parameter
11249  *    also indicates whether the event was sent by a selection of a
11250  *    menu item with the mouse (kMenuContextMenuBarTracking or
11251  *    kMenuContextPopUpTracking will be set), or by a command key press
11252  *    (kMenuContextKeyMatching will be set). If you need to determine
11253  *    the source of a command event on a Carbon release prior to Mac OS
11254  *    X 10.2 or CarbonLib 1.6, we recommend installing a
11255  *    kEventMenuEnableItems handler on each menu and caching the
11256  *    MenuContext parameter in the EnableItems event in a menu
11257  *    property; when you receive the CommandProcess event, look up the
11258  *    cached MenuContext.
11259  *
11260  *    It is essential that your event handler for this event return
11261  *    eventNotHandledErr for any command events that you do not handle,
11262  *    especially for commands that are sent from menus attached to
11263  *    popup or bevel button controls; if, for example, you return noErr
11264  *    for command events sent in response to a menu selection from a
11265  *    popup button, the Menu Manager will return zero from
11266  *    PopUpMenuSelect, and the popup button control will not know that
11267  *    an item was selected from the popup menu and will not redraw with
11268  *    the new selection.
11269  *
11270  *  Mac OS X threading:
11271  *    Not thread safe
11272  *
11273  *  Parameters:
11274  *
11275  *    --> kEventParamDirectObject (in, typeHICommand)
11276  *          The command to be handled.
11277  *
11278  *    --> kEventParamKeyModifiers (in, typeUInt32)
11279  *          The keyboard modifiers that were pressed when the command
11280  *          was invoked by the user. This parameter is optional and may
11281  *          not be present in all instances of this event.
11282  *
11283  *    --> kEventParamMenuContext (in, typeUInt32)
11284  *          If the command was contained in a menu, information about
11285  *          the menu. This parameter is optional and may not be present
11286  *          in all instances of this event. Available in Mac OS X 10.2
11287  *          and CarbonLib 1.6, and later.
11288  *
11289  *  Availability:
11290  *    Mac OS X:         in version 10.0 and later in Carbon.framework
11291  *    CarbonLib:        in CarbonLib 1.1 and later
11292  }
11293 const
11294 	kEventCommandProcess = 1;
11295 
11296 {
11297  *  kEventClassCommand / kEventCommandUpdateStatus
11298  *
11299  *  Summary:
11300  *    A command-generating user interface element requires updating.
11301  *
11302  *  Discussion:
11303  *    When you receive this event, you should update the necessary UI
11304  *    elements in your application to reflect the current status of the
11305  *    command. For example, if the command has the kHICommandFromMenu
11306  *    bit set, you should update the menu item state, menu item text,
11307  *    and so on, to reflect the current reality in your application. If
11308  *    the menu item is the "Undo" item, and the last editing change to
11309  *    the document was a Cut operation, then you might set the text to
11310  *    "Undo Cut" and enable the menu item.
11311  *
11312  *    Currently, this event is only sent for menu items; it is not used
11313  *    to update the status of controls.
11314  *
11315  *    Note that when responding to this event, you should only update
11316  *    the status of the single user interface element (a menu item, for
11317  *    example) described by the HICommand structure; you should not
11318  *    update the status of the entire menu or of all menus in the
11319  *    menubar. You will receive a separate UpdateStatus event for each
11320  *    menu item in a menu, and each item should be updated
11321  *    individually. When updating a menu item, you should generally not
11322  *    use Enable/DisableMenuCommand; these APIs search the entire menu
11323  *    hierarchy for the command ID. Instead, just call
11324  *    Enable/DisableMenuItem directly, passing the menu and menu item
11325  *    index that are provided to you in the HICommand structure.
11326  *
11327  *
11328  *    You may wish to optimize your handling of the UpdateStatus event
11329  *    by examining the MenuContext parameter to the event. This
11330  *    parameter indicates the context in which the command requires
11331  *    updating. For example, if the menu context parameter has the
11332  *    kMenuContextKeyMatching bit set, you know that the update request
11333  *    is being sent in while search for a menu item that matches a
11334  *    command key. This knowledge can help you avoid unnecessary work;
11335  *    if your menu item for this command has no command key, for
11336  *    example, you can ignore this event when the KeyMatching bit is
11337  *    set because your menu item will never match a command key
11338  *    anyways, regardless of whether it is enabled or disabled.
11339  *
11340  *  Mac OS X threading:
11341  *    Not thread safe
11342  *
11343  *  Parameters:
11344  *
11345  *    --> kEventParamDirectObject (in, typeHICommand)
11346  *          The command to be updated.
11347  *
11348  *    --> kEventParamMenuContext (in, typeUInt32)
11349  *          If the command was contained in a menu, information about
11350  *          the menu and the context of the command updating request.
11351  *          This parameter is optional and may not be present in all
11352  *          instances of this event.
11353  *
11354  *  Availability:
11355  *    Mac OS X:         in version 10.0 and later in Carbon.framework
11356  *    CarbonLib:        in CarbonLib 1.1 and later
11357  }
11358 const
11359 	kEventCommandUpdateStatus = 2;
11360 
11361 { HI Commands }
11362 
11363 {
11364  *  Summary:
11365  *    Common command IDs
11366  }
11367 const
11368 {
11369    * The OK button in a dialog or alert.
11370    }
11371 	kHICommandOK = FourCharCode('ok  ');
11372 
11373   {
11374    * The Cancel button in a dialog or alert.
11375    }
11376 	kHICommandCancel = FourCharCode('not!');
11377 
11378   {
11379    * The application should quit. The default application handler
11380    * responds to this command by generating a kAEQuit AppleEvent.
11381    }
11382 	kHICommandQuit = FourCharCode('quit');
11383 
11384   {
11385    * The application should quit, and any file-based document windows
11386    * currently open should be closed when the application is next
11387    * launched. This command is assigned to the "Quit and Discard
11388    * Windows" menu item in Mac OS X 10.7 in all applications. The
11389    * default application handler responds to this command by generating
11390    * a kAEQuit AppleEvent, and discarding the list of currently open
11391    * document windows. When the application is next launched, no
11392    * documents will be reopened. Available on Mac OS X 10.7 and later.
11393    }
11394 	kHICommandQuitAndDiscardWindows = FourCharCode('qudw');
11395 
11396   {
11397    * The application should quit, and any file-based document windows
11398    * currently open should be reopened when the application is next
11399    * launched. This command is assigned to the "Quit and Keep Windows"
11400    * menu item in Mac OS X 10.7 in all applications. The default
11401    * application handler responds to this command by generating a
11402    * kAEQuit AppleEvent, and by making a note of the currently open
11403    * document windows. When the application is next launched, any
11404    * documents that were open at quit will be automatically reopened.
11405    * Available on Mac OS X 10.7 and later.
11406    }
11407 	kHICommandQuitAndKeepWindows = FourCharCode('qukw');
11408 
11409   {
11410    * The last editing operation should be undone.
11411    }
11412 	kHICommandUndo = FourCharCode('undo');
11413 
11414   {
11415    * The last editing operation should be redone.
11416    }
11417 	kHICommandRedo = FourCharCode('redo');
11418 
11419   {
11420    * The selected items should be cut.
11421    }
11422 	kHICommandCut = FourCharCode('cut ');
11423 
11424   {
11425    * The selected items should be copied.
11426    }
11427 	kHICommandCopy = FourCharCode('copy');
11428 
11429   {
11430    * The contents of the clipboard should be pasted.
11431    }
11432 	kHICommandPaste = FourCharCode('past');
11433 
11434   {
11435    * The selected items should be deleted.
11436    }
11437 	kHICommandClear = FourCharCode('clea');
11438 
11439   {
11440    * All items in the active window should be selected.
11441    }
11442 	kHICommandSelectAll = FourCharCode('sall');
11443 
11444   {
11445    * The application should be hidden. The Menu Manager will respond to
11446    * this command automatically; your application does not need to
11447    * handle it.
11448    }
11449 	kHICommandHide = FourCharCode('hide');
11450 
11451   {
11452    * Other applications should be hidden. The Menu Manager will respond
11453    * to this command automatically; your application does not need to
11454    * handle it.
11455    }
11456 	kHICommandHideOthers = FourCharCode('hido');
11457 
11458   {
11459    * All applications should become visible. The Menu Manager will
11460    * respond to this command automatically; your application does not
11461    * need to handle it.
11462    }
11463 	kHICommandShowAll = FourCharCode('shal');
11464 
11465   {
11466    * The Preferences menu item has been selected.
11467    }
11468 	kHICommandPreferences = FourCharCode('pref');
11469 
11470   {
11471    * The active window should be zoomed in or out. The default
11472    * application handler will respond to this event automatically; your
11473    * application does not need to handle it, but you may want to
11474    * install a Carbon event handler for kEventWindowGetIdealSize to
11475    * return the ideal size for your document windows.
11476    }
11477 	kHICommandZoomWindow = FourCharCode('zoom');
11478 
11479   {
11480    * The active window should be minimized. The default application
11481    * handler will respond to this event automatically; your application
11482    * does not need to handle it.
11483    }
11484 	kHICommandMinimizeWindow = FourCharCode('mini');
11485 
11486   {
11487    * All collapsable windows should be minimized. The default
11488    * application handler will respond to this event automatically; your
11489    * application does not need to handle it.
11490    }
11491 	kHICommandMinimizeAll = FourCharCode('mina');
11492 
11493   {
11494    * The active window should be maximized. Only sent on Mac OS 9. The
11495    * default application handler will respond to this event
11496    * automatically; your application does not need to handle it.
11497    }
11498 	kHICommandMaximizeWindow = FourCharCode('maxi');
11499 
11500   {
11501    * All collapsable windows should be maximized. This command is not
11502    * sent or handled on Mac OS X.
11503    }
11504 	kHICommandMaximizeAll = FourCharCode('maxa');
11505 
11506   {
11507    * All document-class windows should be arranged in a stack. The
11508    * default application handler will respond to this event
11509    * automatically; your application does not need to handle it.
11510    }
11511 	kHICommandArrangeInFront = FourCharCode('frnt');
11512 
11513   {
11514    * All windows of this application should be brought in front of
11515    * windows from other applications. Only sent on Mac OS X. The
11516    * default application handler will respond to this event
11517    * automatically; your application does not need to handle it.
11518    }
11519 	kHICommandBringAllToFront = FourCharCode('bfrt');
11520 
11521   {
11522    * This command ID is used as a placeholder to mark the separator
11523    * item dividing the Zoom/Minimize/Maximize/Arrange menu items in the
11524    * standard Window menu from the menu items listing the visible
11525    * windows. If you need to add your own menu items to the standard
11526    * Window menu before the window list section, you can look for the
11527    * menu item with this command ID using GetIndMenuItemWithCommandID,
11528    * and insert your menu items before the item with this ID.
11529    }
11530 	kHICommandWindowListSeparator = FourCharCode('wldv');
11531 
11532   {
11533    * This command ID is used as a placeholder to mark the end of the
11534    * window list section of the standard Window menu. If you need to
11535    * add your own menu items to the standard Window menu after the
11536    * window list section, you can look for the menu item with this
11537    * command ID using GetIndMenuItemWithCommandID, and insert your
11538    * items after the item with this ID.
11539    }
11540 	kHICommandWindowListTerminator = FourCharCode('wlst');
11541 
11542   {
11543    * A window in the standard Window menu has been selected and should
11544    * be activated. In Mac OS X 10.3, this command is also sent by the
11545    * toolbox whenever it needs to activate a window in your
11546    * application; for example, it is used when a window is selected
11547    * from the application's Dock menu, and when a window that uses the
11548    * standard window event handler is clicked. The default application
11549    * handler will respond to this event automatically; your application
11550    * does not need to handle it.
11551    *
11552    * This event is not always sent to the window being selected. When a
11553    * window item from the standard window menu is chosen, a
11554    * kEventCommandProcess event with kHICommandSelectWindow is sent to
11555    * the user focus window, as normal for menu-generated commands,
11556    * rather than to the window that should be selected. In Mac OS X
11557    * 10.5 and later, your application can determine which window would
11558    * be selected in this case by checking for a menu item property on
11559    * the originating menu item in the standard window menu. The
11560    * originating item is recorded in the menuRef and menuItemIndex
11561    * fields of the HICommand structure. This item will have a property
11562    * of kHIWindowMenuCreator/kHIWindowMenuWindowTag containing the
11563    * window that will be selected.
11564    }
11565 	kHICommandSelectWindow = FourCharCode('swin');
11566 
11567   {
11568    * The Rotate Windows hotkey (cmd-~ by default) has been pressed, and
11569    * non-floating windows should be rotated so that the window after
11570    * the active window is activated. The default application handler
11571    * will respond to this event automatically; your application does
11572    * not need to handle it.
11573    }
11574 	kHICommandRotateWindowsForward = FourCharCode('rotw');
11575 
11576   {
11577    * The Rotate Windows hotkey (cmd-~ by default) has been pressed, and
11578    * non-floating windows should be rotated so that the window before
11579    * the active window is activated. The default application handler
11580    * will respond to this event automatically; your application does
11581    * not need to handle it.
11582    }
11583 	kHICommandRotateWindowsBackward = FourCharCode('rotb');
11584 
11585   {
11586    * The floating window focus hotkey (ctl-F6 by default) has been
11587    * pressed, and floating windows should be rotated so that the window
11588    * after the focused window is activated. The default application
11589    * handler will respond to this event automatically; your application
11590    * does not need to handle it.
11591    }
11592 	kHICommandRotateFloatingWindowsForward = FourCharCode('rtfw');
11593 
11594   {
11595    * The floating window focus hotkey (ctl-F6 by default) has been
11596    * pressed, and floating windows should be rotated so that the window
11597    * before the focused window is activated. The default application
11598    * handler will respond to this event automatically; your application
11599    * does not need to handle it.
11600    }
11601 	kHICommandRotateFloatingWindowsBackward = FourCharCode('rtfb');
11602 
11603   {
11604    * The window should enter full screen mode if not currently in full
11605    * screen mode, or vice-versa. The default application handler will
11606    * respond to this event automatically; your application does not
11607    * need to handle it. The default handler will also set the text of a
11608    * menu item with this command ID automatically to either "Enter Full
11609    * Screen" or "Exit Full Screen", and disable or enable the menu item
11610    * appropriately, depending on the fullscreen support and state of
11611    * the focused window. Available on Mac OS X 10.7 and later.
11612    }
11613 	kHICommandToggleFullScreen = FourCharCode('fsm ');
11614 
11615   {
11616    * The About menu item has been selected. In Mac OS X 10.3 and later,
11617    * RunApplicationEventLoop installs a handler for this command ID on
11618    * the application target, and will handle this event automatically
11619    * by calling HIAboutBox. Your application may install its own
11620    * handler if it wishes to display a customized about box.
11621    }
11622 	kHICommandAbout = FourCharCode('abou');
11623 
11624   {
11625    * A new document or item should be created.
11626    }
11627 	kHICommandNew = FourCharCode('new ');
11628 
11629   {
11630    * The user wants to open an existing document.
11631    }
11632 	kHICommandOpen = FourCharCode('open');
11633 
11634   {
11635    * The active window should be closed. This command would typically
11636    * be generated by a Close menu item. On Mac OS X 10.3 and later, the
11637    * default application handler responds to this command by sending a
11638    * kEventWindowClose event; on earlier systems, only the standard
11639    * window event handler responded to this event.
11640    }
11641 	kHICommandClose = FourCharCode('clos');
11642 
11643   {
11644    * All active windows should be closed. The default application
11645    * handler responds to this command by sending a kEventWindowCloseAll
11646    * event to the frontmost document window. A "Close All" menu item
11647    * with this command ID is automatically added to the File menu of
11648    * applications that adopt the automatic termination capability in
11649    * Mac OS X 10.7. An application that wants to provide its own Close
11650    * All menu item should use this command ID; in that case, the OS
11651    * will recognize that the application has already provided the Close
11652    * All item, and will not add another one. Available on Mac OS X 10.7
11653    * and later.
11654    }
11655 	kHICommandCloseAll = FourCharCode('cloa');
11656 
11657   {
11658    * The file relating to the active window should be closed. This
11659    * command would typically be used by applications that allow opening
11660    * multiple windows for the same file. There is no default behavior
11661    * for this command ID.
11662    }
11663 	kHICommandCloseFile = FourCharCode('clof');
11664 
11665   {
11666    * The active document should be saved.
11667    }
11668 	kHICommandSave = FourCharCode('save');
11669 
11670   {
11671    * The user wants to save the active document under a new name.
11672    }
11673 	kHICommandSaveAs = FourCharCode('svas');
11674 
11675   {
11676    * The contents of the active document should be reverted to the last
11677    * saved version.
11678    }
11679 	kHICommandRevert = FourCharCode('rvrt');
11680 
11681   {
11682    * The active window should be printed.
11683    }
11684 	kHICommandPrint = FourCharCode('prnt');
11685 
11686   {
11687    * The user wants to configure the current page margins, formatting,
11688    * and print options.
11689    }
11690 	kHICommandPageSetup = FourCharCode('page');
11691 
11692   {
11693    * The application�s help book should be displayed. Used by the Help
11694    * Manager when it adds the "<AppName> Help" menu item to the Help
11695    * menu. The Help Manager installs a handler for this command ID on
11696    * the Help menu returned by HMGetHelpMenu, and will respond to this
11697    * event automatically; your application does not need to handle it.
11698    }
11699 	kHICommandAppHelp = FourCharCode('ahlp');
11700 
11701   {
11702    * The character palette needs to be shown. Events with this command
11703    * ID are only generated in Mac OS X 10.3 and later. The toolbox will
11704    * respond to this event automatically; your application does not
11705    * need to handle it.
11706    }
11707 	kHICommandShowCharacterPalette = FourCharCode('chrp');
11708 
11709   {
11710    * Display the spelling panel if it is not already visible. Events
11711    * with this command ID are only generated in Mac OS X 10.4 and
11712    * later.  If spell checking has been enabled in MLTE or an
11713    * HITextView then this command is handled automatically.
11714    }
11715 	kHICommandShowSpellingPanel = FourCharCode('shsp');
11716 
11717   {
11718    * Spell check the document now.  Events with this command ID are
11719    * only generated in Mac OS X 10.4 and later.  If spell checking has
11720    * been enabled in MLTE or an HITextView then this command is handled
11721    * automatically.
11722    }
11723 	kHICommandCheckSpelling = FourCharCode('cksp');
11724 	kHICommandChangeSpelling = FourCharCode('chsp');
11725 
11726   {
11727    * Begin interactive spell checking. Events with this command ID are
11728    * only generated in Mac OS X 10.4 and later.  If spell checking has
11729    * been enabled in MLTE or an HITextView then this command is handled
11730    * automatically.
11731    }
11732 	kHICommandCheckSpellingAsYouType = FourCharCode('aspc');
11733 
11734   {
11735    * Ignore this word while spell checking this text view. Events with
11736    * this command ID are only generated in Mac OS X 10.4 and later.  If
11737    * spell checking has been enabled in MLTE or an HITextView then this
11738    * command is handled automatically.
11739    }
11740 	kHICommandIgnoreSpelling = FourCharCode('igsp');
11741 
11742   {
11743    * Learn this spelling for all documents.  Events with this command
11744    * ID are only generated in Mac OS X 10.4 and later.  If spell
11745    * checking has been enabled in MLTE or an HITextView then this
11746    * command is handled automatically.
11747    }
11748 	kHICommandLearnWord = FourCharCode('lrwd');
11749 
11750   {
11751    * Starts listening to spoken dictation. A menu item with this
11752    * command ID is inserted automatically into the Edit menu. An
11753    * application may choose to insert its own menu item with this
11754    * command ID at a custom location in the Edit menu, if appropriate.
11755    * By default, the menu item is always enabled. An application that
11756    * has its own text editing engine should look for this command ID in
11757    * its kEventCommandUpdateStatus event handler and enable or disable
11758    * the menu item appropriately according to keyboard focus. Available
11759    * in Mac OS X 10.8 and later.
11760    }
11761 	kHICommandStartDictation = FourCharCode('sdct');
11762 
11763 
11764 {
11765  *  Summary:
11766  *    Values for the attributes field of the HICommand and
11767  *    HICommandExtended structures.
11768  *
11769  *  Discussion:
11770  *    These bit masks are mutually exclusive; only one should be set at
11771  *    any given time. Some HICommand and HICommandExtended structures
11772  *    will have an attributes value of zero; in this case, there is no
11773  *    information available about the source of the command.
11774  }
11775 const
11776 {
11777    * Indicates that the command originates from a menu item. The
11778    * HICommand.menu and HICommandExtended.source.menu fields are valid.
11779    * This bit is set for commands generated from menu items in all
11780    * versions of CarbonLib and Mac OS X.
11781    }
11782 	kHICommandFromMenu = 1 shl 0;
11783 
11784   {
11785    * Indicates that the command originates from a control. The
11786    * HICommandExtended.source.control field is valid. This bit was
11787    * introduced in Mac OS X 10.2 and CarbonLib 1.6. It is never set in
11788    * earlier versions of Mac OS X or CarbonLib.
11789    }
11790 	kHICommandFromControl = 1 shl 1;
11791 
11792   {
11793    * Indicates that the command originates from a window. The
11794    * HICommandExtended.source.window field is valid. This bit was
11795    * introduced in Mac OS X 10.2 and CarbonLib 1.6. It is never set in
11796    * earlier versions of Mac OS X or CarbonLib.
11797    }
11798 	kHICommandFromWindow = 1 shl 2;
11799 
11800 
11801 {
11802  *  HICommand
11803  *
11804  *  Summary:
11805  *    Information about a command dispatched from a menu.
11806  *
11807  *  Discussion:
11808  *    The HICommand structure was introduced in CarbonLib 1.1 and Mac
11809  *    OS X 10.0. It is provided as the direct object of
11810  *    kEventClassCommand events. Command events are typically generated
11811  *    by either a control/view object or a menu item.
11812  }
11813 type
11814 	HICommand = record
11815 {
11816    * Flags indicating what other fields of the structure are valid.
11817    }
11818 		attributes: UInt32;
11819 
11820   {
11821    * The command ID that was generated.
11822    }
11823 		commandID: UInt32;
11824 	  menuRef: MenuRef_fix;
11825 	  menuItemIndex: MenuItemIndex_fix;
11826 	end;
11827 	HICommandPtr = ^HICommand;
11828 
11829 {
11830  *  HICommandExtended
11831  *
11832  *  Summary:
11833  *    Information about a command dispatched from a menu, control, or
11834  *    window.
11835  *
11836  *  Discussion:
11837  *    The HICommandExtended structure was introduced in Mac OS X 10.2
11838  *    and CarbonLib 1.6. However, because the HICommand and
11839  *    HICommandExtended structures are exactly the same size and have
11840  *    the same fields at the same offsets, you may use an
11841  *    HICommandExtended structure at runtime while running on any
11842  *    version of CarbonLib or Mac OS X. The only difference is that the
11843  *    Extended structure has a union that allows you to get type-safe
11844  *    access to the source object. The originator of the command
11845  *    determines whether the structure actually contains a ControlRef,
11846  *    WindowRef, MenuRef, or nothing at all; you can determine what's
11847  *    in the command by checking the attributes field.
11848  *
11849  *    For example, on Mac OS X 10.2 and later, when a pushbutton is
11850  *    clicked, the Control Manager will send a command event containing
11851  *    the pushbutton's command ID, and will also set the
11852  *    kHICommandFromControl bit in the attributes field and store the
11853  *    button's ControlRef in the source.control field. On Mac OS X 10.0
11854  *    and 10.1, the same command event would be sent, but the
11855  *    kHICommandFromControl attribute would not be set, and the
11856  *    source.control field would be uninitialized. Your code can use an
11857  *    HICommandExtended structure when running on 10.0 or 10.1, as long
11858  *    as it first checks for kHICommandFromControl before accessing the
11859  *    source.control field.
11860  }
11861 type
11862 	HICommandExtended = record
11863 {
11864    * Flags indicating what other fields of the structure are valid.
11865    }
11866 		attributes: UInt32;
11867 
11868   {
11869    * The command ID that was generated.
11870    }
11871 		commandID: UInt32;
11872 		case SInt16 of
11873 			0: (
11874 				control: ControlRef;
11875 			);
11876 			1: (
11877 				window: WindowRef;
11878 			);
11879 			2: (menuRef: MenuRef_fix;
11880 					menuItemIndex: MenuItemIndex_fix;
11881 			);
11882 	end;
11883 	HICommandExtendedPtr = ^HICommandExtended;
11884 {--------------------------------------------------------------------------------------}
11885 {  Control Events                                                                      }
11886 {--------------------------------------------------------------------------------------}
11887 
11888 {
11889     kEventClassControl quick reference:
11890 
11891     // lifespan
11892     kEventControlInitialize                     = 1000,
11893     kEventControlDispose                        = 1001,
11894     kEventControlGetOptimalBounds               = 1003,
11895     kEventControlOptimalBoundsChanged           = 1004,
11896     kEventControlDefInitialize                  = kEventControlInitialize,
11897     kEventControlDefDispose                     = kEventControlDispose,
11898 
11899     // event handling
11900     kEventControlHit                            = 1,
11901     kEventControlSimulateHit                    = 2,
11902     kEventControlHitTest                        = 3,
11903     kEventControlDraw                           = 4,
11904     kEventControlApplyBackground                = 5,
11905     kEventControlApplyTextColor                 = 6,
11906     kEventControlSetFocusPart                   = 7,
11907     kEventControlGetFocusPart                   = 8,
11908     kEventControlActivate                       = 9,
11909     kEventControlDeactivate                     = 10,
11910     kEventControlSetCursor                      = 11,
11911     kEventControlContextualMenuClick            = 12,
11912     kEventControlClick                          = 13,
11913     kEventControlGetNextFocusCandidate          = 14,
11914     kEventControlGetAutoToggleValue             = 15,
11915     kEventControlInterceptSubviewClick          = 16,
11916     kEventControlGetClickActivation             = 17,
11917     kEventControlDragEnter                      = 18,
11918     kEventControlDragWithin                     = 19,
11919     kEventControlDragLeave                      = 20,
11920     kEventControlDragReceive                    = 21,
11921     kEventControlInvalidateForSizeChange        = 22,
11922     kEventControlTrackingAreaEntered            = 23,   // in HIView.h
11923     kEventControlTrackingAreaExited             = 24,   // in HIView.h
11924 
11925     // tracking
11926     kEventControlTrack                          = 51,
11927     kEventControlGetScrollToHereStartPoint      = 52,
11928     kEventControlGetIndicatorDragConstraint     = 53,
11929     kEventControlIndicatorMoved                 = 54,
11930     kEventControlGhostingFinished               = 55,
11931     kEventControlGetActionProcPart              = 56,
11932 
11933     // accessors
11934     kEventControlGetPartRegion                  = 101,
11935     kEventControlGetPartBounds                  = 102,
11936     kEventControlSetData                        = 103,
11937     kEventControlGetData                        = 104,
11938     kEventControlGetSizeConstraints             = 105,
11939     kEventControlGetFrameMetrics                = 106,
11940 
11941     // notification
11942     kEventControlValueFieldChanged              = 151,
11943     kEventControlAddedSubControl                = 152,
11944     kEventControlRemovingSubControl             = 153,
11945     kEventControlBoundsChanged                  = 154,
11946     kEventControlVisibilityChanged              = 157,
11947     kEventControlTitleChanged                   = 158,
11948     kEventControlOwningWindowChanged            = 159,
11949     kEventControlHiliteChanged                  = 160,
11950     kEventControlEnabledStateChanged            = 161,
11951     kEventControlLayoutInfoChanged              = 162,
11952     kEventControlFocusPartChanged               = 164,
11953 
11954     // miscellaneous
11955     kEventControlArbitraryMessage               = 201
11956 }
11957 
11958 {
11959  *  kEventClassControl / kEventControlClick
11960  *
11961  *  Summary:
11962  *    A mouse down event occurred over a control.
11963  *
11964  *  Discussion:
11965  *    This event is sent when a non-contextual-menu click occurs over a
11966  *    control; a contextual menu click generates
11967  *    kEventControlContextualMenuClick instead.
11968  *
11969  *    The handler of this event is responsible for two things: first,
11970  *    the handler must set the keyboard focus to the control if the
11971  *    control takes focus on clicks; look for the
11972  *    kControlGetsFocusOnClick feature bit and call an API such as
11973  *    SetKeyboardFocus. Second, the handler must call one of the
11974  *    control tracking APIs: HIViewClick, HandleControlClick, or
11975  *    TrackControl. The standard window handler does both of these
11976  *    things.
11977  *
11978  *    Warning: Beware of handling kEventControlClick events! This is
11979  *    usually NOT the event you really want to handle.
11980  *    kEventControlClick is a request to "please click this control,"
11981  *    not "allow a control definition to track the mouse." If you are
11982  *    implementing or overriding a control definition�s or HIView�s
11983  *    support for tracking the mouse, you should handle
11984  *    kEventControlTrack instead.
11985  *
11986  *  Mac OS X threading:
11987  *    Not thread safe
11988  *
11989  *  Parameters:
11990  *
11991  *    --> kEventParamDirectObject (in, typeControlRef)
11992  *          The control that was clicked.
11993  *
11994  *    --> kEventParamMouseLocation (in, typeHIPoint)
11995  *          The mouse location, in global coordinates.
11996  *
11997  *    --> kEventParamWindowRef (in, typeWindowRef)
11998  *          The window under the mouse.
11999  *
12000  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
12001  *          The window-relative position of the mouse in the window
12002  *          given in the kEventParamWindowRef parameter. 0,0 is at the
12003  *          top left of the structure of the window.
12004  *
12005  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
12006  *          The part code that the mouse location hit in the window.
12007  *          This parameter only exists if the WindowRef parameter
12008  *          exists. This saves you the trouble of calling FindWindow,
12009  *          which is expensive on Mac OS X as it needs to call the
12010  *          Window Server. Available in Mac OS X 10.3 and later.
12011  *
12012  *    --> kEventParamKeyModifiers (in, typeUInt32)
12013  *          The keyboard modifiers that were pressed when the event was
12014  *          generated.
12015  *
12016  *    --> kEventParamMouseButton (in, typeMouseButton)
12017  *          Which mouse button was pressed.
12018  *
12019  *    --> kEventParamClickCount (in, typeUInt32)
12020  *          Whether this is a single click, double click, etc.
12021  *
12022  *    --> kEventParamMouseChord (in, typeUInt32)
12023  *          Which other mouse buttons were pressed when the event was
12024  *          generated. Available on Mac OS X only.
12025  *
12026  *    --> kEventParamTabletEventType (in, typeUInt32)
12027  *          The type of tablet event which generated this mouse event;
12028  *          contains either kEventTabletPoint or kEventTabletProximity.
12029  *          Only present if the event was generated from a tablet.
12030  *
12031  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
12032  *          Further information about the tablet event which generated
12033  *          this mouse event. Present if the the
12034  *          kEventParamTabletEventType parameter contains
12035  *          kEventTabletPoint.
12036  *
12037  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
12038  *          Further information about the tablet event which generated
12039  *          this mouse event. Present if the the
12040  *          kEventParamTabletEventType parameter contains
12041  *          kEventTabletProximity.
12042  *
12043  *  Availability:
12044  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12045  *    CarbonLib:        in CarbonLib 1.3.1 and later
12046  }
12047 const
12048 	kEventControlClick = 13;
12049 
12050 {
12051  *  kEventClassControl / kEventControlHit
12052  *
12053  *  Summary:
12054  *    Sent by TrackControl and HandleControlClick after handling a
12055  *    click in a control.
12056  *
12057  *  Discussion:
12058  *    This event indicates that a control has been manipulated by the
12059  *    user and that the user released the mouse button over some part
12060  *    of the control. It is sent automatically by the Control Manager
12061  *    when the control tracking code returns a non-zero part
12062  *    code.
12063  *
12064  *    You might want to handle this event in a custom control
12065  *    definition if your control definition has special behavior after
12066  *    the control has been tracked. You can also handle this event in
12067  *    application code, to be notified after a control has been
12068  *    tracked; however, from the application level, it is generally
12069  *    preferred to provide a command ID for the control and handle
12070  *    kEventCommandProcess instead of kEventControlHit. Handling
12071  *    kEventCommandProcess is more generic and allows the same code to
12072  *    handle events from both controls and menu items.
12073  *
12074  *  Mac OS X threading:
12075  *    Not thread safe
12076  *
12077  *  Parameters:
12078  *
12079  *    --> kEventParamDirectObject (in, typeControlRef)
12080  *          The control that was tracked.
12081  *
12082  *    --> kEventParamControlPart (in, typeControlPartCode)
12083  *          The control part that the mouse was over when it was
12084  *          released.
12085  *
12086  *    --> kEventParamKeyModifiers (in, typeUInt32)
12087  *          The keyboard modifiers that were pressed when the mouse was
12088  *          released.
12089  *
12090  *    --> kEventParamClickCount (in, typeUInt32)
12091  *          Whether the original mouse-down on the control was a single
12092  *          click, double click, etc. This parameter is optional and
12093  *          may not be present in all instances of this event. Assume a
12094  *          click count of 1 if this parameter is not present.
12095  *          Available in Mac OS X 10.5 and later.
12096  *
12097  *  Availability:
12098  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12099  *    CarbonLib:        in CarbonLib 1.1 and later
12100  }
12101 const
12102 	kEventControlHit = 1;
12103 
12104 {
12105  *  kEventClassControl / kEventControlInitialize
12106  *
12107  *  Summary:
12108  *    Allows the control to initialize private data.
12109  *
12110  *  Mac OS X threading:
12111  *    Not thread safe
12112  *
12113  *  Parameters:
12114  *
12115  *    --> kEventParamDirectObject (in, typeControlRef)
12116  *          The control that is being created.
12117  *
12118  *    --> kEventParamInitCollection (in, typeCollection)
12119  *          Initialization data supplied to CreateCustomControl.
12120  *
12121  *    <-- kEventParamControlFeatures (out, typeUInt32)
12122  *          On exit, your event handler should supply the control
12123  *          features flags. NOTE: On Mac OS X 10.3 and later, this is
12124  *          deprecated in favor of using the HIViewChangeFeatures API.
12125  *          Instead of supplying this parameter, just call
12126  *          HIViewChangeFeatures. Also, this parameter can only be used
12127  *          to supply features for the original kControlFoo features,
12128  *          not the new kHIViewFoo features.
12129  *
12130  *  Availability:
12131  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12132  *    CarbonLib:        not available
12133  }
12134 const
12135 	kEventControlInitialize = 1000;
12136 
12137 {
12138  *  kEventClassControl / kEventControlDispose
12139  *
12140  *  Summary:
12141  *    Allows the control to dispose of private data.
12142  *
12143  *  Mac OS X threading:
12144  *    Not thread safe
12145  *
12146  *  Parameters:
12147  *
12148  *    --> kEventParamDirectObject (in, typeControlRef)
12149  *          The control that is being destroyed.
12150  *
12151  *  Availability:
12152  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12153  *    CarbonLib:        not available
12154  }
12155 const
12156 	kEventControlDispose = 1001;
12157 
12158 {
12159  *  kEventClassControl / kEventControlGetOptimalBounds
12160  *
12161  *  Summary:
12162  *    Allows the control to report its best size and its text baseline
12163  *    based on its current settings.
12164  *
12165  *  Mac OS X threading:
12166  *    Not thread safe
12167  *
12168  *  Parameters:
12169  *
12170  *    --> kEventParamDirectObject (in, typeControlRef)
12171  *          The control whose optimal bounds to return.
12172  *
12173  *    <-- kEventParamControlOptimalBounds (out, typeHIRect)
12174  *          On exit, contains the control�s optimal bounds.
12175  *
12176  *    <-- kEventParamControlOptimalBaselineOffset (out, typeSInt16)
12177  *          On exit, contains the control�s optimal baseline offset:
12178  *          the distance from the top of the control�s optimal bounds
12179  *          to the baseline of the control text, if any. This parameter
12180  *          is optional and does not need to be provided if it doesn�t
12181  *          apply for your control.
12182  *
12183  *  Availability:
12184  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12185  *    CarbonLib:        not available
12186  }
12187 const
12188 	kEventControlGetOptimalBounds = 1003;
12189 
12190 {
12191  *  kEventClassControl / kEventControlOptimalBoundsChanged
12192  *
12193  *  Summary:
12194  *    Sent by a view to itself (and thence to its superviews) to
12195  *    indicate that its optimal bounds have changed. Superviews may use
12196  *    this event as notification that they should relayout their
12197  *    subviews (but handling this event is completely optional).
12198  *
12199  *  Discussion:
12200  *    This event is created and sent by a view itself; it is not sent
12201  *    by HIToolbox. The event must be sent using
12202  *    SendEventToEventTargetWithOptions, passing
12203  *    kEventTargetSendToAllHandlers.
12204  *
12205  *  Mac OS X threading:
12206  *    Not thread safe
12207  *
12208  *  Parameters:
12209  *
12210  *    --> kEventParamDirectObject (in, typeControlRef)
12211  *          The view whose optimal bounds has changed.
12212  *
12213  *  Availability:
12214  *    Mac OS X:         in version 10.5 and later in Carbon.framework
12215  *    CarbonLib:        not available
12216  }
12217 const
12218 	kEventControlOptimalBoundsChanged = 1004;
12219 
12220 {
12221  *  kEventClassControl / kEventControlSimulateHit
12222  *
12223  *  Summary:
12224  *    Sent when your control should simulate a click in response to
12225  *    some other action, such as a return key for a default button.
12226  *
12227  *  Discussion:
12228  *    Note that this event is solely meant to provide visual feedback
12229  *    that a control was clicked. For example, the push button control
12230  *    hilites itself briefly in response to this event. This event does
12231  *    not cause other events (such as kEventControlHit or
12232  *    kEventCommandProcess) to be sent. To fully simulate the results
12233  *    of clicking on a control, you can use the HIViewSimulateClick
12234  *    API, which sends a kEventControlSimulateHit event and also sends
12235  *    the kEventControlHit and kEventCommandProcess events that would
12236  *    normally result from a click on a control.
12237  *
12238  *  Mac OS X threading:
12239  *    Not thread safe
12240  *
12241  *  Parameters:
12242  *
12243  *    --> kEventParamDirectObject (in, typeControlRef)
12244  *          The control for which a hit should be simulated.
12245  *
12246  *    --> kEventParamKeyModifiers (in, typeUInt32)
12247  *          The keyboard modifiers that should be used for the
12248  *          simulated hit.
12249  *
12250  *    <-> kEventParamControlPart (in/out, typeControlPartCode)
12251  *          On entry, contains the part code for which the control
12252  *          should simulate a hit. On exit, the control may modify this
12253  *          parameter to reflect the same sort of part code that it
12254  *          would pass back while handling kEventControlTrack.
12255  *
12256  *  Availability:
12257  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12258  *    CarbonLib:        not available
12259  }
12260 const
12261 	kEventControlSimulateHit = 2;
12262 
12263 {
12264  *  kEventClassControl / kEventControlHitTest
12265  *
12266  *  Summary:
12267  *    Sent when someone wants to find out what part of your control is
12268  *    at a given point in local coordinates.
12269  *
12270  *  Mac OS X threading:
12271  *    Not thread safe
12272  *
12273  *  Parameters:
12274  *
12275  *    --> kEventParamDirectObject (in, typeControlRef)
12276  *          The control to hit-test.
12277  *
12278  *    --> kEventParamMouseLocation (in, typeQDPoint)
12279  *          The point to hit-test. For controls in non-compositing
12280  *          windows, this coordinate is in local coordinates of the
12281  *          owning window; for controls in compositing windows, this
12282  *          coordinate is in view-local coordinates.
12283  *
12284  *    <-- kEventParamControlPart (out, typeControlPartCode)
12285  *          On exit, contains the part code of the control part that
12286  *          was hit, or kControlNoPart if no part was hit.
12287  *
12288  *  Availability:
12289  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12290  *    CarbonLib:        not available
12291  }
12292 const
12293 	kEventControlHitTest = 3;
12294 
12295 {
12296  *  kEventClassControl / kEventControlDraw
12297  *
12298  *  Summary:
12299  *    Sent when your control should draw itself. The event can
12300  *    optionally contain a port in which to draw and a part to
12301  *    constrain drawing to.
12302  *
12303  *  Mac OS X threading:
12304  *    Not thread safe
12305  *
12306  *  Parameters:
12307  *
12308  *    --> kEventParamDirectObject (in, typeControlRef)
12309  *          The control to be drawn.
12310  *
12311  *    --> kEventParamControlPart (in, typeControlPartCode)
12312  *          The control part code to draw. This parameter is optional
12313  *          and may not be present in all instances of this event. Draw
12314  *          the entire control if the parameter is not present.
12315  *
12316  *    --> kEventParamGrafPort (in, typeGrafPtr)
12317  *          The GrafPort into which to draw the control. This parameter
12318  *          is optional and may not be present in all instances of this
12319  *          event. Draw into the current port if the parameter is not
12320  *          present.
12321  *
12322  *    --> kEventParamRgnHandle (in, typeQDRgnHandle)
12323  *          A region describing the area that needs to be redrawn; you
12324  *          may constrain your drawing to this region. This parameter
12325  *          is only provided on Mac OS X 10.2 and later, and only in
12326  *          certain situations in compositing mode (when the view is
12327  *          visible, etc). Draw the entire control if the parameter is
12328  *          not present.
12329  *
12330  *    --> kEventParamShape (in, typeHIShapeRef)
12331  *          An HIShapeRef describing the area that needs to be redrawn;
12332  *          you may constrain your drawing to this area. This parameter
12333  *          is only provided on Mac OS X 10.4 and later, and only in
12334  *          certain situations in compositing mode (when the view is
12335  *          visible, etc). Draw the entire control if the parameter is
12336  *          not present.
12337  *
12338  *    --> kEventParamCGContextRef (in, typeCGContextRef)
12339  *          The CGContext into which to draw the control. This
12340  *          parameter is only provided on Mac OS X 10.2 and later, and
12341  *          only when the owning window uses compositing mode. The
12342  *          context is already transformed and clipped appropriately
12343  *          for view-local drawing. If this parameter is present, you
12344  *          should always use it; this will be extremely important to
12345  *          allow printing of controls. If this parameter is not
12346  *          present (prior to Mac OS X 10.2, or in a non-compositing
12347  *          window), and you want to draw with CoreGraphics, you can
12348  *          create your own CGContext with QDBeginCGContext.
12349  *
12350  *  Availability:
12351  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12352  *    CarbonLib:        not available
12353  }
12354 const
12355 	kEventControlDraw = 4;
12356 
12357 {$ifc not TARGET_CPU_64}
12358 {
12359  *  kEventClassControl / kEventControlApplyBackground
12360  *
12361  *  Summary:
12362  *    Sent when your control should apply its background color or
12363  *    pattern to the specified port so that subcontrols of this control
12364  *    can properly erase.
12365  *
12366  *  Discussion:
12367  *    This event is used for non-composited control drawing. When an
12368  *    embedded control in a non-composited window draws, it first
12369  *    erases its bounding rect. Before calling EraseRect or EraseRgn,
12370  *    the control calls SetUpControlBackground, which sends this event
12371  *    to parent controls of the embedded control that have the
12372  *    kControlHasSpecialBackground feature flag. An embedding control
12373  *    may respond to this event by setting the background color or
12374  *    pattern of the specified GrafPort; this color or pattern will
12375  *    then be used by the embedded control when it erases its
12376  *    bounds.
12377  *
12378  *    Note that an embedding control should not actually draw its
12379  *    background in response to this event; doing so would not have any
12380  *    effect, because the embedded control will erase any drawing
12381  *    shortly anyways.
12382  *
12383  *  Mac OS X threading:
12384  *    Not thread safe
12385  *
12386  *  Parameters:
12387  *
12388  *    --> kEventParamDirectObject (in, typeControlRef)
12389  *          The control which should apply a background color or
12390  *          pattern.
12391  *
12392  *    --> kEventParamControlSubControl (in, typeControlRef)
12393  *          The subcontrol that is about to draw.
12394  *
12395  *    --> kEventParamControlDrawDepth (in, typeSInt16)
12396  *          The bit depth of the GDevice on which the subcontrol will
12397  *          be drawn.
12398  *
12399  *    --> kEventParamControlDrawInColor (in, typeBoolean)
12400  *          Whether the GDevice on which the subcontrol will be drawn
12401  *          is in color or black & white.
12402  *
12403  *    --> kEventParamGrafPort (in, typeGrafPtr)
12404  *          The port to which the background color or pattern should be
12405  *          applied. This parameter is optional and may not be present
12406  *          in all instances of this event. Apply the background to the
12407  *          current port if this parameter is not present.
12408  *
12409  *  Availability:
12410  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12411  *    CarbonLib:        not available
12412  }
12413 const
12414 	kEventControlApplyBackground = 5;
12415 
12416 {$endc} {not TARGET_CPU_64}
12417 
12418 {
12419  *  kEventClassControl / kEventControlApplyTextColor
12420  *
12421  *  Summary:
12422  *    Sent when your control should apply a color or pattern to the
12423  *    specified port and context so a subcontrol can draw text which
12424  *    looks appropriate for your control�s background.
12425  *
12426  *  Mac OS X threading:
12427  *    Not thread safe
12428  *
12429  *  Parameters:
12430  *
12431  *    --> kEventParamDirectObject (in, typeControlRef)
12432  *          The control which should apply a text color.
12433  *
12434  *    --> kEventParamControlSubControl (in, typeControlRef)
12435  *          The subcontrol that is about to draw.
12436  *
12437  *    --> kEventParamControlDrawDepth (in, typeSInt16)
12438  *          The bit depth of the GDevice on which the subcontrol will
12439  *          be drawn.
12440  *
12441  *    --> kEventParamControlDrawInColor (in, typeBoolean)
12442  *          Whether the GDevice on which the subcontrol will be drawn
12443  *          is in color or black & white.
12444  *
12445  *    --> kEventParamCGContextRef (in, typeCGContextRef)
12446  *          The CGContext to which the text color should be applied.
12447  *          This parameter is optional and may not be present in all
12448  *          instances of this event.
12449  *
12450  *    --> kEventParamGrafPort (in, typeGrafPtr)
12451  *          The GrafPort to which the text color should be applied.
12452  *          This parameter is optional and may not be present in all
12453  *          instances of this event. Apply to the current port if this
12454  *          parameter is not present.
12455  *
12456  *    <-- kEventParamControlDrawEngraved (out, typeBoolean)
12457  *          On exit, contains a Boolean indicating whether your control
12458  *          wants the subcontrol to draw its text engraved. If your
12459  *          control does not want the subcontrol to draw engraved text,
12460  *          you may leave this parameter empty.
12461  *
12462  *  Availability:
12463  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12464  *    CarbonLib:        not available
12465  }
12466 const
12467 	kEventControlApplyTextColor = 6;
12468 
12469 {
12470  *  kEventClassControl / kEventControlGetNextFocusCandidate
12471  *
12472  *  Summary:
12473  *    Sent so that a given control can customize the focus order of its
12474  *    subcontrols.
12475  *
12476  *  Discussion:
12477  *    The recipient will receive a start subcontrol in the
12478  *    kEventParamStartControl parameter and a focusing direction in the
12479  *    kEventParamControlPart parameter. You must only pass back
12480  *    subcontrols of yourself (or NULL) when receiving this event; if
12481  *    you do otherwise, the Control Manager�s behavior is undefined.
12482  *
12483  *  Mac OS X threading:
12484  *    Not thread safe
12485  *
12486  *  Parameters:
12487  *
12488  *    --> kEventParamControlPart (in, typeControlPartCode)
12489  *          A focusing meta-part code, either kControlFocusNextPart or
12490  *          kControlFocusPrevPart.
12491  *
12492  *    --> kEventParamStartControl (in, typeControlRef)
12493  *          The starting point from which to search for the next or
12494  *          previous control. This parameter is optional and may not be
12495  *          present in all instances of this event. Find the first
12496  *          subcontrol in the appropriate focusing direction if this
12497  *          parameter is not present or if it contains NULL.
12498  *
12499  *    <-- kEventParamNextControl (out, typeControlRef)
12500  *          On exit, should contain the next or previous subcontrol; if
12501  *          there is no next subcontrol in the given focusing
12502  *          direction, the recipient must either exclude the
12503  *          kEventParamNextControl parameter or set it to NULL
12504  *
12505  *  Availability:
12506  *    Mac OS X:         in version 10.2 and later in Carbon.framework
12507  *    CarbonLib:        not available
12508  }
12509 const
12510 	kEventControlGetNextFocusCandidate = 14;
12511 
12512 {
12513  *  kEventClassControl / kEventControlGetAutoToggleValue
12514  *
12515  *  Summary:
12516  *    This event is sent when the Control Manager is about to
12517  *    autotoggle a control. You can specify the toggled value to use
12518  *    based on the current value of your control.
12519  *
12520  *  Discussion:
12521  *    The Control Manager provides default behavior for this event. If
12522  *    the event is not handled by a control, the default handler
12523  *    automatically provides this mapping: if the control�s value is 1,
12524  *    the toggled value is 0. If the control�s value is any other
12525  *    value, the toggled value is 1.
12526  *
12527  *  Mac OS X threading:
12528  *    Not thread safe
12529  *
12530  *  Parameters:
12531  *
12532  *    --> kEventParamDirectObject (in, typeControlRef)
12533  *          The control that is being toggled.
12534  *
12535  *    --> kEventParamControlPart (in, typeControlPartCode)
12536  *          The control part that is being toggled.
12537  *
12538  *    <-- kEventParamControlValue (out, typeSInt32)
12539  *          On exit, contains the new control value.
12540  *
12541  *  Availability:
12542  *    Mac OS X:         in version 10.2 and later in Carbon.framework
12543  *    CarbonLib:        not available
12544  }
12545 const
12546 	kEventControlGetAutoToggleValue = 15;
12547 
12548 {
12549  *  kEventClassControl / kEventControlInterceptSubviewClick
12550  *
12551  *  Summary:
12552  *    This is sent when the HIViewGetViewForMouseEvent API is called,
12553  *    to allow embedding controls to intercept clicks in their embedded
12554  *    controls.
12555  *
12556  *  Discussion:
12557  *    The Control Manager sends this event before descending into any
12558  *    subviews. Controls can override this to intercept clicks which
12559  *    would normally be destined for their children. For example, the
12560  *    HIToolbar control intercepts cmd-clicks to handle dragging its
12561  *    children. To accomplish this, it overrides this event, looking
12562  *    for the command key modifier. When the command key is pressed,
12563  *    the view just returns noErr as the result from its event handler.
12564  *    This tells the Control Manager to stop descending and return the
12565  *    view that it called as the mouse event destination.
12566  *
12567  *  Mac OS X threading:
12568  *    Not thread safe
12569  *
12570  *  Parameters:
12571  *
12572  *    --> kEventParamDirectObject (in, typeControlRef)
12573  *          The control that is being given a chance to intercept a
12574  *          click. This parameter is only available in Mac OS X 10.5
12575  *          and later.
12576  *
12577  *    --> kEventParamEventRef (in, typeEventRef)
12578  *          The mouse-down event to intercept.
12579  *
12580  *  Result:
12581  *    An operating system result code. Return noErr to indicate that
12582  *    this view intercepted the click, or eventNotHandledErr to allow
12583  *    subviews of this view to take the click.
12584  *
12585  *  Availability:
12586  *    Mac OS X:         in version 10.2 and later in Carbon.framework
12587  *    CarbonLib:        not available
12588  }
12589 const
12590 	kEventControlInterceptSubviewClick = 16;
12591 
12592 {
12593  *  kEventClassControl / kEventControlGetClickActivation
12594  *
12595  *  Summary:
12596  *    Sent when a click occurs in a window. Allows the control to
12597  *    determine whether the window should be activated and whether the
12598  *    click should be handled.
12599  *
12600  *  Discussion:
12601  *    This is very much like the window class version of this event.
12602  *    The difference is that the mouse location is view- or
12603  *    port-relative. This event is actually a copy of the mouse down
12604  *    event, and so it has all the parameters that such an event would
12605  *    have (modifiers, button number, etc.).
12606  *
12607  *    When handling a click, this event is sent first, and is sent only
12608  *    to the control that was clicked; it is not propagated to the
12609  *    embedder of the clicked control. If the event is not handled,
12610  *    then a kEventWindowGetClickActivation event is sent to the window
12611  *    that was clicked.
12612  *
12613  *  Mac OS X threading:
12614  *    Not thread safe
12615  *
12616  *  Parameters:
12617  *
12618  *    --> kEventParamDirectObject (in, typeControlRef)
12619  *          The control that was clicked.
12620  *
12621  *    <-- kEventParamClickActivation (out, typeClickActivationResult)
12622  *          On exit, indicates how the click should be handled. Should
12623  *          be set a ClickActivationResult constant from Controls.h.
12624  *
12625  *    --> kEventParamMouseLocation (in, typeHIPoint)
12626  *          The mouse location, in view-local coordinates if the
12627  *          control�s owning window is composited, or port-local
12628  *          coordinates if not.
12629  *
12630  *    --> kEventParamWindowRef (in, typeWindowRef)
12631  *          The window under the mouse.
12632  *
12633  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
12634  *          The window-relative position of the mouse in the window
12635  *          given in the kEventParamWindowRef parameter. 0,0 is at the
12636  *          top left of the structure of the window.
12637  *
12638  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
12639  *          The part code that the mouse location hit in the window.
12640  *          This parameter only exists if the WindowRef parameter
12641  *          exists. This saves you the trouble of calling FindWindow,
12642  *          which is expensive on Mac OS X as it needs to call the
12643  *          Window Server. Available in Mac OS X 10.3 and later.
12644  *
12645  *    --> kEventParamKeyModifiers (in, typeUInt32)
12646  *          The keyboard modifiers that were pressed when the event was
12647  *          generated.
12648  *
12649  *    --> kEventParamMouseButton (in, typeMouseButton)
12650  *          Which mouse button was pressed.
12651  *
12652  *    --> kEventParamClickCount (in, typeUInt32)
12653  *          Whether this is a single click, double click, etc.
12654  *
12655  *    --> kEventParamMouseChord (in, typeUInt32)
12656  *          Which other mouse buttons were pressed when the event was
12657  *          generated. Available on Mac OS X only.
12658  *
12659  *    --> kEventParamTabletEventType (in, typeUInt32)
12660  *          The type of tablet event which generated this mouse event;
12661  *          contains either kEventTabletPoint or kEventTabletProximity.
12662  *          Only present if the event was generated from a tablet.
12663  *
12664  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
12665  *          Further information about the tablet event which generated
12666  *          this mouse event. Present if the the
12667  *          kEventParamTabletEventType parameter contains
12668  *          kEventTabletPoint.
12669  *
12670  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
12671  *          Further information about the tablet event which generated
12672  *          this mouse event. Present if the the
12673  *          kEventParamTabletEventType parameter contains
12674  *          kEventTabletProximity.
12675  *
12676  *  Availability:
12677  *    Mac OS X:         in version 10.2 and later in Carbon.framework
12678  *    CarbonLib:        not available
12679  }
12680 const
12681 	kEventControlGetClickActivation = 17;
12682 
12683 {
12684  *  kEventClassControl / kEventControlDragEnter
12685  *
12686  *  Summary:
12687  *    A drag has entered your control.
12688  *
12689  *  Discussion:
12690  *    If you at all wish to handle the drag, you must return true in
12691  *    the kEventParamControlWouldAcceptDrop parameter from your event
12692  *    handler in response to this event. If you return
12693  *    eventNotHandledErr, do not supply a
12694  *    kEventParamControlWouldAcceptDrop parameter, or set its value to
12695  *    false, you will not receive 'within' or 'leave' messages, nor
12696  *    will you be eligible to receive the drop. This is done to try to
12697  *    be as efficient as possible when sending events during the drag
12698  *    operation.
12699  *
12700  *    Note that in order to receive this event, you must first call the
12701  *    SetAutomaticControlDragTrackingEnabledForWindow API, passing true
12702  *    for the inTracks parameter, and then call the
12703  *    SetControlDragTrackingEnabled API, again passing true for the
12704  *    inTracks parameter.
12705  *
12706  *  Mac OS X threading:
12707  *    Not thread safe
12708  *
12709  *  Parameters:
12710  *
12711  *    --> kEventParamDirectObject (in, typeControlRef)
12712  *          The control that is the drag target.
12713  *
12714  *    --> kEventParamDragRef (in, typeDragRef)
12715  *          The DragRef for the drag.
12716  *
12717  *    <-- kEventParamControlWouldAcceptDrop (out, typeBoolean)
12718  *          The control would accept the drop. Return true in this
12719  *          parameter if your view wants to track and possibly receive
12720  *          this drag.
12721  *
12722  *  Availability:
12723  *    Mac OS X:         in version 10.2 and later in Carbon.framework
12724  *    CarbonLib:        not available
12725  }
12726 const
12727 	kEventControlDragEnter = 18;
12728 
12729 {
12730  *  kEventClassControl / kEventControlDragWithin
12731  *
12732  *  Summary:
12733  *    A drag has moved with your airspace (but not on any subcontrol).
12734  *
12735  *  Discussion:
12736  *    Your control will typically respond to this event by drawing its
12737  *    drag highlight. If the user moves into a subcontrol, it becomes
12738  *    the target of the drag and your control will not receive 'within'
12739  *    messages any longer.
12740  *
12741  *    Note that in order to receive this event, you must first call the
12742  *    SetAutomaticControlDragTrackingEnabledForWindow API, passing true
12743  *    for the inTracks parameter, and then call the
12744  *    SetControlDragTrackingEnabled API, again passing true for the
12745  *    inTracks parameter.
12746  *
12747  *  Mac OS X threading:
12748  *    Not thread safe
12749  *
12750  *  Parameters:
12751  *
12752  *    --> kEventParamDirectObject (in, typeControlRef)
12753  *          The control that is the drag target.
12754  *
12755  *    --> kEventParamDragRef (in, typeDragRef)
12756  *          The DragRef for the drag.
12757  *
12758  *  Availability:
12759  *    Mac OS X:         in version 10.2 and later in Carbon.framework
12760  *    CarbonLib:        not available
12761  }
12762 const
12763 	kEventControlDragWithin = 19;
12764 
12765 {
12766  *  kEventClassControl / kEventControlDragLeave
12767  *
12768  *  Summary:
12769  *    A drag is leaving your view.
12770  *
12771  *  Discussion:
12772  *    Your control will typically respond to this event by removing its
12773  *    drag highlight.
12774  *
12775  *    Note that in order to receive this event, you must first call the
12776  *    SetAutomaticControlDragTrackingEnabledForWindow API, passing true
12777  *    for the inTracks parameter, and then call the
12778  *    SetControlDragTrackingEnabled API, again passing true for the
12779  *    inTracks parameter.
12780  *
12781  *  Mac OS X threading:
12782  *    Not thread safe
12783  *
12784  *  Parameters:
12785  *
12786  *    --> kEventParamDirectObject (in, typeControlRef)
12787  *          The control that is the drag target.
12788  *
12789  *    --> kEventParamDragRef (in, typeDragRef)
12790  *          The DragRef for the drag.
12791  *
12792  *  Availability:
12793  *    Mac OS X:         in version 10.2 and later in Carbon.framework
12794  *    CarbonLib:        not available
12795  }
12796 const
12797 	kEventControlDragLeave = 20;
12798 
12799 {
12800  *  kEventClassControl / kEventControlDragReceive
12801  *
12802  *  Summary:
12803  *    Congratulations, you are the lucky recipient of a drag. Enjoy it.
12804  *
12805  *  Discussion:
12806  *    Note that in order to receive this event, you must first call the
12807  *    SetAutomaticControlDragTrackingEnabledForWindow API, passing true
12808  *    for the inTracks parameter, and then call the
12809  *    SetControlDragTrackingEnabled API, again passing true for the
12810  *    inTracks parameter.
12811  *
12812  *  Mac OS X threading:
12813  *    Not thread safe
12814  *
12815  *  Parameters:
12816  *
12817  *    --> kEventParamDirectObject (in, typeControlRef)
12818  *          The control that is the drag target.
12819  *
12820  *    --> kEventParamDragRef (in, typeDragRef)
12821  *          The DragRef for the drag.
12822  *
12823  *  Availability:
12824  *    Mac OS X:         in version 10.2 and later in Carbon.framework
12825  *    CarbonLib:        not available
12826  }
12827 const
12828 	kEventControlDragReceive = 21;
12829 
12830 {
12831  *  kEventClassControl / kEventControlSetFocusPart
12832  *
12833  *  Summary:
12834  *    Sent when your control is gaining, losing, or changing the focus.
12835  *
12836  *  Mac OS X threading:
12837  *    Not thread safe
12838  *
12839  *  Parameters:
12840  *
12841  *    --> kEventParamDirectObject (in, typeControlRef)
12842  *          The control that is gaining, losing, or changing focus.
12843  *
12844  *    --> kEventParamControlFocusEverything (in, typeBoolean)
12845  *          Indicates whether to allowing focusing on a part that
12846  *          doesn�t accept general keyboard input, such as a push
12847  *          button, or if only traditionally focusable parts such as
12848  *          edit fields and list boxes should be allowed to gain focus.
12849  *          This parameter is optional and may not be present in all
12850  *          instances of this event. Restrict focus to traditionally
12851  *          focusable parts if this parameter is not present.
12852  *
12853  *    <-> kEventParamControlPart (in/out, typeControlPartCode)
12854  *          On entry, a part code that may be either an actual control
12855  *          part or a control focus meta-part. This parameter may be
12856  *          one of kControlFocusNoPart (if the control is losing
12857  *          focus), kControlFocusNextPart (if the next part in the
12858  *          control should be focused), kControlFocusPrevPart (if the
12859  *          previous part in the control should be focused), or an
12860  *          actual control part (if that specific part should be
12861  *          focused). On exit, your event handler should store the
12862  *          actual part code that was focused into this parameter. Your
12863  *          control must always allow the focus to be removed (when
12864  *          this parameter is kControlFocusNoPart on entry).
12865  *
12866  *  Availability:
12867  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12868  *    CarbonLib:        not available
12869  }
12870 const
12871 	kEventControlSetFocusPart = 7;
12872 
12873 {
12874  *  kEventClassControl / kEventControlGetFocusPart
12875  *
12876  *  Summary:
12877  *    Sent when your the Control Manager wants to know what part of
12878  *    your control is currently focused. Set the kEventParamControlPart
12879  *    param to your currently focused part.
12880  *
12881  *  Discussion:
12882  *    The Control Manager provides default behavior for this event. If
12883  *    the event is not handled by a control, the default handler
12884  *    returns the part of the control that was most recently focused.
12885  *
12886  *  Mac OS X threading:
12887  *    Not thread safe
12888  *
12889  *  Parameters:
12890  *
12891  *    --> kEventParamDirectObject (in, typeControlRef)
12892  *          The control for which to get the current focus.
12893  *
12894  *    <-- kEventParamControlPart (out, typeControlPartCode)
12895  *          On exit, contains the current focus for this control.
12896  *
12897  *  Availability:
12898  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12899  *    CarbonLib:        not available
12900  }
12901 const
12902 	kEventControlGetFocusPart = 8;
12903 
12904 {
12905  *  kEventClassControl / kEventControlActivate
12906  *
12907  *  Summary:
12908  *    Sent when your control becomes active as a result of a call to
12909  *    ActivateControl.
12910  *
12911  *  Mac OS X threading:
12912  *    Not thread safe
12913  *
12914  *  Parameters:
12915  *
12916  *    --> kEventParamDirectObject (in, typeControlRef)
12917  *          The control that was activated.
12918  *
12919  *  Availability:
12920  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12921  *    CarbonLib:        not available
12922  }
12923 const
12924 	kEventControlActivate = 9;
12925 
12926 {
12927  *  kEventClassControl / kEventControlDeactivate
12928  *
12929  *  Summary:
12930  *    Sent when your control becomes inactive as a result of a call to
12931  *    DeactivateControl.
12932  *
12933  *  Mac OS X threading:
12934  *    Not thread safe
12935  *
12936  *  Parameters:
12937  *
12938  *    --> kEventParamDirectObject (in, typeControlRef)
12939  *          The control that was deactivated.
12940  *
12941  *  Availability:
12942  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12943  *    CarbonLib:        not available
12944  }
12945 const
12946 	kEventControlDeactivate = 10;
12947 
12948 {
12949  *  kEventClassControl / kEventControlSetCursor
12950  *
12951  *  Summary:
12952  *    Sent when your control is asked to change the cursor as a result
12953  *    of a call to HandleControlSetCursor.
12954  *
12955  *  Discussion:
12956  *    Note that the standard window event handler does not call
12957  *    HandleControlSetCursor, and therefore, your control will not
12958  *    ordinarily receive this event. Your host application must call
12959  *    HandleControlSetCursor itself in order for your control to
12960  *    receive this event. On Mac OS X 10.2 and later, we recommend
12961  *    using mouse tracking regions in your control to be notified when
12962  *    to change the cursor, rather than using this event.
12963  *
12964  *  Mac OS X threading:
12965  *    Not thread safe
12966  *
12967  *  Parameters:
12968  *
12969  *    --> kEventParamDirectObject (in, typeControlRef)
12970  *          The control that should set the cursor.
12971  *
12972  *    --> kEventParamMouseLocation (in, typeQDPoint)
12973  *          The mouse location, in view-local coordinates if the
12974  *          control�s owning window is composited, or port-local
12975  *          coordinates if not.
12976  *
12977  *    --> kEventParamKeyModifiers (in, typeUInt32)
12978  *          The current keyboard modifiers.
12979  *
12980  *  Availability:
12981  *    Mac OS X:         in version 10.0 and later in Carbon.framework
12982  *    CarbonLib:        not available
12983  }
12984 const
12985 	kEventControlSetCursor = 11;
12986 
12987 {
12988  *  kEventClassControl / kEventControlContextualMenuClick
12989  *
12990  *  Summary:
12991  *    Sent when your control is asked to display a contextual menu as a
12992  *    result of a call to HandleControlContextualMenuClick.
12993  *
12994  *  Mac OS X threading:
12995  *    Not thread safe
12996  *
12997  *  Parameters:
12998  *
12999  *    --> kEventParamDirectObject (in, typeControlRef)
13000  *          The control that was clicked.
13001  *
13002  *    --> kEventParamMouseLocation (in, typeQDPoint)
13003  *          The mouse location, in view-local coordinates if the
13004  *          control�s owning window is composited, or port-local
13005  *          coordinates if not. In Mac OS X 10.2 and earlier, however,
13006  *          this parameter was incorrectly in global coordinates.
13007  *
13008  *    --> kEventParamWindowRef (in, typeWindowRef)
13009  *          The window under the mouse. Available in Mac OS X 10.3 and
13010  *          later.
13011  *
13012  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
13013  *          The window-relative position of the mouse in the window
13014  *          given in the kEventParamWindowRef parameter. 0,0 is at the
13015  *          top left of the structure of the window. Available in Mac
13016  *          OS X 10.3 and later.
13017  *
13018  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
13019  *          The part code that the mouse location hit in the window.
13020  *          This parameter only exists if the WindowRef parameter
13021  *          exists. This saves you the trouble of calling FindWindow,
13022  *          which is expensive on Mac OS X as it needs to call the
13023  *          Window Server. Available in Mac OS X 10.3 and later.
13024  *
13025  *    --> kEventParamKeyModifiers (in, typeUInt32)
13026  *          The keyboard modifiers that were pressed when the event was
13027  *          generated. Available in Mac OS X 10.3 and later.
13028  *
13029  *    --> kEventParamMouseButton (in, typeMouseButton)
13030  *          Which mouse button was pressed. Available in Mac OS X 10.3
13031  *          and later.
13032  *
13033  *    --> kEventParamClickCount (in, typeUInt32)
13034  *          Whether this is a single click, double click, etc.
13035  *          Available in Mac OS X 10.3 and later.
13036  *
13037  *    --> kEventParamMouseChord (in, typeUInt32)
13038  *          Which other mouse buttons were pressed when the event was
13039  *          generated. Available in Mac OS X 10.3 and later.
13040  *
13041  *    --> kEventParamTabletEventType (in, typeUInt32)
13042  *          The type of tablet event which generated this mouse event;
13043  *          contains either kEventTabletPoint or kEventTabletProximity.
13044  *          Only present if the event was generated from a tablet.
13045  *          Available in Mac OS X 10.3 and later.
13046  *
13047  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
13048  *          Further information about the tablet event which generated
13049  *          this mouse event. Present if the the
13050  *          kEventParamTabletEventType parameter contains
13051  *          kEventTabletPoint. Available in Mac OS X 10.3 and later.
13052  *
13053  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
13054  *          Further information about the tablet event which generated
13055  *          this mouse event. Present if the the
13056  *          kEventParamTabletEventType parameter contains
13057  *          kEventTabletProximity. Available in Mac OS X 10.3 and later.
13058  *
13059  *  Availability:
13060  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13061  *    CarbonLib:        not available
13062  }
13063 const
13064 	kEventControlContextualMenuClick = 12;
13065 
13066 {
13067  *  kEventClassControl / kEventControlTrack
13068  *
13069  *  Summary:
13070  *    Sent to allow a control definition to track the mouse in response
13071  *    to a call to HIViewClick, HandleControlClick, etc.
13072  *
13073  *  Discussion:
13074  *    This event is only sent to controls that return a non-zero
13075  *    control part code from kEventControlHitTest. If you are
13076  *    implementing a custom HIView and you need to receive this event,
13077  *    you must also handle kEventControlHitTest and place a valid
13078  *    control part code into the parameter, and return noErr.
13079  *
13080  *    This event is sent from within HIViewClick and
13081  *    HandleControlClick. The default handling of this event is the
13082  *    Control Manager�s normal tracking logic; this is good enough for
13083  *    simple controls (such as push buttons) and controls with simple
13084  *    indicators (such as scroll bars and sliders). You should only
13085  *    need to handle or override this event if you are trying to do
13086  *    more complex tracking, such as displaying a menu in the middle of
13087  *    tracking.
13088  *
13089  *    In Mac OS X 10.4 and later, when this event is sent in response
13090  *    to a click in a compositing window, the event will include all of
13091  *    the fields of the kEventControlClick event, including
13092  *    kEventParamMouseButton, kEventParamClickCount, and so on.
13093  *
13094  *  Mac OS X threading:
13095  *    Not thread safe
13096  *
13097  *  Parameters:
13098  *
13099  *    --> kEventParamDirectObject (in, typeControlRef)
13100  *          The control to track.
13101  *
13102  *    --> kEventParamMouseLocation (in, typeQDPoint)
13103  *          The mouse location, in view-local coordinates if the
13104  *          control�s owning window is composited, or port-local
13105  *          coordinates if not.
13106  *
13107  *    <-> kEventParamKeyModifiers (in/out, typeUInt32)
13108  *          The current keyboard modifiers. On exit, the event handler
13109  *          may update this parameter with the modifiers that were
13110  *          pressed when tracking ended; these modifiers will be
13111  *          included in the kEventCommandProcess event that is sent by
13112  *          the Control Manager.
13113  *
13114  *    --> kEventParamControlAction (in, typeControlActionUPP)
13115  *          The control action proc that should be called by the
13116  *          control during tracking.
13117  *
13118  *    <-- kEventParamControlPart (out, typeControlPartCode)
13119  *          On exit, contains the part code of the control part that
13120  *          was selected when tracking ended, or kControlNoPart if no
13121  *          part was selected. If the part code is non-zero, the
13122  *          Control Manager will automatically send kEventControlHit
13123  *          and kEventCommandProcess events.
13124  *
13125  *    --> kEventParamWindowRef (in, typeWindowRef)
13126  *          The window under the mouse. This parameter is only
13127  *          available in Mac OS X 10.4 and later, and is only included
13128  *          for clicks in a compositing window or if the application
13129  *          calls HIViewClick itself.
13130  *
13131  *    --> kEventParamWindowMouseLocation (in, typeHIPoint)
13132  *          The window-relative position of the mouse in the window
13133  *          given in the kEventParamWindowRef parameter. 0,0 is at the
13134  *          top left of the structure of the window. This parameter is
13135  *          only available in Mac OS X 10.4 and later, and is only
13136  *          included for clicks in a compositing window or if the
13137  *          application calls HIViewClick itself.
13138  *
13139  *    --> kEventParamWindowPartCode (in, typeWindowPartCode)
13140  *          The part code that the mouse location hit in the window.
13141  *          This parameter only exists if the WindowRef parameter
13142  *          exists. This saves you the trouble of calling FindWindow,
13143  *          which is expensive on Mac OS X as it needs to call the
13144  *          Window Server. This parameter is only available in Mac OS X
13145  *          10.4 and later, and is only included for clicks in a
13146  *          compositing window or if the application calls HIViewClick
13147  *          itself.
13148  *
13149  *    --> kEventParamMouseButton (in, typeMouseButton)
13150  *          Which mouse button was pressed. This parameter is only
13151  *          available in Mac OS X 10.4 and later, and is only included
13152  *          for clicks in a compositing window or if the application
13153  *          calls HIViewClick itself.
13154  *
13155  *    --> kEventParamClickCount (in, typeUInt32)
13156  *          Whether this is a single click, double click, etc. This
13157  *          parameter is only available in Mac OS X 10.4 and later, and
13158  *          is only included for clicks in a compositing window or if
13159  *          the application calls HIViewClick itself.
13160  *
13161  *    --> kEventParamMouseChord (in, typeUInt32)
13162  *          Which other mouse buttons were pressed when the event was
13163  *          generated. This parameter is only available in Mac OS X
13164  *          10.4 and later, and is only included for clicks in a
13165  *          compositing window or if the application calls HIViewClick
13166  *          itself.
13167  *
13168  *    --> kEventParamTabletEventType (in, typeUInt32)
13169  *          The type of tablet event which generated this mouse event;
13170  *          contains either kEventTabletPoint or kEventTabletProximity.
13171  *          Only present if the event was generated from a tablet. This
13172  *          parameter is only available in Mac OS X 10.4 and later, and
13173  *          is only included for clicks in a compositing window or if
13174  *          the application calls HIViewClick itself.
13175  *
13176  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
13177  *          Further information about the tablet event which generated
13178  *          this mouse event. Present if the the
13179  *          kEventParamTabletEventType parameter contains
13180  *          kEventTabletPoint. This parameter is only available in Mac
13181  *          OS X 10.4 and later, and is only included for clicks in a
13182  *          compositing window or if the application calls HIViewClick
13183  *          itself.
13184  *
13185  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
13186  *          Further information about the tablet event which generated
13187  *          this mouse event. Present if the the
13188  *          kEventParamTabletEventType parameter contains
13189  *          kEventTabletProximity. This parameter is only available in
13190  *          Mac OS X 10.4 and later, and is only included for clicks in
13191  *          a compositing window or if the application calls
13192  *          HIViewClick itself.
13193  *
13194  *  Availability:
13195  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13196  *    CarbonLib:        not available
13197  }
13198 const
13199 	kEventControlTrack = 51;
13200 
13201 {
13202  *  kEventClassControl / kEventControlGetScrollToHereStartPoint
13203  *
13204  *  Summary:
13205  *    Sent so your control can support Scroll To Here behavior during
13206  *    tracking.
13207  *
13208  *  Mac OS X threading:
13209  *    Not thread safe
13210  *
13211  *  Parameters:
13212  *
13213  *    --> kEventParamDirectObject (in, typeControlRef)
13214  *          The control for which to retrieve the Scroll To Here point.
13215  *
13216  *    <-> kEventParamMouseLocation (in/out, typeQDPoint)
13217  *          On entry, a point in view-local coordinates if the
13218  *          control�s owning window is composited, or port-local
13219  *          coordinates if not, which provides the location at which
13220  *          the user clicked to request Scroll To Here behavior. On
13221  *          exit, this parameter should contain the mouse location in
13222  *          view-local or port-local coordinates where a click would
13223  *          have needed to be to cause your indicator to be dragged to
13224  *          the incoming mouse location.
13225  *
13226  *    --> kEventParamKeyModifiers (in, typeUInt32)
13227  *          The current keyboard modifiers.
13228  *
13229  *  Availability:
13230  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13231  *    CarbonLib:        not available
13232  }
13233 const
13234 	kEventControlGetScrollToHereStartPoint = 52;
13235 
13236 {
13237  *  kEventClassControl / kEventControlGetIndicatorDragConstraint
13238  *
13239  *  Summary:
13240  *    Sent so your control can constrain the movement of its indicator
13241  *    during tracking.
13242  *
13243  *  Mac OS X threading:
13244  *    Not thread safe
13245  *
13246  *  Parameters:
13247  *
13248  *    --> kEventParamDirectObject (in, typeControlRef)
13249  *          The control that is being tracked.
13250  *
13251  *    --> kEventParamMouseLocation (in, typeQDPoint)
13252  *          The mouse location, in view-local coordinates if the
13253  *          control�s owning window is composited, or port-local
13254  *          coordinates if not.
13255  *
13256  *    --> kEventParamKeyModifiers (in, typeUInt32)
13257  *          The current keyboard modifiers.
13258  *
13259  *    <-- kEventParamControlIndicatorDragConstraint (out, typeIndicatorDragConstraint)
13260  *          On exit, contains an IndicatorDragConstraint structure.
13261  *
13262  *  Availability:
13263  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13264  *    CarbonLib:        not available
13265  }
13266 const
13267 	kEventControlGetIndicatorDragConstraint = 53;
13268 
13269 {
13270  *  kEventClassControl / kEventControlIndicatorMoved
13271  *
13272  *  Summary:
13273  *    Sent during live-tracking of the indicator so your control can
13274  *    update its value based on the new indicator position. During
13275  *    non-live tracking, this event lets you redraw the indicator ghost
13276  *    at the appropriate place.
13277  *
13278  *  Mac OS X threading:
13279  *    Not thread safe
13280  *
13281  *  Parameters:
13282  *
13283  *    --> kEventParamDirectObject (in, typeControlRef)
13284  *          The control that is being tracked.
13285  *
13286  *    --> kEventParamControlIndicatorRegion (in, typeQDRgnHandle)
13287  *          The new indicator region.
13288  *
13289  *    --> kEventParamControlIsGhosting (in, typeBoolean)
13290  *          Indicates whether the control is using non-live-tracking
13291  *          (true) or live tracking (false).
13292  *
13293  *  Availability:
13294  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13295  *    CarbonLib:        not available
13296  }
13297 const
13298 	kEventControlIndicatorMoved = 54;
13299 
13300 {
13301  *  kEventClassControl / kEventControlGhostingFinished
13302  *
13303  *  Summary:
13304  *    Sent at the end of non-live indicator tracking so your control
13305  *    can update its value based on the final ghost location.
13306  *
13307  *  Mac OS X threading:
13308  *    Not thread safe
13309  *
13310  *  Parameters:
13311  *
13312  *    --> kEventParamDirectObject (in, typeControlRef)
13313  *          The control that was being tracked.
13314  *
13315  *    --> kEventParamControlIndicatorOffset (in, typeQDPoint)
13316  *          The final offset of the indicator.
13317  *
13318  *  Availability:
13319  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13320  *    CarbonLib:        not available
13321  }
13322 const
13323 	kEventControlGhostingFinished = 55;
13324 
13325 {
13326  *  kEventClassControl / kEventControlGetActionProcPart
13327  *
13328  *  Summary:
13329  *    Sent during tracking so your control can alter the part that is
13330  *    passed to its action proc based on modifier keys, etc.
13331  *
13332  *  Mac OS X threading:
13333  *    Not thread safe
13334  *
13335  *  Parameters:
13336  *
13337  *    --> kEventParamDirectObject (in, typeControlRef)
13338  *          The control being tracked.
13339  *
13340  *    --> kEventParamKeyModifiers (in, typeUInt32)
13341  *          The current keyboard modifiers.
13342  *
13343  *    <-> kEventParamControlPart (in/out, typeControlPartCode)
13344  *          On entry, the proposed control part that will be sent to
13345  *          the action proc. Your handler may modify this parameter
13346  *          based on its own criteria (which modifier keys are pressed,
13347  *          for example).
13348  *
13349  *    <-- kEventParamControlPartAutoRepeats (out, typeBoolean)
13350  *          On output, a flag to the standard control tracking loop in
13351  *          the Control Manager indicating whether to autorepeat when
13352  *          the user presses and holds on certain parts of your custom
13353  *          control. The autorepeat timing curve is the same as that
13354  *          used for the buttons/page areas of scroll bars. This
13355  *          parameter is observed by the Control Manager in Mac OS X
13356  *          10.2 and later.
13357  *
13358  *  Availability:
13359  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13360  *    CarbonLib:        not available
13361  }
13362 const
13363 	kEventControlGetActionProcPart = 56;
13364 
13365 {
13366  *  kEventClassControl / kEventControlGetPartRegion
13367  *
13368  *  Summary:
13369  *    Sent by the GetControlRegion, HIViewCopyPartShape, and similar
13370  *    APIs when a client wants to get a particular region or shape of
13371  *    your control.
13372  *
13373  *  Discussion:
13374  *    This event is sent to your handler in order to fetch both regions
13375  *    and shapes from your view. Shapes will only be requested on Mac
13376  *    OS X 10.4 and later. There are two strategies for handling this
13377  *    event: the non-shape savvy way and the shape savvy way. The shape
13378  *    savvy way avoids costly conversions between regions and shapes
13379  *    which can slow your view's performance.
13380  *
13381  *    Non-shape savvy way: Get the region out of the
13382  *    kEventParamControlRegion parameter and modify it appropriately to
13383  *    reflect the desired part. Before the advent of shapes, this was
13384  *    the only method for handling this event. If you always handle the
13385  *    event this way on Mac OS X 10.4 and later, you may force the
13386  *    Control Manager to convert the region to a shape, which adversely
13387  *    affects performance.
13388  *
13389  *    Shape savvy way: Get the value of the
13390  *    kEventParamControlPrefersShape parameter. If the parameter
13391  *    doesn't exist or if its value is false, handle this event in the
13392  *    non-shape savvy way as described above. If the parameter exists
13393  *    and has a value of true, allocate an immutable shape that
13394  *    represents the given part of your view and use SetEventParameter
13395  *    to add the shape to the event in the kEventParamShape parameter.
13396  *    You may now release the shape, since it was retained by
13397  *    SetEventParameter. If for some reason you are unwilling or unable
13398  *    to provide a shape for the given part, you may still fall back to
13399  *    the non-shape savvy method.
13400  *
13401  *    NOTE: If your handler attempts to pre- or post-process some other
13402  *    handler's processing of this event by calling
13403  *    CallNextEventHandler, you MUST NOT rely on the value of the
13404  *    kEventParamControlPrefersShape parameter being preserved across
13405  *    the call to CallNextEventHandler. This event may dynamically
13406  *    modify itself depending on how any given handler acts upon it.
13407  *
13408  *  Mac OS X threading:
13409  *    Not thread safe
13410  *
13411  *  Parameters:
13412  *
13413  *    --> kEventParamDirectObject (in, typeControlRef)
13414  *          The control whose region/shape to return.
13415  *
13416  *    --> kEventParamControlPart (in, typeControlPartCode)
13417  *          The control part code whose region/shape to return.
13418  *
13419  *    --> kEventParamControlPrefersShape (in, typeBoolean)
13420  *          A Boolean indicating whether your view may respond to this
13421  *          event by adding a kEventParamShape parameter to it instead
13422  *          of modifying the region in the kEventParamControlRegion
13423  *          parameter. If the parameter is false, you must respond to
13424  *          the event by modifying the region in the
13425  *          kEventParamControlRegion parameter; you may not add a
13426  *          kEventParamShape parameter. If the parameter is true, you
13427  *          may � but are not required to � respond to the event by
13428  *          adding the kEventParamShape parameter; if you choose not
13429  *          to, you must respond to the event by modifying the region
13430  *          in the kEventParamControlRegion parameter. This parameter
13431  *          will only be present on Mac OS X 10.4 and later. In fact,
13432  *          even on Mac OS X 10.4 it is an optional parameter and will
13433  *          not always be present. If this parameter is not present,
13434  *          you should act as though its value were false.
13435  *
13436  *    --> kEventParamControlRegion (in, typeQDRgnHandle)
13437  *          A pre-allocated RgnHandle. Unless your handler is allowed
13438  *          to and chooses to add a kEventParamShape parameter (see the
13439  *          discussion of kEventParamControlPrefersShape above), your
13440  *          handler should get the RgnHandle from the event and set the
13441  *          region contents appropriately. If your handler adds a
13442  *          kEventParamShape parameter to the event, it must neither
13443  *          get nor modify this parameter.
13444  *
13445  *    <-- kEventParamShape (out, typeHIShapeRef)
13446  *          If your handler is allowed to and chooses to provide a
13447  *          shape (see the discussion of kEventParamControlPrefersShape
13448  *          above), your handler should create a new, immutable shape
13449  *          and return it in this parameter. After you call
13450  *          SetEventParameter, you may release the shape, as it will be
13451  *          retained by SetEventParameter and released when the event
13452  *          is destroyed. If your handler gets or modifies the
13453  *          kEventParamControlRegion parameter, it must not set this
13454  *          parameter.
13455  *
13456  *  Availability:
13457  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13458  *    CarbonLib:        not available
13459  }
13460 const
13461 	kEventControlGetPartRegion = 101;
13462 
13463 {
13464  *  kEventClassControl / kEventControlGetPartBounds
13465  *
13466  *  Summary:
13467  *    Sent when a client wants to get a particular rectangle of your
13468  *    control when it may be more efficient than asking for a region.
13469  *
13470  *  Mac OS X threading:
13471  *    Not thread safe
13472  *
13473  *  Parameters:
13474  *
13475  *    --> kEventParamDirectObject (in, typeControlRef)
13476  *          The control whose bounds to return.
13477  *
13478  *    --> kEventParamControlPart (in, typeControlPartCode)
13479  *          The control part whose bounds to return.
13480  *
13481  *    <-- kEventParamControlPartBounds (out, typeHIRect)
13482  *          On exit, contains the bounds of the specified part.
13483  *
13484  *  Availability:
13485  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13486  *    CarbonLib:        not available
13487  }
13488 const
13489 	kEventControlGetPartBounds = 102;
13490 
13491 {
13492  *  kEventClassControl / kEventControlSetData
13493  *
13494  *  Summary:
13495  *    Sent by the SetControlData API when a client wants to change an
13496  *    arbitrary setting of your control.
13497  *
13498  *  Mac OS X threading:
13499  *    Not thread safe
13500  *
13501  *  Parameters:
13502  *
13503  *    --> kEventParamDirectObject (in, typeControlRef)
13504  *          The control for which to set data.
13505  *
13506  *    --> kEventParamControlPart (in, typeControlPartCode)
13507  *          The control part for which to set data.
13508  *
13509  *    --> kEventParamControlDataTag (in, typeEnumeration)
13510  *          The type of data to set.
13511  *
13512  *    --> kEventParamControlDataBuffer (in, typePtr)
13513  *          A pointer to the data.
13514  *
13515  *    --> kEventParamControlDataBufferSize (in, typeByteCount)
13516  *          The size of the data.
13517  *
13518  *          On Mac OS X 10.4 and earlier, this parameter uses
13519  *          typeSInt32, and you must retrieve it using that constant.
13520  *          On Mac OS X 10.5 and later, to support 64-bit data sizes,
13521  *          this parameter uses typeByteCount. For 64-bit
13522  *          compatibility, you must use typeByteCount when retrieving
13523  *          this parameter; for 32-bit targets, however, you may
13524  *          continue to use typeSInt32 if you wish, or switch to
13525  *          typeByteCount.
13526  *
13527  *  Availability:
13528  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13529  *    CarbonLib:        not available
13530  }
13531 const
13532 	kEventControlSetData = 103;
13533 
13534 {
13535  *  kEventClassControl / kEventControlGetData
13536  *
13537  *  Summary:
13538  *    Sent by the GetControlData API when a client wants to get an
13539  *    arbitrary setting of your control.
13540  *
13541  *  Mac OS X threading:
13542  *    Not thread safe
13543  *
13544  *  Parameters:
13545  *
13546  *    --> kEventParamDirectObject (in, typeControlRef)
13547  *          The control from which to get data.
13548  *
13549  *    --> kEventParamControlPart (in, typeControlPartCode)
13550  *          The control part for which to get data.
13551  *
13552  *    --> kEventParamControlDataTag (in, typeEnumeration)
13553  *          The type of data to get.
13554  *
13555  *    --> kEventParamControlDataBuffer (in, typePtr)
13556  *          A buffer in which to write the data.
13557  *
13558  *    <-> kEventParamControlDataBufferSize (in/out, typeByteCount)
13559  *          On entry, the size of the data buffer. On exit, the amount
13560  *          of data that was available.
13561  *
13562  *          On Mac OS X 10.4 and earlier, this parameter uses
13563  *          typeSInt32, and you must retrieve it using that constant.
13564  *          On Mac OS X 10.5 and later, to support 64-bit data sizes,
13565  *          this parameter uses typeByteCount. For 64-bit
13566  *          compatibility, you must use typeByteCount when retrieving
13567  *          this parameter; for 32-bit targets, however, you may
13568  *          continue to use typeSInt32 if you wish, or switch to
13569  *          typeByteCount.
13570  *
13571  *  Availability:
13572  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13573  *    CarbonLib:        not available
13574  }
13575 const
13576 	kEventControlGetData = 104;
13577 
13578 {
13579  *  kEventClassControl / kEventControlGetSizeConstraints
13580  *
13581  *  Summary:
13582  *    Sent by the HIViewGetSizeConstraints API to allow your custom
13583  *    control/view to specify its minimum and maximum size.
13584  *
13585  *  Discussion:
13586  *    This is different from the optimal size event above. The optimal
13587  *    size might be larger than a view�s minimum size. A parent view
13588  *    can use this information to help it lay out subviews. The toolbar
13589  *    control uses this information to help lay out toolbar items, for
13590  *    example.
13591  *
13592  *  Mac OS X threading:
13593  *    Not thread safe
13594  *
13595  *  Parameters:
13596  *
13597  *    --> kEventParamDirectObject (in, typeControlRef)
13598  *          The control for which to get size constraints.
13599  *
13600  *    <-- kEventParamMinimumSize (out, typeHISize)
13601  *          On exit, contains the control�s minimum size.
13602  *
13603  *    <-- kEventParamMaximumSize (out, typeHISize)
13604  *          On exit, contains the control�s maximum size.
13605  *
13606  *  Availability:
13607  *    Mac OS X:         in version 10.2 and later in Carbon.framework
13608  *    CarbonLib:        not available
13609  }
13610 const
13611 	kEventControlGetSizeConstraints = 105;
13612 
13613 {
13614  *  kEventClassControl / kEventControlGetFrameMetrics
13615  *
13616  *  Summary:
13617  *    Sent when a control client needs to determine the width of the
13618  *    control�s structure region.
13619  *
13620  *  Discussion:
13621  *    This event is not sent automatically by the Control Manager at
13622  *    any time, but may be sent by control clients during various
13623  *    layout operations. For example, the Window Manager will send this
13624  *    event to a window frame HIView to determine the window structure
13625  *    widths, and the Menu Manager will send this event to a menu
13626  *    content view to determine the content structure widths.
13627  *
13628  *  Mac OS X threading:
13629  *    Not thread safe
13630  *
13631  *  Parameters:
13632  *
13633  *    --> kEventParamDirectObject (in, typeControlRef)
13634  *          The control for which to get frame metrics.
13635  *
13636  *    <-- kEventParamControlFrameMetrics (out, typeControlFrameMetrics)
13637  *          On exit, contains the control�s frame metrics.
13638  *
13639  *  Availability:
13640  *    Mac OS X:         in version 10.3 and later in Carbon.framework
13641  *    CarbonLib:        not available
13642  }
13643 const
13644 	kEventControlGetFrameMetrics = 106;
13645 
13646 {
13647  *  kEventClassControl / kEventControlValueFieldChanged
13648  *
13649  *  Summary:
13650  *    Sent when your control�s value, min, max, or view size has
13651  *    changed. Useful so other entities can watch for changes to your
13652  *    control�s value.
13653  *
13654  *  Mac OS X threading:
13655  *    Not thread safe
13656  *
13657  *  Parameters:
13658  *
13659  *    --> kEventParamDirectObject (in, typeControlRef)
13660  *          The control whose value, min, max, or view size has changed.
13661  *
13662  *  Availability:
13663  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13664  *    CarbonLib:        not available
13665  }
13666 const
13667 	kEventControlValueFieldChanged = 151;
13668 
13669 {
13670  *  kEventClassControl / kEventControlAddedSubControl
13671  *
13672  *  Summary:
13673  *    Sent when a control was embedded within your control.
13674  *
13675  *  Mac OS X threading:
13676  *    Not thread safe
13677  *
13678  *  Parameters:
13679  *
13680  *    --> kEventParamDirectObject (in, typeControlRef)
13681  *          The control that gained a new subcontrol.
13682  *
13683  *    --> kEventParamControlSubControl (in, typeControlRef)
13684  *          The subcontrol that was added.
13685  *
13686  *  Availability:
13687  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13688  *    CarbonLib:        not available
13689  }
13690 const
13691 	kEventControlAddedSubControl = 152;
13692 
13693 {
13694  *  kEventClassControl / kEventControlRemovingSubControl
13695  *
13696  *  Summary:
13697  *    Sent when one of your child controls will be removed from your
13698  *    control.
13699  *
13700  *  Mac OS X threading:
13701  *    Not thread safe
13702  *
13703  *  Parameters:
13704  *
13705  *    --> kEventParamDirectObject (in, typeControlRef)
13706  *          The control that will be losing a subcontrol.
13707  *
13708  *    --> kEventParamControlSubControl (in, typeControlRef)
13709  *          The subcontrol that will be removed.
13710  *
13711  *  Availability:
13712  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13713  *    CarbonLib:        not available
13714  }
13715 const
13716 	kEventControlRemovingSubControl = 153;
13717 
13718 {
13719  *  kEventClassControl / kEventControlBoundsChanged
13720  *
13721  *  Summary:
13722  *    Sent when your control�s bounding rectangle has changed.
13723  *
13724  *  Discussion:
13725  *    If you want to generate an efficient invalid region in response
13726  *    to a size change, you need to handle
13727  *    kEventControlInvalidateForSizeChange.
13728  *
13729  *  Mac OS X threading:
13730  *    Not thread safe
13731  *
13732  *  Parameters:
13733  *
13734  *    --> kEventParamDirectObject (in, typeControlRef)
13735  *          The control whose bounds have changed.
13736  *
13737  *    --> kEventParamAttributes (in, typeUInt32)
13738  *          Flags indicating how the bounds changed, including
13739  *          kControlBoundsChangeSizeChanged and
13740  *          kControlBoundsChangePositionChanged.
13741  *
13742  *    --> kEventParamOriginalBounds (in, typeQDRectangle)
13743  *          The control�s bounds before the change. This is the
13744  *          control�s frame bounds; for a compositing view, this
13745  *          bounding rect is in the parent view�s coordinate system,
13746  *          and for a non-compositing view, it is in local GrafPort
13747  *          coordinates.
13748  *
13749  *    --> kEventParamPreviousBounds (in, typeQDRectangle)
13750  *          The control�s bounds before the change. This parameter
13751  *          always has the same value as the kEventParamOriginalBounds
13752  *          parameter.
13753  *
13754  *    --> kEventParamCurrentBounds (in, typeQDRectangle)
13755  *          The control�s new bounds. This is the control�s frame
13756  *          bounds; for a compositing view, this bounding rect is in
13757  *          the parent view�s coordinate system, and for a
13758  *          non-compositing view, it is in local GrafPort coordinates.
13759  *
13760  *  Availability:
13761  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13762  *    CarbonLib:        not available
13763  }
13764 const
13765 	kEventControlBoundsChanged = 154;
13766 
13767 {
13768  *  kEventClassControl / kEventControlInvalidateForSizeChange
13769  *
13770  *  Summary:
13771  *    Sent when a control's size changes so it can invalidate the area
13772  *    of itself that needs to be redrawn.
13773  *
13774  *  Discussion:
13775  *    Handle this event by calling HIViewSetNeedsDisplayInRegion with a
13776  *    region that properly reflects the area of your control that needs
13777  *    to be redrawn after a size change. The default handler for this
13778  *    event will invalidate the entire control.
13779  *
13780  *  Mac OS X threading:
13781  *    Not thread safe
13782  *
13783  *  Parameters:
13784  *
13785  *    --> kEventParamDirectObject (in, typeControlRef)
13786  *          The control whose size has changed.
13787  *
13788  *    --> kEventParamOriginalBounds (in, typeQDRectangle)
13789  *          The control�s bounds before the change.
13790  *
13791  *    --> kEventParamCurrentBounds (in, typeQDRectangle)
13792  *          The control�s new bounds.
13793  *
13794  *  Availability:
13795  *    Mac OS X:         in version 10.3 and later in Carbon.framework
13796  *    CarbonLib:        not available
13797  }
13798 const
13799 	kEventControlInvalidateForSizeChange = 22;
13800 
13801 {
13802  *  kEventClassControl / kEventControlVisibilityChanged
13803  *
13804  *  Summary:
13805  *    Sent when a control is hidden or shown. This is here to support
13806  *    custom views/controls which need to update information when the
13807  *    visibility changes.
13808  *
13809  *  Mac OS X threading:
13810  *    Not thread safe
13811  *
13812  *  Parameters:
13813  *
13814  *    --> kEventParamDirectObject (in, typeControlRef)
13815  *          The control whose visibility has changed.
13816  *
13817  *  Availability:
13818  *    Mac OS X:         in version 10.2 and later in Carbon.framework
13819  *    CarbonLib:        not available
13820  }
13821 const
13822 	kEventControlVisibilityChanged = 157;
13823 
13824 {
13825  *  kEventClassControl / kEventControlOwningWindowChanged
13826  *
13827  *  Summary:
13828  *    Sent when your control�s owning window has changed. Useful to
13829  *    udpate any dependencies that your control has on its owning
13830  *    window.
13831  *
13832  *  Mac OS X threading:
13833  *    Not thread safe
13834  *
13835  *  Parameters:
13836  *
13837  *    --> kEventParamDirectObject (in, typeControlRef)
13838  *          The control whose owning window has changed.
13839  *
13840  *    --> kEventParamAttributes (in, typeUInt32)
13841  *          Currently unused.
13842  *
13843  *    --> kEventParamControlOriginalOwningWindow (in, typeWindowRef)
13844  *          The control�s original owning window.
13845  *
13846  *    --> kEventParamControlCurrentOwningWindow (in, typeWindowRef)
13847  *          The control�s new owning window.
13848  *
13849  *  Availability:
13850  *    Mac OS X:         in version 10.0 and later in Carbon.framework
13851  *    CarbonLib:        not available
13852  }
13853 const
13854 	kEventControlOwningWindowChanged = 159;
13855 
13856 {
13857  *  kEventClassControl / kEventControlTitleChanged
13858  *
13859  *  Summary:
13860  *    Sent when the title of your control changes.
13861  *
13862  *  Mac OS X threading:
13863  *    Not thread safe
13864  *
13865  *  Parameters:
13866  *
13867  *    --> kEventParamDirectObject (in, typeControlRef)
13868  *          The control whose title has changed.
13869  *
13870  *  Availability:
13871  *    Mac OS X:         in version 10.2 and later in Carbon.framework
13872  *    CarbonLib:        not available
13873  }
13874 const
13875 	kEventControlTitleChanged = 158;
13876 
13877 {
13878  *  kEventClassControl / kEventControlHiliteChanged
13879  *
13880  *  Summary:
13881  *    Sent when the hilite state changes in a control. This is here to
13882  *    support custom views/controls which need to update information
13883  *    when the hilite state changes.
13884  *
13885  *  Mac OS X threading:
13886  *    Not thread safe
13887  *
13888  *  Parameters:
13889  *
13890  *    --> kEventParamDirectObject (in, typeControlRef)
13891  *          The control whose hilite has changed.
13892  *
13893  *    --> kEventParamControlPreviousPart (in, typeControlPartCode)
13894  *          The previously hilited part.
13895  *
13896  *    --> kEventParamControlCurrentPart (in, typeControlPartCode)
13897  *          The newly hilited part.
13898  *
13899  *  Availability:
13900  *    Mac OS X:         in version 10.2 and later in Carbon.framework
13901  *    CarbonLib:        not available
13902  }
13903 const
13904 	kEventControlHiliteChanged = 160;
13905 
13906 {
13907  *  kEventClassControl / kEventControlEnabledStateChanged
13908  *
13909  *  Summary:
13910  *    Sent when the enabled state changes in a control. This is here to
13911  *    support custom views/controls which need to update information
13912  *    when the enabled state changes.
13913  *
13914  *  Mac OS X threading:
13915  *    Not thread safe
13916  *
13917  *  Parameters:
13918  *
13919  *    --> kEventParamDirectObject (in, typeControlRef)
13920  *          The control whose enabled state has changed.
13921  *
13922  *  Availability:
13923  *    Mac OS X:         in version 10.2 and later in Carbon.framework
13924  *    CarbonLib:        not available
13925  }
13926 const
13927 	kEventControlEnabledStateChanged = 161;
13928 
13929 {
13930  *  kEventClassControl / kEventControlLayoutInfoChanged
13931  *
13932  *  Summary:
13933  *    Sent when the layout info changes in a control.
13934  *
13935  *  Mac OS X threading:
13936  *    Not thread safe
13937  *
13938  *  Parameters:
13939  *
13940  *    --> kEventParamDirectObject (in, typeControlRef)
13941  *          The control whose layout info has changed.
13942  *
13943  *  Availability:
13944  *    Mac OS X:         in version 10.2 and later in Carbon.framework
13945  *    CarbonLib:        not available
13946  }
13947 const
13948 	kEventControlLayoutInfoChanged = 162;
13949 
13950 {
13951  *  kEventClassControl / kEventControlFocusPartChanged
13952  *
13953  *  Summary:
13954  *    Sent when the focused part changes in a control.
13955  *
13956  *    This event is sent only to the control, and is not propagated
13957  *    past it.
13958  *
13959  *  Mac OS X threading:
13960  *    Not thread safe
13961  *
13962  *  Parameters:
13963  *
13964  *    --> kEventParamDirectObject (in, typeControlRef)
13965  *          The control whose focused part has changed.
13966  *
13967  *    --> kEventParamControlPreviousPart (in, typeControlPartCode)
13968  *          The previously focused part. This value will be zero when
13969  *          the control is gaining focus.
13970  *
13971  *    --> kEventParamControlCurrentPart (in, typeControlPartCode)
13972  *          The newly focused part. This value will be zero when the
13973  *          control is losing focus.
13974  *
13975  *  Availability:
13976  *    Mac OS X:         in version 10.5 and later in Carbon.framework
13977  *    CarbonLib:        not available
13978  }
13979 const
13980 	kEventControlFocusPartChanged = 164;
13981 
13982 {$ifc not TARGET_CPU_64}
13983 {
13984  *  kEventClassControl / kEventControlArbitraryMessage
13985  *
13986  *  Summary:
13987  *    Sent by the SendControlMessage API when someone is trying to send
13988  *    an old-style CDEF message to your control.
13989  *
13990  *  Mac OS X threading:
13991  *    Not thread safe
13992  *
13993  *  Parameters:
13994  *
13995  *    --> kEventParamDirectObject (in, typeControlRef)
13996  *          The control that is receiving the message.
13997  *
13998  *    --> kEventParamControlMessage (in, typeSInt16)
13999  *          The message.
14000  *
14001  *    --> kEventParamControlParam (in, typeRefCon)
14002  *          The inParam parameter from SendControlMessage.
14003  *
14004  *          On Mac OS X 10.4 and earlier, this parameter uses
14005  *          typeSInt32, and you must retrieve it using that constant.
14006  *          On Mac OS X 10.5 and later, to support 64-bit refcon
14007  *          values, this parameter uses typeRefCon. For 64-bit
14008  *          compatibility, you must use typeRefCon when retrieving this
14009  *          parameter; for 32-bit targets, however, you may continue to
14010  *          use typeSInt32 if you wish, or switch to typeRefCon.
14011  *
14012  *    <-- kEventParamControlResult (out, typeSInt32)
14013  *          On exit, contains the result that should be returned from
14014  *          SendControlMessage.
14015  *
14016  *  Availability:
14017  *    Mac OS X:         in version 10.0 and later in Carbon.framework
14018  *    CarbonLib:        not available
14019  }
14020 const
14021 	kEventControlArbitraryMessage = 201;
14022 
14023 {$endc} {not TARGET_CPU_64}
14024 
14025 
14026 {
14027  *  Summary:
14028  *    Control bounds change event attributes
14029  *
14030  *  Discussion:
14031  *    When the toolbox sends out a kEventControlBoundsChanged event, it
14032  *    also sends along a parameter containing attributes of the event.
14033  *    These attributes can be used to determine what aspect of the
14034  *    control changed (position, size, or both).
14035  }
14036 const
14037 {
14038    * The dimensions of the control (width and height) changed.
14039    }
14040 	kControlBoundsChangeSizeChanged = 1 shl 2;
14041 
14042   {
14043    * The top left corner (position) changed.
14044    }
14045 	kControlBoundsChangePositionChanged = 1 shl 3;
14046 
14047 {--------------------------------------------------------------------------------------}
14048 {  Tablet Events (and tablet data in mouse events)                                     }
14049 {--------------------------------------------------------------------------------------}
14050 {
14051     kEventClassTablet quick reference:
14052 
14053     kEventTabletPoint                   = 1,
14054     kEventTabletProximity               = 2,
14055 }
14056 {
14057  *  kEventClassTablet / kEventTabletPoint
14058  *
14059  *  Summary:
14060  *    Indicates that the pen has moved on or near a tablet.
14061  *
14062  *  Discussion:
14063  *    Same as deprecated kEventTabletPointer.
14064  *
14065  *  Mac OS X threading:
14066  *    Not thread safe
14067  *
14068  *  Parameters:
14069  *
14070  *    --> kEventParamTabletPointRec (in, typeTabletPointRec)
14071  *          Tablet information for the event.
14072  *
14073  *  Availability:
14074  *    Mac OS X:         in version 10.0 and later in Carbon.framework
14075  *    CarbonLib:        not available
14076  }
14077 const
14078 	kEventTabletPoint = 1;
14079 
14080 {
14081  *  kEventClassTablet / kEventTabletProximity
14082  *
14083  *  Summary:
14084  *    Indicates that the pen has entered or exited proximity of a
14085  *    tablet.
14086  *
14087  *  Mac OS X threading:
14088  *    Not thread safe
14089  *
14090  *  Parameters:
14091  *
14092  *    --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
14093  *          Tablet information for the event.
14094  *
14095  *  Availability:
14096  *    Mac OS X:         in version 10.0 and later in Carbon.framework
14097  *    CarbonLib:        not available
14098  }
14099 const
14100 	kEventTabletProximity = 2;
14101 
14102 type
14103 	TabletPointRecPtr = ^TabletPointRec;
14104 	TabletPointRec = record
14105 		absX: SInt32;                   { absolute x coordinate in tablet space at full tablet resolution }
14106 		absY: SInt32;                   { absolute y coordinate in tablet space at full tablet resolution }
14107 		absZ: SInt32;                   { absolute z coordinate in tablet space at full tablet resolution }
14108 		buttons: UInt16;                { one bit per button - bit 0 is first button - 1 = closed }
14109 		pressure: UInt16;               { scaled pressure value; MAXPRESSURE=(2^16)-1, MINPRESSURE=0 }
14110 		tiltX: SInt16;                  { scaled tilt x value; range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) }
14111 		tiltY: SInt16;                  { scaled tilt y value; range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) }
14112 		rotation: UInt16;               { Fixed-point representation of device rotation in a 10.6 format }
14113 		tangentialPressure: SInt16;     { tangential pressure on the device; range same as tilt }
14114 		deviceID: UInt16;               { system-assigned unique device ID - matches to deviceID field in proximity event }
14115 		vendor1: SInt16;                { vendor-defined signed 16-bit integer }
14116 		vendor2: SInt16;                { vendor-defined signed 16-bit integer }
14117 		vendor3: SInt16;                { vendor-defined signed 16-bit integer }
14118 	end;
14119 type
14120 	TabletPointerRec = TabletPointRec;
14121 	TabletPointerRecPtr = ^TabletPointerRec;
14122 	TabletProximityRecPtr = ^TabletProximityRec;
14123 	TabletProximityRec = record
14124 		vendorID: UInt16;               { vendor-defined ID - typically will be USB vendor ID }
14125 		tabletID: UInt16;               { vendor-defined tablet ID - typically will be USB product ID for the tablet }
14126 		pointerID: UInt16;              { vendor-defined ID of the specific pointing device }
14127 		deviceID: UInt16;               { system-assigned unique device ID - matches to deviceID field in tablet event }
14128 		systemTabletID: UInt16;         { system-assigned unique tablet ID }
14129 		vendorPointerType: UInt16;      { vendor-defined pointer type }
14130 		pointerSerialNumber: UInt32;    { vendor-defined serial number of the specific pointing device }
14131 		uniqueID: UInt64;               { vendor-defined unique ID for this pointer }
14132 		capabilityMask: UInt32;         { mask representing the capabilities of the device. }
14133                                               { capability bits are defined in the tablet capability }
14134                                               { masks section of <IOKit/hidsystem/IOLLEvent.h> }
14135 		pointerType: UInt8;            { type of pointing device - enum to be defined }
14136 		enterProximity: UInt8;         { non-zero = entering; zero = leaving }
14137 	end;
14138 {--------------------------------------------------------------------------------------}
14139 { Volume Events                                                                        }
14140 {--------------------------------------------------------------------------------------}
14141 {
14142     kEventClassVolume quick reference:
14143 
14144     kEventVolumeMounted             = 1,        // new volume mounted
14145     kEventVolumeUnmounted           = 2         // volume has been ejected or unmounted
14146 }
14147 const
14148 	typeFSVolumeRefNum = FourCharCode('voln'); { FSVolumeRefNum}
14149 
14150 {
14151  *  kEventClassVolume / kEventVolumeMounted
14152  *
14153  *  Summary:
14154  *    A new volume has been mounted (or new media inserted).
14155  *
14156  *  Discussion:
14157  *    This event is sent to all handlers registered for it.
14158  *
14159  *  Mac OS X threading:
14160  *    Not thread safe
14161  *
14162  *  Parameters:
14163  *
14164  *    --> kEventParamDirectObject (in, typeFSVolumeRefNum)
14165  *          The volume refnum of the volume that was mounted.
14166  *
14167  *  Availability:
14168  *    Mac OS X:         in version 10.0 and later in Carbon.framework
14169  *    CarbonLib:        in CarbonLib 1.3.1 and later
14170  }
14171 const
14172 	kEventVolumeMounted = 1;
14173 
14174 {
14175  *  kEventClassVolume / kEventVolumeUnmounted
14176  *
14177  *  Summary:
14178  *    An existing volume has been unmounted (or media ejected).
14179  *
14180  *  Discussion:
14181  *    This event is sent to all handlers registered for it.
14182  *
14183  *  Mac OS X threading:
14184  *    Not thread safe
14185  *
14186  *  Parameters:
14187  *
14188  *    --> kEventParamDirectObject (in, typeFSVolumeRefNum)
14189  *          The volume refnum of the volume that was unmounted. At the
14190  *          point when this event is sent, this is no longer a valid
14191  *          volume refnum, and cannot be passed to any File Manager
14192  *          API; it is useful only for comparison with cached volume
14193  *          refnums in your own data structures.
14194  *
14195  *  Availability:
14196  *    Mac OS X:         in version 10.0 and later in Carbon.framework
14197  *    CarbonLib:        in CarbonLib 1.3.1 and later
14198  }
14199 const
14200 	kEventVolumeUnmounted = 2;
14201 
14202 {--------------------------------------------------------------------------------------}
14203 { Appearance Events                                                                    }
14204 {--------------------------------------------------------------------------------------}
14205 {
14206     kEventClassAppearance quick reference:
14207 
14208     kEventAppearanceScrollBarVariantChanged = 1
14209 }
14210 {
14211  *  kEventClassAppearance / kEventAppearanceScrollBarVariantChanged
14212  *
14213  *  Summary:
14214  *    The scroll bar variant has changed. Available on Mac OS X 10.1
14215  *    and later.
14216  *
14217  *  Discussion:
14218  *    This event is sent to all handlers registered for it on Mac OS X
14219  *    10.3 and later.
14220  *
14221  *  Mac OS X threading:
14222  *    Not thread safe
14223  *
14224  *  Parameters:
14225  *
14226  *    --> kEventParamNewScrollBarVariant (in, typeSInt16)
14227  *          The new scroll bar variant.
14228  *
14229  *  Availability:
14230  *    Mac OS X:         in version 10.1 and later in Carbon.framework
14231  *    CarbonLib:        not available
14232  }
14233 const
14234 	kEventAppearanceScrollBarVariantChanged = 1;
14235 
14236 {--------------------------------------------------------------------------------------}
14237 {  Services Events                                                                     }
14238 {--------------------------------------------------------------------------------------}
14239 {
14240     kEventClassService quick reference:
14241 
14242     Services are a feature by which applications can communicate with
14243     one another to request and provide services. This communication
14244     happens either through the Pasteboard or Scrap Manager. When an event is sent that
14245     requires communication for processing or servicing a request,
14246     you will need to use the pasteboard or scrap given in the kEventParamPasteboardRef and
14247     kEventParamScrapRef parameters of the event in order to communicate.
14248     When your app requests a service, it is usually acting on data that is
14249     currently selected or in focus. Therefore all of the Services events
14250     are sent to the UserFocus event target.
14251     <BR><BR>
14252     Service events are available on Mac OS X 10.1 and later.
14253 
14254     kEventServiceCopy           = 1,
14255     kEventServicePaste          = 2,
14256     kEventServiceGetTypes       = 3,
14257     kEventServicePerform        = 4
14258 }
14259 {
14260  *  kEventClassService / kEventServiceCopy
14261  *
14262  *  Summary:
14263  *    The user has invoked a service that requires the application to
14264  *    update the given pasteboard or scrap in the
14265  *    kEventParamPasteboardRef and kEventParamScrapRef parameters with
14266  *    appropriate data from the focus.
14267  *
14268  *  Discussion:
14269  *    On Mac OS X 10.3 and later, this event includes both a
14270  *    PasteboardRef and a ScrapRef. A handler for this event should
14271  *    provide its data using either Pasteboard or Scrap Manager APIs,
14272  *    and the corresponding pasteboard or scrap reference, depending on
14273  *    which is more convenient or appropriate. Data only needs to be
14274  *    placed on one of the pasteboard or scrap; it does not need to be
14275  *    placed on both. Data written to the pasteboard will also be
14276  *    available on the scrap, and vice versa.
14277  *
14278  *  Mac OS X threading:
14279  *    Not thread safe
14280  *
14281  *  Parameters:
14282  *
14283  *    --> kEventParamPasteboardRef (in, typePasteboardRef)
14284  *          Data from the current selection should be placed into this
14285  *          pasteboard. This parameter is provided on Mac OS X 10.3 and
14286  *          later.
14287  *
14288  *    --> kEventParamScrapRef (in, typeScrapRef)
14289  *          Data from the current selection should be placed into this
14290  *          scrap.
14291  *
14292  *  Availability:
14293  *    Mac OS X:         in version 10.1 and later in Carbon.framework
14294  *    CarbonLib:        not available
14295  }
14296 const
14297 	kEventServiceCopy = 1;
14298 
14299 {
14300  *  kEventClassService / kEventServicePaste
14301  *
14302  *  Summary:
14303  *    The user has invoked a service that requires the application to
14304  *    update the current focus with data from the pasteboard or scrap
14305  *    given in the kEventParamPasteboardRef and kEventParamScrapRef
14306  *    parameters.
14307  *
14308  *  Discussion:
14309  *    On Mac OS X 10.3 and later, this event includes both a
14310  *    PasteboardRef and a ScrapRef. A handler for this event should
14311  *    retrieve its data using either Pasteboard or Scrap Manager APIs,
14312  *    and the corresponding pasteboard or scrap reference, depending on
14313  *    which is more convenient or appropriate. Data only needs to be
14314  *    read from one of the pasteboard or scrap; it does not need to be
14315  *    read from both. Data available on the pasteboard will also be
14316  *    available on the scrap, and vice versa.
14317  *
14318  *  Mac OS X threading:
14319  *    Not thread safe
14320  *
14321  *  Parameters:
14322  *
14323  *    --> kEventParamPasteboardRef (in, typePasteboardRef)
14324  *          The current selection should be replaced by data from this
14325  *          pasteboard. This parameter is provided on Mac OS X 10.3 and
14326  *          later.
14327  *
14328  *    --> kEventParamScrapRef (in, typeScrapRef)
14329  *          The current selection should be replaced by data from this
14330  *          scrap.
14331  *
14332  *  Availability:
14333  *    Mac OS X:         in version 10.1 and later in Carbon.framework
14334  *    CarbonLib:        not available
14335  }
14336 const
14337 	kEventServicePaste = 2;
14338 
14339 {
14340  *  kEventClassService / kEventServiceGetTypes
14341  *
14342  *  Summary:
14343  *    The Services Manager needs to know what types of data the
14344  *    application can copy and paste to and from the pasteboard or
14345  *    scrap in order to update the Services menu to enable items that
14346  *    the user can select.
14347  *
14348  *  Discussion:
14349  *    This event sends two CFMutableArrayRefs for the application to
14350  *    add the types to: the kEventParamServiceCopyTypes and the
14351  *    kEventParamServicePasteTypes parameters. The types that are added
14352  *    are CFStringRefs. There is a convenience function,
14353  *    CreateTypeStringWithOSType, which takes an OSType and will create
14354  *    a CFStringRef that you can add to the array(s).
14355  *
14356  *  Mac OS X threading:
14357  *    Not thread safe
14358  *
14359  *  Parameters:
14360  *
14361  *    --> kEventParamServiceCopyTypes (in, typeCFMutableArrayRef)
14362  *          Add CFStringRefs to this array to report the types that can
14363  *          be copied from the current selection. These strings will be
14364  *          released automatically after the event is handled.
14365  *
14366  *    --> kEventParamServicePasteTypes (in, typeCFMutableArrayRef)
14367  *          Add CFStringRefs to this array to report the types that can
14368  *          be pasted into the currently focused object. These strings
14369  *          will be released automatically after the event is handled.
14370  *
14371  *  Availability:
14372  *    Mac OS X:         in version 10.1 and later in Carbon.framework
14373  *    CarbonLib:        not available
14374  }
14375 const
14376 	kEventServiceGetTypes = 3;
14377 
14378 {
14379  *  kEventClassService / kEventServicePerform
14380  *
14381  *  Summary:
14382  *    If the application is a service provider, this event will get
14383  *    sent when a service is requested of the app.
14384  *
14385  *  Discussion:
14386  *    On Mac OS X 10.3 and later, this event includes both a
14387  *    PasteboardRef and a ScrapRef. A handler for this event may
14388  *    provide its data using either Pasteboard or Scrap Manager APIs,
14389  *    and the corresponding pasteboard or scrap reference, depending on
14390  *    which is more convenient or appropriate.
14391  *
14392  *  Mac OS X threading:
14393  *    Not thread safe
14394  *
14395  *  Parameters:
14396  *
14397  *    --> kEventParamPasteboardRef (in, typePasteboardRef)
14398  *          The pasteboard that should be used to send and receive data
14399  *          from the requester. This parameter is only provided on Mac
14400  *          OS X 10.3 and later.
14401  *
14402  *    --> kEventParamScrapRef (in, typeScrapRef)
14403  *          The scrap that should be used to send and receive data from
14404  *          the requester.
14405  *
14406  *    --> kEventParamServiceMessageName (in, typeCFStringRef)
14407  *          A string with the name of the advertised service that was
14408  *          invoked.
14409  *
14410  *    --> kEventParamServiceUserData (in, typeCFStringRef)
14411  *          Extra data provided by the requestor.
14412  *
14413  *  Availability:
14414  *    Mac OS X:         in version 10.1 and later in Carbon.framework
14415  *    CarbonLib:        not available
14416  }
14417 const
14418 	kEventServicePerform = 4;
14419 
14420 {$ifc not TARGET_CPU_64}
14421 {
14422  *  CreateTypeStringWithOSType()
14423  *
14424  *  Discussion:
14425  *    This routine is used to convert an OSType to a CFStringRef that
14426  *    services will understand.
14427  *
14428  *  Mac OS X threading:
14429  *    Not thread safe
14430  *
14431  *  Parameters:
14432  *
14433  *    inType:
14434  *      The OSType that needs to be converted to a CFString.
14435  *
14436  *  Result:
14437  *    A CFStringRef that contains the string that corresponds to the
14438  *    given OSType. This follows CoreFoundation semantics in that it
14439  *    will return NULL for failure, and because it is a "Create"
14440  *    function you will need to CFRelease this string when it is no
14441  *    longer needed.
14442  *
14443  *  Availability:
14444  *    Mac OS X:         in version 10.1 and later in Carbon.framework [32-bit only]
14445  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
14446  *    Non-Carbon CFM:   not available
14447  }
CreateTypeStringWithOSTypenull14448 function CreateTypeStringWithOSType( inType: OSType ): CFStringRef; external name '_CreateTypeStringWithOSType';
14449 (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
14450 
14451 
14452 {$endc} {not TARGET_CPU_64}
14453 
14454 
14455 {
14456  *  kHIServicesMenuProviderName
14457  *
14458  *  Discussion:
14459  *    A CFDictionaryRef key in a dictionary returned by
14460  *    CopyServicesMenuCommandKeys. The value for this key is the name
14461  *    of the service provider represented as a CFString.
14462  }
14463 {$ifc USE_CFSTR_CONSTANT_MACROS}
14464 {$definec kHIServicesMenuProviderName CFSTRP('kHIServicesMenuProviderName')}
14465 {$endc}
14466 
14467 {
14468  *  kHIServicesMenuItemName
14469  *
14470  *  Discussion:
14471  *    A CFDictionaryRef key in a dictionary returned by
14472  *    CopyServicesMenuCommandKeys. The value for this key is the name
14473  *    of the menu item represented as a CFString.
14474  }
14475 {$ifc USE_CFSTR_CONSTANT_MACROS}
14476 {$definec kHIServicesMenuItemName CFSTRP('kHIServicesMenuItemName')}
14477 {$endc}
14478 
14479 {
14480  *  kHIServicesMenuCharCode
14481  *
14482  *  Discussion:
14483  *    A CFDictionaryRef key in a dictionary returned by
14484  *    CopyServicesMenuCommandKeys. The value for this key is the
14485  *    character code of the menu item shortcut, represented as a
14486  *    CFString.
14487  }
14488 {$ifc USE_CFSTR_CONSTANT_MACROS}
14489 {$definec kHIServicesMenuCharCode CFSTRP('kHIServicesMenuCharCode')}
14490 {$endc}
14491 
14492 {
14493  *  kHIServicesMenuKeyModifiers
14494  *
14495  *  Discussion:
14496  *    A CFDictionaryRef key in a dictionary returned by
14497  *    CopyServicesMenuCommandKeys. The value for this key is the
14498  *    keyboard modifiers of the menu item shortcut in Menu Manager
14499  *    modifiers format, represented as a CFNumber.
14500  }
14501 {$ifc USE_CFSTR_CONSTANT_MACROS}
14502 {$definec kHIServicesMenuKeyModifiers CFSTRP('kHIServicesMenuKeyModifiers')}
14503 {$endc}
14504 {$ifc not TARGET_CPU_64}
14505 {
14506  *  CopyServicesMenuCommandKeys()
14507  *
14508  *  Summary:
14509  *    Returns an array of CFDictionaryRefs containing information about
14510  *    the command-key short cuts for items in the application services
14511  *    menu.
14512  *
14513  *  Discussion:
14514  *    Each array entry is a CFDictionaryRef, and each dictionary
14515  *    contains information about a single command key shortcut for
14516  *    items in the application's Services menu. Each dictionary
14517  *    contains the following keys: kHIServicesMenuProviderName,
14518  *    kHIServicesMenuItemName, kHIServicesMenuCharCode, and
14519  *    kHIServicesMenuKeyModifiers. The array must be released by the
14520  *    caller; the dictionaries do not need to be released (they will be
14521  *    auto-released when the array is released).
14522  *
14523  *  Mac OS X threading:
14524  *    Not thread safe
14525  *
14526  *  Parameters:
14527  *
14528  *    outCommandKeyArray:
14529  *      On exit, contains an array of the values of the Services menu
14530  *      items that have command key shortcuts associated with them.
14531  *
14532  *  Result:
14533  *    An operating system status code.
14534  *
14535  *  Availability:
14536  *    Mac OS X:         in version 10.4 and later in Carbon.framework [32-bit only]
14537  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
14538  *    Non-Carbon CFM:   not available
14539  }
CopyServicesMenuCommandKeysnull14540 function CopyServicesMenuCommandKeys( var outCommandKeyArray: CFArrayRef ): OSStatus; external name '_CopyServicesMenuCommandKeys';
14541 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
14542 
14543 
14544 {--------------------------------------------------------------------------------------}
14545 {  System Events                                                                       }
14546 {--------------------------------------------------------------------------------------}
14547 
14548 {
14549     kEventClassSystem quick reference:
14550 
14551     kEventSystemTimeDateChanged             = 2,
14552     kEventSystemDisplaysAsleep              = 3,
14553     kEventSystemDisplaysAwake               = 4,
14554     kEventSystemDisplayReconfigured         = 6,
14555     kEventSystemUserSessionActivated        = 10,
14556     kEventSystemUserSessionDeactivated      = 11
14557 }
14558 {
14559  *  kEventClassSystem / kEventSystemTimeDateChanged
14560  *
14561  *  Summary:
14562  *    The system time and/or date has changed via the preferences panel.
14563  *
14564  *  Discussion:
14565  *    This event is sent to all handlers registered for it on the
14566  *    application event target.
14567  *
14568  *  Mac OS X threading:
14569  *    Not thread safe
14570  *
14571  *  Availability:
14572  *    Mac OS X:         in version 10.3 and later in Carbon.framework
14573  *    CarbonLib:        not available
14574  }
14575 {$endc} {not TARGET_CPU_64}
14576 
14577 const
14578 	kEventSystemTimeDateChanged = 2;
14579 
14580 {
14581  *  kEventClassSystem / kEventSystemDisplaysAsleep
14582  *
14583  *  Summary:
14584  *    All connected displays have gone to sleep.
14585  *
14586  *  Discussion:
14587  *    This event is sent to all handlers registered for it on the
14588  *    application event target.
14589  *
14590  *  Mac OS X threading:
14591  *    Not thread safe
14592  *
14593  *  Availability:
14594  *    Mac OS X:         in version 10.4 and later in Carbon.framework
14595  *    CarbonLib:        not available
14596  }
14597 const
14598 	kEventSystemDisplaysAsleep = 3;
14599 
14600 {
14601  *  kEventClassSystem / kEventSystemDisplaysAwake
14602  *
14603  *  Summary:
14604  *    All connected displays have awoken.
14605  *
14606  *  Discussion:
14607  *    This event is sent to all handlers registered for it on the
14608  *    application event target.
14609  *
14610  *  Mac OS X threading:
14611  *    Not thread safe
14612  *
14613  *  Availability:
14614  *    Mac OS X:         in version 10.4 and later in Carbon.framework
14615  *    CarbonLib:        not available
14616  }
14617 const
14618 	kEventSystemDisplaysAwake = 4;
14619 
14620 {
14621  *  kEventClassSystem / kEventSystemDisplayReconfigured
14622  *
14623  *  Summary:
14624  *    Notification that the Display configuration has changed
14625  *
14626  *  Discussion:
14627  *    This event is sent to all handlers registered for it on the
14628  *    application event target. When this event is received,
14629  *    applications may wish to update geometry and color depth usage or
14630  *    perform a redraw based on the new configuration.
14631  *
14632  *  Mac OS X threading:
14633  *    Not thread safe
14634  *
14635  *  Parameters:
14636  *
14637  *    --> kEventParamDisplayChangeFlags (in, typeCGDisplayChangeFlags)
14638  *          The CGDisplayChangeSummaryFlags specifying what display
14639  *          config changes occurred.  See
14640  *          CoreGraphics/CGDisplayConfiguration.h for more information
14641  *          on these flags.
14642  *
14643  *  Availability:
14644  *    Mac OS X:         in version 10.5 and later in Carbon.framework
14645  *    CarbonLib:        not available
14646  }
14647 const
14648 	kEventSystemDisplayReconfigured = 6;
14649 
14650 {
14651  *  kEventClassSystem / kEventSystemUserSessionActivated
14652  *
14653  *  Summary:
14654  *    The current user login session has been activated.
14655  *
14656  *  Discussion:
14657  *    This event is sent to all handlers registered for it on the
14658  *    application event target. It is sent when the Fast User Switching
14659  *    feature of Mac OS X 10.3 is used to activate the login session in
14660  *    which the current application is running.
14661  *
14662  *  Mac OS X threading:
14663  *    Not thread safe
14664  *
14665  *  Availability:
14666  *    Mac OS X:         in version 10.3 and later in Carbon.framework
14667  *    CarbonLib:        not available
14668  }
14669 const
14670 	kEventSystemUserSessionActivated = 10;
14671 
14672 {
14673  *  kEventClassSystem / kEventSystemUserSessionDeactivated
14674  *
14675  *  Summary:
14676  *    The current user login session has been deactivated.
14677  *
14678  *  Discussion:
14679  *    This event is sent to all handlers registered for it on the
14680  *    application event target. It is sent when the Fast User Switching
14681  *    feature of Mac OS X 10.3 is used to switch to another user's
14682  *    login session.
14683  *
14684  *  Mac OS X threading:
14685  *    Not thread safe
14686  *
14687  *  Availability:
14688  *    Mac OS X:         in version 10.3 and later in Carbon.framework
14689  *    CarbonLib:        not available
14690  }
14691 const
14692 	kEventSystemUserSessionDeactivated = 11;
14693 
14694 {--------------------------------------------------------------------------------------}
14695 {  Installing Event Handlers                                                           }
14696 {--------------------------------------------------------------------------------------}
14697 {$ifc not TARGET_CPU_64}
14698 {
14699  *  GetWindowEventTarget()
14700  *
14701  *  Discussion:
14702  *    Returns the EventTargetRef for the specified window. Once you
14703  *    obtain this reference, you can send events to the target and
14704  *    install an event handler on it.
14705  *
14706  *  Mac OS X threading:
14707  *    Not thread safe
14708  *
14709  *  Parameters:
14710  *
14711  *    inWindow:
14712  *      The window to return the target for.
14713  *
14714  *  Result:
14715  *    An EventTargetRef.
14716  *
14717  *  Availability:
14718  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
14719  *    CarbonLib:        in CarbonLib 1.1 and later
14720  *    Non-Carbon CFM:   not available
14721  }
GetWindowEventTargetnull14722 function GetWindowEventTarget( inWindow: WindowRef ): EventTargetRef; external name '_GetWindowEventTarget';
14723 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
14724 
14725 
14726 {
14727  *  GetControlEventTarget()
14728  *
14729  *  Discussion:
14730  *    Returns the EventTargetRef for the specified control. Once you
14731  *    obtain this reference, you can send events to the target and
14732  *    install event handler on it.
14733  *
14734  *  Mac OS X threading:
14735  *    Not thread safe
14736  *
14737  *  Parameters:
14738  *
14739  *    inControl:
14740  *      The control to return the target for.
14741  *
14742  *  Result:
14743  *    An EventTargetRef.
14744  *
14745  *  Availability:
14746  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
14747  *    CarbonLib:        in CarbonLib 1.1 and later
14748  *    Non-Carbon CFM:   not available
14749  }
GetControlEventTargetnull14750 function GetControlEventTarget( inControl: ControlRef ): EventTargetRef; external name '_GetControlEventTarget';
14751 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
14752 
14753 
14754 {
14755  *  GetMenuEventTarget()
14756  *
14757  *  Discussion:
14758  *    Returns the EventTargetRef for the specified menu. Once you
14759  *    obtain this reference, you can send events to the target and
14760  *    install event handler on it.
14761  *
14762  *  Mac OS X threading:
14763  *    Not thread safe
14764  *
14765  *  Parameters:
14766  *
14767  *    inMenu:
14768  *      The menu to return the target for.
14769  *
14770  *  Result:
14771  *    An EventTargetRef.
14772  *
14773  *  Availability:
14774  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
14775  *    CarbonLib:        in CarbonLib 1.1 and later
14776  *    Non-Carbon CFM:   not available
14777  }
GetMenuEventTargetnull14778 function GetMenuEventTarget( inMenu: MenuRef ): EventTargetRef; external name '_GetMenuEventTarget';
14779 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
14780 
14781 
14782 {$endc} {not TARGET_CPU_64}
14783 
14784 {
14785  *  GetApplicationEventTarget()
14786  *
14787  *  Discussion:
14788  *    Returns the EventTargetRef for the application. Once you obtain
14789  *    this reference, you can send events to the target and install
14790  *    event handler on it.
14791  *
14792  *  Mac OS X threading:
14793  *    Not thread safe
14794  *
14795  *  Result:
14796  *    An EventTargetRef.
14797  *
14798  *  Availability:
14799  *    Mac OS X:         in version 10.0 and later in Carbon.framework
14800  *    CarbonLib:        in CarbonLib 1.1 and later
14801  *    Non-Carbon CFM:   not available
14802  }
GetApplicationEventTargetnull14803 function GetApplicationEventTarget: EventTargetRef; external name '_GetApplicationEventTarget';
14804 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
14805 
14806 
14807 {$ifc not TARGET_CPU_64}
14808 {
14809  *  GetUserFocusEventTarget()
14810  *
14811  *  Discussion:
14812  *    Returns the EventTargetRef for the current user focus at the time
14813  *    of the call. Keyboard events are always sent to this target.
14814  *    Events that are sent to this target are automatically propagated
14815  *    to the following other targets: first to the focused control in
14816  *    the focused window, then up the control hierarchy to the focused
14817  *    window itself, and then to the application target.
14818  *
14819  *    Note that command key processing occurs before key events are
14820  *    sent to this target; to intercept key events before command key
14821  *    processing occurs, install a handler on the event dispatcher
14822  *    target instead of this target.
14823  *
14824  *  Mac OS X threading:
14825  *    Not thread safe
14826  *
14827  *  Result:
14828  *    An EventTargetRef.
14829  *
14830  *  Availability:
14831  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
14832  *    CarbonLib:        in CarbonLib 1.1 and later
14833  *    Non-Carbon CFM:   not available
14834  }
GetUserFocusEventTargetnull14835 function GetUserFocusEventTarget: EventTargetRef; external name '_GetUserFocusEventTarget';
14836 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
14837 
14838 
14839 {$endc} {not TARGET_CPU_64}
14840 
14841 {
14842  *  GetEventDispatcherTarget()
14843  *
14844  *  Discussion:
14845  *    Returns the EventTargetRef for the standard toolbox dispatcher.
14846  *    You typically would never need to use this, but there are some
14847  *    exotic apps that need to pick events off the event queue and call
14848  *    the dispatcher themselves. This allows you to do just that
14849  *    instead of calling RunApplicationEventLoop to handle it all.
14850  *
14851  *  Mac OS X threading:
14852  *    Not thread safe
14853  *
14854  *  Result:
14855  *    An EventTargetRef.
14856  *
14857  *  Availability:
14858  *    Mac OS X:         in version 10.0 and later in Carbon.framework
14859  *    CarbonLib:        in CarbonLib 1.3 and later
14860  *    Non-Carbon CFM:   not available
14861  }
GetEventDispatcherTargetnull14862 function GetEventDispatcherTarget: EventTargetRef; external name '_GetEventDispatcherTarget';
14863 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
14864 
14865 
14866 {
14867  *  GetEventMonitorTarget()
14868  *
14869  *  Summary:
14870  *    Returns the event monitor target.
14871  *
14872  *  Discussion:
14873  *    The event monitor target is a special event target used to
14874  *    monitor user input events across all processes. When an event
14875  *    handler is installed on the event monitor target, the Carbon
14876  *    Event Manager examines the EventTypeSpec for user input event
14877  *    types, such as mouse-down, mouse-up, key-down, and so forth. It
14878  *    then requests that the WindowServer make copies of any of these
14879  *    events that are sent to any process, and deliver them to the
14880  *    current process also. These events are queued into the main
14881  *    thread�s event queue, and during normal event dispatching are
14882  *    sent directly to the event handlers installed on the event
14883  *    monitor target. Monitored events are not sent through the normal
14884  *    event dispatching path for the current process; they will pass
14885  *    through the event dispatcher target, and will then be sent
14886  *    directly to the event monitor target.
14887  *
14888  *    Handlers installed on the event monitor target will only receive
14889  *    events when the current application is inactive. When the current
14890  *    application is active, all event flow occurs through the event
14891  *    dispatcher target, and no events are sent to the event monitor
14892  *    target.
14893  *
14894  *    Currently, the event monitor supports the following event kinds:
14895  *    kEventRawKeyDown, kEventRawKeyUp, kEventRawKeyRepeat,
14896  *    kEventRawKeyModifiersChanged, kEventMouseDown, kEventMouseUp,
14897  *    kEventMouseMoved, kEventMouseDragged, kEventMouseWheelMoved,
14898  *    kEventTabletPoint, and kEventTabletProximity.
14899  *
14900  *    Note that both Carbon and Cocoa password edit text controls
14901  *    enable a secure input mode while the focus is on the control,
14902  *    which prevents keyboard events from being passed to other
14903  *    applications. This prevents the monitoring event target from
14904  *    being used to sniff password keystrokes.
14905  *
14906  *    For added security, GetEventMonitorTarget requires that "Enable
14907  *    access for assistive devices" be checked in the Universal Access
14908  *    preference pane in order to monitor RawKeyDown, RawKeyUp, and
14909  *    RawKeyRepeat events. If this control is not checked, you can
14910  *    still install handlers for these events on the event monitor
14911  *    target, but no events of these types will be sent to your
14912  *    handler. Administrator privileges are required to enable this
14913  *    feature. You can determine whether this control is checked using
14914  *    the AXAPIEnabled API in AXUIElement.h.
14915  *
14916  *  Mac OS X threading:
14917  *    Not thread safe
14918  *
14919  *  Result:
14920  *    An EventTargetRef.
14921  *
14922  *  Availability:
14923  *    Mac OS X:         in version 10.3 and later in Carbon.framework
14924  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
14925  *    Non-Carbon CFM:   not available
14926  }
GetEventMonitorTargetnull14927 function GetEventMonitorTarget: EventTargetRef; external name '_GetEventMonitorTarget';
14928 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
14929 
14930 (*
14931 #define InstallApplicationEventHandler( handler, numTypes, list, userData, outHandlerRef ) \
14932       InstallEventHandler( GetApplicationEventTarget(), (handler), (numTypes), (list), (userData), (outHandlerRef) )
14933 
14934 #define InstallHIObjectEventHandler( target, handler, numTypes, list, userData, outHandlerRef ) \
14935       InstallEventHandler( HIObjectGetEventTarget( target ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
14936 
14937 #define InstallWindowEventHandler( target, handler, numTypes, list, userData, outHandlerRef ) \
14938        InstallEventHandler( GetWindowEventTarget( target ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
14939 
14940 #define InstallControlEventHandler( target, handler, numTypes, list, userData, outHandlerRef ) \
14941         InstallEventHandler( GetControlEventTarget( target ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
14942 
14943 #define InstallMenuEventHandler( target, handler, numTypes, list, userData, outHandlerRef ) \
14944       InstallEventHandler( GetMenuEventTarget( target ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
14945 
14946 #define HIViewInstallEventHandler( target, handler, numTypes, list, userData, outHandlerRef ) \
14947        InstallEventHandler( HIObjectGetEventTarget( (HIObjectRef) (target) ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
14948 
14949 
14950 {
14951     You can use the following macro in your code to allow you to set up an
14952  event handler lazily. You pass the name of your event handler in. You should
14953    use this with caution on Mac OS 9 systems since it could cause heap fragmentation.
14954 }
14955 #define DEFINE_ONE_SHOT_HANDLER_GETTER( x )       \
14956 EventHandlerUPP Get ## x ## UPP()             \
14957 {                                             \
14958   static EventHandlerUPP  sHandler = NULL;    \
14959                                               \
14960   if ( sHandler == NULL )                     \
14961       sHandler = NewEventHandlerUPP( x );     \
14962                                               \
14963   return sHandler;                            \
14964 }
14965 
14966 
14967 #define SendEventToApplication( e ) \
14968         SendEventToEventTarget( (e), GetApplicationEventTarget() )
14969 
14970 #define SendEventToHIObject( e, t ) \
14971       SendEventToEventTarget( (e), HIObjectGetEventTarget( t ) )
14972 
14973 #define SendEventToWindow( e, t ) \
14974         SendEventToEventTarget( (e), GetWindowEventTarget( t ) )
14975 
14976 #define SendEventToControl( e, t ) \
14977      SendEventToEventTarget( (e), GetControlEventTarget( t ) )
14978 
14979 #define SendEventToMenu( e, t ) \
14980        SendEventToEventTarget( (e), GetMenuEventTarget( t ) )
14981 
14982 #define SendEventToUserFocus( e ) \
14983         SendEventToEventTarget( (e), GetUserFocusEventTarget() )
14984 *)
14985 
14986 {======================================================================================}
14987 {  � Command Routines                                                                  }
14988 {======================================================================================}
14989 {
14990  *  ProcessHICommand()
14991  *
14992  *  Summary:
14993  *    Sends a kEventCommandProcess event.
14994  *
14995  *  Discussion:
14996  *    ProcessHICommand is a convenience function for dispatching
14997  *    kEventCommandProcesss events. Normally these events are created
14998  *    and dispatched automatically by the toolbox when a menu item or
14999  *    control is selected, but you may need to dispatch an event
15000  *    yourself at times. This API creates a CommandProcess event, adds
15001  *    the specified HICommand structure as an event parameter, and
15002  *    sends the event to the user focus target for handling.
15003  *
15004  *    If you need to send a CommandProcess event to some other target,
15005  *    or you need to add other event parameters to the event besides
15006  *    the HICommand structure, it is correct and supported to simply
15007  *    create the event yourself and send it to the desired target,
15008  *    without using this API.
15009  *
15010  *  Mac OS X threading:
15011  *    Not thread safe
15012  *
15013  *  Availability:
15014  *    Mac OS X:         in version 10.0 and later in Carbon.framework
15015  *    CarbonLib:        in CarbonLib 1.1 and later
15016  *    Non-Carbon CFM:   not available
15017  }
ProcessHICommandnull15018 function ProcessHICommand( const (*var*) inCommand: HICommand ): OSStatus; external name '_ProcessHICommand';
15019 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
15020 
15021 
15022 {--------------------------------------------------------------------------------------}
15023 {  � Event Loop Routines                                                               }
15024 {--------------------------------------------------------------------------------------}
15025 
15026 {$ifc not TARGET_CPU_64}
15027 {
15028  *  RunApplicationEventLoop()
15029  *
15030  *  Discussion:
15031  *    This routine is used as the main event loop for a Carbon
15032  *    Event-based application. Once entered, this function waits for
15033  *    events to arrive and dispatches them to your event handlers
15034  *    automatically.
15035  *
15036  *  Mac OS X threading:
15037  *    Not thread safe
15038  *
15039  *  Availability:
15040  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
15041  *    CarbonLib:        in CarbonLib 1.1 and later
15042  *    Non-Carbon CFM:   not available
15043  }
15044 procedure RunApplicationEventLoop; external name '_RunApplicationEventLoop';
15045 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
15046 
15047 
15048 {
15049  *  QuitApplicationEventLoop()
15050  *
15051  *  Discussion:
15052  *    This routine is used to quit the RunApplicationEventLoop
15053  *    function. Typically, your application doesn't need to call this.
15054  *    If your application has the Quit menu item tagged with the
15055  *    kHICommandQuit Menu Command ID, the toolbox will automatically
15056  *    call this for your application, automatically terminating your
15057  *    event loop. If your application wants to do pre-processing before
15058  *    the event loop exits, it should intercept either the
15059  *    kHICommandQuit menu command, or the kEventAppQuit event.
15060  *
15061  *  Mac OS X threading:
15062  *    Not thread safe
15063  *
15064  *  Availability:
15065  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
15066  *    CarbonLib:        in CarbonLib 1.1 and later
15067  *    Non-Carbon CFM:   not available
15068  }
15069 procedure QuitApplicationEventLoop; external name '_QuitApplicationEventLoop';
15070 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
15071 
15072 
15073 {--------------------------------------------------------------------------------------}
15074 {  � Event Modality routines                                                           }
15075 {--------------------------------------------------------------------------------------}
15076 
15077 {
15078  *  RunAppModalLoopForWindow()
15079  *
15080  *  Discussion:
15081  *    This routine is used as a replacement to ModalDialog to drive a
15082  *    Carbon Event-based modal dialog. Once called, this routine will
15083  *    not exit until QuitAppModalLoopForWindow is called. Calls to
15084  *    RunAppModalLoopForWindow can be nested, as long as each call is
15085  *    made on a different window. The window must be visible when
15086  *    calling RunAppModalLoopForWindow; otherwise, windowWrongStateErr
15087  *    is returned. In Mac OS X 10.0.x, RunAppModalLoopForWindow will
15088  *    fail to re-enable the menubar before exiting if you dispose of
15089  *    the window during the modal loop (for example, from a Carbon
15090  *    event handler). You can work around this bug by retaining the
15091  *    window before calling RunAppModalLoopForWindow, and releasing it
15092  *    afterwards.
15093  *
15094  *  Mac OS X threading:
15095  *    Not thread safe
15096  *
15097  *  Parameters:
15098  *
15099  *    inWindow:
15100  *      The window you wish to behave modally.
15101  *
15102  *  Result:
15103  *    An operating system status code. windowWrongStateErr will be
15104  *    returned if the window is invisible.
15105  *
15106  *  Availability:
15107  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
15108  *    CarbonLib:        in CarbonLib 1.3 and later
15109  *    Non-Carbon CFM:   not available
15110  }
RunAppModalLoopForWindownull15111 function RunAppModalLoopForWindow( inWindow: WindowRef ): OSStatus; external name '_RunAppModalLoopForWindow';
15112 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
15113 
15114 
15115 {
15116  *  QuitAppModalLoopForWindow()
15117  *
15118  *  Discussion:
15119  *    This routine is used to quit a currently running call to
15120  *    RunAppModalLoopForWindow, i.e. it terminates a modal loop.
15121  *    Typically this would be called from a handler you have installed
15122  *    on the modal window in question when the user clicks the
15123  *    appropriate button, etc.
15124  *
15125  *  Mac OS X threading:
15126  *    Not thread safe
15127  *
15128  *  Parameters:
15129  *
15130  *    inWindow:
15131  *      The window for which to quit the modal state.
15132  *
15133  *  Result:
15134  *    An operating system status code.
15135  *
15136  *  Availability:
15137  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
15138  *    CarbonLib:        in CarbonLib 1.3 and later
15139  *    Non-Carbon CFM:   not available
15140  }
QuitAppModalLoopForWindownull15141 function QuitAppModalLoopForWindow( inWindow: WindowRef ): OSStatus; external name '_QuitAppModalLoopForWindow';
15142 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
15143 
15144 
15145 {
15146  *  BeginAppModalStateForWindow()
15147  *
15148  *  Discussion:
15149  *    This routine is a lower level routine than
15150  *    RunAppModalLoopForWindow. It can be used if you wish to enter an
15151  *    app modal state for a window, but need to control the event loop
15152  *    yourself for whatever reason. In most cases, you would use
15153  *    RunAppModalLoopForWindow. Once you begin your app modal state,
15154  *    the menu bar will disable and prepare for the modal situation.
15155  *    The window must be visible when calling
15156  *    BeginAppModalStateForWindow; otherwise, windowWrongStateErr is
15157  *    returned. Calls to BeginAppModalStateForWindow can be nested, as
15158  *    long as each call is made on a different window. In Mac OS 10.0.x
15159  *    and CarbonLib 1.3.1, BeginAppModalStateForWindow can only be
15160  *    called on a window once; future calls will return an error. This
15161  *    bug is fixed in Mac OS 10.1 and CarbonLib 1.4.
15162  *
15163  *  Mac OS X threading:
15164  *    Not thread safe
15165  *
15166  *  Parameters:
15167  *
15168  *    inWindow:
15169  *      The window you wish to behave modally.
15170  *
15171  *  Result:
15172  *    An operating system status code. windowWrongStateErr will be
15173  *    returned if the window is invisible.
15174  *
15175  *  Availability:
15176  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
15177  *    CarbonLib:        in CarbonLib 1.3 and later
15178  *    Non-Carbon CFM:   not available
15179  }
BeginAppModalStateForWindownull15180 function BeginAppModalStateForWindow( inWindow: WindowRef ): OSStatus; external name '_BeginAppModalStateForWindow';
15181 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
15182 
15183 
15184 {
15185  *  EndAppModalStateForWindow()
15186  *
15187  *  Discussion:
15188  *    This routine ends an app modal state started with
15189  *    BeginAppModalStateForWindow.
15190  *
15191  *  Mac OS X threading:
15192  *    Not thread safe
15193  *
15194  *  Parameters:
15195  *
15196  *    inWindow:
15197  *      The window you wish to stop acting as app modal.
15198  *
15199  *  Result:
15200  *    An operating system status code.
15201  *
15202  *  Availability:
15203  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
15204  *    CarbonLib:        in CarbonLib 1.3 and later
15205  *    Non-Carbon CFM:   not available
15206  }
EndAppModalStateForWindownull15207 function EndAppModalStateForWindow( inWindow: WindowRef ): OSStatus; external name '_EndAppModalStateForWindow';
15208 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
15209 
15210 
15211 {--------------------------------------------------------------------------------------}
15212 {  � Global HotKey API                                                                 }
15213 {--------------------------------------------------------------------------------------}
15214 {$endc} {not TARGET_CPU_64}
15215 
15216 type
15217 	EventHotKeyIDPtr = ^EventHotKeyID;
15218 	EventHotKeyID = record
15219 		signature: OSType;
15220 		id: UInt32;
15221 	end;
15222 type
15223 	EventHotKeyRef = ^OpaqueEventHotKeyRef; { an opaque type }
15224 	OpaqueEventHotKeyRef = record end;
15225 
15226 {
15227  *  HotKeyOptions
15228  *
15229  *  Summary:
15230  *    Constants for the inOptions parameter of RegisterEventHotKey.
15231  }
15232 const
15233 {
15234    * No options specified.
15235    }
15236 	kEventHotKeyNoOptions = 0;
15237 
15238   {
15239    * Hot keys are normally non-exclusive: when the key is pressed,
15240    * notification events are sent to all registrants for that hotkey.
15241    * Registering an exclusive hotkey prevents non-exclusive registrants
15242    * for the same key code and modifiers from receiving notification
15243    * events, as long as the exclusive registrant is enabled. When the
15244    * exclusive entry is disabled or removed, or the owning app goes
15245    * away, non-exclusive registrants will be able to receive
15246    * notifications as normal.
15247    *
15248    * While a key is registered as an exclusive key, non-exclusive
15249    * registrations are accepted as normal, but will not receive
15250    * notification events until the exclusive hot key is disabled,
15251    * removed, or the owning app goes away.
15252    *
15253    * An error is returned when an attempt is made to register an
15254    * exclusive key while another hot key is already registered for that
15255    * key code and modifiers.
15256    * <BR> This option is available in Mac OS X 10.5 and later.
15257    }
15258 	kEventHotKeyExclusive = 1 shl 0;
15259 
15260 {
15261  *  RegisterEventHotKey()
15262  *
15263  *  Discussion:
15264  *    Registers a global hot key based on the virtual key code and
15265  *    modifiers you pass in. Only one such combination can exist for
15266  *    the current application, i.e. multiple entities in the same
15267  *    application cannot register for the same hot key combination. The
15268  *    same hot key can, however, be registered by multiple
15269  *    applications. This means that multiple applications can
15270  *    potentially be notified when a particular hot key is requested.
15271  *    In Mac OS X 10.5 and later, you can request exclusive
15272  *    registration for your process only by passing
15273  *    kEventHotKeyExclusive for the inOptions parameter.
15274  *
15275  *  Mac OS X threading:
15276  *    Not thread safe
15277  *
15278  *  Parameters:
15279  *
15280  *    inHotKeyCode:
15281  *      The virtual key code of the key to watch
15282  *
15283  *    inHotKeyModifiers:
15284  *      The keyboard modifiers to look for. On Mac OS X 10.2 or
15285  *      earlier, this parameter must be non-zero, i.e. there must be a
15286  *      modifier specified. On Mac OS X 10.3 or later, you may pass
15287  *      zero.
15288  *
15289  *    inHotKeyID:
15290  *      The application-specified hot key ID. You will receive this in
15291  *      the kEventHotKeyPressed event as the direct object parameter.
15292  *
15293  *    inTarget:
15294  *      The target to notify when the hot key is pressed.
15295  *
15296  *    inOptions:
15297  *      In Mac OS X 10.5 and later, you may pass either zero or
15298  *      kEventHotKeyExclusive. Prior to Mac OS X 10.5, you must pass
15299  *      zero.
15300  *
15301  *    outRef:
15302  *      The EventHotKeyRef that represents your new hot key. You need
15303  *      this if you later wish to unregister it.
15304  *
15305  *  Result:
15306  *    An operating system status code. eventHotKeyExistsErr is returned
15307  *    if an attempt is made to register a hotkey using the
15308  *    kEventHotKeyExclusive option when another process has already
15309  *    registered the same hotkey using the kEventHotKeyExclusive option.
15310  *
15311  *  Availability:
15312  *    Mac OS X:         in version 10.0 and later in Carbon.framework
15313  *    CarbonLib:        in CarbonLib 1.3 and later
15314  *    Non-Carbon CFM:   not available
15315  }
RegisterEventHotKeynull15316 function RegisterEventHotKey( inHotKeyCode: UInt32; inHotKeyModifiers: UInt32; inHotKeyID: EventHotKeyID; inTarget: EventTargetRef; inOptions: OptionBits; var outRef: EventHotKeyRef ): OSStatus; external name '_RegisterEventHotKey';
15317 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
15318 
15319 
15320 {
15321  *  UnregisterEventHotKey()
15322  *
15323  *  Discussion:
15324  *    Unregisters a global hot key that was previously registered with
15325  *    the RegisterEventHotKey API. You do not need to unregister a hot
15326  *    key when your application terminates; the system will take care
15327  *    of that for you. This would be used if the user changes a hot key
15328  *    for something in your application - you would unregister the
15329  *    previous key and register your new key.
15330  *
15331  *  Mac OS X threading:
15332  *    Not thread safe
15333  *
15334  *  Parameters:
15335  *
15336  *    inHotKey:
15337  *      The EventHotKeyRef to unregister.
15338  *
15339  *  Result:
15340  *    An operating system status code.
15341  *
15342  *  Availability:
15343  *    Mac OS X:         in version 10.0 and later in Carbon.framework
15344  *    CarbonLib:        in CarbonLib 1.3 and later
15345  *    Non-Carbon CFM:   not available
15346  }
UnregisterEventHotKeynull15347 function UnregisterEventHotKey( inHotKey: EventHotKeyRef ): OSStatus; external name '_UnregisterEventHotKey';
15348 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
15349 
15350 
15351 {
15352  *  kHISymbolicHotKeyCode
15353  *
15354  *  Discussion:
15355  *    A CFDictionaryRef key in a dictionary returned by
15356  *    CopySymbolicHotKeys. The value for this key is the virtual
15357  *    keycode of the hotkey, represented as a CFNumber.
15358  }
15359 {$ifc USE_CFSTR_CONSTANT_MACROS}
15360 {$definec kHISymbolicHotKeyCode CFSTRP('kHISymbolicHotKeyCode')}
15361 {$endc}
15362 
15363 {
15364  *  kHISymbolicHotKeyModifiers
15365  *
15366  *  Discussion:
15367  *    A CFDictionaryRef key in a dictionary returned by
15368  *    CopySymbolicHotKeys. The value for this key is the keyboard
15369  *    modifiers of the hotkey, represented as a CFNumber.
15370  }
15371 {$ifc USE_CFSTR_CONSTANT_MACROS}
15372 {$definec kHISymbolicHotKeyModifiers CFSTRP('kHISymbolicHotKeyModifiers')}
15373 {$endc}
15374 
15375 {
15376  *  kHISymbolicHotKeyEnabled
15377  *
15378  *  Discussion:
15379  *    A CFDictionaryRef key in a dictionary returned by
15380  *    CopySymbolicHotKeys. The value for this key is the enable state
15381  *    of the hotkey, represented as a CFBoolean.
15382  }
15383 {$ifc USE_CFSTR_CONSTANT_MACROS}
15384 {$definec kHISymbolicHotKeyEnabled CFSTRP('kHISymbolicHotKeyEnabled')}
15385 {$endc}
15386 {
15387  *  CopySymbolicHotKeys()
15388  *
15389  *  Summary:
15390  *    Returns an array of CFDictionaryRefs containing information about
15391  *    the system-wide symbolic hotkeys that are defined in the Keyboard
15392  *    preferences pane.
15393  *
15394  *  Discussion:
15395  *    The hotkey info returned by this API describes the system-wide
15396  *    hotkeys such as the Screen Capture, Universal Access, and
15397  *    Keyboard Navigation keys. It does not include customized
15398  *    application-specific command keys.
15399  *
15400  *    Each array entry is a CFDictionaryRef, and each dictionary
15401  *    contains information about a single hotkey. There is currently no
15402  *    way to determine which hotkey in the Keyboards preference pane
15403  *    corresponds to a specific dictionary. Each dictionary contains
15404  *    the following keys: kHISymbolicHotKeyCode,
15405  *    kHISymbolicHotKeyModifiers, and kHISymbolicHotKeyEnabled. The
15406  *    array must be released by the caller; the dictionaries do not
15407  *    need to be released (they will be auto-released when the array is
15408  *    released).
15409  *
15410  *    Note that this API will require O(number of hotkeys) to run, and
15411  *    the number of hotkeys will increase in the future, so do not call
15412  *    this API unnecessarily or in highly performance-sensitive code.
15413  *
15414  *  Mac OS X threading:
15415  *    Not thread safe
15416  *
15417  *  Parameters:
15418  *
15419  *    outHotKeyArray:
15420  *      On exit, contains an array of the values of all symbolic hot
15421  *      keys.
15422  *
15423  *  Result:
15424  *    An operating system result code; currently, noErr and memFullErr
15425  *    may be returned.
15426  *
15427  *  Availability:
15428  *    Mac OS X:         in version 10.3 and later in Carbon.framework
15429  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
15430  *    Non-Carbon CFM:   not available
15431  }
CopySymbolicHotKeysnull15432 function CopySymbolicHotKeys( var outHotKeyArray: CFArrayRef ): OSStatus; external name '_CopySymbolicHotKeys';
15433 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
15434 
15435 
15436 {
15437  *  Summary:
15438  *    Parameters to the PushSymbolicHotKeyMode API.
15439  }
15440 const
15441 {
15442    * All hotkeys are enabled.
15443    }
15444 	kHIHotKeyModeAllEnabled = 0;
15445 
15446   {
15447    * All hotkeys are disabled.
15448    }
15449 	kHIHotKeyModeAllDisabled = 1 shl 0;
15450 
15451   {
15452    * All hotkeys are disabled except for the Universal Access hotkeys
15453    * (zooming, white-on-black, and enhanced contrast).
15454    }
15455 	kHIHotKeyModeAllDisabledExceptUniversalAccess = 1 shl 1;
15456 
15457 {
15458  *  PushSymbolicHotKeyMode()
15459  *
15460  *  Summary:
15461  *    Sets a new mode for enabling or disabling symbolic hotkeys.
15462  *
15463  *  Discussion:
15464  *    The Event Manager keeps a stack of hotkey modes that have been
15465  *    requested using the PushSymbolicHotKeyMode API. The most recently
15466  *    pushed mode is the mode that is currently in use.
15467  *
15468  *    Because disabling hotkeys can significantly affect the usability
15469  *    of Mac OS X, applications are only allowed to disable hotkeys if
15470  *    the "Enable access for assistive devices" checkbox is checked in
15471  *    the Universal Access preference pane. If this feature is not
15472  *    enabled, PushSymbolicHotKeyMode will still push the mode request
15473  *    onto the mode stack and return a valid token, but the actual
15474  *    hotkey mode will not change.
15475  *
15476  *    If an application that pushes a new hotkey mode is frontmost,
15477  *    then the new mode (if it disables any hotkeys) will only be
15478  *    active while the application remains frontmost. If the
15479  *    application is deactivated or exits without reenabling hotkeys,
15480  *    the hotkey mode will automatically revert to the previous mode.
15481  *
15482  *  Mac OS X threading:
15483  *    Not thread safe
15484  *
15485  *  Parameters:
15486  *
15487  *    inOptions:
15488  *      The symbolic hotkey mode that is requested.
15489  *
15490  *  Result:
15491  *    A token that should be passed to PopSymbolicHotKeyMode to remove
15492  *    this mode request from the stack.
15493  *
15494  *  Availability:
15495  *    Mac OS X:         in version 10.4 and later in Carbon.framework
15496  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
15497  *    Non-Carbon CFM:   not available
15498  }
PushSymbolicHotKeyModenull15499 function PushSymbolicHotKeyMode( inOptions: OptionBits ): UnivPtr; external name '_PushSymbolicHotKeyMode';
15500 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
15501 
15502 
15503 {
15504  *  PopSymbolicHotKeyMode()
15505  *
15506  *  Summary:
15507  *    Removes a hotkey mode request from the hotkey mode stack.
15508  *
15509  *  Discussion:
15510  *    This API removes a mode request from the mode stack. If this
15511  *    request was the topmost request in the stack, the actual hotkey
15512  *    mode will change to the next request in the stack; if there are
15513  *    other mode requests on top of this one on the stack, the actual
15514  *    mode will not change.
15515  *
15516  *  Mac OS X threading:
15517  *    Not thread safe
15518  *
15519  *  Parameters:
15520  *
15521  *    inToken:
15522  *      A hotkey mode token that was returned by PushSymbolicHotKeyMode.
15523  *
15524  *  Availability:
15525  *    Mac OS X:         in version 10.4 and later in Carbon.framework
15526  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
15527  *    Non-Carbon CFM:   not available
15528  }
15529 procedure PopSymbolicHotKeyMode( inToken: UnivPtr ); external name '_PopSymbolicHotKeyMode';
15530 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
15531 
15532 
15533 {
15534  *  GetSymbolicHotKeyMode()
15535  *
15536  *  Summary:
15537  *    Returns the current hotkey mode in use.
15538  *
15539  *  Mac OS X threading:
15540  *    Not thread safe
15541  *
15542  *  Result:
15543  *    The mode request at the top of the hotkey mode stack. If there
15544  *    are no requests on the stack, it returns zero, indicating that
15545  *    hotkeys are currently enabled.
15546  *
15547  *    Note that even if hotkeys are enabled in the current process,
15548  *    hotkeys can still be disabled for the current user session if
15549  *    they are disabled by some other process.
15550  *
15551  *    Note that if "Enable access for assistive devices" is not checked
15552  *    in the Universal Access preference pane, then even if this API
15553  *    returns a non-zero value, the actual hotkey mode will still be
15554  *    that all hotkeys are enabled.
15555  *
15556  *  Availability:
15557  *    Mac OS X:         in version 10.4 and later in Carbon.framework
15558  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
15559  *    Non-Carbon CFM:   not available
15560  }
GetSymbolicHotKeyModenull15561 function GetSymbolicHotKeyMode: OptionBits; external name '_GetSymbolicHotKeyMode';
15562 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
15563 
15564 
15565 {--------------------------------------------------------------------------------------}
15566 {  Ink Events                                                                          }
15567 {--------------------------------------------------------------------------------------}
15568 const
15569 	kEventParamInkTextRef = FourCharCode('iwrd'); { typePtr }
15570 	kEventParamInkKeyboardShortcut = FourCharCode('ikbd'); { typeBoolean }
15571 	kEventParamInkGestureKind = FourCharCode('gknd'); { typeUInt32 }
15572 	kEventParamInkGestureBounds = FourCharCode('gbnd'); { typeHIRect }
15573 	kEventParamInkGestureHotspot = FourCharCode('ghot'); { typeHIPoint }
15574 
15575 
15576 {
15577  *  kEventClassInk / kEventInkPoint
15578  *
15579  *  Summary:
15580  *    A mouse event will be handled as an Ink point and used for
15581  *    recognition.
15582  *
15583  *  Discussion:
15584  *    The Ink manager has determined that the mouse event in
15585  *    kEventParamEventRef should be used for recognition.  If the
15586  *    application handles the event and returns noErr, then the Ink
15587  *    Manager does nothing further with the mouse event.  If the
15588  *    application returns any other value (including
15589  *    eventNotHandledErr), the point will be processed normally by the
15590  *    Ink Manager.
15591  *
15592  *  Mac OS X threading:
15593  *    Not thread safe
15594  *
15595  *  Parameters:
15596  *
15597  *    --> kEventParamEventRef (in, typeEventRef)
15598  *          The mouse event being handled.
15599  *
15600  *  Availability:
15601  *    Mac OS X:         in version 10.3 and later in Carbon.framework
15602  *    CarbonLib:        not available
15603  }
15604 const
15605 	kEventInkPoint = 10;
15606 
15607 
15608 {
15609  *  kEventClassInk / kEventInkGesture
15610  *
15611  *  Summary:
15612  *    An Ink gesture has been generated.
15613  *
15614  *  Discussion:
15615  *    This Ink event is sent when the Ink Manager has recognized the
15616  *    current ink phrase as one of the known system gestures.
15617  *    Applications can install a handler for these events, to provide
15618  *    targeted gestures and support for context-dependent (tentative)
15619  *    gestures.  Applications should return noErr if they handled the
15620  *    gesture.  If the gesture was context-dependent and does not apply
15621  *    to the current situation, then return eventNotHandledErr.
15622  *
15623  *  Mac OS X threading:
15624  *    Not thread safe
15625  *
15626  *  Parameters:
15627  *
15628  *    --> kEventParamInkGestureKind (in, typeUInt32)
15629  *          Kind of gesture.
15630  *
15631  *    --> kEventParamInkGestureBounds (in, typeHIRect)
15632  *          Bounds of the gesture in global coordinates.
15633  *
15634  *    --> kEventParamInkGestureHotspot (in, typeHIPoint)
15635  *          Hotspot for the gesture in global coordinates.
15636  *
15637  *  Availability:
15638  *    Mac OS X:         in version 10.3 and later in Carbon.framework
15639  *    CarbonLib:        not available
15640  }
15641 const
15642 	kEventInkGesture = 11;
15643 
15644 
15645 {
15646  *  kEventClassInk / kEventInkText
15647  *
15648  *  Summary:
15649  *    A recognized word from the Ink Manager.
15650  *
15651  *  Discussion:
15652  *    The Ink Manager has recognized a word.  kEventParamInkTextRef
15653  *    contains the InkTextRef with all of the information about the
15654  *    word.  See Ink.h for more information.
15655  *
15656  *  Mac OS X threading:
15657  *    Not thread safe
15658  *
15659  *  Parameters:
15660  *
15661  *    --> kEventParamInkTextRef (in, typePtr)
15662  *          The InkTextRef containing the data for the recognized word.
15663  *
15664  *    --> kEventParamInkKeyboardShortcut (in, typeBoolean)
15665  *          Is this likely a keyboard shortcut? (Command or Control key
15666  *          is held down and the top-choice alternate text is a single
15667  *          character.)
15668  *
15669  *  Availability:
15670  *    Mac OS X:         in version 10.3 and later in Carbon.framework
15671  *    CarbonLib:        not available
15672  }
15673 const
15674 	kEventInkText = 12;
15675 
15676 
15677 {--------------------------------------------------------------------------------------}
15678 {  � DEPRECATED                                                                        }
15679 {  All functions below this point are either deprecated (they continue to function     }
15680 {  but are not the most modern nor most efficient solution to a problem), or they are  }
15681 {  completely unavailable on Mac OS X.                                                 }
15682 {--------------------------------------------------------------------------------------}
15683 {$ifc not TARGET_CPU_64}
15684 {--------------------------------------------------------------------------------------}
15685 {  � MouseTrackingRegions                                                              }
15686 {--------------------------------------------------------------------------------------}
15687 
15688 {
15689  *  MouseTrackingRef
15690  *
15691  *  Discussion:
15692  *    MouseTrackingRef   *** DEPRECATED ***
15693  *
15694  *    Deprecated:
15695  *    Applications should use HIViewTrackingAreas, described in
15696  *    HIView.h, instead of MouseTrackingRegions and their associated
15697  *    settings.
15698  *
15699  *    A MouseTrackingRef is an object that controls the generation of
15700  *    mouse-enter and mouse-exit events. When the user moves the mouse
15701  *    into a tracking region, a kEventClassMouse/kEventMouseEntered
15702  *    event is sent to the app. When the user moves the mouse out of a
15703  *    tracking region, an event of type
15704  *    kEventClassMouse/kEventMouseExited is sent.
15705  *
15706  *    Mouse tracking regions are uniquely identified within the scope
15707  *    of a window by a MouseTrackingRegionID which is a client
15708  *    signature/id pair. The client signature should be any unique
15709  *    four-character constant that does not have entirely lowercase
15710  *    characters; a good choice is the usual DTS-registered creator
15711  *    OSType, but you can use any constant that you like.
15712  *
15713  *    Mouse tracking regions can overlap, but are not exclusive. Mouse
15714  *    motion events are generated for each of the tracking areas
15715  *    intersected by the mouse.
15716  *
15717  *    Mouse tracking regions are initially enabled. You can explicitly
15718  *    disable a mouse tracking area to prevent mouse-enter/exit events
15719  *    from being generated.
15720  *
15721  *    Unlike global mouse-moved events, mouse-enter and mouse-exit
15722  *    events are generated while your app is in the background. If this
15723  *    is not considered desirable, disable the tracking areas while the
15724  *    application is in the background.
15725  *
15726  *    MouseTrackingRefs become invalid when the window that they are
15727  *    bound to is disposed.
15728  }
15729 type
15730 	MouseTrackingRef = ^OpaqueMouseTrackingRef; { an opaque type }
15731 	OpaqueMouseTrackingRef = record end;
15732 
15733 
15734 {
15735  *  MouseTrackingOptions
15736  *
15737  *  Discussion:
15738  *    MouseTrackingOptions   *** DEPRECATED ***
15739  *
15740  *    Deprecated:
15741  *    Applications should use HIViewTrackingAreas, described in
15742  *    HIView.h, instead of MouseTrackingRegions and their associated
15743  *    settings.
15744  *
15745  *    These values define how the user�s region is handled by the Mouse
15746  *    Tracking Region API. They define the behavior throughout the life
15747  *    of the Mouse Tracking Region. For example, if a region is created
15748  *    with the option of kMouseTrackingOptionsGlobalClip then all
15749  *    operations on this region will be interpreted in global
15750  *    coordinates and will be clipped to the owning window�s structure.
15751  }
15752 type
15753 	MouseTrackingOptions = UInt32;
15754 const
15755 {
15756    * The region is expected in local coordinates and mouse movement
15757    * tracking is clipped to the owning window�s content region.
15758    }
15759 	kMouseTrackingOptionsLocalClip = 0;
15760 
15761   {
15762    * The region is expected in global coordinates and mouse movement
15763    * tracking is clipped to the owning window�s structure region.
15764    }
15765 	kMouseTrackingOptionsGlobalClip = 1;
15766 
15767   {
15768    * Standard options. The region will be handled in local coordinates
15769    * and remain clipped against the windows content region.
15770    }
15771 	kMouseTrackingOptionsStandard = kMouseTrackingOptionsLocalClip;
15772 
15773 type
15774 	MouseTrackingRegionID = record
15775 		signature: OSType;
15776 		id: SInt32;
15777 	end;
15778 {$endc} {not TARGET_CPU_64}
15779 
15780 { Creation}
15781 {$ifc not TARGET_CPU_64}
15782 {
15783  *  CreateMouseTrackingRegion()   *** DEPRECATED ***
15784  *
15785  *  Deprecated:
15786  *    Use HIView-based tracking areas instead of MouseTrackingRegions.
15787  *    In this case, use HIViewNewTrackingArea(), defined in HIView.h,
15788  *    instead of CreateMouseTrackingRegion().
15789  *
15790  *  Discussion:
15791  *    Creates a mouse tracking region and installs it into the window
15792  *    system.
15793  *
15794  *  Mac OS X threading:
15795  *    Not thread safe
15796  *
15797  *  Parameters:
15798  *
15799  *    inWindow:
15800  *      The window that will contain the created region.
15801  *
15802  *    inRegion:
15803  *      The region for which you will receive entered/exit events.
15804  *
15805  *    inClip:
15806  *      A region to clip inRegion against (can be NULL).
15807  *
15808  *    inOptions:
15809  *      The options which define whether inRegion is given in global or
15810  *      local coordinates. If local coordinates are used, inRegion will
15811  *      be clipped against the window's current content region; if
15812  *      global coordinates are used, inRegion will be clipped against
15813  *      the window's current structure region. All clipping occurs
15814  *      against the regions as they are at the moment when the tracking
15815  *      region is created; changes to the window content or structure
15816  *      regions after the tracking region is created will not affect
15817  *      the tracking region.
15818  *
15819  *    inID:
15820  *      The signature/id pair which uniquely defines this region. Note
15821  *      that if you are creating both LocalClip and GlobalClip tracking
15822  *      regions for a given window, the global regions must use a
15823  *      different inID.signature value from the local regions.
15824  *
15825  *    inRefCon:
15826  *      Any user defined value. This value can be retrieved later by
15827  *      calling GetMouseTrackingRegionRefCon on the MouseTrackingRef.
15828  *
15829  *    inTargetToNotify:
15830  *      The event target that should receive kEventMouseEntered/Exited
15831  *      events for this tracking region. If NULL, the window�s event
15832  *      target receives these events.
15833  *
15834  *    outTrackingRef:
15835  *      A reference to the newly created mouse tracking region. This
15836  *      reference will also be provided in the
15837  *      kEventMouseEntered/Exited events sent to your event target.
15838  *
15839  *  Result:
15840  *    An operating system status code.
15841  *
15842  *  Availability:
15843  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
15844  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
15845  *    Non-Carbon CFM:   not available
15846  }
CreateMouseTrackingRegionnull15847 function CreateMouseTrackingRegion( inWindow: WindowRef; inRegion: RgnHandle; inClip: RgnHandle { can be NULL }; inOptions: MouseTrackingOptions; inID: MouseTrackingRegionID; inRefCon: UnivPtr; inTargetToNotify: EventTargetRef { can be NULL }; var outTrackingRef: MouseTrackingRef ): OSStatus; external name '_CreateMouseTrackingRegion';
15848 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
15849 
15850 
15851 {
15852  *  RetainMouseTrackingRegion()   *** DEPRECATED ***
15853  *
15854  *  Deprecated:
15855  *    Use HIView-based tracking areas, described in HIView.h, instead
15856  *    of MouseTrackingRegions.
15857  *
15858  *  Discussion:
15859  *    Retains the MouseTrackingRef.
15860  *
15861  *  Mac OS X threading:
15862  *    Not thread safe
15863  *
15864  *  Parameters:
15865  *
15866  *    inMouseRef:
15867  *      A valid MouseTrackingRef to retain.
15868  *
15869  *  Result:
15870  *    An operating system status code.
15871  *
15872  *  Availability:
15873  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
15874  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
15875  *    Non-Carbon CFM:   not available
15876  }
RetainMouseTrackingRegionnull15877 function RetainMouseTrackingRegion( inMouseRef: MouseTrackingRef ): OSStatus; external name '_RetainMouseTrackingRegion';
15878 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
15879 
15880 
15881 {
15882  *  ReleaseMouseTrackingRegion()   *** DEPRECATED ***
15883  *
15884  *  Deprecated:
15885  *    Use HIView-based tracking areas instead of MouseTrackingRegions.
15886  *    In this case, use HIViewDisposeTrackingArea(), defined in
15887  *    HIView.h, instead of ReleaseMouseTrackingRegion().
15888  *
15889  *  Discussion:
15890  *    Releases the MouseTrackingRef. Since mouse tracking regions are
15891  *    bound to a window, they are automatically released when the
15892  *    window is disposed of.
15893  *
15894  *  Mac OS X threading:
15895  *    Not thread safe
15896  *
15897  *  Parameters:
15898  *
15899  *    inMouseRef:
15900  *      A valid MouseTrackingRef to release.
15901  *
15902  *  Result:
15903  *    An operating system status code.
15904  *
15905  *  Availability:
15906  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
15907  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
15908  *    Non-Carbon CFM:   not available
15909  }
ReleaseMouseTrackingRegionnull15910 function ReleaseMouseTrackingRegion( inMouseRef: MouseTrackingRef ): OSStatus; external name '_ReleaseMouseTrackingRegion';
15911 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
15912 
15913 
15914 {
15915  *  ChangeMouseTrackingRegion()   *** DEPRECATED ***
15916  *
15917  *  Deprecated:
15918  *    Use HIView-based tracking areas instead of MouseTrackingRegions.
15919  *    In this case, use HIViewChangeTrackingArea(), defined in
15920  *    HIView.h, instead of ChangeMouseTrackingRegion().
15921  *
15922  *  Discussion:
15923  *    Changes the MouseTrackingRefs region and optionally, its clip.
15924  *    This will not change the enabled state or options of the region.
15925  *
15926  *  Mac OS X threading:
15927  *    Not thread safe
15928  *
15929  *  Parameters:
15930  *
15931  *    inMouseRef:
15932  *      A valid MouseTrackingRef to modify.
15933  *
15934  *    inRegion:
15935  *      The region to set as the mouse tracking region.
15936  *
15937  *    inClip:
15938  *      An optional clip to clip inRegion against (may be NULL).
15939  *
15940  *  Result:
15941  *    An operating system status code.
15942  *
15943  *  Availability:
15944  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
15945  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
15946  *    Non-Carbon CFM:   not available
15947  }
ChangeMouseTrackingRegionnull15948 function ChangeMouseTrackingRegion( inMouseRef: MouseTrackingRef; inRegion: RgnHandle; inClip: RgnHandle { can be NULL } ): OSStatus; external name '_ChangeMouseTrackingRegion';
15949 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
15950 
15951 
15952 {
15953  *  ClipMouseTrackingRegion()   *** DEPRECATED ***
15954  *
15955  *  Deprecated:
15956  *    Use HIView-based tracking areas, described in HIView.h, instead
15957  *    of MouseTrackingRegions.
15958  *
15959  *  Discussion:
15960  *    Adjust the region to clip the MouseTrackingRef against. This can
15961  *    be used in the case where a window is resized or when a
15962  *    previously obscured region becomes exposed.
15963  *
15964  *  Mac OS X threading:
15965  *    Not thread safe
15966  *
15967  *  Parameters:
15968  *
15969  *    inMouseRef:
15970  *      A valid MouseTrackingRef to adjust.
15971  *
15972  *    inRegion:
15973  *      A new region to clip inMouseRef against (can be NULL). If NULL,
15974  *      standard clipping will be provided.
15975  *
15976  *  Result:
15977  *    An operating system status code.
15978  *
15979  *  Availability:
15980  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
15981  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
15982  *    Non-Carbon CFM:   not available
15983  }
ClipMouseTrackingRegionnull15984 function ClipMouseTrackingRegion( inMouseRef: MouseTrackingRef; inRegion: RgnHandle ): OSStatus; external name '_ClipMouseTrackingRegion';
15985 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
15986 
15987 
15988 { Accessors}
15989 
15990 {
15991  *  GetMouseTrackingRegionID()   *** DEPRECATED ***
15992  *
15993  *  Deprecated:
15994  *    Use HIView-based tracking areas instead of MouseTrackingRegions.
15995  *    In this case, use HIViewGetTrackingAreaID(), defined in HIView.h,
15996  *    instead of GetMouseTrackingRegionID().
15997  *
15998  *  Discussion:
15999  *    Retrieves the MouseTrackingRegionID of the given
16000  *    MouseTrackingRef. Can be used to determine if the region belongs
16001  *    to your app, and if so, which region it is.
16002  *
16003  *  Mac OS X threading:
16004  *    Not thread safe
16005  *
16006  *  Parameters:
16007  *
16008  *    inMouseRef:
16009  *      A valid MouseTrackingRef from which to obtain the
16010  *      MouseTrackingRegionID.
16011  *
16012  *    outID:
16013  *      Receives the MouseTrackingRegionID.
16014  *
16015  *  Result:
16016  *    An operating system status code.
16017  *
16018  *  Availability:
16019  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
16020  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
16021  *    Non-Carbon CFM:   not available
16022  }
GetMouseTrackingRegionIDnull16023 function GetMouseTrackingRegionID( inMouseRef: MouseTrackingRef; var outID: MouseTrackingRegionID ): OSStatus; external name '_GetMouseTrackingRegionID';
16024 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
16025 
16026 
16027 {
16028  *  GetMouseTrackingRegionRefCon()   *** DEPRECATED ***
16029  *
16030  *  Deprecated:
16031  *    Use HIView-based tracking areas, described in HIView.h, instead
16032  *    of MouseTrackingRegions.
16033  *
16034  *  Discussion:
16035  *    Retrieves the RefCon from the given mouse tracking region.
16036  *
16037  *  Mac OS X threading:
16038  *    Not thread safe
16039  *
16040  *  Parameters:
16041  *
16042  *    inMouseRef:
16043  *      A valid MouseTrackingRef from which to obtain the refcon.
16044  *
16045  *    outRefCon:
16046  *      Receives the refcon that was provided to
16047  *      CreateMouseTrackingRegion.
16048  *
16049  *  Result:
16050  *    An operating system status code.
16051  *
16052  *  Availability:
16053  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
16054  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
16055  *    Non-Carbon CFM:   not available
16056  }
GetMouseTrackingRegionRefConnull16057 function GetMouseTrackingRegionRefCon( inMouseRef: MouseTrackingRef; var outRefCon: UnivPtr ): OSStatus; external name '_GetMouseTrackingRegionRefCon';
16058 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
16059 
16060 
16061 { Geometry}
16062 
16063 {
16064  *  MoveMouseTrackingRegion()   *** DEPRECATED ***
16065  *
16066  *  Deprecated:
16067  *    Use HIView-based tracking areas, described in HIView.h, instead
16068  *    of MouseTrackingRegions.
16069  *
16070  *  Discussion:
16071  *    Moves the given mouse tracking region by the specified delta. It
16072  *    can also optionally reclip the region, such as if the region is
16073  *    scrolled within a pane.
16074  *
16075  *  Mac OS X threading:
16076  *    Not thread safe
16077  *
16078  *  Parameters:
16079  *
16080  *    inMouseRef:
16081  *      A valid MouseTrackingRef to move.
16082  *
16083  *    deltaH:
16084  *      The horizontal delta to move the MouseTrackingRef.
16085  *
16086  *    deltaV:
16087  *      The vertical delta to move the MouseTrackingRef.
16088  *
16089  *    inClip:
16090  *      A region to optionally clip against (can be NULL).
16091  *
16092  *  Result:
16093  *    An operating system status code.
16094  *
16095  *  Availability:
16096  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
16097  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
16098  *    Non-Carbon CFM:   not available
16099  }
MoveMouseTrackingRegionnull16100 function MoveMouseTrackingRegion( inMouseRef: MouseTrackingRef; deltaH: SInt16; deltaV: SInt16; inClip: RgnHandle { can be NULL } ): OSStatus; external name '_MoveMouseTrackingRegion';
16101 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
16102 
16103 
16104 { Enable/disable}
16105 
16106 {
16107  *  SetMouseTrackingRegionEnabled()   *** DEPRECATED ***
16108  *
16109  *  Deprecated:
16110  *    Use HIView-based tracking areas, described in HIView.h, instead
16111  *    of MouseTrackingRegions.
16112  *
16113  *  Discussion:
16114  *    Set the enabled state of the mouse tracking region
16115  *
16116  *  Mac OS X threading:
16117  *    Not thread safe
16118  *
16119  *  Parameters:
16120  *
16121  *    inMouseRef:
16122  *      A valid MouseTrackingRef to modify.
16123  *
16124  *    inEnabled:
16125  *      Indicate whether this region should be enabled (true) or
16126  *      disabled (false).
16127  *
16128  *  Result:
16129  *    An operating system status code.
16130  *
16131  *  Availability:
16132  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
16133  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
16134  *    Non-Carbon CFM:   not available
16135  }
SetMouseTrackingRegionEnablednull16136 function SetMouseTrackingRegionEnabled( inMouseRef: MouseTrackingRef; inEnabled: Boolean ): OSStatus; external name '_SetMouseTrackingRegionEnabled';
16137 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
16138 
16139 
16140 {
16141 
16142    Namespace operators
16143 }
16144 
16145 {
16146  *  ClipWindowMouseTrackingRegions()   *** DEPRECATED ***
16147  *
16148  *  Deprecated:
16149  *    Use HIView-based tracking areas, described in HIView.h, instead
16150  *    of MouseTrackingRegions.
16151  *
16152  *  Discussion:
16153  *    Bulk clip operation to modify the region that all mouse tracking
16154  *    regions with the given signature will be clipped against.
16155  *
16156  *  Mac OS X threading:
16157  *    Not thread safe
16158  *
16159  *  Parameters:
16160  *
16161  *    inWindow:
16162  *      The window that contains the regions with the given signature
16163  *      that you are interested in updating.
16164  *
16165  *    inSignature:
16166  *      The signature of the mouse tracking regions that will be
16167  *      reclipped.
16168  *
16169  *    inClip:
16170  *      The region to clip all of the regions against (can be NULL). If
16171  *      NULL, standard clipping will be provided.
16172  *
16173  *  Result:
16174  *    An operating system status code.
16175  *
16176  *  Availability:
16177  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
16178  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
16179  *    Non-Carbon CFM:   not available
16180  }
ClipWindowMouseTrackingRegionsnull16181 function ClipWindowMouseTrackingRegions( inWindow: WindowRef; inSignature: OSType; inClip: RgnHandle { can be NULL } ): OSStatus; external name '_ClipWindowMouseTrackingRegions';
16182 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
16183 
16184 
16185 {
16186  *  MoveWindowMouseTrackingRegions()   *** DEPRECATED ***
16187  *
16188  *  Deprecated:
16189  *    Use HIView-based tracking areas, described in HIView.h, instead
16190  *    of MouseTrackingRegions.
16191  *
16192  *  Discussion:
16193  *    Bulk move operation to move all regions with the given signature
16194  *    the specified delta. An optional clip can be provided to reclip
16195  *    the regions against, such as in the case of the regions are being
16196  *    scrolled within a pane.
16197  *
16198  *  Mac OS X threading:
16199  *    Not thread safe
16200  *
16201  *  Parameters:
16202  *
16203  *    inWindow:
16204  *      The window that contains the regions with the given signature
16205  *      that you are interested in moving.
16206  *
16207  *    inSignature:
16208  *      The signature of the mouse tracking regions that will be moved.
16209  *
16210  *    deltaH:
16211  *      The horizontal delta to move all of the regions.
16212  *
16213  *    deltaV:
16214  *      The vertical delta to move all of the regions.
16215  *
16216  *    inClip:
16217  *      An optional clipping region to clip against (can be NULL). If
16218  *      NULL, standard clipping will be provided.
16219  *
16220  *  Result:
16221  *    An operating system status code.
16222  *
16223  *  Availability:
16224  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
16225  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
16226  *    Non-Carbon CFM:   not available
16227  }
MoveWindowMouseTrackingRegionsnull16228 function MoveWindowMouseTrackingRegions( inWindow: WindowRef; inSignature: OSType; deltaH: SInt16; deltaV: SInt16; inClip: RgnHandle { can be NULL } ): OSStatus; external name '_MoveWindowMouseTrackingRegions';
16229 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
16230 
16231 
16232 {
16233  *  SetWindowMouseTrackingRegionsEnabled()   *** DEPRECATED ***
16234  *
16235  *  Deprecated:
16236  *    Use HIView-based tracking areas, described in HIView.h, instead
16237  *    of MouseTrackingRegions.
16238  *
16239  *  Discussion:
16240  *    Bulk set the enabled state of the mouse tracking regions of the
16241  *    given signature belonging to the given window.
16242  *
16243  *  Mac OS X threading:
16244  *    Not thread safe
16245  *
16246  *  Parameters:
16247  *
16248  *    inWindow:
16249  *      The window which contains the mouse tracking regions that you
16250  *      are interested in modifying.
16251  *
16252  *    inSignature:
16253  *      The signature of the mouse tracking regions whose enabled state
16254  *      you wish to modify.
16255  *
16256  *    inEnabled:
16257  *      Indicates whether the regions should be enabled (true) or
16258  *      disabled (false).
16259  *
16260  *  Result:
16261  *    An operating system status code.
16262  *
16263  *  Availability:
16264  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
16265  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
16266  *    Non-Carbon CFM:   not available
16267  }
SetWindowMouseTrackingRegionsEnablednull16268 function SetWindowMouseTrackingRegionsEnabled( inWindow: WindowRef; inSignature: OSType; inEnabled: Boolean ): OSStatus; external name '_SetWindowMouseTrackingRegionsEnabled';
16269 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
16270 
16271 
16272 {
16273  *  ReleaseWindowMouseTrackingRegions()   *** DEPRECATED ***
16274  *
16275  *  Deprecated:
16276  *    Use HIView-based tracking areas, described in HIView.h, instead
16277  *    of MouseTrackingRegions.
16278  *
16279  *  Discussion:
16280  *    Bulk release the mouse tracking regions with the given signature.
16281  *
16282  *  Mac OS X threading:
16283  *    Not thread safe
16284  *
16285  *  Parameters:
16286  *
16287  *    inWindow:
16288  *      The window to which the regions to be released belong.
16289  *
16290  *    inSignature:
16291  *      The signature of the regions to be released.
16292  *
16293  *  Result:
16294  *    An operating system status code.
16295  *
16296  *  Availability:
16297  *    Mac OS X:         in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.4
16298  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
16299  *    Non-Carbon CFM:   not available
16300  }
ReleaseWindowMouseTrackingRegionsnull16301 function ReleaseWindowMouseTrackingRegions( inWindow: WindowRef; inSignature: OSType ): OSStatus; external name '_ReleaseWindowMouseTrackingRegions';
16302 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
16303 
16304 
16305 {======================================================================================}
16306 {  EVENT-BASED OBJECT CLASSES                                                          }
16307 {  *** DEPRECATED ***                                                                  }
16308 {  Here it is - the replacement for classic defprocs. This is also a convenient way    }
16309 {  to create toolbox objects (windows, etc.) that have a specific behavior without     }
16310 {  installing handlers on each instance of the object. With a toolbox object class,    }
16311 {  you register your class, then use special creation routines to create objects of    }
16312 {  that class. The event handlers are automatically installed and ready to go.         }
16313 {  Note that on Mac OS X 10.2 and later, we recommend using the HIObject API           }
16314 {  HIObjectRegisterSubclass rather than RegisterToolboxObjectClass. This API is        }
16315 {  considered deprecated on Mac OS X 10.2 and later.                                   }
16316 {======================================================================================}
16317 {$endc} {not TARGET_CPU_64}
16318 type
16319 	ToolboxObjectClassRef = ^OpaqueToolboxObjectClassRef; { an opaque type }
16320 	OpaqueToolboxObjectClassRef = record end;
16321 {$ifc not TARGET_CPU_64}
16322 {
16323  *  RegisterToolboxObjectClass()   *** DEPRECATED ***
16324  *
16325  *  Mac OS X threading:
16326  *    Not thread safe
16327  *
16328  *  Availability:
16329  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.4
16330  *    CarbonLib:        in CarbonLib 1.1 and later
16331  *    Non-Carbon CFM:   not available
16332  }
RegisterToolboxObjectClassnull16333 function RegisterToolboxObjectClass( inClassID: CFStringRef; inBaseClass: ToolboxObjectClassRef { can be NULL }; inNumEvents: ItemCount; {const} inEventList: {variable-size-array} EventTypeSpecPtr; inEventHandler: EventHandlerUPP; inEventHandlerData: UnivPtr; var outClassRef: ToolboxObjectClassRef ): OSStatus; external name '_RegisterToolboxObjectClass';
16334 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
16335 
16336 
16337 {
16338  *  UnregisterToolboxObjectClass()   *** DEPRECATED ***
16339  *
16340  *  Mac OS X threading:
16341  *    Not thread safe
16342  *
16343  *  Availability:
16344  *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.4
16345  *    CarbonLib:        in CarbonLib 1.1 and later
16346  *    Non-Carbon CFM:   not available
16347  }
UnregisterToolboxObjectClassnull16348 function UnregisterToolboxObjectClass( inClassRef: ToolboxObjectClassRef ): OSStatus; external name '_UnregisterToolboxObjectClass';
16349 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
16350 
16351 
16352 {--------------------------------------------------------------------------------------}
16353 { Obsolete constant names - use the new ones.                                          }
16354 {--------------------------------------------------------------------------------------}
16355 {$endc} {not TARGET_CPU_64}
16356 
16357 const
16358 	kEventParamTabletPointerRec = FourCharCode('tbrc'); { typeTabletPointerRec      -- deprecated, for compatibility only}
16359 	typeTabletPointerRec = FourCharCode('tbrc'); { kEventParamTabletPointerRec    -- deprecated, for compatibility only}
16360 
16361 const
16362 	kEventWindowDefDrawFrame = kEventWindowDrawFrame;
16363 	kEventWindowDefDrawPart = kEventWindowDrawPart;
16364 	kEventWindowDefGetRegion = kEventWindowGetRegion;
16365 	kEventWindowDefHitTest = kEventWindowHitTest;
16366 	kEventWindowDefInit = kEventWindowInit;
16367 	kEventWindowDefDispose = kEventWindowDispose;
16368 	kEventWindowDefDragHilite = kEventWindowDragHilite;
16369 	kEventWindowDefModified = kEventWindowModified;
16370 	kEventWindowDefSetupProxyDragImage = kEventWindowSetupProxyDragImage;
16371 	kEventWindowDefStateChanged = kEventWindowStateChanged;
16372 	kEventWindowDefMeasureTitle = kEventWindowMeasureTitle;
16373 	kEventWindowDefDrawGrowBox = kEventWindowDrawGrowBox;
16374 	kEventWindowDefGetGrowImageRegion = kEventWindowGetGrowImageRegion;
16375 
16376 
16377 const
16378 	kEventClassEPPC = kEventClassAppleEvent;
16379 	kEventHighLevelEvent = kEventAppleEvent;
16380 
16381 const
16382 	kEventUpdateActiveInputArea = kEventTextInputUpdateActiveInputArea;
16383 	kEventUnicodeForKeyEvent = kEventTextInputUnicodeForKeyEvent;
16384 	kEventOffsetToPos = kEventTextInputOffsetToPos;
16385 	kEventPosToOffset = kEventTextInputPosToOffset;
16386 	kEventShowHideBottomWindow = kEventTextInputShowHideBottomWindow;
16387 	kEventGetSelectedText = kEventTextInputGetSelectedText;
16388 
16389 const
16390 	kEventProcessCommand = kEventCommandProcess;
16391 	kEventTabletPointer = kEventTabletPoint;
16392 
16393 {--------------------------------------------------------------------------------------}
16394 { Obsolete typedefs.                                                                   }
16395 {--------------------------------------------------------------------------------------}
16396 
16397 type
16398 	EventClassID = UInt32;
16399 	EventClass = UInt32;
16400 	EventType = UInt32;
16401 { OBSOLETE CONSTANTS}
16402 const
16403 	kMouseTrackingMousePressed = kMouseTrackingMouseDown;
16404 	kMouseTrackingMouseReleased = kMouseTrackingMouseUp;
16405 
16406 const
16407 	kEventControlGetSubviewForMouseEvent = kEventControlInterceptSubviewClick;
16408 
16409 
16410 {$endc} {TARGET_OS_MAC}
16411 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
16412 
16413 end.
16414 {$endc} {not MACOSALLINCLUDE}
16415