Mac OS 9
OSA.h
Go to the documentation of this file.
1 
19 #ifndef __OSA__
20 #define __OSA__
21 
22 #ifndef __MACERRORS__
23 #include <MacErrors.h>
24 #endif
25 
26 #ifndef __APPLEEVENTS__
27 #include <AppleEvents.h>
28 #endif
29 
30 #ifndef __AEOBJECTS__
31 #include <AEObjects.h>
32 #endif
33 
34 #ifndef __AEINTERACTION__
35 #include <AEInteraction.h>
36 #endif
37 
38 #ifndef __COMPONENTS__
39 #include <Components.h>
40 #endif
41 
42 #ifndef __MACERRORS__
43 #include <MacErrors.h>
44 #endif
45 
46 #if PRAGMA_ONCE
47 #pragma once
48 #endif
49 
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif
54 
55 #if PRAGMA_IMPORT
56 #pragma import on
57 #endif
58 
59 #if PRAGMA_STRUCT_ALIGN
60 #pragma options align = mac68k
61 #elif PRAGMA_STRUCT_PACKPUSH
62 #pragma pack(push, 2)
63 #elif PRAGMA_STRUCT_PACK
64 #pragma pack(2)
65 #endif
66 
67  /***************************************************************************
68  Types and Constants
69  **************************************************************************/
70 
74  enum
75  {
76  kOSAComponentType = FOUR_CHAR_CODE('osa ')
77  };
78 
80  enum
81  {
82  kOSAGenericScriptingComponentSubtype = FOUR_CHAR_CODE('scpt')
83  };
84 
87  enum
88  {
89  kOSAFileType = FOUR_CHAR_CODE('osas')
90  };
91 
97  enum
98  {
99  kOSASuite = FOUR_CHAR_CODE('ascr')
100  };
101 
103  enum
104  {
105  kOSARecordedText = FOUR_CHAR_CODE('recd')
106  };
107 
110  enum
111  {
112  kOSAScriptIsModified = FOUR_CHAR_CODE('modi')
113  };
114 
117  enum
118  {
119  kOSAScriptIsTypeCompiledScript = FOUR_CHAR_CODE('cscr')
120  };
121 
124  enum
125  {
126  kOSAScriptIsTypeScriptValue = FOUR_CHAR_CODE('valu')
127  };
128 
131  enum
132  {
133  kOSAScriptIsTypeScriptContext = FOUR_CHAR_CODE('cntx')
134  };
135 
138  enum
139  {
140  kOSAScriptBestType = FOUR_CHAR_CODE('best')
141  };
142 
149  enum
150  {
151  kOSACanGetSource = FOUR_CHAR_CODE('gsrc')
152  };
153 
154  enum
155  {
156  typeOSADialectInfo = FOUR_CHAR_CODE('difo'),
157  keyOSADialectName = FOUR_CHAR_CODE('dnam'),
158  keyOSADialectCode = FOUR_CHAR_CODE('dcod'),
159  keyOSADialectLangCode = FOUR_CHAR_CODE('dlcd'),
160  keyOSADialectScriptCode = FOUR_CHAR_CODE('dscd')
161  };
162 
163  typedef ComponentResult OSAError;
165  typedef unsigned long OSAID;
170  enum
171  {
172  kOSANullScript = 0L
173  };
174 
176  enum
177  {
178  kOSANullMode = 0,
179  kOSAModeNull = 0
180  };
181 
186  typedef CALLBACK_API(OSErr, OSACreateAppleEventProcPtr)(
187  AEEventClass theAEEventClass, AEEventID theAEEventID,
188  const AEAddressDesc *target, short returnID, long transactionID,
189  AppleEvent *result, long refCon);
190  typedef CALLBACK_API(OSErr,
191  OSASendProcPtr)(const AppleEvent *theAppleEvent,
192  AppleEvent *reply, AESendMode sendMode,
193  AESendPriority sendPriority,
194  long timeOutInTicks, AEIdleUPP idleProc,
195  AEFilterUPP filterProc, long refCon);
196  typedef STACK_UPP_TYPE(OSACreateAppleEventProcPtr) OSACreateAppleEventUPP;
197  typedef STACK_UPP_TYPE(OSASendProcPtr) OSASendUPP;
206  OSACreateAppleEventUPP
207  NewOSACreateAppleEventUPP(OSACreateAppleEventProcPtr userRoutine);
208 #if !OPAQUE_UPP_TYPES
209  enum
210  {
211  uppOSACreateAppleEventProcInfo = 0x000FEFE0
212  };
214 #ifdef __cplusplus
215  inline OSACreateAppleEventUPP
216  NewOSACreateAppleEventUPP(OSACreateAppleEventProcPtr userRoutine)
217  {
218  return (OSACreateAppleEventUPP)NewRoutineDescriptor(
219  (ProcPtr)(userRoutine), uppOSACreateAppleEventProcInfo,
220  GetCurrentArchitecture());
221  }
222 #else
223 #define NewOSACreateAppleEventUPP(userRoutine) \
224  (OSACreateAppleEventUPP) NewRoutineDescriptor( \
225  (ProcPtr)(userRoutine), uppOSACreateAppleEventProcInfo, \
226  GetCurrentArchitecture())
227 #endif
228 #endif
229 
238  OSASendUPP
239  NewOSASendUPP(OSASendProcPtr userRoutine);
240 #if !OPAQUE_UPP_TYPES
241  enum
242  {
243  uppOSASendProcInfo = 0x003FEFE0
244  };
246 #ifdef __cplusplus
247  inline OSASendUPP NewOSASendUPP(OSASendProcPtr userRoutine)
248  {
249  return (OSASendUPP)NewRoutineDescriptor(
250  (ProcPtr)(userRoutine), uppOSASendProcInfo, GetCurrentArchitecture());
251  }
252 #else
253 #define NewOSASendUPP(userRoutine) \
254  (OSASendUPP) NewRoutineDescriptor( \
255  (ProcPtr)(userRoutine), uppOSASendProcInfo, GetCurrentArchitecture())
256 #endif
257 #endif
258 
267  void
268  DisposeOSACreateAppleEventUPP(OSACreateAppleEventUPP userUPP);
269 #if !OPAQUE_UPP_TYPES
270 #ifdef __cplusplus
271  inline void DisposeOSACreateAppleEventUPP(OSACreateAppleEventUPP userUPP)
272  {
273  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
274  }
275 #else
276 #define DisposeOSACreateAppleEventUPP(userUPP) DisposeRoutineDescriptor(userUPP)
277 #endif
278 #endif
279 
288  void
289  DisposeOSASendUPP(OSASendUPP userUPP);
290 #if !OPAQUE_UPP_TYPES
291 #ifdef __cplusplus
292  inline void DisposeOSASendUPP(OSASendUPP userUPP)
293  {
294  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
295  }
296 #else
297 #define DisposeOSASendUPP(userUPP) DisposeRoutineDescriptor(userUPP)
298 #endif
299 #endif
300 
309  OSErr
310  InvokeOSACreateAppleEventUPP(AEEventClass theAEEventClass,
311  AEEventID theAEEventID,
312  const AEAddressDesc *target, short returnID,
313  long transactionID, AppleEvent *result,
314  long refCon, OSACreateAppleEventUPP userUPP);
315 #if !OPAQUE_UPP_TYPES
316 #ifdef __cplusplus
317  inline OSErr InvokeOSACreateAppleEventUPP(AEEventClass theAEEventClass,
318  AEEventID theAEEventID,
319  const AEAddressDesc *target,
320  short returnID, long transactionID,
321  AppleEvent *result, long refCon,
322  OSACreateAppleEventUPP userUPP)
323  {
324  return (OSErr)CALL_SEVEN_PARAMETER_UPP(
325  userUPP, uppOSACreateAppleEventProcInfo, theAEEventClass, theAEEventID,
326  target, returnID, transactionID, result, refCon);
327  }
328 #else
329 #define InvokeOSACreateAppleEventUPP(theAEEventClass, theAEEventID, target, \
330  returnID, transactionID, result, refCon, \
331  userUPP) \
332  (OSErr) CALL_SEVEN_PARAMETER_UPP((userUPP), uppOSACreateAppleEventProcInfo, \
333  (theAEEventClass), (theAEEventID), \
334  (target), (returnID), (transactionID), \
335  (result), (refCon))
336 #endif
337 #endif
338 
347  OSErr
348  InvokeOSASendUPP(const AppleEvent *theAppleEvent, AppleEvent *reply,
349  AESendMode sendMode, AESendPriority sendPriority,
350  long timeOutInTicks, AEIdleUPP idleProc,
351  AEFilterUPP filterProc, long refCon, OSASendUPP userUPP);
352 #if !OPAQUE_UPP_TYPES
353 #ifdef __cplusplus
354  inline OSErr InvokeOSASendUPP(const AppleEvent *theAppleEvent,
355  AppleEvent *reply, AESendMode sendMode,
356  AESendPriority sendPriority, long timeOutInTicks,
357  AEIdleUPP idleProc, AEFilterUPP filterProc,
358  long refCon, OSASendUPP userUPP)
359  {
360  return (OSErr)CALL_EIGHT_PARAMETER_UPP(
361  userUPP, uppOSASendProcInfo, theAppleEvent, reply, sendMode, sendPriority,
362  timeOutInTicks, idleProc, filterProc, refCon);
363  }
364 #else
365 #define InvokeOSASendUPP(theAppleEvent, reply, sendMode, sendPriority, \
366  timeOutInTicks, idleProc, filterProc, refCon, \
367  userUPP) \
368  (OSErr) CALL_EIGHT_PARAMETER_UPP( \
369  (userUPP), uppOSASendProcInfo, (theAppleEvent), (reply), (sendMode), \
370  (sendPriority), (timeOutInTicks), (idleProc), (filterProc), (refCon))
371 #endif
372 #endif
373 
374 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
376 #define NewOSACreateAppleEventProc(userRoutine) \
377  NewOSACreateAppleEventUPP(userRoutine)
378 #define NewOSASendProc(userRoutine) NewOSASendUPP(userRoutine)
379 #define CallOSACreateAppleEventProc(userRoutine, theAEEventClass, \
380  theAEEventID, target, returnID, \
381  transactionID, result, refCon) \
382  InvokeOSACreateAppleEventUPP(theAEEventClass, theAEEventID, target, \
383  returnID, transactionID, result, refCon, \
384  userRoutine)
385 #define CallOSASendProc(userRoutine, theAppleEvent, reply, sendMode, \
386  sendPriority, timeOutInTicks, idleProc, filterProc, \
387  refCon) \
388  InvokeOSASendUPP(theAppleEvent, reply, sendMode, sendPriority, \
389  timeOutInTicks, idleProc, filterProc, refCon, userRoutine)
390 #endif
392  /***************************************************************************
393  OSA Interface Descriptions
394  **************************************************************************
395  The OSA Interface is broken down into a required interface, and several
396  optional interfaces to support additional functionality. A given scripting
397  component may choose to support only some of the optional interfaces in
398  addition to the basic interface. The OSA Component Flags may be used to
399  query the Component Manager to find a scripting component with a particular
400  capability, or determine if a particular scripting component supports a
401  particular capability.
402  **************************************************************************/
404  enum
405  {
406  kOSASupportsCompiling = 0x0002,
407  kOSASupportsGetSource = 0x0004,
408  kOSASupportsAECoercion = 0x0008,
409  kOSASupportsAESending = 0x0010,
410  kOSASupportsRecording = 0x0020,
411  kOSASupportsConvenience = 0x0040,
412  kOSASupportsDialects = 0x0080,
413  kOSASupportsEventHandling = 0x0100
414  };
415 
417  enum
418  {
419  kOSASelectLoad = 0x0001,
420  kOSASelectStore = 0x0002,
421  kOSASelectExecute = 0x0003,
422  kOSASelectDisplay = 0x0004,
423  kOSASelectScriptError = 0x0005,
424  kOSASelectDispose = 0x0006,
425  kOSASelectSetScriptInfo = 0x0007,
426  kOSASelectGetScriptInfo = 0x0008,
427  kOSASelectSetActiveProc = 0x0009,
428  kOSASelectGetActiveProc = 0x000A
429  };
430 
432  enum
433  {
434  kOSASelectScriptingComponentName = 0x0102,
435  kOSASelectCompile = 0x0103,
436  kOSASelectCopyID = 0x0104
437  };
438 
439  enum
440  {
441  kOSASelectCopyScript = 0x0105
442  };
443 
445  enum
446  {
447  kOSASelectGetSource = 0x0201
448  };
449 
451  enum
452  {
453  kOSASelectCoerceFromDesc = 0x0301,
454  kOSASelectCoerceToDesc = 0x0302
455  };
456 
458  enum
459  {
460  kOSASelectSetSendProc = 0x0401,
461  kOSASelectGetSendProc = 0x0402,
462  kOSASelectSetCreateProc = 0x0403,
463  kOSASelectGetCreateProc = 0x0404,
464  kOSASelectSetDefaultTarget = 0x0405
465  };
466 
468  enum
469  {
470  kOSASelectStartRecording = 0x0501,
471  kOSASelectStopRecording = 0x0502
472  };
473 
475  enum
476  {
477  kOSASelectLoadExecute = 0x0601,
478  kOSASelectCompileExecute = 0x0602,
479  kOSASelectDoScript = 0x0603
480  };
481 
483  enum
484  {
485  kOSASelectSetCurrentDialect = 0x0701,
486  kOSASelectGetCurrentDialect = 0x0702,
487  kOSASelectAvailableDialects = 0x0703,
488  kOSASelectGetDialectInfo = 0x0704,
489  kOSASelectAvailableDialectCodeList = 0x0705
490  };
491 
493  enum
494  {
495  kOSASelectSetResumeDispatchProc = 0x0801,
496  kOSASelectGetResumeDispatchProc = 0x0802,
497  kOSASelectExecuteEvent = 0x0803,
498  kOSASelectDoEvent = 0x0804,
499  kOSASelectMakeContext = 0x0805
500  };
501 
503  enum
504  {
505  kOSADebuggerCreateSession = 0x0901,
506  kOSADebuggerGetSessionState = 0x0902,
507  kOSADebuggerSessionStep = 0x0903,
508  kOSADebuggerDisposeSession = 0x0904,
509  kOSADebuggerGetStatementRanges = 0x0905,
510  kOSADebuggerGetBreakpoint = 0x0910,
511  kOSADebuggerSetBreakpoint = 0x0911,
512  kOSADebuggerGetDefaultBreakpoint = 0x0912,
513  kOSADebuggerGetCurrentCallFrame = 0x0906,
514  kOSADebuggerGetCallFrameState = 0x0907,
515  kOSADebuggerGetVariable = 0x0908,
516  kOSADebuggerSetVariable = 0x0909,
517  kOSADebuggerGetPreviousCallFrame = 0x090A,
518  kOSADebuggerDisposeCallFrame = 0x090B,
519  kOSADebuggerCountVariables = 0x090C
520  };
521 
524  enum
525  {
526  kOSASelectComponentSpecificStart = 0x1001
527  };
528 
544  enum
545  {
546  kOSAModePreventGetSource = 0x00000001
547  };
548 
556  enum
557  {
558  kOSAModeNeverInteract = kAENeverInteract,
559  kOSAModeCanInteract = kAECanInteract,
560  kOSAModeAlwaysInteract = kAEAlwaysInteract,
561  kOSAModeDontReconnect = kAEDontReconnect
562  };
563 
575  enum
576  {
577  kOSAModeCantSwitchLayer = 0x00000040
578  };
579 
590  enum
591  {
592  kOSAModeDoRecord = 0x00001000
593  };
594 
602  enum
603  {
604  kOSAModeCompileIntoContext = 0x00000002
605  };
606 
616  enum
617  {
618  kOSAModeAugmentContext = 0x00000004
619  };
620 
627  enum
628  {
629  kOSAModeDisplayForHumans = 0x00000008
630  };
631 
638  enum
639  {
640  kOSAModeDontStoreParent = 0x00010000
641  };
642 
651  enum
652  {
653  kOSAModeDispatchToDirectObject = 0x00020000
654  };
655 
660  enum
661  {
662  kOSAModeDontGetDataForArguments = 0x00040000
663  };
664 
665  /***************************************************************************
666  OSA Basic Scripting Interface
667  **************************************************************************
668  Scripting components must at least support the Basic Scripting interface.
669  **************************************************************************/
677  enum
678  {
679  kOSAScriptResourceType = kOSAGenericScriptingComponentSubtype
680  };
681 
686  enum
687  {
688  typeOSAGenericStorage = kOSAScriptResourceType
689  };
690 
699  OSAError
700  OSALoad(ComponentInstance scriptingComponent, const AEDesc *scriptData,
701  long modeFlags, OSAID *resultingScriptID);
702 
726  OSAError
727  OSAStore(ComponentInstance scriptingComponent, OSAID scriptID,
728  DescType desiredType, long modeFlags, AEDesc *resultingScriptData);
729 
752  OSAError
753  OSAExecute(ComponentInstance scriptingComponent, OSAID compiledScriptID,
754  OSAID contextID, long modeFlags, OSAID *resultingScriptValueID);
755 
790  OSAError
791  OSADisplay(ComponentInstance scriptingComponent, OSAID scriptValueID,
792  DescType desiredType, long modeFlags, AEDesc *resultingText);
793 
824  OSAError
825  OSAScriptError(ComponentInstance scriptingComponent, OSType selector,
826  DescType desiredType, AEDesc *resultingErrorDescription);
827 
851  enum
852  {
853  kOSAErrorNumber = keyErrorNumber
854  };
855 
865  enum
866  {
867  kOSAErrorMessage = keyErrorString
868  };
869 
880  enum
881  {
882  kOSAErrorBriefMessage = FOUR_CHAR_CODE('errb')
883  };
884 
894  enum
895  {
896  kOSAErrorApp = FOUR_CHAR_CODE('erap')
897  };
898 
907  enum
908  {
909  kOSAErrorPartialResult = FOUR_CHAR_CODE('ptlr')
910  };
911 
920  enum
921  {
922  kOSAErrorOffendingObject = FOUR_CHAR_CODE('erob')
923  };
924 
930  enum
931  {
932  kOSAErrorExpectedType = FOUR_CHAR_CODE('errt')
933  };
934 
942  enum
943  {
944  kOSAErrorRange = FOUR_CHAR_CODE('erng')
945  };
946 
952  enum
953  {
954  typeOSAErrorRange = FOUR_CHAR_CODE('erng')
955  };
956 
959  enum
960  {
961  keyOSASourceStart = FOUR_CHAR_CODE('srcs')
962  };
963 
966  enum
967  {
968  keyOSASourceEnd = FOUR_CHAR_CODE('srce')
969  };
970 
980  OSAError
981  OSADispose(ComponentInstance scriptingComponent, OSAID scriptID);
982 
1001  OSAError
1002  OSASetScriptInfo(ComponentInstance scriptingComponent, OSAID scriptID,
1003  OSType selector, long value);
1004 
1023  OSAError
1024  OSAGetScriptInfo(ComponentInstance scriptingComponent, OSAID scriptID,
1025  OSType selector, long *result);
1026 
1042  typedef CALLBACK_API(OSErr, OSAActiveProcPtr)(long refCon);
1043  typedef STACK_UPP_TYPE(OSAActiveProcPtr) OSAActiveUPP;
1052  OSAActiveUPP
1053  NewOSAActiveUPP(OSAActiveProcPtr userRoutine);
1054 #if !OPAQUE_UPP_TYPES
1055  enum
1056  {
1057  uppOSAActiveProcInfo = 0x000000E0
1058  };
1059 #ifdef __cplusplus
1060  inline OSAActiveUPP NewOSAActiveUPP(OSAActiveProcPtr userRoutine)
1061  {
1062  return (OSAActiveUPP)NewRoutineDescriptor(
1063  (ProcPtr)(userRoutine), uppOSAActiveProcInfo, GetCurrentArchitecture());
1064  }
1065 #else
1066 #define NewOSAActiveUPP(userRoutine) \
1067  (OSAActiveUPP) NewRoutineDescriptor( \
1068  (ProcPtr)(userRoutine), uppOSAActiveProcInfo, GetCurrentArchitecture())
1069 #endif
1070 #endif
1071 
1080  void
1081  DisposeOSAActiveUPP(OSAActiveUPP userUPP);
1082 #if !OPAQUE_UPP_TYPES
1083 #ifdef __cplusplus
1084  inline void DisposeOSAActiveUPP(OSAActiveUPP userUPP)
1085  {
1086  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1087  }
1088 #else
1089 #define DisposeOSAActiveUPP(userUPP) DisposeRoutineDescriptor(userUPP)
1090 #endif
1091 #endif
1092 
1101  OSErr
1102  InvokeOSAActiveUPP(long refCon, OSAActiveUPP userUPP);
1103 #if !OPAQUE_UPP_TYPES
1104 #ifdef __cplusplus
1105  inline OSErr InvokeOSAActiveUPP(long refCon, OSAActiveUPP userUPP)
1106  {
1107  return (OSErr)CALL_ONE_PARAMETER_UPP(userUPP, uppOSAActiveProcInfo, refCon);
1108  }
1109 #else
1110 #define InvokeOSAActiveUPP(refCon, userUPP) \
1111  (OSErr) CALL_ONE_PARAMETER_UPP((userUPP), uppOSAActiveProcInfo, (refCon))
1112 #endif
1113 #endif
1114 
1115 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
1117 #define NewOSAActiveProc(userRoutine) NewOSAActiveUPP(userRoutine)
1118 #define CallOSAActiveProc(userRoutine, refCon) \
1119  InvokeOSAActiveUPP(refCon, userRoutine)
1120 #endif
1130  OSAError
1131  OSASetActiveProc(ComponentInstance scriptingComponent, OSAActiveUPP activeProc,
1132  long refCon);
1133 
1150  OSAError
1151  OSAGetActiveProc(ComponentInstance scriptingComponent, OSAActiveUPP *activeProc,
1152  long *refCon);
1153 
1161  /***************************************************************************
1162  OSA Optional Compiling Interface
1163  **************************************************************************
1164  Scripting components that support the Compiling interface have the
1165  kOSASupportsCompiling bit set in it's ComponentDescription.
1166  **************************************************************************/
1175  OSAError
1177  AEDesc *resultingScriptingComponentName);
1178 
1199  OSAError
1200  OSACompile(ComponentInstance scriptingComponent, const AEDesc *sourceData,
1201  long modeFlags, OSAID *previousAndResultingScriptID);
1202 
1239  OSAError
1240  OSACopyID(ComponentInstance scriptingComponent, OSAID fromID, OSAID *toID);
1241 
1253 #if CALL_NOT_IN_CARBON
1262  OSAError
1263  OSACopyScript(ComponentInstance scriptingComponent, OSAID fromID, OSAID *toID);
1264 
1275 #endif
1277  /***************************************************************************
1278  OSA Optional GetSource Interface
1279  **************************************************************************
1280  Scripting components that support the GetSource interface have the
1281  kOSASupportsGetSource bit set in their ComponentDescription.
1282  **************************************************************************/
1291  OSAError
1292  OSAGetSource(ComponentInstance scriptingComponent, OSAID scriptID,
1293  DescType desiredType, AEDesc *resultingSourceData);
1294 
1306  /***************************************************************************
1307  OSA Optional AECoercion Interface
1308  **************************************************************************
1309  Scripting components that support the AECoercion interface have the
1310  kOSASupportsAECoercion bit set in their ComponentDescription.
1311  **************************************************************************/
1320  OSAError
1322  const AEDesc *scriptData, long modeFlags,
1323  OSAID *resultingScriptID);
1324 
1354  OSAError
1355  OSACoerceToDesc(ComponentInstance scriptingComponent, OSAID scriptID,
1356  DescType desiredType, long modeFlags, AEDesc *result);
1357 
1369  /***************************************************************************
1370  OSA Optional AESending Interface
1371  **************************************************************************
1372  Scripting components that support the AESending interface have the
1373  kOSASupportsAESending bit set in their ComponentDescription.
1374  **************************************************************************/
1387  OSAError
1388  OSASetSendProc(ComponentInstance scriptingComponent, OSASendUPP sendProc,
1389  long refCon);
1390 
1407  OSAError
1408  OSAGetSendProc(ComponentInstance scriptingComponent, OSASendUPP *sendProc,
1409  long *refCon);
1410 
1426  OSAError
1428  OSACreateAppleEventUPP createProc, long refCon);
1429 
1446  OSAError
1448  OSACreateAppleEventUPP *createProc, long *refCon);
1449 
1465  OSAError
1467  const AEAddressDesc *target);
1468 
1481  /***************************************************************************
1482  OSA Optional Recording Interface
1483  **************************************************************************
1484  Scripting components that support the Recording interface have the
1485  kOSASupportsRecording bit set in their ComponentDescription.
1486  **************************************************************************/
1495  OSAError
1497  OSAID *compiledScriptToModifyID);
1498 
1521  OSAError
1522  OSAStopRecording(ComponentInstance scriptingComponent, OSAID compiledScriptID);
1523 
1534  /***************************************************************************
1535  OSA Optional Convenience Interface
1536  **************************************************************************
1537  Scripting components that support the Convenience interface have the
1538  kOSASupportsConvenience bit set in their ComponentDescription.
1539  **************************************************************************/
1548  OSAError
1549  OSALoadExecute(ComponentInstance scriptingComponent, const AEDesc *scriptData,
1550  OSAID contextID, long modeFlags, OSAID *resultingScriptValueID);
1551 
1584  OSAError
1586  const AEDesc *sourceData, OSAID contextID, long modeFlags,
1587  OSAID *resultingScriptValueID);
1588 
1620  OSAError
1621  OSADoScript(ComponentInstance scriptingComponent, const AEDesc *sourceData,
1622  OSAID contextID, DescType desiredType, long modeFlags,
1623  AEDesc *resultingText);
1624 
1654  /***************************************************************************
1655  OSA Optional Dialects Interface
1656  **************************************************************************
1657  Scripting components that support the Dialects interface have the
1658  kOSASupportsDialects bit set in their ComponentDescription.
1659  **************************************************************************/
1673  OSAError
1674  OSASetCurrentDialect(ComponentInstance scriptingComponent, short dialectCode);
1675 
1692  OSAError
1694  short *resultingDialectCode);
1695 
1711  OSAError
1713  AEDesc *resultingDialectInfoList);
1714 
1735  OSAError
1736  OSAGetDialectInfo(ComponentInstance scriptingComponent, short dialectCode,
1737  OSType selector, AEDesc *resultingDialectInfo);
1738 
1761  OSAError
1763  AEDesc *resultingDialectCodeList);
1764 
1788  /***************************************************************************
1789  OSA Optional Event Handling Interface
1790  **************************************************************************
1791  Scripting components that support the Event Handling interface have the
1792  kOSASupportsEventHandling bit set in their ComponentDescription.
1793  **************************************************************************/
1802  OSAError
1804  AEEventHandlerUPP resumeDispatchProc, long refCon);
1805 
1820  enum
1821  {
1822  kOSAUseStandardDispatch = kAEUseStandardDispatch
1823  };
1824 
1835  enum
1836  {
1837  kOSANoDispatch = kAENoDispatch
1838  };
1839 
1849  enum
1850  {
1851  kOSADontUsePhac = 0x0001
1852  };
1853 
1871  OSAError
1873  AEEventHandlerUPP *resumeDispatchProc, long *refCon);
1874 
1892  OSAError
1894  const AppleEvent *theAppleEvent, OSAID contextID,
1895  long modeFlags, OSAID *resultingScriptValueID);
1896 
1931  OSAError
1932  OSADoEvent(ComponentInstance scriptingComponent,
1933  const AppleEvent *theAppleEvent, OSAID contextID, long modeFlags,
1934  AppleEvent *reply);
1935 
1974  OSAError
1975  OSAMakeContext(ComponentInstance scriptingComponent, const AEDesc *contextName,
1976  OSAID parentContext, OSAID *resultingContextID);
1977 
1998  typedef OSAID OSADebugCallFrameRef;
2002  typedef UInt32 OSAProgramState;
2003  enum
2004  {
2005  eNotStarted = 0,
2006  eRunnable = 1,
2007  eRunning = 2,
2008  eStopped = 3,
2009  eTerminated = 4
2010  };
2011 
2012  typedef UInt32 OSADebugStepKind;
2013  enum
2014  {
2015  eStepOver = 0,
2016  eStepIn = 1,
2017  eStepOut = 2,
2018  eRun = 3
2019  };
2020 
2021  typedef UInt32 OSALocalOrGlobal;
2022  enum
2023  {
2024  eLocal = 0,
2025  eGlobal = 1,
2026  eProperties = 2
2027  };
2028 
2032  enum
2033  {
2034  keyProgramState = FOUR_CHAR_CODE('dsps')
2035  };
2036 
2041  {
2042  unsigned long startPos;
2043  unsigned long endPos;
2044  };
2045  typedef struct StatementRange StatementRange;
2046  enum
2047  {
2048  typeStatementRange = FOUR_CHAR_CODE('srng')
2049  };
2050 
2051  enum
2052  {
2053  keyProcedureName = FOUR_CHAR_CODE('dfnm'),
2054  keyStatementRange = FOUR_CHAR_CODE('dfsr'),
2055  keyLocalsNames = FOUR_CHAR_CODE('dfln'),
2056  keyGlobalsNames = FOUR_CHAR_CODE('dfgn'),
2057  keyParamsNames = FOUR_CHAR_CODE('dfpn')
2058  };
2059 
2071  OSAError
2072  OSADebuggerCreateSession(ComponentInstance scriptingComponent, OSAID inScript,
2073  OSAID inContext, OSADebugSessionRef *outSession);
2074 
2083  OSAError
2085  OSADebugSessionRef inSession, AERecord *outState);
2086 
2095  OSAError
2097  OSADebugSessionRef inSession, OSADebugStepKind inKind);
2098 
2107  OSAError
2109  OSADebugSessionRef inSession);
2110 
2119  OSAError
2121  OSADebugSessionRef inSession,
2122  AEDescList *outStatementRangeArray);
2123 
2133  OSAError
2135  OSADebugSessionRef inSession, UInt32 inSrcOffset,
2136  OSAID *outBreakpoint);
2137 
2146  OSAError
2148  OSADebugSessionRef inSession, UInt32 inSrcOffset,
2149  OSAID inBreakpoint);
2150 
2159  OSAError
2161  OSADebugSessionRef inSession,
2162  OSAID *outBreakpoint);
2163 
2175  OSAError
2177  OSADebugSessionRef inSession,
2178  OSADebugCallFrameRef *outCallFrame);
2179 
2188  OSAError
2190  OSADebugCallFrameRef inCallFrame,
2191  AERecord *outState);
2192 
2201  OSAError
2203  OSADebugCallFrameRef inCallFrame,
2204  const AEDesc *inVariableName, OSAID *outVariable);
2205 
2214  OSAError
2216  OSADebugCallFrameRef inCallFrame,
2217  const AEDesc *inVariableName, OSAID inVariable);
2218 
2227  OSAError
2229  OSADebugCallFrameRef inCurrentFrame,
2230  OSADebugCallFrameRef *outPrevFrame);
2231 
2240  OSAError
2242  OSADebugCallFrameRef inCallFrame);
2243 
2252  OSAError
2254  OSADebugSessionRef inSession,
2255  OSADebugCallFrameRef inCallFrame,
2256  OSALocalOrGlobal inWhichSet, long *outVariableCount);
2257 
2258 #if PRAGMA_STRUCT_ALIGN
2259 #pragma options align = reset
2260 #elif PRAGMA_STRUCT_PACKPUSH
2261 #pragma pack(pop)
2262 #elif PRAGMA_STRUCT_PACK
2263 #pragma pack()
2264 #endif
2265 
2266 #ifdef PRAGMA_IMPORT_OFF
2267 #pragma import off
2268 #elif PRAGMA_IMPORT
2269 #pragma import reset
2270 #endif
2271 
2272 #ifdef __cplusplus
2273 }
2274 #endif
2275 
2276 #endif
ResType DescType
Definition: AEDataModel.h:165
AppleEvent functions that deal with Events and interacting with user.
Object Support Library Interfaces.
AppleEvent Package Interfaces.
Component Manager Interfaces.
OSErr codes.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
#define NewOSACreateAppleEventUPP(userRoutine)
Definition: OSA.h:223
OSAError OSAGetDialectInfo(ComponentInstance scriptingComponent, short dialectCode, OSType selector, AEDesc *resultingDialectInfo)
unsigned long OSAID
Definition: OSA.h:165
OSAError OSADebuggerGetStatementRanges(ComponentInstance scriptingComponent, OSADebugSessionRef inSession, AEDescList *outStatementRangeArray)
OSAError OSADebuggerGetCallFrameState(ComponentInstance scriptingComponent, OSADebugCallFrameRef inCallFrame, AERecord *outState)
OSAError OSAScriptError(ComponentInstance scriptingComponent, OSType selector, DescType desiredType, AEDesc *resultingErrorDescription)
OSAError OSAExecute(ComponentInstance scriptingComponent, OSAID compiledScriptID, OSAID contextID, long modeFlags, OSAID *resultingScriptValueID)
OSAError OSASetScriptInfo(ComponentInstance scriptingComponent, OSAID scriptID, OSType selector, long value)
OSAError OSAStartRecording(ComponentInstance scriptingComponent, OSAID *compiledScriptToModifyID)
OSAError OSADispose(ComponentInstance scriptingComponent, OSAID scriptID)
OSAError OSAStopRecording(ComponentInstance scriptingComponent, OSAID compiledScriptID)
OSAError OSADebuggerGetVariable(ComponentInstance scriptingComponent, OSADebugCallFrameRef inCallFrame, const AEDesc *inVariableName, OSAID *outVariable)
OSAError OSAAvailableDialectCodeList(ComponentInstance scriptingComponent, AEDesc *resultingDialectCodeList)
OSAError OSAGetScriptInfo(ComponentInstance scriptingComponent, OSAID scriptID, OSType selector, long *result)
OSAID OSADebugSessionRef
Definition: OSA.h:1997
OSAError OSAGetCreateProc(ComponentInstance scriptingComponent, OSACreateAppleEventUPP *createProc, long *refCon)
@ kOSAModeNull
Definition: OSA.h:179
OSAError OSALoad(ComponentInstance scriptingComponent, const AEDesc *scriptData, long modeFlags, OSAID *resultingScriptID)
void DisposeOSACreateAppleEventUPP(OSACreateAppleEventUPP userUPP)
OSAError OSACoerceFromDesc(ComponentInstance scriptingComponent, const AEDesc *scriptData, long modeFlags, OSAID *resultingScriptID)
OSAError OSACompileExecute(ComponentInstance scriptingComponent, const AEDesc *sourceData, OSAID contextID, long modeFlags, OSAID *resultingScriptValueID)
OSAError OSASetDefaultTarget(ComponentInstance scriptingComponent, const AEAddressDesc *target)
OSAError OSASetSendProc(ComponentInstance scriptingComponent, OSASendUPP sendProc, long refCon)
@ keyOSADialectLangCode
Definition: OSA.h:159
@ keyOSADialectScriptCode
Definition: OSA.h:160
@ keyOSADialectCode
Definition: OSA.h:158
@ keyOSADialectName
Definition: OSA.h:157
OSAError OSADoScript(ComponentInstance scriptingComponent, const AEDesc *sourceData, OSAID contextID, DescType desiredType, long modeFlags, AEDesc *resultingText)
OSAError OSADebuggerGetSessionState(ComponentInstance scriptingComponent, OSADebugSessionRef inSession, AERecord *outState)
OSAError OSASetActiveProc(ComponentInstance scriptingComponent, OSAActiveUPP activeProc, long refCon)
OSAError OSACompile(ComponentInstance scriptingComponent, const AEDesc *sourceData, long modeFlags, OSAID *previousAndResultingScriptID)
OSAError OSADebuggerSetBreakpoint(ComponentInstance scriptingComponent, OSADebugSessionRef inSession, UInt32 inSrcOffset, OSAID inBreakpoint)
OSErr InvokeOSASendUPP(const AppleEvent *theAppleEvent, AppleEvent *reply, AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks, AEIdleUPP idleProc, AEFilterUPP filterProc, long refCon, OSASendUPP userUPP)
OSAError OSADoEvent(ComponentInstance scriptingComponent, const AppleEvent *theAppleEvent, OSAID contextID, long modeFlags, AppleEvent *reply)
OSAError OSACopyID(ComponentInstance scriptingComponent, OSAID fromID, OSAID *toID)
OSAError OSADebuggerGetCurrentCallFrame(ComponentInstance scriptingComponent, OSADebugSessionRef inSession, OSADebugCallFrameRef *outCallFrame)
OSAError OSASetCreateProc(ComponentInstance scriptingComponent, OSACreateAppleEventUPP createProc, long refCon)
#define NewOSASendUPP(userRoutine)
Definition: OSA.h:253
OSAError OSADebuggerCreateSession(ComponentInstance scriptingComponent, OSAID inScript, OSAID inContext, OSADebugSessionRef *outSession)
OSAError OSAMakeContext(ComponentInstance scriptingComponent, const AEDesc *contextName, OSAID parentContext, OSAID *resultingContextID)
OSAError OSAExecuteEvent(ComponentInstance scriptingComponent, const AppleEvent *theAppleEvent, OSAID contextID, long modeFlags, OSAID *resultingScriptValueID)
OSAError OSADebuggerGetPreviousCallFrame(ComponentInstance scriptingComponent, OSADebugCallFrameRef inCurrentFrame, OSADebugCallFrameRef *outPrevFrame)
OSAError OSADisplay(ComponentInstance scriptingComponent, OSAID scriptValueID, DescType desiredType, long modeFlags, AEDesc *resultingText)
OSAError OSAGetCurrentDialect(ComponentInstance scriptingComponent, short *resultingDialectCode)
OSAError OSADebuggerGetBreakpoint(ComponentInstance scriptingComponent, OSADebugSessionRef inSession, UInt32 inSrcOffset, OSAID *outBreakpoint)
void DisposeOSAActiveUPP(OSAActiveUPP userUPP)
OSErr InvokeOSACreateAppleEventUPP(AEEventClass theAEEventClass, AEEventID theAEEventID, const AEAddressDesc *target, short returnID, long transactionID, AppleEvent *result, long refCon, OSACreateAppleEventUPP userUPP)
OSAError OSAGetResumeDispatchProc(ComponentInstance scriptingComponent, AEEventHandlerUPP *resumeDispatchProc, long *refCon)
OSAError OSALoadExecute(ComponentInstance scriptingComponent, const AEDesc *scriptData, OSAID contextID, long modeFlags, OSAID *resultingScriptValueID)
OSAError OSADebuggerCountVariables(ComponentInstance scriptingComponent, OSADebugSessionRef inSession, OSADebugCallFrameRef inCallFrame, OSALocalOrGlobal inWhichSet, long *outVariableCount)
OSAError OSAScriptingComponentName(ComponentInstance scriptingComponent, AEDesc *resultingScriptingComponentName)
OSAError OSASetResumeDispatchProc(ComponentInstance scriptingComponent, AEEventHandlerUPP resumeDispatchProc, long refCon)
OSAError OSADebuggerSessionStep(ComponentInstance scriptingComponent, OSADebugSessionRef inSession, OSADebugStepKind inKind)
typedef CALLBACK_API(OSErr, OSACreateAppleEventProcPtr)(AEEventClass theAEEventClass
UInt32 OSAProgramState
Definition: OSA.h:2002
OSAError OSAGetSendProc(ComponentInstance scriptingComponent, OSASendUPP *sendProc, long *refCon)
OSAError OSACoerceToDesc(ComponentInstance scriptingComponent, OSAID scriptID, DescType desiredType, long modeFlags, AEDesc *result)
OSAError OSADebuggerGetDefaultBreakpoint(ComponentInstance scriptingComponent, OSADebugSessionRef inSession, OSAID *outBreakpoint)
OSAError OSADebuggerSetVariable(ComponentInstance scriptingComponent, OSADebugCallFrameRef inCallFrame, const AEDesc *inVariableName, OSAID inVariable)
OSAError OSADebuggerDisposeCallFrame(ComponentInstance scriptingComponent, OSADebugCallFrameRef inCallFrame)
OSAError OSAGetActiveProc(ComponentInstance scriptingComponent, OSAActiveUPP *activeProc, long *refCon)
#define NewOSAActiveUPP(userRoutine)
Definition: OSA.h:1066
OSAError OSADebuggerDisposeSession(ComponentInstance scriptingComponent, OSADebugSessionRef inSession)
@ keyStatementRange
Definition: OSA.h:2054
@ keyGlobalsNames
Definition: OSA.h:2056
@ keyParamsNames
Definition: OSA.h:2057
@ keyLocalsNames
Definition: OSA.h:2055
OSAError OSASetCurrentDialect(ComponentInstance scriptingComponent, short dialectCode)
OSErr InvokeOSAActiveUPP(long refCon, OSAActiveUPP userUPP)
void DisposeOSASendUPP(OSASendUPP userUPP)
OSAError OSAAvailableDialects(ComponentInstance scriptingComponent, AEDesc *resultingDialectInfoList)
OSAError OSAStore(ComponentInstance scriptingComponent, OSAID scriptID, DescType desiredType, long modeFlags, AEDesc *resultingScriptData)
OSAError OSAGetSource(ComponentInstance scriptingComponent, OSAID scriptID, DescType desiredType, AEDesc *resultingSourceData)
OSAError OSACopyScript(ComponentInstance scriptingComponent, OSAID fromID, OSAID *toID)
Definition: AEDataModel.h:175
Definition: Components.h:220
Definition: OSA.h:2041