HIObject.pas 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263
  1. {
  2. File: HIToolbox/HIObject.h
  3. Contains: Base object for HIToolbox
  4. Version: HIToolbox-219.4.81~2
  5. Copyright: © 2001-2005 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. {
  11. Change History (most recent first):
  12. <4> 5/8/04 GRP Updated comments to match changes in HIObject.h, version HIToolbox-145.33~1.
  13. <3> 4/8/04 PNL Moved HIObjectxxxx type declarations to HIObjectCore to fix cyclic dependency problem.
  14. <2> 10/02/04 GRP Added support for GPC as well as CodeWarrior Pascal.
  15. <1> 9/8/03 GRP First Pascal translation of HIObject.h, version HIToolbox-123.6~10.
  16. }
  17. {This file was processed by Dan's Source Converter}
  18. {version 1.3 (this version modified by Ingemar Ragnemalm)}
  19. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, August 2005 }
  20. {
  21. Modified for use with Free Pascal
  22. Version 200
  23. Please report any bugs to <[email protected]>
  24. }
  25. {$mode macpas}
  26. {$packenum 1}
  27. {$macro on}
  28. {$inline on}
  29. {$CALLING MWPASCAL}
  30. unit HIObject;
  31. interface
  32. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  33. {$setc GAP_INTERFACES_VERSION := $0200}
  34. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  35. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  36. {$endc}
  37. {$ifc defined CPUPOWERPC and defined CPUI386}
  38. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  39. {$endc}
  40. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  41. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  42. {$endc}
  43. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  44. {$setc __ppc__ := 1}
  45. {$elsec}
  46. {$setc __ppc__ := 0}
  47. {$endc}
  48. {$ifc not defined __i386__ and defined CPUI386}
  49. {$setc __i386__ := 1}
  50. {$elsec}
  51. {$setc __i386__ := 0}
  52. {$endc}
  53. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  54. {$error Conflicting definitions for __ppc__ and __i386__}
  55. {$endc}
  56. {$ifc defined __ppc__ and __ppc__}
  57. {$setc TARGET_CPU_PPC := TRUE}
  58. {$setc TARGET_CPU_X86 := FALSE}
  59. {$elifc defined __i386__ and __i386__}
  60. {$setc TARGET_CPU_PPC := FALSE}
  61. {$setc TARGET_CPU_X86 := TRUE}
  62. {$elsec}
  63. {$error Neither __ppc__ nor __i386__ is defined.}
  64. {$endc}
  65. {$setc TARGET_CPU_PPC_64 := FALSE}
  66. {$ifc defined FPC_BIG_ENDIAN}
  67. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  68. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  69. {$elifc defined FPC_LITTLE_ENDIAN}
  70. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  71. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  72. {$elsec}
  73. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  74. {$endc}
  75. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  76. {$setc CALL_NOT_IN_CARBON := FALSE}
  77. {$setc OLDROUTINENAMES := FALSE}
  78. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  79. {$setc OPAQUE_UPP_TYPES := TRUE}
  80. {$setc OTCARBONAPPLICATION := TRUE}
  81. {$setc OTKERNEL := FALSE}
  82. {$setc PM_USE_SESSION_APIS := TRUE}
  83. {$setc TARGET_API_MAC_CARBON := TRUE}
  84. {$setc TARGET_API_MAC_OS8 := FALSE}
  85. {$setc TARGET_API_MAC_OSX := TRUE}
  86. {$setc TARGET_CARBON := TRUE}
  87. {$setc TARGET_CPU_68K := FALSE}
  88. {$setc TARGET_CPU_MIPS := FALSE}
  89. {$setc TARGET_CPU_SPARC := FALSE}
  90. {$setc TARGET_OS_MAC := TRUE}
  91. {$setc TARGET_OS_UNIX := FALSE}
  92. {$setc TARGET_OS_WIN32 := FALSE}
  93. {$setc TARGET_RT_MAC_68881 := FALSE}
  94. {$setc TARGET_RT_MAC_CFM := FALSE}
  95. {$setc TARGET_RT_MAC_MACHO := TRUE}
  96. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  97. {$setc TYPE_BOOL := FALSE}
  98. {$setc TYPE_EXTENDED := FALSE}
  99. {$setc TYPE_LONGLONG := TRUE}
  100. uses MacTypes,CFBase,CFBundle,Events,CarbonEvents,HIObjectCore,AXUIElement,CFDictionary,CarbonEventsCore;
  101. {$ALIGN POWER}
  102. {
  103. * HIObject
  104. *
  105. * Discussion:
  106. * HIObject is the HIToolbox's base class for various objects. Over
  107. * time, all of our common objects (controls, windows, menus, etc.)
  108. * will be derived from HIObject. Code which is external to
  109. * HIToolbox can also create its own subclasses of our objects using
  110. * the routines contained in this file. There are also polymorphic
  111. * functions one can use on any HIObject for getting the class ID,
  112. * etc.
  113. *
  114. * HIObjects are actually CF types under the hood. This means that
  115. * they can be put into CF collections and retain/release can be
  116. * called on them.
  117. *
  118. * An HIObject is essentially a very basic building-block object
  119. * which contains an event target. You can create these objects to
  120. * use as your own Carbon Event receptors in your application, or
  121. * you can subclass existing Toolbox object to suit your needs.
  122. *
  123. *
  124. * You register your subclasses with HIObjectRegisterSubclass,
  125. * passing your class ID, the parent class, and an event handler.
  126. * You also pass a list of events the handler is interested in.
  127. *
  128. *
  129. * To create an object of your subclass, you call HIObjectCreate,
  130. * passing the class ref you registered, as well as an
  131. * initialization event.
  132. *
  133. * Construction is two-phase: first the basic construction of the
  134. * object is done, then initialization is performed. The toolbox
  135. * sends construction events bottom-up, as you would expect in C++
  136. * or the like. Here is the list of what goes on to create an
  137. * object:
  138. *
  139. * 1) The Toolbox creates the base HIObject
  140. *
  141. * 2) It then installs the event handler you specified when you
  142. * registered your subclass. Your handler must listen for
  143. * kEventHIObjectConstruct and kEventHIObjectDestruct events. If it
  144. * does not, the class cannot be registered (you will get a
  145. * paramErr).
  146. *
  147. * 3) Next, the Toolbox _directly_ calls your handler with an
  148. * kEventHIObjectConstruct event. When called like this, you are not
  149. * really being called in the context of a handler stack, so you
  150. * cannot do things like CallNextEventHandler. The userData
  151. * parameter is what you specified when you registered the class.
  152. * Typically, during construction you will allocate memory yourself
  153. * to store your own instance data; this allocation might be as
  154. * simple as calling malloc or NewPtr, or it might involve creating
  155. * your own C++ object. In the construct event, you are passed the
  156. * base HIObjectRef of the object being created. Typically you would
  157. * store this HIObjectRef in your own instance data for later use.
  158. * When handling this construct event, you should be sure to use
  159. * SetEventParameter to set the kEventParamHIObjectInstance
  160. * parameter in the construction event with your own instance data.
  161. * You must use typeVoidPtr as the type.
  162. *
  163. * 4) The Toolbox looks for your instance of typeVoidPtr after you
  164. * handle the construct event. It then takes that data and stores it
  165. * off with the object and also sets the user data of the event
  166. * handler it installed to be this instance data. This means that
  167. * following the construct event, all calls to your event handler
  168. * will have the instance data you returned to us.
  169. *
  170. * 5) Once construction has completed successfully, we will send
  171. * your object the initialize event passed into HIObjectCreate. At
  172. * this point, all events are now sent to your object using standard
  173. * Carbon Events mechanisms (it is only the construct event which is
  174. * special). When we send the initialization event to your subclass,
  175. * you should pass the event to your superclass before proceeding.
  176. * You do this with CallNextEventHandler. Once back from that call,
  177. * you should verify that the result is noErr, indicating that the
  178. * superclass did in fact initialize properly. If it did not, your
  179. * should return the error that CallNextEventHandler returned from
  180. * your handler as well. The object will be destroyed by the
  181. * Toolbox. Your object should be able to be destroyed in a
  182. * partially initialized state such as this. This stage is optional,
  183. * i.e. an object does not need to respond to the initialize event
  184. * unless it is expecting certain parameters to be passed to it at
  185. * creation time. This is where those parameters can be fetched.
  186. *
  187. *
  188. * 6) Once initialization is successful, the HIObjectRef is
  189. * returned to the caller of HIObjectCreate. From there, you can
  190. * have all sorts of cool fun.
  191. *
  192. * When someone has called CFRelease enough such that the refcount
  193. * of the object drops to zero, the object is destroyed. The Toolbox
  194. * will send a kEventHIObjectDestruct event to your object. DO NOT
  195. * CALL CALLNEXTEVENTHANDLER. You will be setting yourself up for
  196. * some hurt. Just clean up and return from your handler.
  197. }
  198. {
  199. The declarations for HIObjectClassRef, HIObjectClassRefPtr, and HIObjectRef
  200. have been moved to HIObjectCore. See HIObjectCore.p[.pas] for reason.
  201. }
  202. {
  203. * Discussion:
  204. * HIObject errors
  205. }
  206. const
  207. {
  208. * You are trying to register a class ID that already exists.
  209. }
  210. hiObjectClassExistsErr = -22080;
  211. {
  212. * You are trying to unregister a class which has instances which
  213. * still exist. You must destroy them first, before they destroy you!
  214. }
  215. hiObjectClassHasInstancesErr = -22081;
  216. hiObjectClassHasSubclassesErr = -22082;
  217. {
  218. * You are trying to create an HIObject class that is defined as
  219. * being abstract. You must subclass it instead. Oh yes. Don't make
  220. * us say it twice!
  221. }
  222. hiObjectClassIsAbstractErr = -22083;
  223. const
  224. {
  225. * The event class for HIObject events.
  226. }
  227. kEventClassHIObject = $68696F62 (* 'hiob' *);
  228. const
  229. kEventParamHIObjectInstance = $68696F69 (* 'hioi' *);
  230. kEventParamHIArchive = $68696163 (* 'hiac' *); { typeCFTypeRef }
  231. typeHIObjectRef = $68696F62 (* 'hiob' *);
  232. {
  233. kEventClassHIObject quick reference:
  234. These are the events for base class functionality of HIObjects. You should only need to be
  235. aware of these if you are implementing a subclass of HIObject.
  236. kEventHIObjectConstruct = 1,
  237. kEventHIObjectInitialize = 2,
  238. kEventHIObjectDestruct = 3,
  239. kEventHIObjectIsEqual = 4,
  240. kEventHIObjectPrintDebugInfo = 5,
  241. kEventHIObjectEncode = 6
  242. }
  243. {
  244. * kEventClassHIObject / kEventHIObjectConstruct
  245. *
  246. * Summary:
  247. * Your object is being constructed. You should allocate instance
  248. * data for your object.
  249. *
  250. * Discussion:
  251. * When your event handler is called with this event, it is being
  252. * called directly and not through the normal event dispatching
  253. * mechanism. This means that the EventHandlerCallRef passed to your
  254. * handler will be NULL and CallNextEventHandler will not work. You
  255. * are passed the actual HIObjectRef of your base class for you to
  256. * record in your instance data.
  257. *
  258. * Mac OS X threading:
  259. * Not thread safe
  260. *
  261. * Parameters:
  262. *
  263. * <-> kEventParamHIObjectInstance (in/out, typeHIObjectRef)
  264. * On entry, this parameter is typeHIObjectRef, and is the
  265. * HIObjectRef of your instanceÕs base class. Typically you
  266. * will read this parameter from the event and store it in
  267. * your instance data so that when your instance needs to call
  268. * HIObject APIs, it can use this HIObjectRef.
  269. *
  270. * On exit, this parameter is typeVoidPtr, and should be a
  271. * pointer to your instance data that you have written into
  272. * the event with SetEventParameter. After your event handler
  273. * returns, the toolbox reads your instance data pointer from
  274. * the event, installs the event handlers that were passed to
  275. * HIObjectRegisterSubclass on the new object, and uses the
  276. * instance data pointer as the refcon for those event
  277. * handlers. This allows your event handlers to retrieve your
  278. * instance data pointer from the refcon.
  279. *
  280. * Availability:
  281. * Mac OS X: in version 10.2 and later in Carbon.framework
  282. * CarbonLib: not available
  283. }
  284. const
  285. kEventHIObjectConstruct = 1;
  286. {
  287. * kEventClassHIObject / kEventHIObjectInitialize
  288. *
  289. * Summary:
  290. * Your object is being initialized. You should read initialization
  291. * data from the event and store it into your instance data.
  292. *
  293. * Discussion:
  294. * Your handler should pass this event on to the superclass first
  295. * before handling this event. This is done by calling
  296. * CallNextEventHandler with the event. When that function returns,
  297. * you should make sure the result is noErr. If not, you should NOT
  298. * continue to initialize your class.
  299. *
  300. * Assuming that CallNextEventHandler returned noErr, you may then
  301. * proceed to read initialization data from the event parameters, if
  302. * any. For example, you might be create an object that includes a
  303. * string as part of its instance data. The caller of HIObjectCreate
  304. * would create an EventRef and add a string to the event using a
  305. * parameter name and type defined by your object. In your objectÕs
  306. * kEventHIObjectInitialize event handler, you would read the string
  307. * from the event parameter and store it into your instance
  308. * data.
  309. *
  310. * The parameters of this event, therefore, contain the union of all
  311. * parameters needed by all base classes of this object to properly
  312. * construct themselves.
  313. *
  314. * Mac OS X threading:
  315. * Not thread safe
  316. *
  317. * Parameters:
  318. *
  319. * --> kEventParamHIArchive (in, typeCFTypeRef)
  320. * The HIArchive reference from which the HIObject should be
  321. * decoded. This parameter will only exist when the HIObject
  322. * is requested to initialize itself from a decoded archive.
  323. * Otherwise, the HIObject should initialize itself normally.
  324. *
  325. * Availability:
  326. * Mac OS X: in version 10.2 and later in Carbon.framework
  327. * CarbonLib: not available
  328. }
  329. const
  330. kEventHIObjectInitialize = 2;
  331. {
  332. * kEventClassHIObject / kEventHIObjectDestruct
  333. *
  334. * Summary:
  335. * Your object is being destroyed. This is your chance to dispose of
  336. * anything you might have allocated for your objectÕs instance data.
  337. *
  338. * Discussion:
  339. * Do NOT call through with CallNextEventHandler, as you will
  340. * disrupt the fabric of space-time. An HIObject is destroyed in
  341. * most-derived to least-derived order, and if you call through,
  342. * your base class can be destroyed before you destroy your own
  343. * data, which can cause undefined results.
  344. *
  345. * Note that the refcon of your event handler for this event will be
  346. * the instance data pointer allocated and returned by your
  347. * kEventHIObjectConstruct handler in the
  348. * kEventParamHIObjectInstance parameter.
  349. *
  350. * Mac OS X threading:
  351. * Not thread safe
  352. *
  353. * Availability:
  354. * Mac OS X: in version 10.2 and later in Carbon.framework
  355. * CarbonLib: not available
  356. }
  357. const
  358. kEventHIObjectDestruct = 3;
  359. {
  360. * kEventClassHIObject / kEventHIObjectIsEqual
  361. *
  362. * Summary:
  363. * HIObjectIsEqual has been called, and you are being asked to
  364. * determine if your object is equivalent to the one being passed to
  365. * your handler.
  366. *
  367. * Discussion:
  368. * The base HIObject class handles this event by comparing the
  369. * HIObjectRef values for pointer equality. Your subclass may choose
  370. * to also compare the contents of the HIObject instance data.
  371. *
  372. * Mac OS X threading:
  373. * Not thread safe
  374. *
  375. * Parameters:
  376. *
  377. * --> kEventParamDirectObject (in, typeHIObjectRef)
  378. * The object to which your object should be compared.
  379. *
  380. * <-- kEventParamResult (out, typeBoolean)
  381. * If your object is equivalent to the direct object, you
  382. * should return true in this parameter; otherwise, return
  383. * false.
  384. *
  385. * Availability:
  386. * Mac OS X: in version 10.2 and later in Carbon.framework
  387. * CarbonLib: not available
  388. }
  389. const
  390. kEventHIObjectIsEqual = 4;
  391. {
  392. * kEventClassHIObject / kEventHIObjectPrintDebugInfo
  393. *
  394. * Summary:
  395. * HIObjectPrintDebugInfo has been called, and you are being asked
  396. * to print your information to stdout.
  397. *
  398. * Discussion:
  399. * This event is sent to all handlers registered for it. You should
  400. * NOT call CallNextEventHandler.
  401. *
  402. * Mac OS X threading:
  403. * Not thread safe
  404. *
  405. * Availability:
  406. * Mac OS X: in version 10.2 and later in Carbon.framework
  407. * CarbonLib: not available
  408. }
  409. const
  410. kEventHIObjectPrintDebugInfo = 5;
  411. {
  412. * kEventClassHIObject / kEventHIObjectEncode
  413. *
  414. * Summary:
  415. * Your object is being requested to encode itself into an archive.
  416. *
  417. * Discussion:
  418. * Your handler should pass this event on to the superclass first
  419. * before handling this event. This is done by calling
  420. * CallNextEventHandler with the event. When that function returns,
  421. * you should make sure the result is noErr. If not, you should NOT
  422. * continue to initialize your class.
  423. *
  424. * HIArchiveEncodeHIObject has been called on your HIObject. At this
  425. * point all relevant long term data should be encoded to the
  426. * HIArchive provided.
  427. *
  428. * Mac OS X threading:
  429. * Not thread safe
  430. *
  431. * Parameters:
  432. *
  433. * --> kEventParamHIArchive (in, typeCFTypeRef)
  434. * The HIArchive reference into which the HIObject should be
  435. * compiled.
  436. *
  437. * Availability:
  438. * Mac OS X: in version 10.4 and later in Carbon.framework
  439. * CarbonLib: not available
  440. }
  441. const
  442. kEventHIObjectEncode = 6;
  443. {
  444. * HIObjectRegisterSubclass()
  445. *
  446. * Discussion:
  447. * Registers a class with the Toolbox for creation later.
  448. *
  449. * Mac OS X threading:
  450. * Not thread safe
  451. *
  452. * Parameters:
  453. *
  454. * inClassID:
  455. * The class ID of your class. It should be unique. We recommend
  456. * using Java-style com.company.foo naming conventions to avoid
  457. * collisions.
  458. *
  459. * inBaseClassID:
  460. * The class ID of the class you derive from. Passing NULL
  461. * indicates you wish to subclass HIObject (the base class)
  462. * directly.
  463. *
  464. * inOptions:
  465. * Any special options for your class. Currently you must pass 0
  466. * for this parameter.
  467. *
  468. * inConstructProc:
  469. * The construction proc for this subclass. You pass the address
  470. * of an event handler into this parameter. This handler is called
  471. * directly, rather than through the normal event dispatching
  472. * mechanism. This means that the EventHandlerCallRef passed in
  473. * will be NULL, and you cannot use it for calls like
  474. * CallNextEventHandler. Other than that, you should return a
  475. * result as usual. After your object is constructed, this proc
  476. * will be installed as the event handler for the remaining events
  477. * specified in the inEventList parameter. On Mac OS X 10.4 and
  478. * later, you may pass NULL to create an "abstract class" that
  479. * cannot be instantiated, but can still be used as a base class
  480. * for subclasses; if you pass NULL, HIObjectCreate on the class
  481. * ID will return hiObjectClassIsAbstractErr.
  482. *
  483. * inNumEvents:
  484. * The number of events you are installing.
  485. *
  486. * inEventList:
  487. * The events your handler wishes to receive. If you are not
  488. * creating an abstract class, then you must handle the
  489. * kEventHIObjectConstruct and kEventHIObjectDestruct event. If
  490. * these events are not specified, an error is returned. An
  491. * abstract class may pass 0 for the inNumEvents parameter and
  492. * NULL for the inEventList parameter.
  493. *
  494. * inConstructData:
  495. * Pass any info you want passed into your event handler here. For
  496. * a C++ hierarchy based on HIObjects, you might actually pass a
  497. * static method to construct your object here, and the base class
  498. * event handler to do construction as your event handler.
  499. *
  500. * outClassRef:
  501. * The newly created class reference. Pass NULL if you don't care.
  502. *
  503. * Result:
  504. * An operating system result code.
  505. *
  506. * Availability:
  507. * Mac OS X: in version 10.2 and later in Carbon.framework
  508. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  509. * Non-Carbon CFM: not available
  510. }
  511. function HIObjectRegisterSubclass( inClassID: CFStringRef; inBaseClassID: CFStringRef; inOptions: OptionBits; inConstructProc: EventHandlerUPP { can be NULL }; inNumEvents: UInt32; {const} inEventList: {variable-size-array} EventTypeSpecPtr; inConstructData: UnivPtr; outClassRef: HIObjectClassRefPtr { can be NULL } ): OSStatus; external name '_HIObjectRegisterSubclass';
  512. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  513. {
  514. * HIObjectUnregisterClass()
  515. *
  516. * Discussion:
  517. * Unregisters a previously registered subclass of HIObject. You
  518. * will receive an error if there are subclasses of your class or
  519. * instances of it which still exist. All instances and subclasses
  520. * must be disposed of and unregistered first.
  521. *
  522. * Mac OS X threading:
  523. * Not thread safe
  524. *
  525. * Parameters:
  526. *
  527. * inClassRef:
  528. * The class ref of the class of object you wish to unregister.
  529. *
  530. * Availability:
  531. * Mac OS X: in version 10.2 and later in Carbon.framework
  532. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  533. * Non-Carbon CFM: not available
  534. }
  535. function HIObjectUnregisterClass( inClassRef: HIObjectClassRef ): OSStatus; external name '_HIObjectUnregisterClass';
  536. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  537. {
  538. * HIObjectCreate()
  539. *
  540. * Discussion:
  541. * Creates an object derived from HIObject.
  542. *
  543. * Mac OS X threading:
  544. * Not thread safe
  545. *
  546. * Parameters:
  547. *
  548. * inClassID:
  549. * The class ID of the class of object you wish to instantiate.
  550. *
  551. * inConstructData:
  552. * If your class (or any class you derive from) accepts creation
  553. * parameters, you need to pass an event into this parameter. The
  554. * class must be kEventClassHIObject, and the kind should be
  555. * kEventHIObjectInitialize. Any other parameters should be added
  556. * as necessary. Specific subclasses of HIObject which require
  557. * initialization parameters will specify those parameters in the
  558. * appropriate headers.
  559. *
  560. * outObject:
  561. * The instance of the object you create.
  562. *
  563. * Result:
  564. * An operating system result code. A return value of
  565. * hiObjectClassIsAbstractErr indicates that the inConstructProc
  566. * parameter to HIObjectRegisterSubclass was NULL; instances of such
  567. * a class may not be created, only subclassed.
  568. *
  569. * Availability:
  570. * Mac OS X: in version 10.2 and later in Carbon.framework
  571. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  572. * Non-Carbon CFM: not available
  573. }
  574. function HIObjectCreate( inClassID: CFStringRef; inConstructData: EventRef; var outObject: HIObjectRef ): OSStatus; external name '_HIObjectCreate';
  575. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  576. {
  577. * HIObjectGetEventTarget()
  578. *
  579. * Discussion:
  580. * Returns the event target of an HIObjectRef.
  581. *
  582. * Mac OS X threading:
  583. * Not thread safe
  584. *
  585. * Parameters:
  586. *
  587. * inObject:
  588. * The object whose target you want.
  589. *
  590. * Result:
  591. * An EventTargetRef.
  592. *
  593. * Availability:
  594. * Mac OS X: in version 10.2 and later in Carbon.framework
  595. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  596. * Non-Carbon CFM: not available
  597. }
  598. function HIObjectGetEventTarget( inObject: HIObjectRef ): EventTargetRef; external name '_HIObjectGetEventTarget';
  599. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  600. {
  601. * HIObjectPrintDebugInfo()
  602. *
  603. * Discussion:
  604. * Prints the internal information of an HIObject for debugging
  605. * purposes. It outputs the info to stdout.
  606. *
  607. * Mac OS X threading:
  608. * Not thread safe
  609. *
  610. * Parameters:
  611. *
  612. * inObject:
  613. * The object to inspect.
  614. *
  615. * Availability:
  616. * Mac OS X: in version 10.2 and later in Carbon.framework
  617. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  618. * Non-Carbon CFM: not available
  619. }
  620. procedure HIObjectPrintDebugInfo( inObject: HIObjectRef ); external name '_HIObjectPrintDebugInfo';
  621. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  622. {
  623. * HIObjectCopyClassID()
  624. *
  625. * Discussion:
  626. * Returns the class ID of a given HIObject.
  627. *
  628. * Mac OS X threading:
  629. * Not thread safe
  630. *
  631. * Parameters:
  632. *
  633. * inObject:
  634. * The object whose class ID you are interested in.
  635. *
  636. * Result:
  637. * A CFStringRef containing the object's class ID.
  638. *
  639. * Availability:
  640. * Mac OS X: in version 10.2 and later in Carbon.framework
  641. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  642. * Non-Carbon CFM: not available
  643. }
  644. function HIObjectCopyClassID( inObject: HIObjectRef ): CFStringRef; external name '_HIObjectCopyClassID';
  645. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  646. {
  647. * HIObjectIsOfClass()
  648. *
  649. * Discussion:
  650. * Returns whether or not an object is of a certain class. You can
  651. * us this to see whether or not an object you have derives from an
  652. * expected superclass.
  653. *
  654. * Mac OS X threading:
  655. * Not thread safe
  656. *
  657. * Parameters:
  658. *
  659. * inObject:
  660. * The object whose class ID you wish to check.
  661. *
  662. * inObjectClassID:
  663. * The class ID in question.
  664. *
  665. * Result:
  666. * A Boolean result indicating whether or not the object is of the
  667. * class specified.
  668. *
  669. * Availability:
  670. * Mac OS X: in version 10.2 and later in Carbon.framework
  671. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  672. * Non-Carbon CFM: not available
  673. }
  674. function HIObjectIsOfClass( inObject: HIObjectRef; inObjectClassID: CFStringRef ): Boolean; external name '_HIObjectIsOfClass';
  675. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  676. {
  677. * HIObjectDynamicCast()
  678. *
  679. * Discussion:
  680. * Returns the instance data for a specific class of an HIObject.
  681. * The instance data returned is the same instance data the class's
  682. * construction event handler returns in the instance data
  683. * parameter. This is stored off with the class reference so that it
  684. * can be fetched later for use by this function. It allows your
  685. * subclass to easily get at the data it created, if your subclass
  686. * needs that data outside of an event handler. (Inside an event
  687. * handler, your subclass can get at its instance data via the
  688. * userData parameter to the event handler.)
  689. *
  690. * Mac OS X threading:
  691. * Not thread safe
  692. *
  693. * Parameters:
  694. *
  695. * inObject:
  696. * The object whose class ID you wish to check.
  697. *
  698. * inClassID:
  699. * The class ID to get the instance data for.
  700. *
  701. * Result:
  702. * A void * result which contains the instance data for the object,
  703. * or NULL if the object is not an instance of the class.
  704. *
  705. * Availability:
  706. * Mac OS X: in version 10.2 and later in Carbon.framework
  707. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  708. * Non-Carbon CFM: not available
  709. }
  710. function HIObjectDynamicCast( inObject: HIObjectRef; inClassID: CFStringRef ): UnivPtr; external name '_HIObjectDynamicCast';
  711. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  712. {
  713. * HIObjectCreateFromBundle()
  714. *
  715. * Discussion:
  716. * Returns the HIObject for the given bundle. A bundle can be
  717. * designed to communicate with an app through an HIObject. The
  718. * bundle must be designed to create an HIObject and have a defined
  719. * suite of CarbonEvents that clients can use to communicate with
  720. * the bundle's HIObject. Given a CFBundleRef, this API will tell
  721. * the bundle to create the HIObject and return it to the caller.
  722. *
  723. * Mac OS X threading:
  724. * Not thread safe
  725. *
  726. * Parameters:
  727. *
  728. * inBundle:
  729. * The bundle that you wish to communicate with.
  730. *
  731. * outObject:
  732. * The HIObject associated with the bundle.
  733. *
  734. * Result:
  735. * An operating system result code. If the bundle's HIObject
  736. * creation function cannot be found, cfragNoSymbolErr will be
  737. * returned.
  738. *
  739. * Availability:
  740. * Mac OS X: in version 10.2 and later in Carbon.framework
  741. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  742. * Non-Carbon CFM: not available
  743. }
  744. function HIObjectCreateFromBundle( inBundle: CFBundleRef; var outObject: HIObjectRef ): OSStatus; external name '_HIObjectCreateFromBundle';
  745. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  746. {
  747. * HIObjectIsAccessibilityIgnored()
  748. *
  749. * Discussion:
  750. * Reports whether or not the given HIObject is marked as ignored
  751. * for accessibility.
  752. *
  753. * See the discussion of HIObjectSetAccessibilityIgnored for details
  754. * on what it means to be accessibility ignored.
  755. *
  756. * Mac OS X threading:
  757. * Not thread safe
  758. *
  759. * Parameters:
  760. *
  761. * inObject:
  762. * The object whose accessibility ignored state you wish to query.
  763. *
  764. * Result:
  765. * A Boolean value indicating whether or not the HIObject is ignored
  766. * for accessibility.
  767. *
  768. * Availability:
  769. * Mac OS X: in version 10.2 and later in Carbon.framework
  770. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  771. * Non-Carbon CFM: not available
  772. }
  773. function HIObjectIsAccessibilityIgnored( inObject: HIObjectRef ): Boolean; external name '_HIObjectIsAccessibilityIgnored';
  774. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  775. {
  776. * HIObjectSetAccessibilityIgnored()
  777. *
  778. * Discussion:
  779. * Marks an HIObject as ignored (or not) for the purposes of the
  780. * accessibility APIs.
  781. *
  782. * An HIObject that is ignored for accessibility will never be shown
  783. * to an assistive application that uses the accessibility APIs to
  784. * examine an interface. Your application's accessibility
  785. * implementation can (and should) still report an ignored HIObject
  786. * as usual. Carbon's accessibility engine will automatically prune
  787. * any ignored HIObjects out of the data that is shown to an
  788. * assistive application.
  789. * <BR>By default, an HIObject is *not* accessibility ignored.
  790. *
  791. * Mac OS X threading:
  792. * Not thread safe
  793. *
  794. * Parameters:
  795. *
  796. * inObject:
  797. * The object whose accessibility ignored state you wish to change.
  798. *
  799. * inIgnored:
  800. * A Boolean value indicating whether or not to ignore the object.
  801. *
  802. * Result:
  803. * An OSStatus signifying success or failure.
  804. *
  805. * Availability:
  806. * Mac OS X: in version 10.2 and later in Carbon.framework
  807. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  808. * Non-Carbon CFM: not available
  809. }
  810. function HIObjectSetAccessibilityIgnored( inObject: HIObjectRef; inIgnored: Boolean ): OSStatus; external name '_HIObjectSetAccessibilityIgnored';
  811. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  812. {
  813. * HIObjectSetAuxiliaryAccessibilityAttribute()
  814. *
  815. * Summary:
  816. * Associates an additional accessibility attribute with a UIElement
  817. * that is used to represent a given HIObject or a part thereof.
  818. *
  819. * Discussion:
  820. * This routine lets your application provide the name of and data
  821. * for an accessibility attribute that you want to add to the
  822. * UIElement used to represent a given HIObject-identifier pair.
  823. * Normally, accessibility attributes can only be supplied
  824. * dynamically via Carbon Events, but this routine allows you to
  825. * supply them statically.
  826. *
  827. * When an accessibility attribute Carbon Event is handled by the
  828. * HIObject with a given identifier, the toolbox automatically
  829. * supplies the names and/or values of any auxiliary attributes
  830. * associated with that HIObject- identifier pair.
  831. *
  832. * This routine is particularly useful for supplying values for the
  833. * kAXDescriptionAttribute, kAXTitleUIElementAttribute,
  834. * kAXServesAsTitleUIElementAttribute, kAXLinkedUIElementsAttribute
  835. * and other attributes whose value is specific to the layout and
  836. * usage of your application.
  837. *
  838. * This routine only allows you to associate attributes whose values
  839. * never change. If you need to supply attributes whose values are
  840. * determined dynamically or whose values are settable, you must
  841. * install the normal accessibility Carbon Event handlers.
  842. *
  843. * The auxiliary attribute store is consulted during the HIObject's
  844. * default handling of the accessibility attribute Carbon Events.
  845. * This means that any programmatic handling of a given
  846. * accessibility attribute will have a chance to override or block
  847. * the consultation of the store. The general rule is that if the
  848. * toolbox or a Carbon Event handler can provide the attribute value
  849. * some other way, the store will not be consulted.
  850. *
  851. * Mac OS X threading:
  852. * Not thread safe
  853. *
  854. * Parameters:
  855. *
  856. * inHIObject:
  857. * The HIObjectRef part of the object-identifier pair to which the
  858. * attribute data is associated.
  859. *
  860. * inIdentifier:
  861. * The 64-bit identifier part of the object-identifier pair to
  862. * which the attribute data is associated. When you want to
  863. * associate the attribute data to the HIObject as a whole -- such
  864. * as when you want to give a description attribute to a push
  865. * button -- you should pass zero in this parameter.
  866. *
  867. * inAttributeName:
  868. * A CFStringRef of the name of the attribute you wish to
  869. * associate with the object-identifier pair. This string will be
  870. * retained before adding it to the auxiliary attribute store.
  871. *
  872. * inAttributeData:
  873. * A CFTypeRef with the data to be supplied as the attribute's
  874. * value. This data will be retained before adding it to the
  875. * auxiliary attribute store; you may release inAttributeData
  876. * after you have called this routine. The inAttributeData
  877. * parameter may also be NULL, which indicates that the named
  878. * auxiliary attribute should no longer be associated with the
  879. * object-identifier pair; any named attribute data previously
  880. * associated with the object-identifier pair will be released.
  881. *
  882. * Result:
  883. * An OSStatus result code. The function will return noErr if it was
  884. * able to associate the attribute data with the HIObjectRef. If the
  885. * HIObjectRef is invalid, paramErr will be returned. Other results
  886. * may be returned in other situations.
  887. *
  888. * Availability:
  889. * Mac OS X: in version 10.4 and later in Carbon.framework
  890. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  891. * Non-Carbon CFM: not available
  892. }
  893. function HIObjectSetAuxiliaryAccessibilityAttribute( inHIObject: HIObjectRef; inIdentifier: UInt64; inAttributeName: CFStringRef; inAttributeData: CFTypeRef { can be NULL } ): OSStatus; external name '_HIObjectSetAuxiliaryAccessibilityAttribute';
  894. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  895. {
  896. * HIObjectOverrideAccessibilityContainment()
  897. *
  898. * Summary:
  899. * Allows you to override the AXUIElementRefs that an HIObject would
  900. * normally supply as the values of its AXParent, AXWindow, and
  901. * AXTopLevelUIElement attributes.
  902. *
  903. * Discussion:
  904. * This routine allows you to change the parent that an HIObject
  905. * would normally supply in the accessibility hierarchy. For
  906. * instance, a popup control could call this routine on its menu so
  907. * that the menu returned the popup control as the menu's parent;
  908. * normally the menu would return the application as its parent.
  909. * Optionally, this routine also allows you to change the window and
  910. * top-level element that an HIObject would normally supply.
  911. *
  912. * If the input HIObject is a standard toolbox construct like an
  913. * HIView or a Menu, the input HIObject will not be added as an
  914. * accessibility child of its normal parent. In all other cases, it
  915. * is the client's responsibility to ensure that the input HIObject
  916. * is not added as an accessibility child of its normal parent.
  917. *
  918. * If the desired AXUIElementRef parent represents an HIView, a
  919. * Menu, or a Window, the input HIObject will be automatically added
  920. * as an accessibility child of the specified parent. In all other
  921. * cases, it is the client's responsibility to manually add the
  922. * input HIObject as a child of the specified parent. To represent
  923. * an HIView, a Menu, or a Window, an AXUIElementRef must contain
  924. * the appropriate HIObjectRef as well as an identifier value of
  925. * zero.
  926. *
  927. * Similar rules don't have to apply for the handling of the window
  928. * and top-level element attributes because those attributes don't
  929. * represent two-way relationships.
  930. *
  931. * A containment override is not necessarily supported by every type
  932. * of HIObject. Currently, it is supported by HIViews, Menus, and
  933. * Windows.
  934. *
  935. * Mac OS X threading:
  936. * Not thread safe
  937. *
  938. * Parameters:
  939. *
  940. * inHIObject:
  941. * The HIObjectRef whose parent attribute you want to override.
  942. *
  943. * inDesiredParent:
  944. * The AXUIElementRef that you wish the HIObject to return as the
  945. * value of its AXParent attribute. This routine makes a copy of
  946. * the AXUIElementRef; you must release inDesiredParent after you
  947. * have called this routine. Passing NULL indicates that you want
  948. * the HIObject to revert to its normal, un-overridden behavior.
  949. *
  950. * inDesiredWindow:
  951. * The AXUIElementRef that you wish the HIObject to return as the
  952. * value of its AXWindow attribute. This routine makes a copy of
  953. * the AXUIElementRef; you must release inDesiredWindow after you
  954. * have called this routine. Passing NULL indicates that you want
  955. * the HIObject to report its normal window, if any.
  956. *
  957. * inDesiredTopLevelUIElement:
  958. * The AXUIElementRef that you wish the HIObject to return as the
  959. * value of its AXTopLevelUIElement attribute. This routine makes
  960. * a copy of the AXUIElementRef; you must release
  961. * inDesiredTopLevelUIElement after you have called this routine.
  962. * Passing NULL indicates that you want the HIObject to report its
  963. * normal top-level element, if any.
  964. *
  965. * Result:
  966. * An OSStatus result code. If the HIObjectRef is invalid, this
  967. * routine will return paramErr.
  968. *
  969. * Availability:
  970. * Mac OS X: in version 10.4 and later in Carbon.framework
  971. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  972. * Non-Carbon CFM: not available
  973. }
  974. function HIObjectOverrideAccessibilityContainment( inHIObject: HIObjectRef; inDesiredParent: AXUIElementRef; inDesiredWindow: AXUIElementRef; inDesiredTopLevelUIElement: AXUIElementRef ): OSStatus; external name '_HIObjectOverrideAccessibilityContainment';
  975. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  976. {
  977. * HIObjectIsArchivingIgnored()
  978. *
  979. * Discussion:
  980. * Reports whether or not the given HIObject is marked as ignored
  981. * for archiving.
  982. * See the discussion of HIObjectSetArchivingIgnored for details on
  983. * what it means to be archiving ignored.
  984. *
  985. * Mac OS X threading:
  986. * Not thread safe
  987. *
  988. * Parameters:
  989. *
  990. * inObject:
  991. * The object whose archiving ignored state you wish to query.
  992. *
  993. * Result:
  994. * A Boolean value indicating whether or not the HIObject is ignored
  995. * for archiving.
  996. *
  997. * Availability:
  998. * Mac OS X: in version 10.4 and later in Carbon.framework
  999. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1000. * Non-Carbon CFM: not available
  1001. }
  1002. function HIObjectIsArchivingIgnored( inObject: HIObjectRef ): Boolean; external name '_HIObjectIsArchivingIgnored';
  1003. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1004. {
  1005. * HIObjectSetArchivingIgnored()
  1006. *
  1007. * Discussion:
  1008. * Marks an HIObject as ignored (or not) for the purposes of the
  1009. * archiving APIs.
  1010. * An HIObject that is ignored for archiving will never be requested
  1011. * to encode itself into an archive. This is a statement that the
  1012. * HIObject does not handle the archiving protocol.
  1013. * By default, an HIObject *is* archiving ignored.
  1014. *
  1015. * Mac OS X threading:
  1016. * Not thread safe
  1017. *
  1018. * Parameters:
  1019. *
  1020. * inObject:
  1021. * The object whose archiving ignored state you wish to change.
  1022. *
  1023. * inIgnored:
  1024. * A Boolean value indicating whether or not to ignore the object.
  1025. *
  1026. * Result:
  1027. * An OSStatus signifying success or failure.
  1028. *
  1029. * Availability:
  1030. * Mac OS X: in version 10.4 and later in Carbon.framework
  1031. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1032. * Non-Carbon CFM: not available
  1033. }
  1034. function HIObjectSetArchivingIgnored( inObject: HIObjectRef; inIgnored: Boolean ): OSStatus; external name '_HIObjectSetArchivingIgnored';
  1035. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1036. {
  1037. Standard custom archive data dictionary keys describing custom initialize event parameters.
  1038. Each keyed value is an array of OSTypes represented by CFStrings. Use UTCreateStringForOSType
  1039. and UTGetOSTypeFromString in UTType.h for CFStringRef <-> OSType conversion.
  1040. }
  1041. {
  1042. * kHIObjectCustomDataParameterNamesKey
  1043. *
  1044. * Mac OS X threading:
  1045. * Not thread safe
  1046. *
  1047. * Availability:
  1048. * Mac OS X: in version 10.4 and later in Carbon.framework
  1049. * CarbonLib: not available
  1050. * Non-Carbon CFM: not available
  1051. }
  1052. var kHIObjectCustomDataParameterNamesKey: CFStringRef; external name '_kHIObjectCustomDataParameterNamesKey'; (* attribute const *)
  1053. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1054. {
  1055. * kHIObjectCustomDataParameterTypesKey
  1056. *
  1057. * Mac OS X threading:
  1058. * Not thread safe
  1059. *
  1060. * Availability:
  1061. * Mac OS X: in version 10.4 and later in Carbon.framework
  1062. * CarbonLib: not available
  1063. * Non-Carbon CFM: not available
  1064. }
  1065. var kHIObjectCustomDataParameterTypesKey: CFStringRef; external name '_kHIObjectCustomDataParameterTypesKey'; (* attribute const *)
  1066. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1067. {
  1068. * kHIObjectCustomDataParameterValuesKey
  1069. *
  1070. * Mac OS X threading:
  1071. * Not thread safe
  1072. *
  1073. * Availability:
  1074. * Mac OS X: in version 10.4 and later in Carbon.framework
  1075. * CarbonLib: not available
  1076. * Non-Carbon CFM: not available
  1077. }
  1078. var kHIObjectCustomDataParameterValuesKey: CFStringRef; external name '_kHIObjectCustomDataParameterValuesKey'; (* attribute const *)
  1079. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1080. {
  1081. Standard custom archive data dictionary keys defining a class and superclass for clients who do
  1082. not implement the object's true class. Each keyed value is a CFStringRef based HIObject class ID.
  1083. }
  1084. {
  1085. * kHIObjectCustomDataClassIDKey
  1086. *
  1087. * Mac OS X threading:
  1088. * Not thread safe
  1089. *
  1090. * Availability:
  1091. * Mac OS X: in version 10.4 and later in Carbon.framework
  1092. * CarbonLib: not available
  1093. * Non-Carbon CFM: not available
  1094. }
  1095. var kHIObjectCustomDataClassIDKey: CFStringRef; external name '_kHIObjectCustomDataClassIDKey'; (* attribute const *)
  1096. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1097. {
  1098. * kHIObjectCustomDataSuperClassIDKey
  1099. *
  1100. * Mac OS X threading:
  1101. * Not thread safe
  1102. *
  1103. * Availability:
  1104. * Mac OS X: in version 10.4 and later in Carbon.framework
  1105. * CarbonLib: not available
  1106. * Non-Carbon CFM: not available
  1107. }
  1108. var kHIObjectCustomDataSuperClassIDKey: CFStringRef; external name '_kHIObjectCustomDataSuperClassIDKey'; (* attribute const *)
  1109. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1110. {
  1111. Standard custom archive data dictionary key for ProcPointer based CDEFs. The key value is a
  1112. CFString based SInt16. Use CFStringGetIntValue in CFString.h for CFStringRef <-> SInt16 conversion.
  1113. }
  1114. {
  1115. * kHIObjectCustomDataCDEFProcIDKey
  1116. *
  1117. * Mac OS X threading:
  1118. * Not thread safe
  1119. *
  1120. * Availability:
  1121. * Mac OS X: in version 10.4 and later in Carbon.framework
  1122. * CarbonLib: not available
  1123. * Non-Carbon CFM: not available
  1124. }
  1125. var kHIObjectCustomDataCDEFProcIDKey: CFStringRef; external name '_kHIObjectCustomDataCDEFProcIDKey'; (* attribute const *)
  1126. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1127. {
  1128. * HIObjectCopyCustomArchiveData()
  1129. *
  1130. * Discussion:
  1131. * Copies the custom archive data associated with an HIObject that
  1132. * has been read from or will be written to an archive. Useful for
  1133. * an archive editor that has read a custom object from an archive
  1134. * and would like to edit its custom data.
  1135. *
  1136. * Mac OS X threading:
  1137. * Not thread safe
  1138. *
  1139. * Parameters:
  1140. *
  1141. * inObject:
  1142. * The object whose custom archive data you wish to retrieve.
  1143. *
  1144. * outCustomData:
  1145. * On return, a CFDictionaryRef containing the custom data. The
  1146. * client is responsible for releasing the dictionary. NULL will
  1147. * be returned if there is no custom archive data available.
  1148. *
  1149. * Result:
  1150. * An OSStatus signifying success or failure.
  1151. *
  1152. * Availability:
  1153. * Mac OS X: in version 10.4 and later in Carbon.framework
  1154. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1155. * Non-Carbon CFM: not available
  1156. }
  1157. function HIObjectCopyCustomArchiveData( inObject: HIObjectRef; var outCustomData: CFDictionaryRef ): OSStatus; external name '_HIObjectCopyCustomArchiveData';
  1158. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1159. {
  1160. * HIObjectSetCustomArchiveData()
  1161. *
  1162. * Discussion:
  1163. * Retrieves the custom archive data associated with an HIObject
  1164. * that has been read from or will be written to an archive. Useful
  1165. * for an archive editor that has edited a custom object's custom
  1166. * data and would like it to be written to an archive with the
  1167. * object.
  1168. *
  1169. * Mac OS X threading:
  1170. * Not thread safe
  1171. *
  1172. * Parameters:
  1173. *
  1174. * inObject:
  1175. * The object whose custom archive data you wish to change.
  1176. *
  1177. * inCustomData:
  1178. * A CFDictionaryRef containing the custom archive data you would
  1179. * like to associate with the object. Setting custom data will
  1180. * replace any existing custom data. Passing NULL will clear the
  1181. * custom archive data. The dictionary's keys and values must use
  1182. * CFType callbacks for archiving purposes.
  1183. *
  1184. * Result:
  1185. * An OSStatus signifying success or failure.
  1186. *
  1187. * Availability:
  1188. * Mac OS X: in version 10.4 and later in Carbon.framework
  1189. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1190. * Non-Carbon CFM: not available
  1191. }
  1192. function HIObjectSetCustomArchiveData( inObject: HIObjectRef; inCustomData: CFDictionaryRef { can be NULL } ): OSStatus; external name '_HIObjectSetCustomArchiveData';
  1193. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1194. end.