Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

911 lines
29 KiB

  1. /*
  2. File: MacHelp.h
  3. Contains: Macintosh Help Package Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1998-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __MACHELP__
  11. #define __MACHELP__
  12. #ifndef __BALLOONS__
  13. #include <Balloons.h>
  14. #endif
  15. #ifndef __CONTROLS__
  16. #include <Controls.h>
  17. #endif
  18. #ifndef __DIALOGS__
  19. #include <Dialogs.h>
  20. #endif
  21. #ifndef __EVENTS__
  22. #include <Events.h>
  23. #endif
  24. #ifndef __MACWINDOWS__
  25. #include <MacWindows.h>
  26. #endif
  27. #ifndef __MENUS__
  28. #include <Menus.h>
  29. #endif
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. #if PRAGMA_IMPORT
  37. #pragma import on
  38. #endif
  39. #if PRAGMA_STRUCT_ALIGN
  40. #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42. #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44. #pragma pack(2)
  45. #endif
  46. /*----------------------------------------------------------------------------------*/
  47. /* Help Manager constants, etc. */
  48. /*----------------------------------------------------------------------------------*/
  49. enum {
  50. kMacHelpVersion = 0x0003
  51. };
  52. typedef SInt16 HMContentRequest;
  53. enum {
  54. kHMSupplyContent = 0,
  55. kHMDisposeContent = 1
  56. };
  57. typedef UInt32 HMContentType;
  58. enum {
  59. kHMNoContent = FOUR_CHAR_CODE('none'),
  60. kHMCFStringContent = FOUR_CHAR_CODE('cfst'), /* CFStringRef*/
  61. kHMCFStringLocalizedContent = FOUR_CHAR_CODE('cfsl'), /* CFStringRef; name of a localized string. Supported by Jaguar and later.*/
  62. kHMPascalStrContent = FOUR_CHAR_CODE('pstr'),
  63. kHMStringResContent = FOUR_CHAR_CODE('str#'),
  64. kHMTEHandleContent = FOUR_CHAR_CODE('txth'), /* Supported by CarbonLib and Jaguar and later*/
  65. kHMTextResContent = FOUR_CHAR_CODE('text'), /* Supported by CarbonLib and Jaguar and later*/
  66. kHMStrResContent = FOUR_CHAR_CODE('str ')
  67. };
  68. /*
  69. * HMTagDisplaySide
  70. *
  71. * Discussion:
  72. * Help tag display locations relative to absolute hot rect
  73. */
  74. typedef SInt16 HMTagDisplaySide;
  75. enum {
  76. /*
  77. * System default location
  78. */
  79. kHMDefaultSide = 0,
  80. /*
  81. * Above, aligned with left or right depending on system script
  82. */
  83. kHMOutsideTopScriptAligned = 1,
  84. /*
  85. * To the left, centered vertically
  86. */
  87. kHMOutsideLeftCenterAligned = 2,
  88. kHMOutsideBottomScriptAligned = 3,
  89. /*
  90. * To the right, centered vertically
  91. */
  92. kHMOutsideRightCenterAligned = 4,
  93. /*
  94. * Above, aligned with left
  95. */
  96. kHMOutsideTopLeftAligned = 5,
  97. /*
  98. * Above, aligned with right
  99. */
  100. kHMOutsideTopRightAligned = 6,
  101. /*
  102. * To the left, aligned with top
  103. */
  104. kHMOutsideLeftTopAligned = 7,
  105. /*
  106. * To the left, aligned with bottom
  107. */
  108. kHMOutsideLeftBottomAligned = 8,
  109. /*
  110. * To the right, aligned with top
  111. */
  112. kHMOutsideBottomLeftAligned = 9,
  113. /*
  114. * To the right, aligned with bottom
  115. */
  116. kHMOutsideBottomRightAligned = 10,
  117. kHMOutsideRightTopAligned = 11,
  118. kHMOutsideRightBottomAligned = 12,
  119. /*
  120. * Above, centered horizontally
  121. */
  122. kHMOutsideTopCenterAligned = 13,
  123. /*
  124. * Below, centered horizontally
  125. */
  126. kHMOutsideBottomCenterAligned = 14,
  127. /*
  128. * Inside, aligned with right, centered vertically
  129. */
  130. kHMInsideRightCenterAligned = 15,
  131. /*
  132. * Inside, aligned with left, centered vertically
  133. */
  134. kHMInsideLeftCenterAligned = 16,
  135. /*
  136. * Inside, aligned with bottom, centered horizontally
  137. */
  138. kHMInsideBottomCenterAligned = 17,
  139. /*
  140. * Inside, aligned with top, centered horizontally
  141. */
  142. kHMInsideTopCenterAligned = 18,
  143. /*
  144. * Inside, aligned with top and left
  145. */
  146. kHMInsideTopLeftCorner = 19,
  147. /*
  148. * Inside, aligned with top and right
  149. */
  150. kHMInsideTopRightCorner = 20,
  151. /*
  152. * Inside, aligned with bottom and left
  153. */
  154. kHMInsideBottomLeftCorner = 21,
  155. /*
  156. * Inside, aligned with bottom and right
  157. */
  158. kHMInsideBottomRightCorner = 22,
  159. /*
  160. * Centered vertically and horizontally
  161. */
  162. kHMAbsoluteCenterAligned = 23
  163. };
  164. /* Obsoleted constants HMTagDisplaySides, use the new ones, please */
  165. enum {
  166. kHMTopSide = kHMOutsideTopScriptAligned,
  167. kHMLeftSide = kHMOutsideLeftCenterAligned,
  168. kHMBottomSide = kHMOutsideBottomScriptAligned,
  169. kHMRightSide = kHMOutsideRightCenterAligned,
  170. kHMTopLeftCorner = kHMOutsideTopLeftAligned,
  171. kHMTopRightCorner = kHMOutsideTopRightAligned,
  172. kHMLeftTopCorner = kHMOutsideLeftTopAligned,
  173. kHMLeftBottomCorner = kHMOutsideLeftBottomAligned,
  174. kHMBottomLeftCorner = kHMOutsideBottomLeftAligned,
  175. kHMBottomRightCorner = kHMOutsideBottomRightAligned,
  176. kHMRightTopCorner = kHMOutsideRightTopAligned,
  177. kHMRightBottomCorner = kHMOutsideRightBottomAligned
  178. };
  179. typedef SInt16 HMContentProvidedType;
  180. enum {
  181. kHMContentProvided = 0,
  182. kHMContentNotProvided = 1,
  183. kHMContentNotProvidedDontPropagate = 2
  184. };
  185. enum {
  186. kHMMinimumContentIndex = 0, /* first entry in HMHelpContentRec.content is the minimum content */
  187. kHMMaximumContentIndex = 1 /* second entry in HMHelpContentRec.content is the maximum content */
  188. };
  189. enum {
  190. errHMIllegalContentForMinimumState = -10980, /* unrecognized content type for minimum content */
  191. errHMIllegalContentForMaximumState = -10981 /* unrecognized content type for maximum content */
  192. };
  193. /* obsolete names; will be removed*/
  194. enum {
  195. kHMIllegalContentForMinimumState = errHMIllegalContentForMinimumState
  196. };
  197. enum {
  198. kHelpTagEventHandlerTag = FOUR_CHAR_CODE('hevt')
  199. };
  200. struct HMHelpContent {
  201. HMContentType contentType;
  202. union {
  203. CFStringRef tagCFString; /* CFStringRef*/
  204. Str255 tagString; /* Pascal String*/
  205. HMStringResType tagStringRes; /* STR# resource ID and index*/
  206. TEHandle tagTEHandle; /* TextEdit handle (NOT SUPPORTED ON MAC OS X)*/
  207. SInt16 tagTextRes; /* TEXT/styl resource ID (NOT SUPPORTED ON MAC OS X)*/
  208. SInt16 tagStrRes; /* STR resource ID*/
  209. } u;
  210. };
  211. typedef struct HMHelpContent HMHelpContent;
  212. struct HMHelpContentRec {
  213. SInt32 version;
  214. Rect absHotRect;
  215. HMTagDisplaySide tagSide;
  216. HMHelpContent content[2];
  217. };
  218. typedef struct HMHelpContentRec HMHelpContentRec;
  219. typedef HMHelpContentRec * HMHelpContentPtr;
  220. /*------------------------------------------------------------------------------------------*/
  221. /* Callback procs */
  222. /*------------------------------------------------------------------------------------------ */
  223. typedef CALLBACK_API( OSStatus , HMControlContentProcPtr )(ControlRef inControl, Point inGlobalMouse, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
  224. typedef CALLBACK_API( OSStatus , HMWindowContentProcPtr )(WindowRef inWindow, Point inGlobalMouse, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
  225. typedef CALLBACK_API( OSStatus , HMMenuTitleContentProcPtr )(MenuRef inMenu, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
  226. typedef CALLBACK_API( OSStatus , HMMenuItemContentProcPtr )(const MenuTrackingData *inTrackingData, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
  227. typedef STACK_UPP_TYPE(HMControlContentProcPtr) HMControlContentUPP;
  228. typedef STACK_UPP_TYPE(HMWindowContentProcPtr) HMWindowContentUPP;
  229. typedef STACK_UPP_TYPE(HMMenuTitleContentProcPtr) HMMenuTitleContentUPP;
  230. typedef STACK_UPP_TYPE(HMMenuItemContentProcPtr) HMMenuItemContentUPP;
  231. /*
  232. * NewHMControlContentUPP()
  233. *
  234. * Availability:
  235. * Non-Carbon CFM: available as macro/inline
  236. * CarbonLib: in CarbonLib 1.0 and later
  237. * Mac OS X: in version 10.0 and later
  238. */
  239. EXTERN_API_C( HMControlContentUPP )
  240. NewHMControlContentUPP(HMControlContentProcPtr userRoutine);
  241. #if !OPAQUE_UPP_TYPES
  242. enum { uppHMControlContentProcInfo = 0x0000FBF0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes, 2_bytes, 4_bytes, 4_bytes) */
  243. #ifdef __cplusplus
  244. inline DEFINE_API_C(HMControlContentUPP) NewHMControlContentUPP(HMControlContentProcPtr userRoutine) { return (HMControlContentUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHMControlContentProcInfo, GetCurrentArchitecture()); }
  245. #else
  246. #define NewHMControlContentUPP(userRoutine) (HMControlContentUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHMControlContentProcInfo, GetCurrentArchitecture())
  247. #endif
  248. #endif
  249. /*
  250. * NewHMWindowContentUPP()
  251. *
  252. * Availability:
  253. * Non-Carbon CFM: available as macro/inline
  254. * CarbonLib: in CarbonLib 1.0 and later
  255. * Mac OS X: in version 10.0 and later
  256. */
  257. EXTERN_API_C( HMWindowContentUPP )
  258. NewHMWindowContentUPP(HMWindowContentProcPtr userRoutine);
  259. #if !OPAQUE_UPP_TYPES
  260. enum { uppHMWindowContentProcInfo = 0x0000FBF0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes, 2_bytes, 4_bytes, 4_bytes) */
  261. #ifdef __cplusplus
  262. inline DEFINE_API_C(HMWindowContentUPP) NewHMWindowContentUPP(HMWindowContentProcPtr userRoutine) { return (HMWindowContentUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHMWindowContentProcInfo, GetCurrentArchitecture()); }
  263. #else
  264. #define NewHMWindowContentUPP(userRoutine) (HMWindowContentUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHMWindowContentProcInfo, GetCurrentArchitecture())
  265. #endif
  266. #endif
  267. /*
  268. * NewHMMenuTitleContentUPP()
  269. *
  270. * Availability:
  271. * Non-Carbon CFM: available as macro/inline
  272. * CarbonLib: in CarbonLib 1.0 and later
  273. * Mac OS X: in version 10.0 and later
  274. */
  275. EXTERN_API_C( HMMenuTitleContentUPP )
  276. NewHMMenuTitleContentUPP(HMMenuTitleContentProcPtr userRoutine);
  277. #if !OPAQUE_UPP_TYPES
  278. enum { uppHMMenuTitleContentProcInfo = 0x00003EF0 }; /* pascal 4_bytes Func(4_bytes, 2_bytes, 4_bytes, 4_bytes) */
  279. #ifdef __cplusplus
  280. inline DEFINE_API_C(HMMenuTitleContentUPP) NewHMMenuTitleContentUPP(HMMenuTitleContentProcPtr userRoutine) { return (HMMenuTitleContentUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHMMenuTitleContentProcInfo, GetCurrentArchitecture()); }
  281. #else
  282. #define NewHMMenuTitleContentUPP(userRoutine) (HMMenuTitleContentUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHMMenuTitleContentProcInfo, GetCurrentArchitecture())
  283. #endif
  284. #endif
  285. /*
  286. * NewHMMenuItemContentUPP()
  287. *
  288. * Availability:
  289. * Non-Carbon CFM: available as macro/inline
  290. * CarbonLib: in CarbonLib 1.0 and later
  291. * Mac OS X: in version 10.0 and later
  292. */
  293. EXTERN_API_C( HMMenuItemContentUPP )
  294. NewHMMenuItemContentUPP(HMMenuItemContentProcPtr userRoutine);
  295. #if !OPAQUE_UPP_TYPES
  296. enum { uppHMMenuItemContentProcInfo = 0x00003EF0 }; /* pascal 4_bytes Func(4_bytes, 2_bytes, 4_bytes, 4_bytes) */
  297. #ifdef __cplusplus
  298. inline DEFINE_API_C(HMMenuItemContentUPP) NewHMMenuItemContentUPP(HMMenuItemContentProcPtr userRoutine) { return (HMMenuItemContentUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHMMenuItemContentProcInfo, GetCurrentArchitecture()); }
  299. #else
  300. #define NewHMMenuItemContentUPP(userRoutine) (HMMenuItemContentUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHMMenuItemContentProcInfo, GetCurrentArchitecture())
  301. #endif
  302. #endif
  303. /*
  304. * DisposeHMControlContentUPP()
  305. *
  306. * Availability:
  307. * Non-Carbon CFM: available as macro/inline
  308. * CarbonLib: in CarbonLib 1.0 and later
  309. * Mac OS X: in version 10.0 and later
  310. */
  311. EXTERN_API_C( void )
  312. DisposeHMControlContentUPP(HMControlContentUPP userUPP);
  313. #if !OPAQUE_UPP_TYPES
  314. #ifdef __cplusplus
  315. inline DEFINE_API_C(void) DisposeHMControlContentUPP(HMControlContentUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  316. #else
  317. #define DisposeHMControlContentUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  318. #endif
  319. #endif
  320. /*
  321. * DisposeHMWindowContentUPP()
  322. *
  323. * Availability:
  324. * Non-Carbon CFM: available as macro/inline
  325. * CarbonLib: in CarbonLib 1.0 and later
  326. * Mac OS X: in version 10.0 and later
  327. */
  328. EXTERN_API_C( void )
  329. DisposeHMWindowContentUPP(HMWindowContentUPP userUPP);
  330. #if !OPAQUE_UPP_TYPES
  331. #ifdef __cplusplus
  332. inline DEFINE_API_C(void) DisposeHMWindowContentUPP(HMWindowContentUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  333. #else
  334. #define DisposeHMWindowContentUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  335. #endif
  336. #endif
  337. /*
  338. * DisposeHMMenuTitleContentUPP()
  339. *
  340. * Availability:
  341. * Non-Carbon CFM: available as macro/inline
  342. * CarbonLib: in CarbonLib 1.0 and later
  343. * Mac OS X: in version 10.0 and later
  344. */
  345. EXTERN_API_C( void )
  346. DisposeHMMenuTitleContentUPP(HMMenuTitleContentUPP userUPP);
  347. #if !OPAQUE_UPP_TYPES
  348. #ifdef __cplusplus
  349. inline DEFINE_API_C(void) DisposeHMMenuTitleContentUPP(HMMenuTitleContentUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  350. #else
  351. #define DisposeHMMenuTitleContentUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  352. #endif
  353. #endif
  354. /*
  355. * DisposeHMMenuItemContentUPP()
  356. *
  357. * Availability:
  358. * Non-Carbon CFM: available as macro/inline
  359. * CarbonLib: in CarbonLib 1.0 and later
  360. * Mac OS X: in version 10.0 and later
  361. */
  362. EXTERN_API_C( void )
  363. DisposeHMMenuItemContentUPP(HMMenuItemContentUPP userUPP);
  364. #if !OPAQUE_UPP_TYPES
  365. #ifdef __cplusplus
  366. inline DEFINE_API_C(void) DisposeHMMenuItemContentUPP(HMMenuItemContentUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  367. #else
  368. #define DisposeHMMenuItemContentUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  369. #endif
  370. #endif
  371. /*
  372. * InvokeHMControlContentUPP()
  373. *
  374. * Availability:
  375. * Non-Carbon CFM: available as macro/inline
  376. * CarbonLib: in CarbonLib 1.0 and later
  377. * Mac OS X: in version 10.0 and later
  378. */
  379. EXTERN_API_C( OSStatus )
  380. InvokeHMControlContentUPP(
  381. ControlRef inControl,
  382. Point inGlobalMouse,
  383. HMContentRequest inRequest,
  384. HMContentProvidedType * outContentProvided,
  385. HMHelpContentPtr ioHelpContent,
  386. HMControlContentUPP userUPP);
  387. #if !OPAQUE_UPP_TYPES
  388. #ifdef __cplusplus
  389. inline DEFINE_API_C(OSStatus) InvokeHMControlContentUPP(ControlRef inControl, Point inGlobalMouse, HMContentRequest inRequest, HMContentProvidedType * outContentProvided, HMHelpContentPtr ioHelpContent, HMControlContentUPP userUPP) { return (OSStatus)CALL_FIVE_PARAMETER_UPP(userUPP, uppHMControlContentProcInfo, inControl, inGlobalMouse, inRequest, outContentProvided, ioHelpContent); }
  390. #else
  391. #define InvokeHMControlContentUPP(inControl, inGlobalMouse, inRequest, outContentProvided, ioHelpContent, userUPP) (OSStatus)CALL_FIVE_PARAMETER_UPP((userUPP), uppHMControlContentProcInfo, (inControl), (inGlobalMouse), (inRequest), (outContentProvided), (ioHelpContent))
  392. #endif
  393. #endif
  394. /*
  395. * InvokeHMWindowContentUPP()
  396. *
  397. * Availability:
  398. * Non-Carbon CFM: available as macro/inline
  399. * CarbonLib: in CarbonLib 1.0 and later
  400. * Mac OS X: in version 10.0 and later
  401. */
  402. EXTERN_API_C( OSStatus )
  403. InvokeHMWindowContentUPP(
  404. WindowRef inWindow,
  405. Point inGlobalMouse,
  406. HMContentRequest inRequest,
  407. HMContentProvidedType * outContentProvided,
  408. HMHelpContentPtr ioHelpContent,
  409. HMWindowContentUPP userUPP);
  410. #if !OPAQUE_UPP_TYPES
  411. #ifdef __cplusplus
  412. inline DEFINE_API_C(OSStatus) InvokeHMWindowContentUPP(WindowRef inWindow, Point inGlobalMouse, HMContentRequest inRequest, HMContentProvidedType * outContentProvided, HMHelpContentPtr ioHelpContent, HMWindowContentUPP userUPP) { return (OSStatus)CALL_FIVE_PARAMETER_UPP(userUPP, uppHMWindowContentProcInfo, inWindow, inGlobalMouse, inRequest, outContentProvided, ioHelpContent); }
  413. #else
  414. #define InvokeHMWindowContentUPP(inWindow, inGlobalMouse, inRequest, outContentProvided, ioHelpContent, userUPP) (OSStatus)CALL_FIVE_PARAMETER_UPP((userUPP), uppHMWindowContentProcInfo, (inWindow), (inGlobalMouse), (inRequest), (outContentProvided), (ioHelpContent))
  415. #endif
  416. #endif
  417. /*
  418. * InvokeHMMenuTitleContentUPP()
  419. *
  420. * Availability:
  421. * Non-Carbon CFM: available as macro/inline
  422. * CarbonLib: in CarbonLib 1.0 and later
  423. * Mac OS X: in version 10.0 and later
  424. */
  425. EXTERN_API_C( OSStatus )
  426. InvokeHMMenuTitleContentUPP(
  427. MenuRef inMenu,
  428. HMContentRequest inRequest,
  429. HMContentProvidedType * outContentProvided,
  430. HMHelpContentPtr ioHelpContent,
  431. HMMenuTitleContentUPP userUPP);
  432. #if !OPAQUE_UPP_TYPES
  433. #ifdef __cplusplus
  434. inline DEFINE_API_C(OSStatus) InvokeHMMenuTitleContentUPP(MenuRef inMenu, HMContentRequest inRequest, HMContentProvidedType * outContentProvided, HMHelpContentPtr ioHelpContent, HMMenuTitleContentUPP userUPP) { return (OSStatus)CALL_FOUR_PARAMETER_UPP(userUPP, uppHMMenuTitleContentProcInfo, inMenu, inRequest, outContentProvided, ioHelpContent); }
  435. #else
  436. #define InvokeHMMenuTitleContentUPP(inMenu, inRequest, outContentProvided, ioHelpContent, userUPP) (OSStatus)CALL_FOUR_PARAMETER_UPP((userUPP), uppHMMenuTitleContentProcInfo, (inMenu), (inRequest), (outContentProvided), (ioHelpContent))
  437. #endif
  438. #endif
  439. /*
  440. * InvokeHMMenuItemContentUPP()
  441. *
  442. * Availability:
  443. * Non-Carbon CFM: available as macro/inline
  444. * CarbonLib: in CarbonLib 1.0 and later
  445. * Mac OS X: in version 10.0 and later
  446. */
  447. EXTERN_API_C( OSStatus )
  448. InvokeHMMenuItemContentUPP(
  449. const MenuTrackingData * inTrackingData,
  450. HMContentRequest inRequest,
  451. HMContentProvidedType * outContentProvided,
  452. HMHelpContentPtr ioHelpContent,
  453. HMMenuItemContentUPP userUPP);
  454. #if !OPAQUE_UPP_TYPES
  455. #ifdef __cplusplus
  456. inline DEFINE_API_C(OSStatus) InvokeHMMenuItemContentUPP(const MenuTrackingData * inTrackingData, HMContentRequest inRequest, HMContentProvidedType * outContentProvided, HMHelpContentPtr ioHelpContent, HMMenuItemContentUPP userUPP) { return (OSStatus)CALL_FOUR_PARAMETER_UPP(userUPP, uppHMMenuItemContentProcInfo, inTrackingData, inRequest, outContentProvided, ioHelpContent); }
  457. #else
  458. #define InvokeHMMenuItemContentUPP(inTrackingData, inRequest, outContentProvided, ioHelpContent, userUPP) (OSStatus)CALL_FOUR_PARAMETER_UPP((userUPP), uppHMMenuItemContentProcInfo, (inTrackingData), (inRequest), (outContentProvided), (ioHelpContent))
  459. #endif
  460. #endif
  461. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  462. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  463. #define NewHMControlContentProc(userRoutine) NewHMControlContentUPP(userRoutine)
  464. #define NewHMWindowContentProc(userRoutine) NewHMWindowContentUPP(userRoutine)
  465. #define NewHMMenuTitleContentProc(userRoutine) NewHMMenuTitleContentUPP(userRoutine)
  466. #define NewHMMenuItemContentProc(userRoutine) NewHMMenuItemContentUPP(userRoutine)
  467. #define CallHMControlContentProc(userRoutine, inControl, inGlobalMouse, inRequest, outContentProvided, ioHelpContent) InvokeHMControlContentUPP(inControl, inGlobalMouse, inRequest, outContentProvided, ioHelpContent, userRoutine)
  468. #define CallHMWindowContentProc(userRoutine, inWindow, inGlobalMouse, inRequest, outContentProvided, ioHelpContent) InvokeHMWindowContentUPP(inWindow, inGlobalMouse, inRequest, outContentProvided, ioHelpContent, userRoutine)
  469. #define CallHMMenuTitleContentProc(userRoutine, inMenu, inRequest, outContentProvided, ioHelpContent) InvokeHMMenuTitleContentUPP(inMenu, inRequest, outContentProvided, ioHelpContent, userRoutine)
  470. #define CallHMMenuItemContentProc(userRoutine, inTrackingData, inRequest, outContentProvided, ioHelpContent) InvokeHMMenuItemContentUPP(inTrackingData, inRequest, outContentProvided, ioHelpContent, userRoutine)
  471. #endif /* CALL_NOT_IN_CARBON */
  472. /*------------------------------------------------------------------------------------------*/
  473. /* API */
  474. /*------------------------------------------------------------------------------------------*/
  475. /* Help Menu */
  476. /*
  477. * HMGetHelpMenu()
  478. *
  479. * Summary:
  480. * Returns a menu to which applications may add their own help items.
  481. *
  482. * Parameters:
  483. *
  484. * outHelpMenu:
  485. * On exit, contains the help menu.
  486. *
  487. * outFirstCustomItemIndex:
  488. * On exit, contains the menu item index that will be used by the
  489. * first item added by the application. This parameter may be NULL.
  490. *
  491. * Availability:
  492. * Non-Carbon CFM: not available
  493. * CarbonLib: in CarbonLib 1.1 and later
  494. * Mac OS X: in version 10.0 and later
  495. */
  496. EXTERN_API( OSStatus )
  497. HMGetHelpMenu(
  498. MenuRef * outHelpMenu,
  499. MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
  500. /* Installing/Retrieving Content */
  501. /* Menu title and item help tags are not yet supported by Carbon or CarbonLib. */
  502. /* They will be fully supported in a future release. */
  503. /*
  504. * HMSetControlHelpContent()
  505. *
  506. * Availability:
  507. * Non-Carbon CFM: not available
  508. * CarbonLib: in CarbonLib 1.0 and later
  509. * Mac OS X: in version 10.0 and later
  510. */
  511. EXTERN_API( OSStatus )
  512. HMSetControlHelpContent(
  513. ControlRef inControl,
  514. const HMHelpContentRec * inContent);
  515. /*
  516. * HMGetControlHelpContent()
  517. *
  518. * Availability:
  519. * Non-Carbon CFM: not available
  520. * CarbonLib: in CarbonLib 1.0 and later
  521. * Mac OS X: in version 10.0 and later
  522. */
  523. EXTERN_API( OSStatus )
  524. HMGetControlHelpContent(
  525. ControlRef inControl,
  526. HMHelpContentRec * outContent);
  527. /*
  528. * HMSetWindowHelpContent()
  529. *
  530. * Availability:
  531. * Non-Carbon CFM: not available
  532. * CarbonLib: in CarbonLib 1.0 and later
  533. * Mac OS X: in version 10.0 and later
  534. */
  535. EXTERN_API( OSStatus )
  536. HMSetWindowHelpContent(
  537. WindowRef inWindow,
  538. const HMHelpContentRec * inContent);
  539. /*
  540. * HMGetWindowHelpContent()
  541. *
  542. * Availability:
  543. * Non-Carbon CFM: not available
  544. * CarbonLib: in CarbonLib 1.0 and later
  545. * Mac OS X: in version 10.0 and later
  546. */
  547. EXTERN_API( OSStatus )
  548. HMGetWindowHelpContent(
  549. WindowRef inWindow,
  550. HMHelpContentRec * outContent);
  551. /*
  552. * HMSetMenuItemHelpContent()
  553. *
  554. * Availability:
  555. * Non-Carbon CFM: not available
  556. * CarbonLib: in CarbonLib 1.0 and later
  557. * Mac OS X: in version 10.0 and later
  558. */
  559. EXTERN_API( OSStatus )
  560. HMSetMenuItemHelpContent(
  561. MenuRef inMenu,
  562. MenuItemIndex inItem,
  563. const HMHelpContentRec * inContent);
  564. /*
  565. * HMGetMenuItemHelpContent()
  566. *
  567. * Availability:
  568. * Non-Carbon CFM: not available
  569. * CarbonLib: in CarbonLib 1.0 and later
  570. * Mac OS X: in version 10.0 and later
  571. */
  572. EXTERN_API( OSStatus )
  573. HMGetMenuItemHelpContent(
  574. MenuRef inMenu,
  575. MenuItemIndex inItem,
  576. HMHelpContentRec * outContent);
  577. /* Installing/Retrieving Content Callbacks */
  578. /*
  579. * HMInstallControlContentCallback()
  580. *
  581. * Availability:
  582. * Non-Carbon CFM: not available
  583. * CarbonLib: in CarbonLib 1.0 and later
  584. * Mac OS X: in version 10.0 and later
  585. */
  586. EXTERN_API( OSStatus )
  587. HMInstallControlContentCallback(
  588. ControlRef inControl,
  589. HMControlContentUPP inContentUPP);
  590. /*
  591. * HMInstallWindowContentCallback()
  592. *
  593. * Availability:
  594. * Non-Carbon CFM: not available
  595. * CarbonLib: in CarbonLib 1.0 and later
  596. * Mac OS X: in version 10.0 and later
  597. */
  598. EXTERN_API( OSStatus )
  599. HMInstallWindowContentCallback(
  600. WindowRef inWindow,
  601. HMWindowContentUPP inContentUPP);
  602. /*
  603. * HMInstallMenuTitleContentCallback()
  604. *
  605. * Availability:
  606. * Non-Carbon CFM: not available
  607. * CarbonLib: in CarbonLib 1.0 and later
  608. * Mac OS X: in version 10.0 and later
  609. */
  610. EXTERN_API( OSStatus )
  611. HMInstallMenuTitleContentCallback(
  612. MenuRef inMenu,
  613. HMMenuTitleContentUPP inContentUPP);
  614. /*
  615. * HMInstallMenuItemContentCallback()
  616. *
  617. * Availability:
  618. * Non-Carbon CFM: not available
  619. * CarbonLib: in CarbonLib 1.0 and later
  620. * Mac OS X: in version 10.0 and later
  621. */
  622. EXTERN_API( OSStatus )
  623. HMInstallMenuItemContentCallback(
  624. MenuRef inMenu,
  625. HMMenuItemContentUPP inContentUPP);
  626. /*
  627. * HMGetControlContentCallback()
  628. *
  629. * Availability:
  630. * Non-Carbon CFM: not available
  631. * CarbonLib: in CarbonLib 1.0 and later
  632. * Mac OS X: in version 10.0 and later
  633. */
  634. EXTERN_API( OSStatus )
  635. HMGetControlContentCallback(
  636. ControlRef inControl,
  637. HMControlContentUPP * outContentUPP);
  638. /*
  639. * HMGetWindowContentCallback()
  640. *
  641. * Availability:
  642. * Non-Carbon CFM: not available
  643. * CarbonLib: in CarbonLib 1.0 and later
  644. * Mac OS X: in version 10.0 and later
  645. */
  646. EXTERN_API( OSStatus )
  647. HMGetWindowContentCallback(
  648. WindowRef inWindow,
  649. HMWindowContentUPP * outContentUPP);
  650. /*
  651. * HMGetMenuTitleContentCallback()
  652. *
  653. * Availability:
  654. * Non-Carbon CFM: not available
  655. * CarbonLib: in CarbonLib 1.0 and later
  656. * Mac OS X: in version 10.0 and later
  657. */
  658. EXTERN_API( OSStatus )
  659. HMGetMenuTitleContentCallback(
  660. MenuRef inMenu,
  661. HMMenuTitleContentUPP * outContentUPP);
  662. /*
  663. * HMGetMenuItemContentCallback()
  664. *
  665. * Availability:
  666. * Non-Carbon CFM: not available
  667. * CarbonLib: in CarbonLib 1.0 and later
  668. * Mac OS X: in version 10.0 and later
  669. */
  670. EXTERN_API( OSStatus )
  671. HMGetMenuItemContentCallback(
  672. MenuRef inMenu,
  673. HMMenuItemContentUPP * outContentUPP);
  674. /* Enabling and Disabling Help Tags */
  675. /*
  676. * HMAreHelpTagsDisplayed()
  677. *
  678. * Availability:
  679. * Non-Carbon CFM: not available
  680. * CarbonLib: in CarbonLib 1.0 and later
  681. * Mac OS X: in version 10.0 and later
  682. */
  683. EXTERN_API( Boolean )
  684. HMAreHelpTagsDisplayed(void);
  685. /*
  686. * HMSetHelpTagsDisplayed()
  687. *
  688. * Availability:
  689. * Non-Carbon CFM: not available
  690. * CarbonLib: in CarbonLib 1.0 and later
  691. * Mac OS X: in version 10.0 and later
  692. */
  693. EXTERN_API( OSStatus )
  694. HMSetHelpTagsDisplayed(Boolean inDisplayTags);
  695. /*
  696. * HMSetTagDelay()
  697. *
  698. * Availability:
  699. * Non-Carbon CFM: not available
  700. * CarbonLib: in CarbonLib 1.0 and later
  701. * Mac OS X: in version 10.0 and later
  702. */
  703. EXTERN_API( OSStatus )
  704. HMSetTagDelay(Duration inDelay);
  705. /*
  706. * HMGetTagDelay()
  707. *
  708. * Availability:
  709. * Non-Carbon CFM: not available
  710. * CarbonLib: in CarbonLib 1.0 and later
  711. * Mac OS X: in version 10.0 and later
  712. */
  713. EXTERN_API( OSStatus )
  714. HMGetTagDelay(Duration * outDelay);
  715. /* Compatibility */
  716. /*
  717. * HMSetMenuHelpFromBalloonRsrc()
  718. *
  719. * Availability:
  720. * Non-Carbon CFM: not available
  721. * CarbonLib: in CarbonLib 1.0 and later
  722. * Mac OS X: in version 10.0 and later
  723. */
  724. EXTERN_API( OSStatus )
  725. HMSetMenuHelpFromBalloonRsrc(
  726. MenuRef inMenu,
  727. SInt16 inHmnuRsrcID);
  728. /*
  729. * HMSetDialogHelpFromBalloonRsrc()
  730. *
  731. * Availability:
  732. * Non-Carbon CFM: not available
  733. * CarbonLib: in CarbonLib 1.0 and later
  734. * Mac OS X: in version 10.0 and later
  735. */
  736. EXTERN_API( OSStatus )
  737. HMSetDialogHelpFromBalloonRsrc(
  738. DialogRef inDialog,
  739. SInt16 inHdlgRsrcID,
  740. SInt16 inItemStart);
  741. /* Displaying tags */
  742. /*
  743. * HMDisplayTag()
  744. *
  745. * Summary:
  746. * Displays a help tag at a user defined location.
  747. *
  748. * Parameters:
  749. *
  750. * inContent:
  751. * HMHelpContentRec describing the help tag to be displayed.
  752. *
  753. * Result:
  754. * An OSStatus code indicating success or failure.
  755. *
  756. * Availability:
  757. * Non-Carbon CFM: not available
  758. * CarbonLib: in CarbonLib 1.2 and later
  759. * Mac OS X: in version 10.0 and later
  760. */
  761. EXTERN_API( OSStatus )
  762. HMDisplayTag(const HMHelpContentRec * inContent);
  763. /*
  764. * HMHideTag()
  765. *
  766. * Summary:
  767. * HMHideTag hides the currently visible help tag. If there is no
  768. * current help tag, this call does nothing.
  769. *
  770. * Result:
  771. * An OSStatus code indicating success or failure.
  772. *
  773. * Availability:
  774. * Non-Carbon CFM: not available
  775. * CarbonLib: in CarbonLib 1.2 and later
  776. * Mac OS X: in version 10.1 and later
  777. */
  778. EXTERN_API( OSStatus )
  779. HMHideTag(void);
  780. #if PRAGMA_STRUCT_ALIGN
  781. #pragma options align=reset
  782. #elif PRAGMA_STRUCT_PACKPUSH
  783. #pragma pack(pop)
  784. #elif PRAGMA_STRUCT_PACK
  785. #pragma pack()
  786. #endif
  787. #ifdef PRAGMA_IMPORT_OFF
  788. #pragma import off
  789. #elif PRAGMA_IMPORT
  790. #pragma import reset
  791. #endif
  792. #ifdef __cplusplus
  793. }
  794. #endif
  795. #endif /* __MACHELP__ */