home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / AppleScript.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  5.7 KB  |  197 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        AppleScript.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __APPLESCRIPT__
  18. #define __APPLESCRIPT__
  19.  
  20.  
  21. #ifndef __ERRORS__
  22. #include <Errors.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __APPLEEVENTS__
  27. #include <AppleEvents.h>
  28. #endif
  29. /*    #include <Types.h>                                            */
  30. /*    #include <Memory.h>                                            */
  31. /*        #include <MixedMode.h>                                    */
  32. /*    #include <OSUtils.h>                                        */
  33. /*    #include <Events.h>                                            */
  34. /*        #include <Quickdraw.h>                                    */
  35. /*            #include <QuickdrawText.h>                            */
  36. /*    #include <EPPC.h>                                            */
  37. /*        #include <PPCToolbox.h>                                    */
  38. /*            #include <AppleTalk.h>                                */
  39. /*        #include <Processes.h>                                    */
  40. /*            #include <Files.h>                                    */
  41. /*    #include <Notification.h>                                    */
  42.  
  43. #ifndef __OSA__
  44. #include <OSA.h>
  45. #endif
  46. /*    #include <AEObjects.h>                                        */
  47. /*    #include <Components.h>                                        */
  48.  
  49. #ifndef __TEXTEDIT__
  50. #include <TextEdit.h>
  51. #endif
  52.  
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif
  56.  
  57. #if GENERATINGPOWERPC
  58. #pragma options align=mac68k
  59. #endif
  60.  
  61. #ifdef __CFM68K__
  62. #pragma lib_export on
  63. #endif
  64.  
  65.  
  66. enum {
  67.     typeAppleScript                = 'ascr',
  68.     kAppleScriptSubtype            = typeAppleScript,
  69.     typeASStorage                = typeAppleScript
  70. };
  71.  
  72. /**************************************************************************
  73.     Component Selectors
  74. **************************************************************************/
  75. enum {
  76.     kASSelectInit                = 0x1001,
  77.     kASSelectSetSourceStyles    = 0x1002,
  78.     kASSelectGetSourceStyles    = 0x1003,
  79.     kASSelectGetSourceStyleNames = 0x1004
  80. };
  81.  
  82. /**************************************************************************
  83.     OSAGetScriptInfo Selectors
  84. **************************************************************************/
  85. enum {
  86.     kASHasOpenHandler            = 'hsod'
  87. };
  88.  
  89. /*
  90.         This selector is used to query a context as to whether it contains
  91.         a handler for the kAEOpenDocuments event. This allows "applets" to be 
  92.         distinguished from "droplets."  OSAGetScriptInfo returns false if
  93.         there is no kAEOpenDocuments handler, and returns the error value 
  94.         errOSAInvalidAccess if the input is not a context.
  95.     */
  96. /**************************************************************************
  97.     Initialization
  98. **************************************************************************/
  99. extern pascal OSAError ASInit(ComponentInstance scriptingComponent, long modeFlags, long minStackSize, long preferredStackSize, long maxStackSize, long minHeapSize, long preferredHeapSize, long maxHeapSize)
  100.  FIVEWORDINLINE(0x2F3C, 0x1C, 0x1001, 0x7000, 0xA82A);
  101. /*
  102.         ComponentCallNow(kASSelectInit, 28);
  103.         This call can be used to explicitly initialize AppleScript.  If it is
  104.         not called, the a scripting size resource is looked for and used. If
  105.         there is no scripting size resource, then the constants listed below
  106.         are used.  If at any stage (the init call, the size resource, the 
  107.         defaults) any of these parameters are zero, then parameters from the
  108.         next stage are used.  ModeFlags are not currently used.
  109.         Errors:
  110.         errOSASystemError        initialization failed
  111.     */
  112. /*
  113.     These values will be used if ASInit is not called explicitly, or if any
  114.     of ASInit's parameters are zero:
  115. */
  116.  
  117. enum {
  118.     kASDefaultMinStackSize        = 4 * 1024,
  119.     kASDefaultPreferredStackSize = 16 * 1024,
  120.     kASDefaultMaxStackSize        = 16 * 1024,
  121.     kASDefaultMinHeapSize        = 4 * 1024,
  122.     kASDefaultPreferredHeapSize    = 16 * 1024,
  123.     kASDefaultMaxHeapSize        = 32L * 1024 * 1024
  124. };
  125.  
  126. /**************************************************************************
  127.     Source Styles
  128. **************************************************************************/
  129. extern pascal OSAError ASSetSourceStyles(ComponentInstance scriptingComponent, STHandle sourceStyles)
  130.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1002, 0x7000, 0xA82A);
  131. /*
  132.         ComponentCallNow(kASSelectSetSourceStyles, 4);
  133.         Errors:
  134.         errOSASystemError        operation failed
  135.     */
  136. extern pascal OSAError ASGetSourceStyles(ComponentInstance scriptingComponent, STHandle *resultingSourceStyles)
  137.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1003, 0x7000, 0xA82A);
  138. /*
  139.         ComponentCallNow(kASSelectGetSourceStyles, 4);
  140.         Errors:
  141.         errOSASystemError        operation failed
  142.     */
  143. extern pascal OSAError ASGetSourceStyleNames(ComponentInstance scriptingComponent, long modeFlags, AEDescList *resultingSourceStyleNamesList)
  144.  FIVEWORDINLINE(0x2F3C, 0x8, 0x1004, 0x7000, 0xA82A);
  145. /*
  146.         ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  147.         This call returns an AEList of styled text descriptors the names of the
  148.         source styles in the current dialect.  The order of the names corresponds
  149.         to the order of the source style constants, below.  The style of each
  150.         name is the same as the styles returned by ASGetSourceStyles.
  151.         
  152.         Errors:
  153.         errOSASystemError        operation failed
  154.     */
  155. /*
  156.     Elements of STHandle correspond to following categories of tokens, and
  157.     accessed through following index constants:
  158. */
  159.  
  160. enum {
  161.     kASSourceStyleUncompiledText = 0,
  162.     kASSourceStyleNormalText    = 1,
  163.     kASSourceStyleLanguageKeyword = 2,
  164.     kASSourceStyleApplicationKeyword = 3,
  165.     kASSourceStyleComment        = 4,
  166.     kASSourceStyleLiteral        = 5,
  167.     kASSourceStyleUserSymbol    = 6,
  168.     kASSourceStyleObjectSpecifier = 7,
  169.     kASNumberOfSourceStyles        = 8
  170. };
  171.  
  172. /* Gestalt selectors for AppleScript */
  173. enum {
  174.     gestaltAppleScriptAttr        = 'ascr',
  175.     gestaltAppleScriptVersion    = 'ascv'
  176. };
  177.  
  178. enum {
  179.     gestaltAppleScriptPresent    = 0,
  180.     gestaltAppleScriptPowerPCSupport = 1
  181. };
  182.  
  183.  
  184. #ifdef __CFM68K__
  185. #pragma lib_export off
  186. #endif
  187.  
  188. #if GENERATINGPOWERPC
  189. #pragma options align=reset
  190. #endif
  191.  
  192. #ifdef __cplusplus
  193. }
  194. #endif
  195.  
  196. #endif /* __APPLESCRIPT__ */
  197.