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.

243 lines
6.8 KiB

  1. /*
  2. File: AppleScript.h
  3. Contains: AppleScript Specific Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1992-2000 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 __APPLESCRIPT__
  11. #define __APPLESCRIPT__
  12. #ifndef __MACERRORS__
  13. #include <MacErrors.h>
  14. #endif
  15. #ifndef __OSA__
  16. #include <OSA.h>
  17. #endif
  18. #ifndef __TEXTEDIT__
  19. #include <TextEdit.h>
  20. #endif
  21. #if PRAGMA_ONCE
  22. #pragma once
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #if PRAGMA_IMPORT
  28. #pragma import on
  29. #endif
  30. #if PRAGMA_STRUCT_ALIGN
  31. #pragma options align=mac68k
  32. #elif PRAGMA_STRUCT_PACKPUSH
  33. #pragma pack(push, 2)
  34. #elif PRAGMA_STRUCT_PACK
  35. #pragma pack(2)
  36. #endif
  37. /**************************************************************************
  38. Types and Constants
  39. **************************************************************************/
  40. /*
  41. The specific type for the AppleScript instance of the
  42. Open Scripting Architecture type.
  43. */
  44. enum {
  45. typeAppleScript = FOUR_CHAR_CODE('ascr'),
  46. kAppleScriptSubtype = typeAppleScript,
  47. typeASStorage = typeAppleScript
  48. };
  49. /**************************************************************************
  50. Component Selectors
  51. **************************************************************************/
  52. enum {
  53. kASSelectInit = 0x1001,
  54. kASSelectSetSourceStyles = 0x1002,
  55. kASSelectGetSourceStyles = 0x1003,
  56. kASSelectGetSourceStyleNames = 0x1004
  57. };
  58. /**************************************************************************
  59. OSAGetScriptInfo Selectors
  60. **************************************************************************/
  61. enum {
  62. kASHasOpenHandler = FOUR_CHAR_CODE('hsod')
  63. };
  64. /*
  65. This selector is used to query a context as to whether it contains
  66. a handler for the kAEOpenDocuments event. This allows "applets" to be
  67. distinguished from "droplets." OSAGetScriptInfo returns false if
  68. there is no kAEOpenDocuments handler, and returns the error value
  69. errOSAInvalidAccess if the input is not a context.
  70. */
  71. /**************************************************************************
  72. Initialization
  73. **************************************************************************/
  74. /*
  75. * ASInit()
  76. *
  77. * Availability:
  78. * Non-Carbon CFM: in AppleScriptLib 1.1 and later
  79. * CarbonLib: in CarbonLib 1.0 and later
  80. * Mac OS X: in version 10.0 and later
  81. */
  82. EXTERN_API( OSAError )
  83. ASInit(
  84. ComponentInstance scriptingComponent,
  85. long modeFlags,
  86. long minStackSize,
  87. long preferredStackSize,
  88. long maxStackSize,
  89. long minHeapSize,
  90. long preferredHeapSize,
  91. long maxHeapSize) FIVEWORDINLINE(0x2F3C, 0x001C, 0x1001, 0x7000, 0xA82A);
  92. /*
  93. ComponentCallNow(kASSelectInit, 28);
  94. This call can be used to explicitly initialize AppleScript. If it is
  95. not called, the a scripting size resource is looked for and used. If
  96. there is no scripting size resource, then the constants listed below
  97. are used. If at any stage (the init call, the size resource, the
  98. defaults) any of these parameters are zero, then parameters from the
  99. next stage are used. ModeFlags are not currently used.
  100. Errors:
  101. errOSASystemError initialization failed
  102. */
  103. /*
  104. These values will be used if ASInit is not called explicitly, or if any
  105. of ASInit's parameters are zero:
  106. */
  107. enum {
  108. kASDefaultMinStackSize = 4 * 1024,
  109. kASDefaultPreferredStackSize = 16 * 1024,
  110. kASDefaultMaxStackSize = 16 * 1024,
  111. kASDefaultMinHeapSize = 4 * 1024,
  112. kASDefaultPreferredHeapSize = 16 * 1024,
  113. kASDefaultMaxHeapSize = 32L * 1024 * 1024
  114. };
  115. /**************************************************************************
  116. Source Styles
  117. **************************************************************************/
  118. /*
  119. * ASSetSourceStyles()
  120. *
  121. * Availability:
  122. * Non-Carbon CFM: in AppleScriptLib 1.1 and later
  123. * CarbonLib: in CarbonLib 1.0 and later
  124. * Mac OS X: in version 10.0 and later
  125. */
  126. EXTERN_API( OSAError )
  127. ASSetSourceStyles(
  128. ComponentInstance scriptingComponent,
  129. STHandle sourceStyles) FIVEWORDINLINE(0x2F3C, 0x0004, 0x1002, 0x7000, 0xA82A);
  130. /*
  131. ComponentCallNow(kASSelectSetSourceStyles, 4);
  132. Errors:
  133. errOSASystemError operation failed
  134. */
  135. /*
  136. * ASGetSourceStyles()
  137. *
  138. * Availability:
  139. * Non-Carbon CFM: in AppleScriptLib 1.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( OSAError )
  144. ASGetSourceStyles(
  145. ComponentInstance scriptingComponent,
  146. STHandle * resultingSourceStyles) FIVEWORDINLINE(0x2F3C, 0x0004, 0x1003, 0x7000, 0xA82A);
  147. /*
  148. ComponentCallNow(kASSelectGetSourceStyles, 4);
  149. Errors:
  150. errOSASystemError operation failed
  151. */
  152. /*
  153. * ASGetSourceStyleNames()
  154. *
  155. * Availability:
  156. * Non-Carbon CFM: in AppleScriptLib 1.1 and later
  157. * CarbonLib: in CarbonLib 1.0 and later
  158. * Mac OS X: in version 10.0 and later
  159. */
  160. EXTERN_API( OSAError )
  161. ASGetSourceStyleNames(
  162. ComponentInstance scriptingComponent,
  163. long modeFlags,
  164. AEDescList * resultingSourceStyleNamesList) FIVEWORDINLINE(0x2F3C, 0x0008, 0x1004, 0x7000, 0xA82A);
  165. /*
  166. ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  167. This call returns an AEList of styled text descriptors the names of the
  168. source styles in the current dialect. The order of the names corresponds
  169. to the order of the source style constants, below. The style of each
  170. name is the same as the styles returned by ASGetSourceStyles.
  171. Errors:
  172. errOSASystemError operation failed
  173. */
  174. /*
  175. Elements of STHandle correspond to following categories of tokens, and
  176. accessed through following index constants:
  177. */
  178. enum {
  179. kASSourceStyleUncompiledText = 0,
  180. kASSourceStyleNormalText = 1,
  181. kASSourceStyleLanguageKeyword = 2,
  182. kASSourceStyleApplicationKeyword = 3,
  183. kASSourceStyleComment = 4,
  184. kASSourceStyleLiteral = 5,
  185. kASSourceStyleUserSymbol = 6,
  186. kASSourceStyleObjectSpecifier = 7,
  187. kASNumberOfSourceStyles = 8
  188. };
  189. #if PRAGMA_STRUCT_ALIGN
  190. #pragma options align=reset
  191. #elif PRAGMA_STRUCT_PACKPUSH
  192. #pragma pack(pop)
  193. #elif PRAGMA_STRUCT_PACK
  194. #pragma pack()
  195. #endif
  196. #ifdef PRAGMA_IMPORT_OFF
  197. #pragma import off
  198. #elif PRAGMA_IMPORT
  199. #pragma import reset
  200. #endif
  201. #ifdef __cplusplus
  202. }
  203. #endif
  204. #endif /* __APPLESCRIPT__ */