1 {
2      File:       HIToolbox/HIObject.h
3 
4      Contains:   Base object for HIToolbox
5 
6      Version:    HIToolbox-624~3
7 
8      Copyright:  � 2001-2008 by Apple Computer, 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 {
17       Change History (most recent first):
18 
19          <4>      5/8/04    GRP     Updated comments to match changes in HIObject.h, version HIToolbox-145.33~1.
20          <3>      4/8/04    PNL     Moved HIObjectxxxx type declarations to HIObjectCore to fix cyclic dependency problem.
21          <2>    10/02/04    GRP     Added support for GPC as well as CodeWarrior Pascal.
22          <1>      9/8/03    GRP     First Pascal translation of HIObject.h, version HIToolbox-123.6~10.
23 }
24 {This file was processed by Dan's Source Converter}
25 {version 1.3 (this version modified by Ingemar Ragnemalm)}
26 {       Pascal Translation Updated:  Peter N Lewis, <peter@stairways.com.au>, August 2005 }
27 {       Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, October 2009 }
28 {       Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, October 2012 }
29 {
30     Modified for use with Free Pascal
31     Version 308
32     Please report any bugs to <gpc@microbizz.nl>
33 }
34 
35 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
36 {$mode macpas}
37 {$modeswitch cblocks}
38 {$packenum 1}
39 {$macro on}
40 {$inline on}
41 {$calling mwpascal}
42 
43 unit HIObject;
44 interface
45 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
46 {$setc GAP_INTERFACES_VERSION := $0308}
47 
48 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
49     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
50 {$endc}
51 
52 {$ifc defined CPUPOWERPC and defined CPUI386}
53 	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
54 {$endc}
55 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
56 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
57 {$endc}
58 
59 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
60 	{$setc __ppc__ := 1}
61 {$elsec}
62 	{$setc __ppc__ := 0}
63 {$endc}
64 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
65 	{$setc __ppc64__ := 1}
66 {$elsec}
67 	{$setc __ppc64__ := 0}
68 {$endc}
69 {$ifc not defined __i386__ and defined CPUI386}
70 	{$setc __i386__ := 1}
71 {$elsec}
72 	{$setc __i386__ := 0}
73 {$endc}
74 {$ifc not defined __x86_64__ and defined CPUX86_64}
75 	{$setc __x86_64__ := 1}
76 {$elsec}
77 	{$setc __x86_64__ := 0}
78 {$endc}
79 {$ifc not defined __arm__ and defined CPUARM}
80 	{$setc __arm__ := 1}
81 {$elsec}
82 	{$setc __arm__ := 0}
83 {$endc}
84 {$ifc not defined __arm64__ and defined CPUAARCH64}
85   {$setc __arm64__ := 1}
86 {$elsec}
87   {$setc __arm64__ := 0}
88 {$endc}
89 
90 {$ifc defined cpu64}
91   {$setc __LP64__ := 1}
92 {$elsec}
93   {$setc __LP64__ := 0}
94 {$endc}
95 
96 
97 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
98 	{$error Conflicting definitions for __ppc__ and __i386__}
99 {$endc}
100 
101 {$ifc defined __ppc__ and __ppc__}
102 	{$setc TARGET_CPU_PPC := TRUE}
103 	{$setc TARGET_CPU_PPC64 := FALSE}
104 	{$setc TARGET_CPU_X86 := FALSE}
105 	{$setc TARGET_CPU_X86_64 := FALSE}
106 	{$setc TARGET_CPU_ARM := FALSE}
107 	{$setc TARGET_CPU_ARM64 := FALSE}
108 	{$setc TARGET_OS_MAC := TRUE}
109 	{$setc TARGET_OS_IPHONE := FALSE}
110 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
111 	{$setc TARGET_OS_EMBEDDED := FALSE}
112 {$elifc defined __ppc64__ and __ppc64__}
113 	{$setc TARGET_CPU_PPC := FALSE}
114 	{$setc TARGET_CPU_PPC64 := TRUE}
115 	{$setc TARGET_CPU_X86 := FALSE}
116 	{$setc TARGET_CPU_X86_64 := FALSE}
117 	{$setc TARGET_CPU_ARM := FALSE}
118 	{$setc TARGET_CPU_ARM64 := FALSE}
119 	{$setc TARGET_OS_MAC := TRUE}
120 	{$setc TARGET_OS_IPHONE := FALSE}
121 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
122 	{$setc TARGET_OS_EMBEDDED := FALSE}
123 {$elifc defined __i386__ and __i386__}
124 	{$setc TARGET_CPU_PPC := FALSE}
125 	{$setc TARGET_CPU_PPC64 := FALSE}
126 	{$setc TARGET_CPU_X86 := TRUE}
127 	{$setc TARGET_CPU_X86_64 := FALSE}
128 	{$setc TARGET_CPU_ARM := FALSE}
129 	{$setc TARGET_CPU_ARM64 := FALSE}
130 {$ifc defined iphonesim}
131  	{$setc TARGET_OS_MAC := FALSE}
132 	{$setc TARGET_OS_IPHONE := TRUE}
133 	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
134 {$elsec}
135 	{$setc TARGET_OS_MAC := TRUE}
136 	{$setc TARGET_OS_IPHONE := FALSE}
137 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
138 {$endc}
139 	{$setc TARGET_OS_EMBEDDED := FALSE}
140 {$elifc defined __x86_64__ and __x86_64__}
141 	{$setc TARGET_CPU_PPC := FALSE}
142 	{$setc TARGET_CPU_PPC64 := FALSE}
143 	{$setc TARGET_CPU_X86 := FALSE}
144 	{$setc TARGET_CPU_X86_64 := TRUE}
145 	{$setc TARGET_CPU_ARM := FALSE}
146 	{$setc TARGET_CPU_ARM64 := FALSE}
147 {$ifc defined iphonesim}
148  	{$setc TARGET_OS_MAC := FALSE}
149 	{$setc TARGET_OS_IPHONE := TRUE}
150 	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
151 {$elsec}
152 	{$setc TARGET_OS_MAC := TRUE}
153 	{$setc TARGET_OS_IPHONE := FALSE}
154 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
155 {$endc}
156 	{$setc TARGET_OS_EMBEDDED := FALSE}
157 {$elifc defined __arm__ and __arm__}
158 	{$setc TARGET_CPU_PPC := FALSE}
159 	{$setc TARGET_CPU_PPC64 := FALSE}
160 	{$setc TARGET_CPU_X86 := FALSE}
161 	{$setc TARGET_CPU_X86_64 := FALSE}
162 	{$setc TARGET_CPU_ARM := TRUE}
163 	{$setc TARGET_CPU_ARM64 := FALSE}
164 	{$setc TARGET_OS_MAC := FALSE}
165 	{$setc TARGET_OS_IPHONE := TRUE}
166 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
167 	{$setc TARGET_OS_EMBEDDED := TRUE}
168 {$elifc defined __arm64__ and __arm64__}
169 	{$setc TARGET_CPU_PPC := FALSE}
170 	{$setc TARGET_CPU_PPC64 := FALSE}
171 	{$setc TARGET_CPU_X86 := FALSE}
172 	{$setc TARGET_CPU_X86_64 := FALSE}
173 	{$setc TARGET_CPU_ARM := FALSE}
174 	{$setc TARGET_CPU_ARM64 := TRUE}
175 {$ifc defined ios}
176 	{$setc TARGET_OS_MAC := FALSE}
177 	{$setc TARGET_OS_IPHONE := TRUE}
178 	{$setc TARGET_OS_EMBEDDED := TRUE}
179 {$elsec}
180 	{$setc TARGET_OS_MAC := TRUE}
181 	{$setc TARGET_OS_IPHONE := FALSE}
182 	{$setc TARGET_OS_EMBEDDED := FALSE}
183 {$endc}
184 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
185 {$elsec}
186 	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
187 {$endc}
188 
189 {$ifc defined __LP64__ and __LP64__ }
190   {$setc TARGET_CPU_64 := TRUE}
191 {$elsec}
192   {$setc TARGET_CPU_64 := FALSE}
193 {$endc}
194 
195 {$ifc defined FPC_BIG_ENDIAN}
196 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
197 	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
198 {$elifc defined FPC_LITTLE_ENDIAN}
199 	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
200 	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
201 {$elsec}
202 	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
203 {$endc}
204 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
205 {$setc CALL_NOT_IN_CARBON := FALSE}
206 {$setc OLDROUTINENAMES := FALSE}
207 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
208 {$setc OPAQUE_UPP_TYPES := TRUE}
209 {$setc OTCARBONAPPLICATION := TRUE}
210 {$setc OTKERNEL := FALSE}
211 {$setc PM_USE_SESSION_APIS := TRUE}
212 {$setc TARGET_API_MAC_CARBON := TRUE}
213 {$setc TARGET_API_MAC_OS8 := FALSE}
214 {$setc TARGET_API_MAC_OSX := TRUE}
215 {$setc TARGET_CARBON := TRUE}
216 {$setc TARGET_CPU_68K := FALSE}
217 {$setc TARGET_CPU_MIPS := FALSE}
218 {$setc TARGET_CPU_SPARC := FALSE}
219 {$setc TARGET_OS_UNIX := FALSE}
220 {$setc TARGET_OS_WIN32 := FALSE}
221 {$setc TARGET_RT_MAC_68881 := FALSE}
222 {$setc TARGET_RT_MAC_CFM := FALSE}
223 {$setc TARGET_RT_MAC_MACHO := TRUE}
224 {$setc TYPED_FUNCTION_POINTERS := TRUE}
225 {$setc TYPE_BOOL := FALSE}
226 {$setc TYPE_EXTENDED := FALSE}
227 {$setc TYPE_LONGLONG := TRUE}
228 uses MacTypes,CFBase,CFBundle,Events,CarbonEventsCore,AXUIElement,CFDictionary;
229 {$endc} {not MACOSALLINCLUDE}
230 
231 
232 {$ifc TARGET_OS_MAC}
233 
234 {$ALIGN POWER}
235 
236 
237 {
238  *  HIObject
239  *
240  *  Discussion:
241  *    HIObject is the HIToolbox's base class for various objects. In
242  *    Mac OS X 10.2 and later, most common user interface objects
243  *    (controls, windows, menus, and toolbars) are derived from
244  *    HIObject. Code which is external to HIToolbox can also create its
245  *    own subclasses of our objects using the routines contained in
246  *    this file. There are also polymorphic functions one can use on
247  *    any HIObject for getting the class ID, etc.
248  *
249  *    HIObjects are actually CF types under the hood. This means that
250  *    they can be put into CF collections and retain/release can be
251  *    called on them.
252  *
253  *    An HIObject is essentially a very basic building-block object
254  *    which contains an event target. You can create these objects to
255  *    use as your own Carbon Event receptors in your application, or
256  *    you can subclass existing Toolbox object to suit your needs.
257  *
258  *
259  *    You register your subclasses with HIObjectRegisterSubclass,
260  *    passing your class ID, the parent class, and an event handler.
261  *    You also pass a list of events the handler is interested in.
262  *
263  *
264  *    To create an object of your subclass, you call HIObjectCreate,
265  *    passing the class ref you registered, as well as an
266  *    initialization event.
267  *
268  *    Construction is two-phase: first the basic construction of the
269  *    object is done, then initialization is performed. The toolbox
270  *    sends construction events bottom-up, as you would expect in C++
271  *    or the like. Here is the list of what goes on to create an
272  *    object:
273  *
274  *    1)  The Toolbox creates the base HIObject
275  *
276  *    2)  It then installs the event handler you specified when you
277  *    registered your subclass. Your handler must listen for
278  *    kEventHIObjectConstruct and kEventHIObjectDestruct events. If it
279  *    does not, the class cannot be registered (you will get a
280  *    paramErr).
281  *
282  *    3)  Next, the Toolbox _directly_ calls your handler with an
283  *    kEventHIObjectConstruct event. When called like this, you are not
284  *    really being called in the context of a handler stack, so you
285  *    cannot do things like CallNextEventHandler. The userData
286  *    parameter is what you specified as the inConstructData parameter
287  *    to HIObjectRegisterSubclass. Typically, during construction you
288  *    will allocate memory yourself to store your own instance data;
289  *    this allocation might be as simple as calling malloc or NewPtr,
290  *    or it might involve creating your own C++ object. In the
291  *    construct event, the base HIObject of the object being created is
292  *    passed as the kEventParamHIObjectInstance parameter. Typically
293  *    you would store this HIObjectRef in your own instance data for
294  *    later use. When handling this construct event, you should be sure
295  *    to use SetEventParameter to set the kEventParamHIObjectInstance
296  *    parameter in the construction event with your own instance data.
297  *    You must use typeVoidPtr as the type.
298  *
299  *    4)  The Toolbox looks for your instance of typeVoidPtr after you
300  *    handle the construct event. It then takes that data and stores it
301  *    off with the object and also sets the user data of the event
302  *    handler it installed to be this instance data. This means that
303  *    following the construct event, all calls to your event handler
304  *    will have the instance data you returned to us.
305  *
306  *    5)  Once construction has completed successfully, we will send
307  *    your object the initialize event passed into HIObjectCreate. At
308  *    this point, all events are now sent to your object using standard
309  *    Carbon Events mechanisms (it is only the construct event which is
310  *    special). When we send the initialization event to your subclass,
311  *    you should pass the event to your superclass before proceeding.
312  *    You do this with CallNextEventHandler. Once back from that call,
313  *    you should verify that the result is noErr, indicating that the
314  *    superclass did in fact initialize properly. If it did not, your
315  *    should return the error that CallNextEventHandler returned from
316  *    your handler as well. The object will be destroyed by the
317  *    Toolbox. Your object should be able to be destroyed in a
318  *    partially initialized state such as this. This stage is optional,
319  *    i.e. an object does not need to respond to the initialize event
320  *    unless it is expecting certain parameters to be passed to it at
321  *    creation time. This is where those parameters can be fetched.
322  *
323  *
324  *    6)  Once initialization is successful, the HIObjectRef is
325  *    returned to the caller of HIObjectCreate. From there, you can
326  *    have all sorts of cool fun.
327  *
328  *    When someone has called CFRelease enough such that the refcount
329  *    of the object drops to zero, the object is destroyed. The Toolbox
330  *    will send a kEventHIObjectDestruct event to your object. DO NOT
331  *    CALL CALLNEXTEVENTHANDLER. You will be setting yourself up for
332  *    some hurt. Just clean up and return from your handler.
333  }
334 type
335 	HIObjectClassRef = ^OpaqueHIObjectClassRef; { an opaque type }
336 	OpaqueHIObjectClassRef = record end;
337 	HIObjectClassRefPtr = ^HIObjectClassRef; { when a var xx:HIObjectClassRef parameter can be nil, it is changed to xx: HIObjectClassRefPtr }
338 	HIObjectRef = ^OpaqueHIObjectRef; { an opaque type }
339 	OpaqueHIObjectRef = record end;
340 {--------------------------------------------------------------------------------------}
341 {  � Constants                                                                         }
342 {--------------------------------------------------------------------------------------}
343 
344 {
345  *  Discussion:
346  *    HIObject errors
347  }
348 const
349 {
350    * You are trying to register a class ID that already exists.
351    }
352 	hiObjectClassExistsErr = -22080;
353 
354   {
355    * You are trying to unregister a class which has instances which
356    * still exist. You must destroy them first, before they destroy you!
357    }
358 	hiObjectClassHasInstancesErr = -22081;
359 	hiObjectClassHasSubclassesErr = -22082;
360 
361   {
362    * You are trying to create an HIObject class that is defined as
363    * being abstract. You must subclass it instead. Oh yes. Don't make
364    * us say it twice!
365    }
366 	hiObjectClassIsAbstractErr = -22083;
367 
368   {
369    * You may not register a subclass of a class that has the
370    * kHIClassOptionSingleton attribute.
371    }
372 	hiObjectCannotSubclassSingletonErr = -22084;
373 
374   {
375    * Indicates that HIObjectAddDelegate has been called with a delegate
376    * that already exists at the specified position.
377    }
378 	hiObjectDelegateAlreadyExistsErr = -22090;
379 
380   {
381    * Indicates that HIObjectRemoveDelegate has been called with a
382    * delegate that could not be found at the specified position.
383    }
384 	hiObjectDelegateNotFoundErr = -22091;
385 
386 
387 {
388  *  Summary:
389  *    Options for HIObjectRegisterSubclass.
390  }
391 const
392 {
393    * Indicates that HIObjectCreate should always return the same
394    * instance of this class. This instance is created and cached on the
395    * first call to HIObjectCreate for this class ID. All other calls to
396    * HIObjectCreate will return the same instance. Available in Mac OS
397    * X 10.5 and later.
398    }
399 	kHIClassOptionSingleton = 1 shl 0;
400 
401 {--------------------------------------------------------------------------------------}
402 {  � kEventClassHIObject                                                               }
403 {--------------------------------------------------------------------------------------}
404 
405 const
406 {
407    * The event class for HIObject events.
408    }
409 	kEventClassHIObject = FourCharCode('hiob');
410 
411 
412 const
413 {
414    * [typeHIObjectRef or typeVoidPtr] An HIObjectRef that identifies an
415    * instance of an HIObject subclass. This parameter is included in
416    * the kEventHIObjectInitialize event.
417    }
418 	kEventParamHIObjectInstance = FourCharCode('hioi');
419 
420   {
421    * [typeCFTypeRef] An HIArchiveRef for encoding or decoding an
422    * HIObject. This parameter may be included in the
423    * kEventParamInitialize event. It is optional and may not be found
424    * in all instances of this event. This parameter is also included in
425    * the kEventHIObjectEncode event.
426    }
427 	kEventParamHIArchive = FourCharCode('hiac');
428 
429   {
430    * [typeCFArrayRef]  An array of HIObjectRefs that will be added as
431    * delegates in the Before position on an HIObject. This parameter
432    * may be included in the kEventHIObjectInitialize event. It is
433    * optional and may not be found in all instances of this event. This
434    * parameter is supported on Mac OS X 10.5 and later.
435    }
436 	kEventParamBeforeDelegates = FourCharCode('bdel');
437 
438   {
439    * [typeCFArrayRef]  An array of HIObjectRefs that will be added as
440    * delegates in the After position on an HIObject. This parameter may
441    * be included in the kEventHIObjectInitialize event. It is optional
442    * and may not be found in all instances of this event. This
443    * parameter is supported on Mac OS X 10.5 and later.
444    }
445 	kEventParamAfterDelegates = FourCharCode('adel');
446 
447   {
448    * [typeBoolean]  Indicates whether an object is being created inside
449    * an editing environment. An object may choose to change its
450    * behavior in this case. This parameter is included in the
451    * kEventHIObjectInitialize and kEventHIObjectCreatedFromArchive
452    * events. This parameter is supported on Mac OS X 10.5 and later.
453    }
454 	kEventParamDecodingForEditor = FourCharCode('defe');
455 
456   {
457    * [typeCFMutableArrayRef]  A list of dictionaries describing init
458    * event parameters supported by this object class. This parameter is
459    * included in the kEventHIObjectGetInitParameters event. This
460    * parameter is supported on Mac OS X 10.5 and later.
461    }
462 	kEventParamInitParameters = FourCharCode('para');
463 
464   {
465    * The type for an event parameter that contains an HIObjectRef.
466    }
467 	typeHIObjectRef = FourCharCode('hiob');
468 
469 {
470     Dictionary keys for dictionaries included in the kEventParamInitParameters parameter
471     of the kEventHIObjectGetInitParameters event.
472 }
473 {
474  *  kHIObjectInitParamUserName
475  *
476  *  Discussion:
477  *    The human-readable name of this parameter, such as "Bounds". The
478  *    data for this key is a CFStringRef.
479  *
480  *  Mac OS X threading:
481  *    Not thread safe
482  *
483  *  Availability:
484  *    Mac OS X:         in version 10.5 and later in Carbon.framework
485  *    CarbonLib:        not available
486  *    Non-Carbon CFM:   not available
487  }
488 var kHIObjectInitParamUserName: CFStringRef; external name '_kHIObjectInitParamUserName'; (* attribute const *)
489 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
490 {
491  *  kHIObjectInitParamDescription
492  *
493  *  Discussion:
494  *    A human-readable description of a parameter, such as "Bounding
495  *    box of the view". The data for this key is a CFStringRef.
496  *
497  *  Mac OS X threading:
498  *    Not thread safe
499  *
500  *  Availability:
501  *    Mac OS X:         in version 10.5 and later in Carbon.framework
502  *    CarbonLib:        not available
503  *    Non-Carbon CFM:   not available
504  }
505 var kHIObjectInitParamDescription: CFStringRef; external name '_kHIObjectInitParamDescription'; (* attribute const *)
506 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
507 {
508  *  kHIObjectInitParamEventName
509  *
510  *  Discussion:
511  *    The Carbon event parameter name used for this parameter, such as
512  *    'boun'. The data for this key is a CFString, typically created
513  *    with the CreateTypeStringWithOSType API.
514  *
515  *  Mac OS X threading:
516  *    Not thread safe
517  *
518  *  Availability:
519  *    Mac OS X:         in version 10.5 and later in Carbon.framework
520  *    CarbonLib:        not available
521  *    Non-Carbon CFM:   not available
522  }
523 var kHIObjectInitParamEventName: CFStringRef; external name '_kHIObjectInitParamEventName'; (* attribute const *)
524 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
525 {
526  *  kHIObjectInitParamEventType
527  *
528  *  Discussion:
529  *    The Carbon event parameter type used for this parameter, such as
530  *    typeHIRect. The data for this key is a CFString, typically
531  *    created with the CreateTypeStringWithOSType API.
532  *
533  *  Mac OS X threading:
534  *    Not thread safe
535  *
536  *  Availability:
537  *    Mac OS X:         in version 10.5 and later in Carbon.framework
538  *    CarbonLib:        not available
539  *    Non-Carbon CFM:   not available
540  }
541 var kHIObjectInitParamEventType: CFStringRef; external name '_kHIObjectInitParamEventType'; (* attribute const *)
542 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
543 {
544     kEventClassHIObject quick reference:
545 
546     These are the events for base class functionality of HIObjects. You should only need to be
547     aware of these if you are implementing a subclass of HIObject.
548 
549     kEventHIObjectConstruct             = 1,
550     kEventHIObjectInitialize            = 2,
551     kEventHIObjectDestruct              = 3,
552     kEventHIObjectIsEqual               = 4,
553     kEventHIObjectPrintDebugInfo        = 5,
554     kEventHIObjectEncode                = 6,
555     kEventHIObjectCreatedFromArchive    = 7,
556     kEventHIObjectGetInitParameters     = 8
557 }
558 {
559  *  kEventClassHIObject / kEventHIObjectConstruct
560  *
561  *  Summary:
562  *    Your object is being constructed. You should allocate instance
563  *    data for your object.
564  *
565  *  Discussion:
566  *    When your event handler is called with this event, it is being
567  *    called directly and not through the normal event dispatching
568  *    mechanism. This means that the EventHandlerCallRef passed to your
569  *    handler will be NULL and CallNextEventHandler will not work. You
570  *    are passed the actual HIObjectRef of your base class for you to
571  *    record in your instance data.
572  *
573  *  Mac OS X threading:
574  *    Not thread safe
575  *
576  *  Parameters:
577  *
578  *    <-> kEventParamHIObjectInstance (in/out, typeHIObjectRef)
579  *          On entry, this parameter is typeHIObjectRef, and is the
580  *          HIObjectRef of your instance�s base class. Typically you
581  *          will read this parameter from the event and store it in
582  *          your instance data so that when your instance needs to call
583  *          HIObject APIs, it can use this HIObjectRef.
584  *
585  *          On exit, this parameter is typeVoidPtr, and should be a
586  *          pointer to your instance data that you have written into
587  *          the event with SetEventParameter. After your event handler
588  *          returns, the toolbox reads your instance data pointer from
589  *          the event, installs the event handlers that were passed to
590  *          HIObjectRegisterSubclass on the new object, and uses the
591  *          instance data pointer as the refcon for those event
592  *          handlers. This allows your event handlers to retrieve your
593  *          instance data pointer from the refcon.
594  *
595  *  Availability:
596  *    Mac OS X:         in version 10.2 and later in Carbon.framework
597  *    CarbonLib:        not available
598  }
599 const
600 	kEventHIObjectConstruct = 1;
601 
602 {
603  *  kEventClassHIObject / kEventHIObjectInitialize
604  *
605  *  Summary:
606  *    Your object is being initialized. You should read initialization
607  *    data from the event and store it into your instance data.
608  *
609  *  Discussion:
610  *    Your handler should pass this event on to the superclass first
611  *    before handling this event. This is done by calling
612  *    CallNextEventHandler with the event. When that function returns,
613  *    you should make sure the result is noErr. If not, you should NOT
614  *    continue to initialize your object.
615  *
616  *    Assuming that CallNextEventHandler returned noErr, you may then
617  *    proceed to read initialization data from the event parameters, if
618  *    any. For example, you might be create an object that includes a
619  *    string as part of its instance data. The caller of HIObjectCreate
620  *    would create an EventRef and add a string to the event using a
621  *    parameter name and type defined by your object. In your object�s
622  *    kEventHIObjectInitialize event handler, you would read the string
623  *    from the event parameter and store it into your instance
624  *    data.
625  *
626  *    The parameters of this event, therefore, contain the union of all
627  *    parameters needed by all base classes of this object to properly
628  *    construct themselves.
629  *
630  *  Mac OS X threading:
631  *    Not thread safe
632  *
633  *  Parameters:
634  *
635  *    --> kEventParamHIArchive (in, typeCFTypeRef)
636  *          The HIArchive reference from which the HIObject should be
637  *          decoded. This parameter will only exist when the HIObject
638  *          is requested to initialize itself from a decoded archive.
639  *          Otherwise, the HIObject should initialize itself normally.
640  *
641  *    --> kEventParamDecodingForEditor (in, typeBoolean)
642  *          If the kEventParamHIArchive parameter is present, then this
643  *          parameter will also be present on Mac OS X 10.5 and later.
644  *          It indicates whether the client that is creating the object
645  *          is doing so for the purposes of editing the archive
646  *          contents.
647  *
648  *  Availability:
649  *    Mac OS X:         in version 10.2 and later in Carbon.framework
650  *    CarbonLib:        not available
651  }
652 const
653 	kEventHIObjectInitialize = 2;
654 
655 {
656  *  kEventClassHIObject / kEventHIObjectDestruct
657  *
658  *  Summary:
659  *    Your object is being destroyed. This is your chance to dispose of
660  *    anything you might have allocated for your object�s instance data.
661  *
662  *  Discussion:
663  *    Do NOT call through with CallNextEventHandler, as you will
664  *    disrupt the fabric of space-time. An HIObject is destroyed in
665  *    most-derived to least-derived order, and if you call through,
666  *    your base class can be destroyed before you destroy your own
667  *    data, which can cause undefined results.
668  *
669  *    Note that the refcon of your event handler for this event will be
670  *    the instance data pointer allocated and returned by your
671  *    kEventHIObjectConstruct handler in the
672  *    kEventParamHIObjectInstance parameter.
673  *
674  *  Mac OS X threading:
675  *    Not thread safe
676  *
677  *  Availability:
678  *    Mac OS X:         in version 10.2 and later in Carbon.framework
679  *    CarbonLib:        not available
680  }
681 const
682 	kEventHIObjectDestruct = 3;
683 
684 {
685  *  kEventClassHIObject / kEventHIObjectIsEqual
686  *
687  *  Summary:
688  *    HIObjectIsEqual has been called, and you are being asked to
689  *    determine if your object is equivalent to the one being passed to
690  *    your handler.
691  *
692  *  Discussion:
693  *    The base HIObject class handles this event by comparing the
694  *    HIObjectRef values for pointer equality. Your subclass may choose
695  *    to also compare the contents of the HIObject instance data.
696  *
697  *  Mac OS X threading:
698  *    Not thread safe
699  *
700  *  Parameters:
701  *
702  *    --> kEventParamDirectObject (in, typeHIObjectRef)
703  *          The object to which your object should be compared.
704  *
705  *    <-- kEventParamResult (out, typeBoolean)
706  *          If your object is equivalent to the direct object, you
707  *          should return true in this parameter; otherwise, return
708  *          false.
709  *
710  *  Availability:
711  *    Mac OS X:         in version 10.2 and later in Carbon.framework
712  *    CarbonLib:        not available
713  }
714 const
715 	kEventHIObjectIsEqual = 4;
716 
717 {
718  *  kEventClassHIObject / kEventHIObjectPrintDebugInfo
719  *
720  *  Summary:
721  *    HIObjectPrintDebugInfo has been called, and you are being asked
722  *    to print your information to stdout.
723  *
724  *  Discussion:
725  *    This event is sent to all handlers registered for it. You should
726  *    NOT call CallNextEventHandler.
727  *
728  *  Mac OS X threading:
729  *    Not thread safe
730  *
731  *  Availability:
732  *    Mac OS X:         in version 10.2 and later in Carbon.framework
733  *    CarbonLib:        not available
734  }
735 const
736 	kEventHIObjectPrintDebugInfo = 5;
737 
738 {
739  *  kEventClassHIObject / kEventHIObjectEncode
740  *
741  *  Summary:
742  *    Your object is being requested to encode itself into an archive.
743  *
744  *  Discussion:
745  *    HIArchiveEncodeCFType has been called on your HIObject, and you
746  *    are being asked to encode any relevant long-term instance data to
747  *    the HIArchive provided. Your handler should pass this event on to
748  *    the superclass first before handling this event, by calling
749  *    CallNextEventHandler with the event. If CallNextEventHandler does
750  *    not return noErr, you should not continue to encode your instance
751  *    data.
752  *
753  *  Mac OS X threading:
754  *    Not thread safe
755  *
756  *  Parameters:
757  *
758  *    --> kEventParamHIArchive (in, typeCFTypeRef)
759  *          The HIArchive reference into which the HIObject should be
760  *          stored.
761  *
762  *  Availability:
763  *    Mac OS X:         in version 10.4 and later in Carbon.framework
764  *    CarbonLib:        not available
765  }
766 const
767 	kEventHIObjectEncode = 6;
768 
769 {
770  *  kEventClassHIObject / kEventHIObjectCreatedFromArchive
771  *
772  *  Summary:
773  *    Your object has been recreated from an archive.
774  *
775  *  Discussion:
776  *    This event is a notification that your object has been decoded
777  *    from an archive. This event is also sent by IBCarbonRuntime after
778  *    recreating a window, control, or menu from a nib file. The event
779  *    is provided so that your object can perform any necessary
780  *    post-decoding initialization or setup.
781  *
782  *    At the time this event is sent, the object has been completely
783  *    decoded and initialized using data from the archive. However, the
784  *    object has not yet been returned to the caller of the decoding
785  *    API (either HIArchiveCopyDecodedCFType, CreateWindowFromNib, or
786  *    CreateMenuFromNib), and so the caller will not be able to install
787  *    an event handler on the object for this event before the event is
788  *    sent. Therefore, there are only two ways to handle this event: an
789  *    object that is a custom subclass of HIObject or HIView can
790  *    install a handler for this event in its kEventHIObjectInitialize
791  *    handler, or an object (not necessarily a custom subclass) can
792  *    have the class ID of a delegate HIObject specified in its
793  *    archived data, and the delegate object can have a handler for
794  *    this event.
795  *
796  *    This event is only sent to the object that has been decoded; it
797  *    is not propagated past that object. It is sent to all handlers
798  *    registered for it.
799  *
800  *  Mac OS X threading:
801  *    Not thread safe
802  *
803  *  Parameters:
804  *
805  *    --> kEventParamHIObjectInstance (in, typeHIObjectRef)
806  *          The object that has been recreated from an archive.
807  *
808  *    --> kEventParamDecodingForEditor (in, typeBoolean)
809  *          Indicates whether the client that is decoding the archive
810  *          is doing so for the purposes of editing the archive
811  *          contents. Event handlers for this event may choose to
812  *          ignore the event in this case, if appropriate.
813  *
814  *  Availability:
815  *    Mac OS X:         in version 10.5 and later in Carbon.framework
816  *    CarbonLib:        not available
817  }
818 const
819 	kEventHIObjectCreatedFromArchive = 7;
820 
821 {
822  *  kEventClassHIObject / kEventHIObjectGetInitParameters
823  *
824  *  Summary:
825  *    Requests information about the init event parameters supported by
826  *    this object.
827  *
828  *  Discussion:
829  *    This event is typically used by UI editing environments that are
830  *    providing the ability to edit an instance of an object. The
831  *    object should respond to this event by first calling
832  *    CallNextEventHandler, so that superclasses can add their own
833  *    event parameters, and then by adding CFDictionaries containing
834  *    information about the init event parameters supported by this
835  *    object class. Each dictionary should, at a minimum, contain data
836  *    for two keys, kHIObjectInitParamEventName and
837  *    kHIObjectInitParamEventType, which are both CFStringRefs. The
838  *    contents of each string should be a four-character code,
839  *    indicating (respectively) the OSType for the event parameter, and
840  *    the OSType for the parameter type. The dictionary may optionally
841  *    contain data for other keys, as described above.
842  *
843  *  Mac OS X threading:
844  *    Not thread safe
845  *
846  *  Parameters:
847  *
848  *    --> kEventParamHIObjectInstance (in, typeHIObjectRef)
849  *          The object whose parameters are being requested.
850  *
851  *    --> kEventParamInitParameters (in, typeCFMutableArrayRef)
852  *          On entry, contains a mutable CFArrayRef. A handler for this
853  *          event should add CFDictionaries containing data about each
854  *          init event parameter supported by this HIObject class.
855  *
856  *  Availability:
857  *    Mac OS X:         in version 10.5 and later in Carbon.framework
858  *    CarbonLib:        not available
859  }
860 const
861 	kEventHIObjectGetInitParameters = 8;
862 
863 {--------------------------------------------------------------------------------------}
864 {  � kEventClassDelegate                                                               }
865 {--------------------------------------------------------------------------------------}
866 
867 const
868 {
869    * The event class for events that are sent to HIObject delegate
870    * objects. This event class is available in Mac OS X 10.5 and later.
871    }
872 	kEventClassDelegate = FourCharCode('dele');
873 
874   {
875    * [typeHIObjectRef]  The HIObject to which a delegate is attached.
876    }
877 	kEventParamDelegateTarget = FourCharCode('delt');
878 
879   {
880    * [typeCFMutableArrayRef]  A list of HIObject classes to which a
881    * delegate can be attached.
882    }
883 	kEventParamDelegateTargetClasses = FourCharCode('trgc');
884 
885   {
886    * [typeCFMutableArrayRef]  A list of HIObject delegate classes that
887    * is installed automatically by this delegate.
888    }
889 	kEventParamDelegateGroupClasses = FourCharCode('grpc');
890 
891   {
892    * [typeCFDictionaryRef] This parameter is used with
893    * kEventHIObjectInitialize when that event is sent to a delegate
894    * group object. The event data is a dictionary containing custom
895    * archive data for the subdelegates of a delegate group. The keys
896    * are subdelegate class IDs, and the values are CFDictionaryRefs in
897    * the custom archive data format.
898    }
899 	kEventParamDelegateGroupParameters = FourCharCode('grpp');
900 
901 {
902     kEventClassDelegate quick reference:
903 
904     These are the events that are sent to HIObjects that are serving as delegates to another object.
905     You should only need to be aware of these if you are implementing a delegate object.
906 
907     kEventDelegateInstalled         = 1,
908     kEventDelegateRemoved           = 2,
909     kEventDelegateGetTargetClasses  = 3,
910     kEventDelegateIsGroup           = 4,
911     kEventDelegateGetGroupClasses   = 5
912 }
913 {
914  *  kEventClassDelegate / kEventDelegateInstalled
915  *
916  *  Summary:
917  *    Notifies a delegate that it has been installed on another object.
918  *
919  *  Discussion:
920  *    Most delegate objects can ignore this event, but a delegate that
921  *    implements a delegate group should handle this event so it can
922  *    install its subdelegate objects. This event is sent to all
923  *    handlers registered for it. This event is only sent to the
924  *    delegate object, and is not propagated past it.
925  *
926  *  Mac OS X threading:
927  *    Not thread safe
928  *
929  *  Parameters:
930  *
931  *    --> kEventParamDirectObject (in, typeHIObjectRef)
932  *          The delegate object.
933  *
934  *    --> kEventParamDelegateTarget (in, typeHIObjectRef)
935  *          The object on which the delegate is being installed.
936  *
937  *  Availability:
938  *    Mac OS X:         in version 10.5 and later in Carbon.framework
939  *    CarbonLib:        not available
940  }
941 const
942 	kEventDelegateInstalled = 1;
943 
944 {
945  *  kEventClassDelegate / kEventDelegateRemoved
946  *
947  *  Summary:
948  *    Notifies a delegate that it has been removed from another object.
949  *
950  *  Discussion:
951  *    Most delegate objects can ignore this event, but a delegate that
952  *    implements a delegate group should handle this event so it can
953  *    remove its subdelegate objects. This event is sent to all
954  *    handlers registered for it. This event is only sent to the
955  *    delegate object, and is not propagated past it.
956  *
957  *  Mac OS X threading:
958  *    Not thread safe
959  *
960  *  Parameters:
961  *
962  *    --> kEventParamDirectObject (in, typeHIObjectRef)
963  *          The delegate object.
964  *
965  *    --> kEventParamDelegateTarget (in, typeHIObjectRef)
966  *          The object from which the delegate is being removed.
967  *
968  *  Availability:
969  *    Mac OS X:         in version 10.5 and later in Carbon.framework
970  *    CarbonLib:        not available
971  }
972 const
973 	kEventDelegateRemoved = 2;
974 
975 {
976  *  kEventClassDelegate / kEventDelegateGetTargetClasses
977  *
978  *  Summary:
979  *    Requests a list of HIObject classes to which a delegate can be
980  *    attached.
981  *
982  *  Discussion:
983  *    This event is typically used by user interface editor
984  *    applications to determine whether a delegate object can be
985  *    attached to a particular HIObject. If this event is not handled,
986  *    the event sender should assume that the object can be attached to
987  *    any type of object.
988  *
989  *  Mac OS X threading:
990  *    Not thread safe
991  *
992  *  Parameters:
993  *
994  *    --> kEventParamDirectObject (in, typeHIObjectRef)
995  *          The delegate object.
996  *
997  *    --> kEventParamDelegateTargetClasses (in, typeCFMutableArrayRef)
998  *          On entry, contains a mutable CFArrayRef. A handler for this
999  *          event should add CFStringRefs containing the HIObject class
1000  *          IDs to which this object can be attached.
1001  *
1002  *  Availability:
1003  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1004  *    CarbonLib:        not available
1005  }
1006 const
1007 	kEventDelegateGetTargetClasses = 3;
1008 
1009 {
1010  *  kEventClassDelegate / kEventDelegateIsGroup
1011  *
1012  *  Summary:
1013  *    Indicates whether a delegate is a delegate group.
1014  *
1015  *  Discussion:
1016  *    A delegate group is a delegate object that installs other
1017  *    delegates when it is itself installed.
1018  *
1019  *  Mac OS X threading:
1020  *    Not thread safe
1021  *
1022  *  Parameters:
1023  *
1024  *    --> kEventParamDirectObject (in, typeHIObjectRef)
1025  *          The delegate object.
1026  *
1027  *    <-- kEventParamResult (out, typeBoolean)
1028  *          On return, indicates whether the object is a delegate
1029  *          group. If not present, the event sender should assume that
1030  *          the object is not a group.
1031  *
1032  *  Availability:
1033  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1034  *    CarbonLib:        not available
1035  }
1036 const
1037 	kEventDelegateIsGroup = 4;
1038 
1039 {
1040  *  kEventClassDelegate / kEventDelegateGetGroupClasses
1041  *
1042  *  Summary:
1043  *    Retrieves the HIObject class IDs of the delegates that are
1044  *    installed by a delegate group.
1045  *
1046  *  Mac OS X threading:
1047  *    Not thread safe
1048  *
1049  *  Parameters:
1050  *
1051  *    --> kEventParamDirectObject (in, typeHIObjectRef)
1052  *          The delegate object.
1053  *
1054  *    --> kEventParamDelegateGroupClasses (in, typeCFMutableArrayRef)
1055  *          On entry, contains a mutable CFArrayRef. A handler for this
1056  *          event should add CFStringRefs containing the HIObject class
1057  *          IDs which this object installs.
1058  *
1059  *  Availability:
1060  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1061  *    CarbonLib:        not available
1062  }
1063 const
1064 	kEventDelegateGetGroupClasses = 5;
1065 
1066 {--------------------------------------------------------------------------------------}
1067 {  � API                                                                               }
1068 {--------------------------------------------------------------------------------------}
1069 {
1070  *  HIObjectRegisterSubclass()
1071  *
1072  *  Discussion:
1073  *    Registers a class with the Toolbox for creation later.
1074  *
1075  *  Mac OS X threading:
1076  *    Not thread safe
1077  *
1078  *  Parameters:
1079  *
1080  *    inClassID:
1081  *      The class ID of your class. It should be unique. We recommend
1082  *      using Java-style com.company.foo naming conventions to avoid
1083  *      collisions.
1084  *
1085  *    inBaseClassID:
1086  *      The class ID of the class you derive from. Passing NULL
1087  *      indicates you wish to subclass HIObject (the base class)
1088  *      directly.
1089  *
1090  *    inOptions:
1091  *      Any special options for your class. Currently you must pass 0
1092  *      for this parameter.
1093  *
1094  *    inConstructProc:
1095  *      The construction proc for this subclass. You pass the address
1096  *      of an event handler into this parameter. This handler is called
1097  *      directly, rather than through the normal event dispatching
1098  *      mechanism. This means that the EventHandlerCallRef passed in
1099  *      will be NULL, and you cannot use it for calls like
1100  *      CallNextEventHandler. Other than that, you should return a
1101  *      result as usual. After your object is constructed, this proc
1102  *      will be installed as the event handler for the remaining events
1103  *      specified in the inEventList parameter. On Mac OS X 10.4 and
1104  *      later, you may pass NULL to create an "abstract class" that
1105  *      cannot be instantiated, but can still be used as a base class
1106  *      for subclasses; if you pass NULL, HIObjectCreate on the class
1107  *      ID will return hiObjectClassIsAbstractErr.
1108  *
1109  *    inNumEvents:
1110  *      The number of events you are installing.
1111  *
1112  *    inEventList:
1113  *      The events your handler wishes to receive. If you are not
1114  *      creating an abstract class, then you must handle the
1115  *      kEventHIObjectConstruct and kEventHIObjectDestruct event. If
1116  *      these events are not specified, an error is returned. An
1117  *      abstract class may pass 0 for the inNumEvents parameter and
1118  *      NULL for the inEventList parameter.
1119  *
1120  *    inConstructData:
1121  *      Pass any info you want passed into your event handler here. For
1122  *      a C++ hierarchy based on HIObjects, you might actually pass a
1123  *      static method to construct your object here, and the base class
1124  *      event handler to do construction as your event handler.
1125  *
1126  *    outClassRef:
1127  *      The newly created class reference. Pass NULL if you don't care.
1128  *
1129  *  Result:
1130  *    An operating system result code.
1131  *
1132  *  Availability:
1133  *    Mac OS X:         in version 10.2 and later in Carbon.framework
1134  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1135  *    Non-Carbon CFM:   not available
1136  }
HIObjectRegisterSubclassnull1137 function HIObjectRegisterSubclass( inClassID: CFStringRef; inBaseClassID: CFStringRef; inOptions: OptionBits; inConstructProc: EventHandlerUPP { can be NULL }; inNumEvents: ItemCount; {const} inEventList: {variable-size-array} EventTypeSpecPtr; inConstructData: UnivPtr; outClassRef: HIObjectClassRefPtr { can be NULL } ): OSStatus; external name '_HIObjectRegisterSubclass';
1138 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1139 
1140 
1141 {
1142  *  HIObjectUnregisterClass()
1143  *
1144  *  Discussion:
1145  *    Unregisters a previously registered subclass of HIObject. You
1146  *    will receive an error if there are subclasses of your class or
1147  *    instances of it which still exist. All instances and subclasses
1148  *    must be disposed of and unregistered first.
1149  *
1150  *  Mac OS X threading:
1151  *    Not thread safe
1152  *
1153  *  Parameters:
1154  *
1155  *    inClassRef:
1156  *      The class ref of the class of object you wish to unregister.
1157  *
1158  *  Availability:
1159  *    Mac OS X:         in version 10.2 and later in Carbon.framework
1160  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1161  *    Non-Carbon CFM:   not available
1162  }
HIObjectUnregisterClassnull1163 function HIObjectUnregisterClass( inClassRef: HIObjectClassRef ): OSStatus; external name '_HIObjectUnregisterClass';
1164 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1165 
1166 
1167 {
1168  *  HIObjectCreate()
1169  *
1170  *  Discussion:
1171  *    Creates an object derived from HIObject.
1172  *
1173  *  Mac OS X threading:
1174  *    Not thread safe
1175  *
1176  *  Parameters:
1177  *
1178  *    inClassID:
1179  *      The class ID of the class of object you wish to instantiate.
1180  *
1181  *    inConstructData:
1182  *      If your class (or any class you derive from) accepts creation
1183  *      parameters, you need to pass an event into this parameter. The
1184  *      class must be kEventClassHIObject, and the kind should be
1185  *      kEventHIObjectInitialize. Any other parameters should be added
1186  *      as necessary. Specific subclasses of HIObject which require
1187  *      initialization parameters will specify those parameters in the
1188  *      appropriate headers.
1189  *
1190  *    outObject:
1191  *      The instance of the object you create.
1192  *
1193  *  Result:
1194  *    An operating system result code. A return value of
1195  *    hiObjectClassIsAbstractErr indicates that the inConstructProc
1196  *    parameter to HIObjectRegisterSubclass was NULL; instances of such
1197  *    a class may not be created, only subclassed.
1198  *
1199  *  Availability:
1200  *    Mac OS X:         in version 10.2 and later in Carbon.framework
1201  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1202  *    Non-Carbon CFM:   not available
1203  }
HIObjectCreatenull1204 function HIObjectCreate( inClassID: CFStringRef; inConstructData: EventRef; var outObject: HIObjectRef ): OSStatus; external name '_HIObjectCreate';
1205 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1206 
1207 
1208 {
1209  *  HIObjectGetEventTarget()
1210  *
1211  *  Discussion:
1212  *    Returns the event target of an HIObjectRef.
1213  *
1214  *  Mac OS X threading:
1215  *    Not thread safe
1216  *
1217  *  Parameters:
1218  *
1219  *    inObject:
1220  *      The object whose target you want.
1221  *
1222  *  Result:
1223  *    An EventTargetRef.
1224  *
1225  *  Availability:
1226  *    Mac OS X:         in version 10.2 and later in Carbon.framework
1227  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1228  *    Non-Carbon CFM:   not available
1229  }
HIObjectGetEventTargetnull1230 function HIObjectGetEventTarget( inObject: HIObjectRef ): EventTargetRef; external name '_HIObjectGetEventTarget';
1231 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1232 
1233 
1234 {
1235  *  HIObjectPrintDebugInfo()
1236  *
1237  *  Discussion:
1238  *    Prints the internal information of an HIObject for debugging
1239  *    purposes. It outputs the info to stdout.
1240  *
1241  *  Mac OS X threading:
1242  *    Not thread safe
1243  *
1244  *  Parameters:
1245  *
1246  *    inObject:
1247  *      The object to inspect.
1248  *
1249  *  Availability:
1250  *    Mac OS X:         in version 10.2 and later in Carbon.framework
1251  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1252  *    Non-Carbon CFM:   not available
1253  }
1254 procedure HIObjectPrintDebugInfo( inObject: HIObjectRef ); external name '_HIObjectPrintDebugInfo';
1255 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1256 
1257 
1258 {
1259  *  HIObjectCopyClassID()
1260  *
1261  *  Discussion:
1262  *    Returns the class ID of a given HIObject.
1263  *
1264  *    This API will crash if called from an kEventHIObjectConstruct
1265  *    handler in Mac OS X 10.4 and earlier. It successfully returns the
1266  *    object's class ID in Mac OS X 10.5 and later.
1267  *
1268  *  Mac OS X threading:
1269  *    Not thread safe
1270  *
1271  *  Parameters:
1272  *
1273  *    inObject:
1274  *      The object whose class ID you are interested in.
1275  *
1276  *  Result:
1277  *    A CFStringRef containing the object's class ID.
1278  *
1279  *  Availability:
1280  *    Mac OS X:         in version 10.2 and later in Carbon.framework
1281  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1282  *    Non-Carbon CFM:   not available
1283  }
HIObjectCopyClassIDnull1284 function HIObjectCopyClassID( inObject: HIObjectRef ): CFStringRef; external name '_HIObjectCopyClassID';
1285 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1286 
1287 
1288 {
1289  *  HIObjectIsOfClass()
1290  *
1291  *  Discussion:
1292  *    Returns whether or not an object is of a certain class. You can
1293  *    us this to see whether or not an object you have derives from an
1294  *    expected superclass.
1295  *
1296  *  Mac OS X threading:
1297  *    Not thread safe
1298  *
1299  *  Parameters:
1300  *
1301  *    inObject:
1302  *      The object whose class ID you wish to check.
1303  *
1304  *    inObjectClassID:
1305  *      The class ID in question.
1306  *
1307  *  Result:
1308  *    A Boolean result indicating whether or not the object is of the
1309  *    class specified.
1310  *
1311  *  Availability:
1312  *    Mac OS X:         in version 10.2 and later in Carbon.framework
1313  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1314  *    Non-Carbon CFM:   not available
1315  }
HIObjectIsOfClassnull1316 function HIObjectIsOfClass( inObject: HIObjectRef; inObjectClassID: CFStringRef ): Boolean; external name '_HIObjectIsOfClass';
1317 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1318 
1319 
1320 {
1321  *  HIObjectDynamicCast()
1322  *
1323  *  Discussion:
1324  *    Returns the instance data for a specific class of an HIObject.
1325  *    The instance data returned is the same instance data the class's
1326  *    construction event handler returns in the instance data
1327  *    parameter. This is stored off with the class reference so that it
1328  *    can be fetched later for use by this function. It allows your
1329  *    subclass to easily get at the data it created, if your subclass
1330  *    needs that data outside of an event handler. (Inside an event
1331  *    handler, your subclass can get at its instance data via the
1332  *    userData parameter to the event handler.)
1333  *
1334  *  Mac OS X threading:
1335  *    Not thread safe
1336  *
1337  *  Parameters:
1338  *
1339  *    inObject:
1340  *      The object whose class ID you wish to check.
1341  *
1342  *    inClassID:
1343  *      The class ID to get the instance data for.
1344  *
1345  *  Result:
1346  *    A void * result which contains the instance data for the object,
1347  *    or NULL if the object is not an instance of the class.
1348  *
1349  *  Availability:
1350  *    Mac OS X:         in version 10.2 and later in Carbon.framework
1351  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1352  *    Non-Carbon CFM:   not available
1353  }
HIObjectDynamicCastnull1354 function HIObjectDynamicCast( inObject: HIObjectRef; inClassID: CFStringRef ): UnivPtr; external name '_HIObjectDynamicCast';
1355 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1356 
1357 
1358 {
1359  *  HIObjectCreateFromBundle()
1360  *
1361  *  Discussion:
1362  *    Returns the HIObject for the given bundle. A bundle can be
1363  *    designed to communicate with an app through an HIObject. The
1364  *    bundle must be designed to create an HIObject and have a defined
1365  *    suite of CarbonEvents that clients can use to communicate with
1366  *    the bundle's HIObject. Given a CFBundleRef, this API will tell
1367  *    the bundle to create the HIObject and return it to the caller.
1368  *
1369  *  Mac OS X threading:
1370  *    Not thread safe
1371  *
1372  *  Parameters:
1373  *
1374  *    inBundle:
1375  *      The bundle that you wish to communicate with.
1376  *
1377  *    outObject:
1378  *      The HIObject associated with the bundle.
1379  *
1380  *  Result:
1381  *    An operating system result code. If the bundle's HIObject
1382  *    creation function cannot be found, cfragNoSymbolErr will be
1383  *    returned.
1384  *
1385  *  Availability:
1386  *    Mac OS X:         in version 10.2 and later in Carbon.framework
1387  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
1388  *    Non-Carbon CFM:   not available
1389  }
HIObjectCreateFromBundlenull1390 function HIObjectCreateFromBundle( inBundle: CFBundleRef; var outObject: HIObjectRef ): OSStatus; external name '_HIObjectCreateFromBundle';
1391 (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
1392 
1393 
1394 {
1395  *  HIObjectFromEventTarget()
1396  *
1397  *  Summary:
1398  *    Returns the HIObjectRef that owns an event target.
1399  *
1400  *  Mac OS X threading:
1401  *    Not thread safe
1402  *
1403  *  Parameters:
1404  *
1405  *    inTarget:
1406  *      The event target whose owing HIObjectRef to return.
1407  *
1408  *  Result:
1409  *    The HIObjectRef that owns the event target, or NULL if the target
1410  *    is invalid.
1411  *
1412  *  Availability:
1413  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1414  *    CarbonLib:        not available
1415  *    Non-Carbon CFM:   not available
1416  }
HIObjectFromEventTargetnull1417 function HIObjectFromEventTarget( inTarget: EventTargetRef ): HIObjectRef; external name '_HIObjectFromEventTarget';
1418 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
1419 
1420 
1421 {--------------------------------------------------------------------------------------}
1422 {  � Archiving                                                                         }
1423 {--------------------------------------------------------------------------------------}
1424 {
1425  *  HIObjectIsArchivingIgnored()
1426  *
1427  *  Discussion:
1428  *    Reports whether or not the given HIObject is marked as ignored
1429  *    for archiving.
1430  *    See the discussion of HIObjectSetArchivingIgnored for details on
1431  *    what it means to be archiving-ignored.
1432  *
1433  *  Mac OS X threading:
1434  *    Not thread safe
1435  *
1436  *  Parameters:
1437  *
1438  *    inObject:
1439  *      The object whose archiving-ignored state you wish to query.
1440  *
1441  *  Result:
1442  *    A Boolean value indicating whether or not the HIObject is ignored
1443  *    for archiving.
1444  *
1445  *  Availability:
1446  *    Mac OS X:         in version 10.4 and later in Carbon.framework
1447  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1448  *    Non-Carbon CFM:   not available
1449  }
HIObjectIsArchivingIgnorednull1450 function HIObjectIsArchivingIgnored( inObject: HIObjectRef ): Boolean; external name '_HIObjectIsArchivingIgnored';
1451 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1452 
1453 
1454 {$ifc not TARGET_CPU_64}
1455 {
1456  *  HIObjectSetArchivingIgnored()
1457  *
1458  *  Discussion:
1459  *    Call this function to mark or unmark an HIObject as ignored for
1460  *    archiving. By default, HIObjects are marked as ignored for
1461  *    archiving. HIObject subclasses that support archiving with the
1462  *    kEventHIObjectInitialize and kEventHIObjectEncode events must set
1463  *    their archiving-ignored state to false in order to receive
1464  *    archiving requests from clients. Typically, an HIObject subclass
1465  *    will call HIObjectSetArchivingIgnored in its
1466  *    kEventHIObjectInitialize handler. A client may still reset the
1467  *    archiving-ignored state to true on a particular object after the
1468  *    object has been initialized. An HIObject marked as ignored for
1469  *    archiving will never be requested to encode itself into an
1470  *    archive.
1471  *
1472  *  Mac OS X threading:
1473  *    Not thread safe
1474  *
1475  *  Parameters:
1476  *
1477  *    inObject:
1478  *      The object whose archiving-ignored state you wish to change.
1479  *
1480  *    inIgnored:
1481  *      A Boolean value indicating whether or not to ignore the object.
1482  *
1483  *  Result:
1484  *    An OSStatus signifying success or failure.
1485  *
1486  *  Availability:
1487  *    Mac OS X:         in version 10.4 and later in Carbon.framework [32-bit only]
1488  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1489  *    Non-Carbon CFM:   not available
1490  }
HIObjectSetArchivingIgnorednull1491 function HIObjectSetArchivingIgnored( inObject: HIObjectRef; inIgnored: Boolean ): OSStatus; external name '_HIObjectSetArchivingIgnored';
1492 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1493 
1494 
1495 {
1496    Standard custom archive data dictionary keys describing custom initialize event parameters.
1497    The name and type keys denote an array of OSTypes represented by CFStrings. Use
1498    UTCreateStringForOSType and UTGetOSTypeFromString in UTType.h for CFStringRef <-> OSType
1499    conversion. The value key denotes an array of CFType objects.
1500 }
1501 {$endc} {not TARGET_CPU_64}
1502 
1503 {
1504  *  kHIObjectCustomDataParameterNamesKey
1505  *
1506  *  Mac OS X threading:
1507  *    Not thread safe
1508  *
1509  *  Availability:
1510  *    Mac OS X:         in version 10.4 and later in Carbon.framework
1511  *    CarbonLib:        not available
1512  *    Non-Carbon CFM:   not available
1513  }
1514 var kHIObjectCustomDataParameterNamesKey: CFStringRef; external name '_kHIObjectCustomDataParameterNamesKey'; (* attribute const *)
1515 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1516 {
1517  *  kHIObjectCustomDataParameterTypesKey
1518  *
1519  *  Mac OS X threading:
1520  *    Not thread safe
1521  *
1522  *  Availability:
1523  *    Mac OS X:         in version 10.4 and later in Carbon.framework
1524  *    CarbonLib:        not available
1525  *    Non-Carbon CFM:   not available
1526  }
1527 var kHIObjectCustomDataParameterTypesKey: CFStringRef; external name '_kHIObjectCustomDataParameterTypesKey'; (* attribute const *)
1528 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1529 {
1530  *  kHIObjectCustomDataParameterValuesKey
1531  *
1532  *  Mac OS X threading:
1533  *    Not thread safe
1534  *
1535  *  Availability:
1536  *    Mac OS X:         in version 10.4 and later in Carbon.framework
1537  *    CarbonLib:        not available
1538  *    Non-Carbon CFM:   not available
1539  }
1540 var kHIObjectCustomDataParameterValuesKey: CFStringRef; external name '_kHIObjectCustomDataParameterValuesKey'; (* attribute const *)
1541 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1542 {
1543    Standard custom archive data dictionary keys defining a class and superclass for clients who do
1544    not implement the object's true class. Each keyed value is a CFStringRef based HIObject class ID.
1545 }
1546 {
1547  *  kHIObjectCustomDataClassIDKey
1548  *
1549  *  Mac OS X threading:
1550  *    Not thread safe
1551  *
1552  *  Availability:
1553  *    Mac OS X:         in version 10.4 and later in Carbon.framework
1554  *    CarbonLib:        not available
1555  *    Non-Carbon CFM:   not available
1556  }
1557 var kHIObjectCustomDataClassIDKey: CFStringRef; external name '_kHIObjectCustomDataClassIDKey'; (* attribute const *)
1558 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1559 {
1560  *  kHIObjectCustomDataSuperClassIDKey
1561  *
1562  *  Mac OS X threading:
1563  *    Not thread safe
1564  *
1565  *  Availability:
1566  *    Mac OS X:         in version 10.4 and later in Carbon.framework
1567  *    CarbonLib:        not available
1568  *    Non-Carbon CFM:   not available
1569  }
1570 var kHIObjectCustomDataSuperClassIDKey: CFStringRef; external name '_kHIObjectCustomDataSuperClassIDKey'; (* attribute const *)
1571 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1572 {
1573  *  kHIObjectCustomDataCDEFProcIDKey
1574  *
1575  *  Discussion:
1576  *    Standard custom archive data dictionary key for ProcPointer based
1577  *    CDEFs. The key value is a CFString based SInt16. Use
1578  *    CFStringGetIntValue in CFString.h for CFStringRef <-> SInt16
1579  *    conversion.
1580  *
1581  *  Mac OS X threading:
1582  *    Not thread safe
1583  *
1584  *  Availability:
1585  *    Mac OS X:         in version 10.4 and later in Carbon.framework [32-bit only]
1586  *    CarbonLib:        not available
1587  *    Non-Carbon CFM:   not available
1588  }
1589 var kHIObjectCustomDataCDEFProcIDKey: CFStringRef; external name '_kHIObjectCustomDataCDEFProcIDKey'; (* attribute const *)
1590 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1591 {
1592  *  kHIObjectCustomDataDelegateGroupParametersKey
1593  *
1594  *  Discussion:
1595  *    Custom archive data dictionary key identifying custom archive
1596  *    data for subdelegates of a delegate group. The value for this key
1597  *    is a dictionary, whose keys are the class IDs of a delegate
1598  *    group's subdelegates, and whose values are custom archive data
1599  *    dictionaries for the respective subdelegate objects.
1600  *
1601  *  Mac OS X threading:
1602  *    Not thread safe
1603  *
1604  *  Availability:
1605  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1606  *    CarbonLib:        not available
1607  *    Non-Carbon CFM:   not available
1608  }
1609 var kHIObjectCustomDataDelegateGroupParametersKey: CFStringRef; external name '_kHIObjectCustomDataDelegateGroupParametersKey'; (* attribute const *)
1610 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
1611 
1612 {$ifc not TARGET_CPU_64}
1613 {
1614  *  HIObjectCopyCustomArchiveData()
1615  *
1616  *  Discussion:
1617  *    Copies the custom archive data associated with an HIObject that
1618  *    has been read from or will be written to an archive. Useful for
1619  *    an archive editor that has read a custom object from an archive
1620  *    and would like to edit its custom data.
1621  *
1622  *  Mac OS X threading:
1623  *    Not thread safe
1624  *
1625  *  Parameters:
1626  *
1627  *    inObject:
1628  *      The object whose custom archive data you wish to retrieve.
1629  *
1630  *    outCustomData:
1631  *      On return, a CFDictionaryRef containing the custom data. The
1632  *      client is responsible for releasing the dictionary. NULL will
1633  *      be returned if there is no custom archive data available.
1634  *
1635  *  Result:
1636  *    An OSStatus signifying success or failure.
1637  *
1638  *  Availability:
1639  *    Mac OS X:         in version 10.4 and later in Carbon.framework [32-bit only]
1640  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1641  *    Non-Carbon CFM:   not available
1642  }
HIObjectCopyCustomArchiveDatanull1643 function HIObjectCopyCustomArchiveData( inObject: HIObjectRef; var outCustomData: CFDictionaryRef ): OSStatus; external name '_HIObjectCopyCustomArchiveData';
1644 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1645 
1646 
1647 {
1648  *  HIObjectSetCustomArchiveData()
1649  *
1650  *  Discussion:
1651  *    Retrieves the custom archive data associated with an HIObject
1652  *    that has been read from or will be written to an archive. Useful
1653  *    for an archive editor that has edited a custom object's custom
1654  *    data and would like it to be written to an archive with the
1655  *    object.
1656  *
1657  *  Mac OS X threading:
1658  *    Not thread safe
1659  *
1660  *  Parameters:
1661  *
1662  *    inObject:
1663  *      The object whose custom archive data you wish to change.
1664  *
1665  *    inCustomData:
1666  *      A CFDictionaryRef containing the custom archive data you would
1667  *      like to associate with the object. Setting custom data will
1668  *      replace any existing custom data. Passing NULL will clear the
1669  *      custom archive data. The dictionary's keys and values must use
1670  *      CFType callbacks for archiving purposes.
1671  *
1672  *  Result:
1673  *    An OSStatus signifying success or failure.
1674  *
1675  *  Availability:
1676  *    Mac OS X:         in version 10.4 and later in Carbon.framework [32-bit only]
1677  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
1678  *    Non-Carbon CFM:   not available
1679  }
HIObjectSetCustomArchiveDatanull1680 function HIObjectSetCustomArchiveData( inObject: HIObjectRef; inCustomData: CFDictionaryRef { can be NULL } ): OSStatus; external name '_HIObjectSetCustomArchiveData';
1681 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
1682 
1683 
1684 {--------------------------------------------------------------------------------------}
1685 {  � Delegate API constants                                                            }
1686 {--------------------------------------------------------------------------------------}
1687 {$endc} {not TARGET_CPU_64}
1688 
1689 
1690 {
1691  *  HIDelegatePosition
1692  *
1693  *  Summary:
1694  *    Positions in the list of delegates of an HIObject where a new
1695  *    delegate will be added.
1696  *
1697  *  Discussion:
1698  *    When an event is sent to an HIObject, its delegates are also
1699  *    given the opportunity to handle the event. Delegates installed
1700  *    with kHIDelegateBefore will be called before the object receives
1701  *    the event. Delegates installed with kHIDelegateAfter will be
1702  *    called after the object receives the event, if the object's
1703  *    handler (and any delegates installed before the object) have all
1704  *    returned eventNotHandledErr.
1705  *
1706  *    If the event is sent with the SendToAllHandlers option, it will
1707  *    be delivered to every handler registered for it on each delegate
1708  *    and on the object, regardless of the error codes returned from
1709  *    event handlers on the delegates and the object.
1710  *
1711  *    If the event is not sent with the SendToAllHandlers option,
1712  *    normal event-processing rules apply. If the event handler of any
1713  *    delegate installed before the object returns an error code other
1714  *    than eventNotHandledErr, event processing will stop and neither
1715  *    the object nor any other delegate will receive the event. If the
1716  *    event reaches the object handler but the object handler returns
1717  *    an error code other than eventNotHandledErr, no delegate
1718  *    installed after the object will receive the event.
1719  }
1720 type
1721 	HIDelegatePosition = UInt32;
1722 const
1723 {
1724    * This constant may only be used with HIObjectRemoveDelegate. It
1725    * indicates that a delegate should be removed from all positions in
1726    * which it is installed. Passing this value to HIObjectAddDelegate
1727    * will cause an error to be returned.
1728    }
1729 	kHIDelegateAll = 0;
1730 
1731   {
1732    * This delegate will be added at the top of the delegate list, and
1733    * will receive events sent to the object first. However, other
1734    * delegates added later with the "Before" position will be
1735    * positioned before this delegate.
1736    }
1737 	kHIDelegateBefore = 1;
1738 
1739   {
1740    * This delegate will be added at the end of the delegate list, and
1741    * will receive events sent to the object last. However, other
1742    * delegates added later with the "After" position will be positioned
1743    * after this delegate. Also, delegates installed at this position
1744    * will never receive the kEventHIObjectDestruct event; once the
1745    * object on which the delegate is installed has handled the Destruct
1746    * event, all delegates have been removed from the object.
1747    }
1748 	kHIDelegateAfter = 2;
1749 
1750 {
1751  *  kHIDelegateBeforeKey
1752  *
1753  *  Discussion:
1754  *    In a dictionary returned by HICopyDelegates, the key for an array
1755  *    of HIObjects installed before an object.
1756  *
1757  *  Mac OS X threading:
1758  *    Not thread safe
1759  *
1760  *  Availability:
1761  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1762  *    CarbonLib:        not available
1763  *    Non-Carbon CFM:   not available
1764  }
1765 var kHIDelegateBeforeKey: CFStringRef; external name '_kHIDelegateBeforeKey'; (* attribute const *)
1766 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
1767 {
1768  *  kHIDelegateAfterKey
1769  *
1770  *  Discussion:
1771  *    In a dictionary returned by HICopyDelegates, the key for an array
1772  *    of HIObjects installed after an object.
1773  *
1774  *  Mac OS X threading:
1775  *    Not thread safe
1776  *
1777  *  Availability:
1778  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1779  *    CarbonLib:        not available
1780  *    Non-Carbon CFM:   not available
1781  }
1782 var kHIDelegateAfterKey: CFStringRef; external name '_kHIDelegateAfterKey'; (* attribute const *)
1783 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
1784 {--------------------------------------------------------------------------------------}
1785 {  � Delegate APIs                                                                     }
1786 {--------------------------------------------------------------------------------------}
1787 {
1788  *  HIObjectAddDelegate()
1789  *
1790  *  Summary:
1791  *    Adds a delegate to an object at the specified position.
1792  *
1793  *  Mac OS X threading:
1794  *    Not thread safe
1795  *
1796  *  Parameters:
1797  *
1798  *    inObject:
1799  *      The object to which to add the delegate.
1800  *
1801  *    inDelegate:
1802  *      The delegate object. The delegate object will be retained by
1803  *      the owning object. If the owning object is destroyed, the
1804  *      delegate object will be automatically removed and released.
1805  *
1806  *    inPosition:
1807  *      The position in the delegate list where this object should be
1808  *      added, either kHIDelegateBefore or kHIDelegateAfter. A delegate
1809  *      can be installed once for each possible delegate position.
1810  *
1811  *  Result:
1812  *    An operating system result code. hiObjectDelegateAlreadyExistsErr
1813  *    is returned if the delegate already exists in the specified
1814  *    section of the delegate list.
1815  *
1816  *  Availability:
1817  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1818  *    CarbonLib:        not available
1819  *    Non-Carbon CFM:   not available
1820  }
HIObjectAddDelegatenull1821 function HIObjectAddDelegate( inObject: HIObjectRef; inDelegate: HIObjectRef; inPosition: HIDelegatePosition ): OSStatus; external name '_HIObjectAddDelegate';
1822 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
1823 
1824 
1825 {
1826  *  HIObjectRemoveDelegate()
1827  *
1828  *  Summary:
1829  *    Removes a delegate from an object.
1830  *
1831  *  Mac OS X threading:
1832  *    Not thread safe
1833  *
1834  *  Parameters:
1835  *
1836  *    inObject:
1837  *      The object from which to remove the delegate.
1838  *
1839  *    inDelegate:
1840  *      The delegate to remove. The delegate object will be released
1841  *      after it is removed from the owning object.
1842  *
1843  *    inPosition:
1844  *      The position in the delegate list from which this object should
1845  *      be removed. A delegate may be installed on an object in
1846  *      multiple positions; removing the delegate from a specified
1847  *      position does not remove it from any other position. You may
1848  *      pass kHIDelegateAll to remove the delegate from all positions
1849  *      on the object.
1850  *
1851  *  Result:
1852  *    An operating system result code. hiObjectDelegateNotFoundErr is
1853  *    returned if the delegate is not found in the specified section of
1854  *    the delegate list.
1855  *
1856  *  Availability:
1857  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1858  *    CarbonLib:        not available
1859  *    Non-Carbon CFM:   not available
1860  }
HIObjectRemoveDelegatenull1861 function HIObjectRemoveDelegate( inObject: HIObjectRef; inDelegate: HIObjectRef; inPosition: HIDelegatePosition ): OSStatus; external name '_HIObjectRemoveDelegate';
1862 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
1863 
1864 
1865 {
1866  *  HIObjectCopyDelegates()
1867  *
1868  *  Summary:
1869  *    Returns a dictionary containing a list of the delegates attached
1870  *    to an object.
1871  *
1872  *  Mac OS X threading:
1873  *    Not thread safe
1874  *
1875  *  Parameters:
1876  *
1877  *    inObject:
1878  *      The object whose delegates to retrieve.
1879  *
1880  *    outDelegates:
1881  *      On exit, contains a dictionary describing the delegates
1882  *      attached to the object. The dictionary keys are
1883  *      kHIDelegateBeforeKey and kHIDelegateAfterKey, and the values
1884  *      are CFArrays. The arrays will contain the HIObjects installed
1885  *      at the corresponding positions in the delegate list, in order
1886  *      that they would be called to handle an event. If the specific
1887  *      object has no delegates installed in a particular position, the
1888  *      key and value for that position will be missing from the
1889  *      dictionary. The dictionary itself will always be created,
1890  *      however, even if the object has no delegates at all. The caller
1891  *      should release the dictionary but should not release the arrays.
1892  *
1893  *  Result:
1894  *    An operating system result code. paramErr is returned if the
1895  *    object is invalid.
1896  *
1897  *  Availability:
1898  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1899  *    CarbonLib:        not available
1900  *    Non-Carbon CFM:   not available
1901  }
HIObjectCopyDelegatesnull1902 function HIObjectCopyDelegates( inObject: HIObjectRef; var outDelegates: CFDictionaryRef ): OSStatus; external name '_HIObjectCopyDelegates';
1903 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
1904 
1905 
1906 {
1907  *  HIObjectGetEventHandlerObject()
1908  *
1909  *  Summary:
1910  *    Given an EventHandlerCallRef for an invocation of an event
1911  *    handler, returns the HIObject that owns the event target that is
1912  *    currently handling the event.
1913  *
1914  *  Discussion:
1915  *    This API is typically used by a delegate handler when handling an
1916  *    event that does not contain a parameter indicating the object to
1917  *    which the event is sent. For example, a delegate handler for a
1918  *    kEventTextDidChange event might want to know the HIViewRef of the
1919  *    text field object that changed; it can get this object by calling
1920  *    HIObjectGetEventHandlerObject while the delegate handler is
1921  *    executing.
1922  *
1923  *    Note that this API does not return the delegate object; it
1924  *    returns the object to which the delegate is attached.
1925  *
1926  *    This API may also be useful whenever you have an event handler
1927  *    installed on an object's event target and you need to know which
1928  *    object is currently handling the event, especially if the event
1929  *    does not have a DirectObject parameter or other identifier. For
1930  *    example, a kEventScrollableGetInfo handler could use this API to
1931  *    determine the object to which the GetInfo event was sent, without
1932  *    needing to store the object in the event handler's refcon.
1933  *
1934  *  Mac OS X threading:
1935  *    Not thread safe
1936  *
1937  *  Parameters:
1938  *
1939  *    inRef:
1940  *      The EventHandlerCallRef that was passed to the event handler.
1941  *
1942  *  Result:
1943  *    The HIObjectRef that owns the event target that is currently
1944  *    handling the event.
1945  *
1946  *  Availability:
1947  *    Mac OS X:         in version 10.5 and later in Carbon.framework
1948  *    CarbonLib:        not available
1949  *    Non-Carbon CFM:   not available
1950  }
HIObjectGetEventHandlerObjectnull1951 function HIObjectGetEventHandlerObject( inRef: EventHandlerCallRef ): HIObjectRef; external name '_HIObjectGetEventHandlerObject';
1952 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
1953 
1954 
1955 {������������������������������������������������������������������������������������������������������}
1956 {  � ControlRef                                                                                        }
1957 {������������������������������������������������������������������������������������������������������}
1958 {
1959    This is a forward declaration for ControlRef and HIViewRef so that other
1960    HIToolbox headers can use these types without causing recursive includes.
1961 }
1962 type
1963 	ControlRef = ^OpaqueControlRef; { an opaque type }
1964 	OpaqueControlRef = record end;
1965 	ControlRefPtr = ^ControlRef;
1966 { ControlHandle is obsolete. Use ControlRef.}
1967 type
1968 	ControlHandle = ControlRef;
1969 	HIViewRef = ControlRef;
1970 
1971 {$endc} {TARGET_OS_MAC}
1972 
1973 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
1974 
1975 end.
1976 {$endc} {not MACOSALLINCLUDE}
1977