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.

250 lines
7.4 KiB

  1. /*
  2. File: AppleEvents.h
  3. Contains: AppleEvent Package Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1989-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 __APPLEEVENTS__
  11. #define __APPLEEVENTS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __MIXEDMODE__
  16. #include <MixedMode.h>
  17. #endif
  18. /*
  19. Note: The functions and types for the building and parsing AppleEvent
  20. messages has moved to AEDataModel.h
  21. */
  22. #ifndef __AEDATAMODEL__
  23. #include <AEDataModel.h>
  24. #endif
  25. /*Note: The functions for interacting with events has moved to AEInteraction.h*/
  26. #if PRAGMA_ONCE
  27. #pragma once
  28. #endif
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. #if PRAGMA_IMPORT
  33. #pragma import on
  34. #endif
  35. enum {
  36. /* Keywords for Apple event parameters */
  37. keyDirectObject = FOUR_CHAR_CODE('----'),
  38. keyErrorNumber = FOUR_CHAR_CODE('errn'),
  39. keyErrorString = FOUR_CHAR_CODE('errs'),
  40. keyProcessSerialNumber = FOUR_CHAR_CODE('psn '), /* Keywords for special handlers */
  41. keyPreDispatch = FOUR_CHAR_CODE('phac'), /* preHandler accessor call */
  42. keySelectProc = FOUR_CHAR_CODE('selh'), /* more selector call */
  43. /* Keyword for recording */
  44. keyAERecorderCount = FOUR_CHAR_CODE('recr'), /* available only in vers 1.0.1 and greater */
  45. /* Keyword for version information */
  46. keyAEVersion = FOUR_CHAR_CODE('vers') /* available only in vers 1.0.1 and greater */
  47. };
  48. /* Event Class */
  49. enum {
  50. kCoreEventClass = FOUR_CHAR_CODE('aevt')
  51. };
  52. /* Event ID's */
  53. enum {
  54. kAEOpenApplication = FOUR_CHAR_CODE('oapp'),
  55. kAEOpenDocuments = FOUR_CHAR_CODE('odoc'),
  56. kAEPrintDocuments = FOUR_CHAR_CODE('pdoc'),
  57. kAEQuitApplication = FOUR_CHAR_CODE('quit'),
  58. kAEAnswer = FOUR_CHAR_CODE('ansr'),
  59. kAEApplicationDied = FOUR_CHAR_CODE('obit'),
  60. kAEShowPreferences = FOUR_CHAR_CODE('pref') /* sent by Mac OS X when the user chooses the Preferences item */
  61. };
  62. /* Constants for recording */
  63. enum {
  64. kAEStartRecording = FOUR_CHAR_CODE('reca'), /* available only in vers 1.0.1 and greater */
  65. kAEStopRecording = FOUR_CHAR_CODE('recc'), /* available only in vers 1.0.1 and greater */
  66. kAENotifyStartRecording = FOUR_CHAR_CODE('rec1'), /* available only in vers 1.0.1 and greater */
  67. kAENotifyStopRecording = FOUR_CHAR_CODE('rec0'), /* available only in vers 1.0.1 and greater */
  68. kAENotifyRecording = FOUR_CHAR_CODE('recr') /* available only in vers 1.0.1 and greater */
  69. };
  70. /*
  71. * AEEventSource is defined as an SInt8 for compatability with pascal.
  72. * Important note: keyEventSourceAttr is returned by AttributePtr as a typeShortInteger.
  73. * Be sure to pass at least two bytes of storage to AEGetAttributePtr - the result can be
  74. * compared directly against the following enums.
  75. */
  76. typedef SInt8 AEEventSource;
  77. enum {
  78. kAEUnknownSource = 0,
  79. kAEDirectCall = 1,
  80. kAESameProcess = 2,
  81. kAELocalProcess = 3,
  82. kAERemoteProcess = 4
  83. };
  84. /**************************************************************************
  85. These calls are used to set up and modify the event dispatch table.
  86. **************************************************************************/
  87. /*
  88. * AEInstallEventHandler()
  89. *
  90. * Availability:
  91. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  92. * CarbonLib: in CarbonLib 1.0 and later
  93. * Mac OS X: in version 10.0 and later
  94. */
  95. EXTERN_API( OSErr )
  96. AEInstallEventHandler(
  97. AEEventClass theAEEventClass,
  98. AEEventID theAEEventID,
  99. AEEventHandlerUPP handler,
  100. long handlerRefcon,
  101. Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x091F, 0xA816);
  102. /*
  103. * AERemoveEventHandler()
  104. *
  105. * Availability:
  106. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  107. * CarbonLib: in CarbonLib 1.0 and later
  108. * Mac OS X: in version 10.0 and later
  109. */
  110. EXTERN_API( OSErr )
  111. AERemoveEventHandler(
  112. AEEventClass theAEEventClass,
  113. AEEventID theAEEventID,
  114. AEEventHandlerUPP handler,
  115. Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0720, 0xA816);
  116. /*
  117. * AEGetEventHandler()
  118. *
  119. * Availability:
  120. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  121. * CarbonLib: in CarbonLib 1.0 and later
  122. * Mac OS X: in version 10.0 and later
  123. */
  124. EXTERN_API( OSErr )
  125. AEGetEventHandler(
  126. AEEventClass theAEEventClass,
  127. AEEventID theAEEventID,
  128. AEEventHandlerUPP * handler,
  129. long * handlerRefcon,
  130. Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0921, 0xA816);
  131. /**************************************************************************
  132. These calls are used to set up and modify special hooks into the
  133. AppleEvent manager.
  134. **************************************************************************/
  135. /*
  136. * AEInstallSpecialHandler()
  137. *
  138. * Availability:
  139. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  140. * CarbonLib: in CarbonLib 1.0 and later
  141. * Mac OS X: in version 10.0 and later
  142. */
  143. EXTERN_API( OSErr )
  144. AEInstallSpecialHandler(
  145. AEKeyword functionClass,
  146. AEEventHandlerUPP handler,
  147. Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0500, 0xA816);
  148. /*
  149. * AERemoveSpecialHandler()
  150. *
  151. * Availability:
  152. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  153. * CarbonLib: in CarbonLib 1.0 and later
  154. * Mac OS X: in version 10.0 and later
  155. */
  156. EXTERN_API( OSErr )
  157. AERemoveSpecialHandler(
  158. AEKeyword functionClass,
  159. AEEventHandlerUPP handler,
  160. Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0501, 0xA816);
  161. /*
  162. * AEGetSpecialHandler()
  163. *
  164. * Availability:
  165. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  166. * CarbonLib: in CarbonLib 1.0 and later
  167. * Mac OS X: in version 10.0 and later
  168. */
  169. EXTERN_API( OSErr )
  170. AEGetSpecialHandler(
  171. AEKeyword functionClass,
  172. AEEventHandlerUPP * handler,
  173. Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x052D, 0xA816);
  174. /**************************************************************************
  175. This call was added in version 1.0.1. If called with the keyword
  176. keyAERecorderCount ('recr'), the number of recorders that are
  177. currently active is returned in 'result'
  178. (available only in vers 1.0.1 and greater).
  179. **************************************************************************/
  180. /*
  181. * AEManagerInfo()
  182. *
  183. * Availability:
  184. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  185. * CarbonLib: in CarbonLib 1.0 and later
  186. * Mac OS X: in version 10.0 and later
  187. */
  188. EXTERN_API( OSErr )
  189. AEManagerInfo(
  190. AEKeyword keyWord,
  191. long * result) THREEWORDINLINE(0x303C, 0x0441, 0xA816);
  192. #ifdef PRAGMA_IMPORT_OFF
  193. #pragma import off
  194. #elif PRAGMA_IMPORT
  195. #pragma import reset
  196. #endif
  197. #ifdef __cplusplus
  198. }
  199. #endif
  200. #endif /* __APPLEEVENTS__ */