MacApplication.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  1. {
  2. File: HIToolbox/MacApplication.h
  3. Contains: Application-level APIs
  4. Version: HIToolbox-219.4.81~2
  5. Copyright: © 2000-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. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, August 2005 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit MacApplication;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,CGImage,Menus,CGContext,Quickdraw,HIObjectCore,TextCommon,CFBase,CFDictionary;
  92. {$ALIGN POWER}
  93. {
  94. * kHIToolboxVersionNumber
  95. *
  96. * Discussion:
  97. * The current build number of HIToolbox.
  98. *
  99. * Mac OS X threading:
  100. * Not thread safe
  101. *
  102. * Availability:
  103. * Mac OS X: in version 10.3 and later in Carbon.framework
  104. * CarbonLib: not available
  105. * Non-Carbon CFM: not available
  106. }
  107. var kHIToolboxVersionNumber: Float32; external name '_kHIToolboxVersionNumber'; (* attribute const *)
  108. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  109. // the HIToolbox version number for various Mac OS X releases
  110. const
  111. kHIToolboxVersionNumber10_3 = 145.0;
  112. const
  113. kHIToolboxVersionNumber10_3_2 = 145.35;
  114. const
  115. kHIToolboxVersionNumber10_3_3 = 145.38;
  116. const
  117. kHIToolboxVersionNumber10_3_4 = 145.41;
  118. const
  119. kHIToolboxVersionNumber10_3_5 = 145.43;
  120. {
  121. * Summary:
  122. * Controls the presentation of system-provided user interface
  123. * elements.
  124. *
  125. * Discussion:
  126. * Note that the system UI mode is a per-process state. Switching
  127. * from a process that is suppressing system UI to another process
  128. * that is not will cause system UI elements to become visible
  129. * automatically. Switching back to the first process will suppress
  130. * system UI elements again.
  131. }
  132. const
  133. {
  134. * In this mode, all standard system UI elements are visible.
  135. }
  136. kUIModeNormal = 0;
  137. {
  138. * In this mode, system UI elements which cover the "content area" of
  139. * the screen (the area other than the menubar) are hidden. However,
  140. * these elements may automatically show themselves in response to
  141. * mouse movements or other user activity; specifically, the Dock
  142. * will still show itself automatically when the mouse moves into the
  143. * Dock's auto-show region.
  144. }
  145. kUIModeContentSuppressed = 1;
  146. {
  147. * In this mode, system UI elements which cover the "content area" of
  148. * the screen (the area other than the menubar) are hidden. Unlike
  149. * kUIModeContentSuppressed, most UI elements will not automatically
  150. * show themselves in this mode.
  151. }
  152. kUIModeContentHidden = 2;
  153. {
  154. * In this mode, all system UI elements, including the menubar, are
  155. * hidden. However, these elements may automatically show themselves
  156. * in response to mouse movements or other user activity;
  157. * specifically, the Dock and menubar will still show themselves
  158. * automatically when the mouse moves into the Dock's auto-show
  159. * region. Available in Mac OS X 10.3 and later.
  160. }
  161. kUIModeAllSuppressed = 4;
  162. {
  163. * In this mode, all system UI elements, including the menubar, are
  164. * hidden. Most system UI elements will not automatically show
  165. * themselves in this mode. The application may request that the
  166. * menubar automatically show itself while in this mode by passing
  167. * the kUIOptionAutoShowMenuBar flag to SetSystemUIMode.
  168. }
  169. kUIModeAllHidden = 3;
  170. type
  171. SystemUIMode = UInt32;
  172. SystemUIModePtr = ^SystemUIMode;
  173. {
  174. * Summary:
  175. * Controls optional behavior of system-provided user interface
  176. * elements.
  177. }
  178. const
  179. {
  180. * Requests that the menubar automatically show itself when the user
  181. * moves the mouse into the screen area that would ordinarily be
  182. * occupied by the menubar. Only valid with kUIModeAllHidden.
  183. }
  184. kUIOptionAutoShowMenuBar = 1 shl 0;
  185. {
  186. * Disables all items in the Apple menu. Valid for all modes.
  187. }
  188. kUIOptionDisableAppleMenu = 1 shl 2;
  189. {
  190. * The active application may not be changed while this process is
  191. * active. Currently disables the Command-Tab and Command-Shift-Tab
  192. * key sequences to switch the active process, and the global window
  193. * rotation key sequence selected by the user in the Keyboard
  194. * preference pane. SetFrontProcess may still be used to explicitly
  195. * switch the active process. Only valid with modes other than
  196. * kUIModeNormal.
  197. }
  198. kUIOptionDisableProcessSwitch = 1 shl 3;
  199. {
  200. * The Force Quit window may not be displayed while this process is
  201. * active. Currently disables the Command-Option-Escape key sequence
  202. * to open the Force Quit window and the Force Quit menu item in the
  203. * Apple menu. Only valid with modes other than kUIModeNormal.
  204. }
  205. kUIOptionDisableForceQuit = 1 shl 4;
  206. {
  207. * The current login session may not be terminated while this process
  208. * is active. Currently disables the Power key and the Restart, Shut
  209. * Down, and Log Out menu items in the Apple menu. Only valid with
  210. * modes other than kUIModeNormal.
  211. }
  212. kUIOptionDisableSessionTerminate = 1 shl 5;
  213. {
  214. * The Hide menu item in the Application menu is disabled. Note that
  215. * this option does not prevent this application from being hidden if
  216. * Hide Others is selected in some other application. Available in
  217. * Mac OS X 10.3 and later.
  218. }
  219. kUIOptionDisableHide = 1 shl 6;
  220. type
  221. SystemUIOptions = OptionBits;
  222. SystemUIOptionsPtr = ^SystemUIOptions;
  223. {
  224. * SetSystemUIMode()
  225. *
  226. * Summary:
  227. * Sets the presentation mode for system-provided user interface
  228. * elements.
  229. *
  230. * Discussion:
  231. * The presentation mode of an application determines which
  232. * system-provided user interface elements are visible on thes
  233. * screen. When the frontmost application changes its presentation
  234. * mode, a kEventAppSystemUIModeChanged Carbon event is sent to all
  235. * applications that have registered for the event. This event is
  236. * also sent when an application is activated; it contains the newly
  237. * active application's presentation mode.
  238. *
  239. * Mac OS X threading:
  240. * Not thread safe
  241. *
  242. * Parameters:
  243. *
  244. * inMode:
  245. * The new mode.
  246. *
  247. * inOptions:
  248. * Options controlling how the new mode behaves.
  249. *
  250. * Result:
  251. * An operating system result code.
  252. *
  253. * Availability:
  254. * Mac OS X: in version 10.2 and later in Carbon.framework
  255. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  256. * Non-Carbon CFM: not available
  257. }
  258. function SetSystemUIMode( inMode: SystemUIMode; inOptions: SystemUIOptions ): OSStatus; external name '_SetSystemUIMode';
  259. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  260. {
  261. * GetSystemUIMode()
  262. *
  263. * Summary:
  264. * Returns the current presentation mode of the application.
  265. *
  266. * Mac OS X threading:
  267. * Not thread safe
  268. *
  269. * Parameters:
  270. *
  271. * outMode:
  272. * On exit, contains the current mode. You may pass NULL if you
  273. * don't need this information.
  274. *
  275. * outOptions:
  276. * On exit, contains the current options for the mode. You may
  277. * pass NULL if you don't need this information.
  278. *
  279. * Availability:
  280. * Mac OS X: in version 10.2 and later in Carbon.framework
  281. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  282. * Non-Carbon CFM: not available
  283. }
  284. procedure GetSystemUIMode( outMode: SystemUIModePtr { can be NULL }; outOptions: SystemUIOptionsPtr { can be NULL } ); external name '_GetSystemUIMode';
  285. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  286. {
  287. * HIApplicationGetCurrent()
  288. *
  289. * Discussion:
  290. * Returns the HIObjectRef of the currently running application
  291. * object. This HIObject's EventTargetRef is what will be returned
  292. * from GetApplicationEventTarget.
  293. *
  294. * Mac OS X threading:
  295. * Not thread safe
  296. *
  297. * Result:
  298. * The HIObjectRef of the currently running application object.
  299. *
  300. * Availability:
  301. * Mac OS X: in version 10.2 and later in Carbon.framework
  302. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  303. * Non-Carbon CFM: not available
  304. }
  305. function HIApplicationGetCurrent: HIObjectRef; external name '_HIApplicationGetCurrent';
  306. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  307. {
  308. * SetApplicationDockTileImage()
  309. *
  310. * Discussion:
  311. * Sets the image for the tile in the dock that represents your
  312. * application while it is running. If you set the image, it will
  313. * NOT revert back to its original image when your application
  314. * terminates. You need to manually restore it before quitting.
  315. *
  316. * Mac OS X threading:
  317. * Not thread safe
  318. *
  319. * Parameters:
  320. *
  321. * inImage:
  322. * The image you wish to have as your tile image.
  323. *
  324. * Result:
  325. * An operating system status code.
  326. *
  327. * Availability:
  328. * Mac OS X: in version 10.0 and later in Carbon.framework
  329. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  330. * Non-Carbon CFM: not available
  331. }
  332. function SetApplicationDockTileImage( inImage: CGImageRef ): OSStatus; external name '_SetApplicationDockTileImage';
  333. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  334. {
  335. * OverlayApplicationDockTileImage()
  336. *
  337. * Discussion:
  338. * Takes the image passed in and composites it on top of the current
  339. * image of your application's dock tile. You might do this to put a
  340. * standard badge over your application's icon to indicate something
  341. * to the user.
  342. *
  343. * Mac OS X threading:
  344. * Not thread safe
  345. *
  346. * Parameters:
  347. *
  348. * inImage:
  349. * The image you wish to overlay onto your tile image.
  350. *
  351. * Result:
  352. * An operating system status code.
  353. *
  354. * Availability:
  355. * Mac OS X: in version 10.0 and later in Carbon.framework
  356. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  357. * Non-Carbon CFM: not available
  358. }
  359. function OverlayApplicationDockTileImage( inImage: CGImageRef ): OSStatus; external name '_OverlayApplicationDockTileImage';
  360. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  361. {
  362. * RestoreApplicationDockTileImage()
  363. *
  364. * Discussion:
  365. * Restores the tile for your appliation in the dock to its normal
  366. * image (your application icon). You would use this if some overlay
  367. * or change of the application icon needed to be removed.
  368. *
  369. * Mac OS X threading:
  370. * Not thread safe
  371. *
  372. * Result:
  373. * An operating system status code.
  374. *
  375. * Availability:
  376. * Mac OS X: in version 10.0 and later in Carbon.framework
  377. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  378. * Non-Carbon CFM: not available
  379. }
  380. function RestoreApplicationDockTileImage: OSStatus; external name '_RestoreApplicationDockTileImage';
  381. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  382. {
  383. * BeginCGContextForApplicationDockTile()
  384. *
  385. * Discussion:
  386. * Creates and returns a CGContextRef. You can use this context to
  387. * draw into your application's dock tile with Quartz. You **MUST**
  388. * call EndCGContextForApplicationDockTile and NOT CGEndContext when
  389. * using this API, as it locks your application's tile in the dock.
  390. * If you call CGEndContext, the dock will never know you are done
  391. * with the tile.
  392. *
  393. * Mac OS X threading:
  394. * Not thread safe
  395. *
  396. * Result:
  397. * An Quartz (Core Graphics) context reference.
  398. *
  399. * Availability:
  400. * Mac OS X: in version 10.0 and later in Carbon.framework
  401. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  402. * Non-Carbon CFM: not available
  403. }
  404. function BeginCGContextForApplicationDockTile: CGContextRef; external name '_BeginCGContextForApplicationDockTile';
  405. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  406. {
  407. * EndCGContextForApplicationDockTile()
  408. *
  409. * Discussion:
  410. * Ends the CG context for your application tile and frees the lock
  411. * on the application dock tile. You **MUST** call this routine and
  412. * NOT CGEndContext when using BeginCGContextForApplicationDockTile,
  413. * as it locks your application's tile in the dock. If you call
  414. * CGEndContext, the dock will never know you are done with the tile.
  415. *
  416. * Mac OS X threading:
  417. * Not thread safe
  418. *
  419. * Parameters:
  420. *
  421. * inContext:
  422. * The context to end. The context is invalid after this call and
  423. * should no longer be used.
  424. *
  425. * Availability:
  426. * Mac OS X: in version 10.0 and later in Carbon.framework
  427. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  428. * Non-Carbon CFM: not available
  429. }
  430. procedure EndCGContextForApplicationDockTile( inContext: CGContextRef ); external name '_EndCGContextForApplicationDockTile';
  431. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  432. {
  433. * BeginQDContextForApplicationDockTile()
  434. *
  435. * Discussion:
  436. * Creates and returns a CGrafPtr for your application's tile in the
  437. * dock. You can use this port to draw into your application's dock
  438. * tile with Quickdraw. You **MUST** call
  439. * EndQDContextForApplicationDockTile and NOT DisposePort when using
  440. * this API, as it locks your application's tile in the dock. If you
  441. * call DisposePort, the dock will never know you are done with the
  442. * tile.
  443. *
  444. * Mac OS X threading:
  445. * Not thread safe
  446. *
  447. * Result:
  448. * A Quickdraw port reference.
  449. *
  450. * Availability:
  451. * Mac OS X: in version 10.0 and later in Carbon.framework
  452. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  453. * Non-Carbon CFM: not available
  454. }
  455. function BeginQDContextForApplicationDockTile: CGrafPtr; external name '_BeginQDContextForApplicationDockTile';
  456. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  457. {
  458. * EndQDContextForApplicationDockTile()
  459. *
  460. * Discussion:
  461. * Disposes the Quickdraw port for your application tile and frees
  462. * the lock on the application dock tile. You **MUST** call this
  463. * routine and NOT DisposePort when using
  464. * BeginQDContextForApplicationDockTile, else the dock will never
  465. * know you are done with the tile.
  466. *
  467. * Mac OS X threading:
  468. * Not thread safe
  469. *
  470. * Parameters:
  471. *
  472. * inContext:
  473. * The context to end. The context is invalid after this call and
  474. * should no longer be used.
  475. *
  476. * Availability:
  477. * Mac OS X: in version 10.0 and later in Carbon.framework
  478. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  479. * Non-Carbon CFM: not available
  480. }
  481. procedure EndQDContextForApplicationDockTile( inContext: CGrafPtr ); external name '_EndQDContextForApplicationDockTile';
  482. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  483. {
  484. * SetApplicationDockTileMenu()
  485. *
  486. * Summary:
  487. * Sets the menu that is displayed by the application's dock tile.
  488. *
  489. * Discussion:
  490. * The Carbon Window Manager and the Dock will always automatically
  491. * display a menu containing a list of the application's document
  492. * windows. If the application wants to add other additional menu
  493. * items, it can use the SetApplicationDockTileMenu API to provide
  494. * those items. The items in the specified menu will be combined
  495. * with the window title items. This API increments the refcount of
  496. * the specified menu. Before the menu is actually displayed, it
  497. * will receive kEventMenuPopulate, kEventMenuOpening, and
  498. * kEventMenuEnableItems Carbon events, so any event handlers for
  499. * these events may update the menu appropriately for the current
  500. * state of the application. The application should set a command ID
  501. * for each menu item in the dock tile menu, and when that item is
  502. * chosen, a kEventCommandProcess Carbon event containing the item's
  503. * command ID will be sent to the user focus target.
  504. *
  505. * Mac OS X threading:
  506. * Not thread safe
  507. *
  508. * Parameters:
  509. *
  510. * inMenu:
  511. * The menu to display, or NULL to remove the current dock tile
  512. * menu.
  513. *
  514. * Availability:
  515. * Mac OS X: in version 10.1 and later in Carbon.framework
  516. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  517. * Non-Carbon CFM: not available
  518. }
  519. function SetApplicationDockTileMenu( inMenu: MenuRef ): OSStatus; external name '_SetApplicationDockTileMenu';
  520. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  521. {
  522. * GetApplicationDockTileMenu()
  523. *
  524. * Summary:
  525. * Returns the menu that is displayed by the application's dock tile.
  526. *
  527. * Mac OS X threading:
  528. * Not thread safe
  529. *
  530. * Result:
  531. * The application's dock tile menu, or NULL if none.
  532. *
  533. * Availability:
  534. * Mac OS X: in version 10.1 and later in Carbon.framework
  535. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  536. * Non-Carbon CFM: not available
  537. }
  538. function GetApplicationDockTileMenu: MenuRef; external name '_GetApplicationDockTileMenu';
  539. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  540. {
  541. * CreateCGImageFromPixMaps()
  542. *
  543. * Mac OS X threading:
  544. * Not thread safe
  545. *
  546. * Availability:
  547. * Mac OS X: in version 10.0 and later in Carbon.framework
  548. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  549. * Non-Carbon CFM: not available
  550. }
  551. function CreateCGImageFromPixMaps( inImage: PixMapHandle; inMask: PixMapHandle; var outImage: CGImageRef ): OSStatus; external name '_CreateCGImageFromPixMaps';
  552. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  553. {
  554. * GetApplicationTextEncoding()
  555. *
  556. * Summary:
  557. * Returns the application's primary text encoding.
  558. *
  559. * Discussion:
  560. * The application text encoding is used when you create a
  561. * CFStringRef from text stored in Resource Manager resources, which
  562. * typically uses one of the Mac encodings such as MacRoman or
  563. * MacJapanese. The encoding is determined by: (a) if your app is
  564. * bundled, the encoding of the .lproj directory chosen by CFBundle,
  565. * (b) else if your plist has a CFBundleDevelopmentRegionKey, the
  566. * encoding specified by that key, (c) else if your app has a 'vers'
  567. * resource, the encoding for the region field in the 'vers', (d)
  568. * else the current localization of the operating system.
  569. *
  570. * Mac OS X threading:
  571. * Not thread safe
  572. *
  573. * Availability:
  574. * Mac OS X: in version 10.0 and later in Carbon.framework
  575. * CarbonLib: in CarbonLib 1.2 and later
  576. * Non-Carbon CFM: not available
  577. }
  578. function GetApplicationTextEncoding: TextEncoding; external name '_GetApplicationTextEncoding';
  579. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  580. {
  581. * GetApplicationScript()
  582. *
  583. * Summary:
  584. * Returns the application script.
  585. *
  586. * Discussion:
  587. * The application script is used when you need a ScriptCode to pass
  588. * to some other API, such as UseThemeFont.
  589. *
  590. * Mac OS X threading:
  591. * Not thread safe
  592. *
  593. * Availability:
  594. * Mac OS X: in version 10.0 and later in Carbon.framework
  595. * CarbonLib: in CarbonLib 1.3 and later
  596. * Non-Carbon CFM: not available
  597. }
  598. function GetApplicationScript: ScriptCode; external name '_GetApplicationScript';
  599. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  600. {------------------------------------------------------------------------------}
  601. { HIAboutBox }
  602. { The strings below are for use as keys in the inOptions parameter of the }
  603. { HIAboutBox function, described below. }
  604. {------------------------------------------------------------------------------}
  605. {$ifc USE_CFSTR_CONSTANT_MACROS}
  606. {$definec kHIAboutBoxNameKey CFSTRP('HIAboutBoxName')}
  607. {$endc}
  608. {$ifc USE_CFSTR_CONSTANT_MACROS}
  609. {$definec kHIAboutBoxVersionKey CFSTRP('HIAboutBoxVersion')}
  610. {$endc}
  611. {$ifc USE_CFSTR_CONSTANT_MACROS}
  612. {$definec kHIAboutBoxCopyrightKey CFSTRP('HIAboutBoxCopyright')}
  613. {$endc}
  614. {$ifc USE_CFSTR_CONSTANT_MACROS}
  615. {$definec kHIAboutBoxDescriptionKey CFSTRP('HIAboutBoxDescription')}
  616. {$endc}
  617. {$ifc USE_CFSTR_CONSTANT_MACROS}
  618. {$definec kHIAboutBoxStringFileKey CFSTRP('HIAboutBoxStringFile')}
  619. {$endc}
  620. {
  621. * HIAboutBox()
  622. *
  623. * Summary:
  624. * Displays an HI-conformant about box.
  625. *
  626. * Discussion:
  627. * This about box is a generic about box that automatically can
  628. * display your application name, version string, and copyright
  629. * string. It peeks into either the Info.plist (for the
  630. * CFBundleName, CFBundleVersion, and CFBundleGetInfoString keys) or
  631. * your bundle resource (not recommended) to get the information by
  632. * default. You can customize what it displays by passing in various
  633. * options in the input dictionary. Note that currently the
  634. * description string can only be specified in the options
  635. * dictionary; this function does not check your Info.plist for a
  636. * descriptions string. <br>
  637. * There are three basic ways to call this function. First, you can
  638. * pass NULL for inOptions. As mentioned, default information will
  639. * be displayed. Second, you can pass the actual values for the
  640. * strings displayed by passing the strings in the inOptions
  641. * dictionary using the keys provided, such as kHIAboutBoxNameKey.
  642. * If a replacement string is not passed, the default behavior kicks
  643. * in. For example, you could pass some variant of your application
  644. * name in the dictionary, but not pass a replacement version or
  645. * copyright strings. The Toolbox would display your replacement
  646. * string, and fall back to looking in the Info.plist for the other
  647. * strings. The third way to call this is to pass the name of a
  648. * string file in the dictionary with the key
  649. * kHIAboutBoxStringFileKey. We will automatically use that file to
  650. * find the strings for the about box. The keys in the string file
  651. * should be the same value as the keys you would use to pass into
  652. * the inOptions dictionary. Again, if a string is not found in that
  653. * file, we would fall back to looking for a string in the
  654. * dictionary, and then finally the Info.plist.
  655. *
  656. * Certainly this is not the be-all-end-all of about boxes, but it
  657. * does provide a simple no-work about box for your application. The
  658. * standard Toolbox application handler now responds to the
  659. * kHICommandAbout command ID by calling HIAboutBox for you. This
  660. * means that any Carbon Event-based application will get this
  661. * behavior for free right out of the box. If you wish for the
  662. * window to respond to cmd-W in the menu bar, you should make sure
  663. * that menu item has the kHICommandClose commandID.
  664. *
  665. * Mac OS X threading:
  666. * Not thread safe
  667. *
  668. * Parameters:
  669. *
  670. * inOptions:
  671. * A dictionary of replacement strings, or the name of a string
  672. * file to retrieve the strings from, or NULL. See the discussion
  673. * for how this is used.
  674. *
  675. * Result:
  676. * An operating system status code.
  677. *
  678. * Availability:
  679. * Mac OS X: in version 10.3 and later in Carbon.framework
  680. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  681. * Non-Carbon CFM: not available
  682. }
  683. function HIAboutBox( inOptions: CFDictionaryRef ): OSStatus; external name '_HIAboutBox';
  684. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  685. {
  686. * HISearchWindowShow()
  687. *
  688. * Summary:
  689. * Sends a message to the System UI server to put up Spotlight UI.
  690. *
  691. * Discussion:
  692. * Brings up "search for string" Spotlight UI. The window is shown
  693. * in the default configuration (Search scope and grouping rules)
  694. *
  695. * Mac OS X threading:
  696. * Not thread safe
  697. *
  698. * Parameters:
  699. *
  700. * inSearchString:
  701. * A CFString to search for. You may pass NULL to open the search
  702. * window with no initial query string.
  703. *
  704. * inFlags:
  705. * Optional flags. Use kNilOptions for now.
  706. *
  707. * Result:
  708. * An operating system status code.
  709. *
  710. * Availability:
  711. * Mac OS X: in version 10.4 and later in Carbon.framework
  712. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  713. * Non-Carbon CFM: not available
  714. }
  715. function HISearchWindowShow( inSearchString: CFStringRef { can be NULL }; inFlags: OptionBits ): OSStatus; external name '_HISearchWindowShow';
  716. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  717. end.