AppleScript.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:7k
源码类别:

多媒体编程

开发平台:

Visual C++

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