home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / AppleScript.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  5.8 KB  |  200 lines  |  [TEXT/MMCC]

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