home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / AppleEvents.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  26.1 KB  |  662 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleEvents.p
  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. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT AppleEvents;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __APPLEEVENTS__}
  27. {$SETC __APPLEEVENTS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC AppleEventsIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __ERRORS__}
  35. {$I Errors.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __TYPES__}
  40. {$I Types.p}
  41. {$ENDC}
  42.  
  43. {$IFC UNDEFINED __MEMORY__}
  44. {$I Memory.p}
  45. {$ENDC}
  46. {    MixedMode.p                                                    }
  47.  
  48. {$IFC UNDEFINED __OSUTILS__}
  49. {$I OSUtils.p}
  50. {$ENDC}
  51.  
  52. {$IFC UNDEFINED __EVENTS__}
  53. {$I Events.p}
  54. {$ENDC}
  55. {    Quickdraw.p                                                    }
  56. {        QuickdrawText.p                                            }
  57.  
  58. {$IFC UNDEFINED __EPPC__}
  59. {$I EPPC.p}
  60. {$ENDC}
  61. {    PPCToolbox.p                                                }
  62. {        AppleTalk.p                                                }
  63. {    Processes.p                                                    }
  64. {        Files.p                                                    }
  65.  
  66. {$IFC UNDEFINED __NOTIFICATION__}
  67. {$I Notification.p}
  68. {$ENDC}
  69.  
  70. {$PUSH}
  71. {$ALIGN MAC68K}
  72. {$LibExport+}
  73.  
  74. CONST
  75. { Apple event descriptor types }
  76.     typeBoolean                    = 'bool';
  77.     typeChar                    = 'TEXT';
  78.     typeSMInt                    = 'shor';
  79.     typeInteger                    = 'long';
  80.     typeSMFloat                    = 'sing';
  81.     typeFloat                    = 'doub';
  82.     typeLongInteger                = 'long';
  83.     typeShortInteger            = 'shor';
  84.     typeLongFloat                = 'doub';
  85.     typeShortFloat                = 'sing';
  86.     typeExtended                = 'exte';
  87.     typeComp                    = 'comp';
  88.     typeMagnitude                = 'magn';
  89.     typeAEList                    = 'list';
  90.     typeAERecord                = 'reco';
  91.     typeAppleEvent                = 'aevt';
  92.     typeTrue                    = 'true';
  93.     typeFalse                    = 'fals';
  94.     typeAlias                    = 'alis';
  95.     typeEnumerated                = 'enum';
  96.     typeType                    = 'type';
  97.     typeAppParameters            = 'appa';
  98.     typeProperty                = 'prop';
  99.     typeFSS                        = 'fss ';
  100.     typeKeyword                    = 'keyw';
  101.     typeSectionH                = 'sect';
  102.     typeWildCard                = '****';
  103.     typeApplSignature            = 'sign';
  104.     typeQDRectangle                = 'qdrt';
  105.     typeFixed                    = 'fixd';
  106.     typeSessionID                = 'ssid';
  107.     typeTargetID                = 'targ';
  108.     typeProcessSerialNumber        = 'psn ';
  109.     typeNull                    = 'null';                        { null or nonexistent data }
  110. { Keywords for Apple event parameters }
  111.     keyDirectObject                = '----';
  112.     keyErrorNumber                = 'errn';
  113.     keyErrorString                = 'errs';
  114.     keyProcessSerialNumber        = 'psn ';
  115. { Keywords for Apple event attributes }
  116.     keyTransactionIDAttr        = 'tran';
  117.     keyReturnIDAttr                = 'rtid';
  118.     keyEventClassAttr            = 'evcl';
  119.     keyEventIDAttr                = 'evid';
  120.     keyAddressAttr                = 'addr';
  121.     keyOptionalKeywordAttr        = 'optk';
  122.     keyTimeoutAttr                = 'timo';
  123.     keyInteractLevelAttr        = 'inte';                        { this attribute is read only - will be set in AESend }
  124.     keyEventSourceAttr            = 'esrc';                        { this attribute is read only }
  125.     keyMissedKeywordAttr        = 'miss';                        { this attribute is read only }
  126.     keyOriginalAddressAttr        = 'from';                        { new in 1.0.1 }
  127. { Keywords for special handlers }
  128.     keyPreDispatch                = 'phac';                        { preHandler accessor call }
  129.     keySelectProc                = 'selh';                        { more selector call }
  130. { Keyword for recording }
  131.     keyAERecorderCount            = 'recr';                        { available only in vers 1.0.1 and greater }
  132. { Keyword for version information }
  133.     keyAEVersion                = 'vers';                        { available only in vers 1.0.1 and greater }
  134. { Event Class }
  135.     kCoreEventClass                = 'aevt';
  136. { Event ID’s }
  137.     kAEOpenApplication            = 'oapp';
  138.     kAEOpenDocuments            = 'odoc';
  139.     kAEPrintDocuments            = 'pdoc';
  140.     kAEQuitApplication            = 'quit';
  141.     kAEAnswer                    = 'ansr';
  142.     kAEApplicationDied            = 'obit';
  143.  
  144. { Constants for use in AESend mode }
  145.     kAENoReply                    = $00000001;                    { sender doesn't want a reply to event }
  146.     kAEQueueReply                = $00000002;                    { sender wants a reply but won't wait }
  147.     kAEWaitReply                = $00000003;                    { sender wants a reply and will wait }
  148.     kAENeverInteract            = $00000010;                    { server should not interact with user }
  149.     kAECanInteract                = $00000020;                    { server may try to interact with user }
  150.     kAEAlwaysInteract            = $00000030;                    { server should always interact with user where appropriate }
  151.     kAECanSwitchLayer            = $00000040;                    { interaction may switch layer }
  152.     kAEDontReconnect            = $00000080;                    { don't reconnect if there is a sessClosedErr from PPCToolbox }
  153.     kAEWantReceipt                = nReturnReceipt;                { sender wants a receipt of message }
  154.     kAEDontRecord                = $00001000;                    { don't record this event - available only in vers 1.0.1 and greater }
  155.     kAEDontExecute                = $00002000;                    { don't send the event for recording - available only in vers 1.0.1 and greater }
  156. { Constants for the send priority in AESend }
  157.     kAENormalPriority            = $00000000;                    { post message at the end of the event queue }
  158.     kAEHighPriority                = nAttnMsg;                        { post message at the front of the event queue }
  159.  
  160. { Constants for recording }
  161.     kAEStartRecording            = 'reca';                        { available only in vers 1.0.1 and greater }
  162.     kAEStopRecording            = 'recc';                        { available only in vers 1.0.1 and greater }
  163.     kAENotifyStartRecording        = 'rec1';                        { available only in vers 1.0.1 and greater }
  164.     kAENotifyStopRecording        = 'rec0';                        { available only in vers 1.0.1 and greater }
  165.     kAENotifyRecording            = 'recr';
  166.  
  167. { Constant for the returnID param of AECreateAppleEvent }
  168.     kAutoGenerateReturnID        = -1;                            { AECreateAppleEvent will generate a session-unique ID }
  169. { Constant for transaction ID’s }
  170.     kAnyTransactionID            = 0;                            { no transaction is in use }
  171. { Constants for timeout durations }
  172.     kAEDefaultTimeout            = -1;                            { timeout value determined by AEM }
  173.     kNoTimeOut                    = -2;                            { wait until reply comes back, however long it takes }
  174.  
  175. { Constants for AEResumeTheCurrentEvent }
  176.     kAENoDispatch                = 0;                            { dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch }
  177.     kAEUseStandardDispatch        = $FFFFFFFF;                    { table, or one of these two constants }
  178. { Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch }
  179.     kAEDoNotIgnoreHandler        = $00000000;
  180.     kAEIgnoreAppPhacHandler        = $00000001;                    { available only in vers 1.0.1 and greater }
  181.     kAEIgnoreAppEventHandler    = $00000002;                    { available only in vers 1.0.1 and greater }
  182.     kAEIgnoreSysPhacHandler        = $00000004;                    { available only in vers 1.0.1 and greater }
  183.     kAEIgnoreSysEventHandler    = $00000008;                    { available only in vers 1.0.1 and greater }
  184.     kAEIngoreBuiltInEventHandler = $00000010;                    { available only in vers 1.0.1 and greater }
  185.     kAEDontDisposeOnResume        = $80000000;                    { available only in vers 1.0.1 and greater }
  186.  
  187. { Apple event manager data types }
  188.     
  189. TYPE
  190.     AEEventClass = FourCharCode;
  191.  
  192.     AEEventID = FourCharCode;
  193.  
  194.     AEKeyword = FourCharCode;
  195.  
  196.     DescType = ResType;
  197.  
  198.     AEDesc = RECORD
  199.         descriptorType:            DescType;
  200.         dataHandle:                Handle;
  201.     END;
  202.     AEKeyDesc = RECORD
  203.         descKey:                AEKeyword;
  204.         descContent:            AEDesc;
  205.     END;
  206. { an AEDesc which contains address data }
  207.     AEAddressDesc = AEDesc;
  208.  
  209. { a list of AEDesc's is a special kind of AEDesc }
  210.     AEDescList = AEDesc;
  211.  
  212. { AERecord is a list of keyworded AEDesc's }
  213.     AERecord = AEDescList;
  214.  
  215. { an AERecord that contains an AppleEvent }
  216.     AppleEvent = AERecord;
  217.  
  218. { parameter to AESend }
  219.     AESendMode = LONGINT;
  220.  
  221. { priority param of AESend }
  222.     AESendPriority = INTEGER;
  223.  
  224.  
  225. CONST
  226.     kAEInteractWithSelf            = 0;
  227.     kAEInteractWithLocal        = 1;
  228.     kAEInteractWithAll            = 2;
  229.  
  230.     
  231. TYPE
  232.     AEInteractAllowed = SInt8;
  233.  
  234.  
  235. CONST
  236.     kAEUnknownSource            = 0;
  237.     kAEDirectCall                = 1;
  238.     kAESameProcess                = 2;
  239.     kAELocalProcess                = 3;
  240.     kAERemoteProcess            = 4;
  241.  
  242.     
  243. TYPE
  244.     AEEventSource = SInt8;
  245.  
  246.  
  247. CONST
  248.     kAEDataArray                = 0;
  249.     kAEPackedArray                = 1;
  250.     kAEHandleArray                = 2;
  251.     kAEDescArray                = 3;
  252.     kAEKeyDescArray                = 4;
  253.  
  254.     
  255. TYPE
  256.     AEArrayType = SInt8;
  257.  
  258.     AEArrayData = RECORD
  259.         CASE INTEGER OF
  260.         0: (
  261.             kAEDataArray:                ARRAY [0..0] OF INTEGER;
  262.            );
  263.         1: (
  264.             kAEPackedArray:                PACKED ARRAY [0..0] OF CHAR;
  265.            );
  266.         2: (
  267.             kAEHandleArray:                ARRAY [0..0] OF Handle;
  268.            );
  269.         3: (
  270.             kAEDescArray:                ARRAY [0..0] OF AEDesc;
  271.            );
  272.         4: (
  273.             kAEKeyDescArray:            ARRAY [0..0] OF AEKeyDesc;
  274.            );
  275.     END;
  276.     AEArrayDataPointer = ^AEArrayData;
  277.  
  278.     AEIdleProcPtr = ProcPtr;  { FUNCTION AEIdle(VAR theEvent: EventRecord; VAR sleepTime: LONGINT; VAR mouseRgn: RgnHandle): BOOLEAN; }
  279.     AEIdleUPP = UniversalProcPtr;
  280.  
  281. CONST
  282.     uppAEIdleProcInfo = $00000FD0; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 1 byte result; }
  283.  
  284. FUNCTION NewAEIdleProc(userRoutine: AEIdleProcPtr): AEIdleUPP;
  285.     {$IFC NOT GENERATINGCFM }
  286.     INLINE $2E9F;
  287.     {$ENDC}
  288.  
  289. FUNCTION CallAEIdleProc(VAR theEvent: EventRecord; VAR sleepTime: LONGINT; VAR mouseRgn: RgnHandle; userRoutine: AEIdleUPP): BOOLEAN;
  290.     {$IFC NOT GENERATINGCFM}
  291.     INLINE $205F, $4E90;
  292.     {$ENDC}
  293. TYPE
  294.     AEFilterProcPtr = ProcPtr;  { FUNCTION AEFilter(VAR theEvent: EventRecord; returnID: LONGINT; transactionID: LONGINT; (CONST)VAR sender: AEAddressDesc): BOOLEAN; }
  295.     AEFilterUPP = UniversalProcPtr;
  296.  
  297. CONST
  298.     uppAEFilterProcInfo = $00003FD0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 1 byte result; }
  299.  
  300. FUNCTION NewAEFilterProc(userRoutine: AEFilterProcPtr): AEFilterUPP;
  301.     {$IFC NOT GENERATINGCFM }
  302.     INLINE $2E9F;
  303.     {$ENDC}
  304.  
  305. FUNCTION CallAEFilterProc(VAR theEvent: EventRecord; returnID: LONGINT; transactionID: LONGINT; {CONST}VAR sender: AEAddressDesc; userRoutine: AEFilterUPP): BOOLEAN;
  306.     {$IFC NOT GENERATINGCFM}
  307.     INLINE $205F, $4E90;
  308.     {$ENDC}
  309. TYPE
  310.     AEEventHandlerProcPtr = ProcPtr;  { FUNCTION AEEventHandler((CONST)VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; handlerRefcon: LONGINT): OSErr; }
  311.     AEEventHandlerUPP = UniversalProcPtr;
  312.  
  313. CONST
  314.     uppAEEventHandlerProcInfo = $00000FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  315.  
  316. FUNCTION NewAEEventHandlerProc(userRoutine: AEEventHandlerProcPtr): AEEventHandlerUPP;
  317.     {$IFC NOT GENERATINGCFM }
  318.     INLINE $2E9F;
  319.     {$ENDC}
  320.  
  321. FUNCTION CallAEEventHandlerProc({CONST}VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; handlerRefcon: LONGINT; userRoutine: AEEventHandlerUPP): OSErr;
  322.     {$IFC NOT GENERATINGCFM}
  323.     INLINE $205F, $4E90;
  324.     {$ENDC}
  325. TYPE
  326.     AECoerceDescProcPtr = ProcPtr;  { FUNCTION AECoerceDesc((CONST)VAR fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc): OSErr; }
  327.     AECoerceDescUPP = UniversalProcPtr;
  328.  
  329. CONST
  330.     uppAECoerceDescProcInfo = $00003FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  331.  
  332. FUNCTION NewAECoerceDescProc(userRoutine: AECoerceDescProcPtr): AECoerceDescUPP;
  333.     {$IFC NOT GENERATINGCFM }
  334.     INLINE $2E9F;
  335.     {$ENDC}
  336.  
  337. FUNCTION CallAECoerceDescProc({CONST}VAR fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc; userRoutine: AECoerceDescUPP): OSErr;
  338.     {$IFC NOT GENERATINGCFM}
  339.     INLINE $205F, $4E90;
  340.     {$ENDC}
  341. TYPE
  342.     AECoercePtrProcPtr = ProcPtr;  { FUNCTION AECoercePtr(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc): OSErr; }
  343.     AECoercePtrUPP = UniversalProcPtr;
  344.  
  345. CONST
  346.     uppAECoercePtrProcInfo = $0003FFE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  347.  
  348. FUNCTION NewAECoercePtrProc(userRoutine: AECoercePtrProcPtr): AECoercePtrUPP;
  349.     {$IFC NOT GENERATINGCFM }
  350.     INLINE $2E9F;
  351.     {$ENDC}
  352.  
  353. FUNCTION CallAECoercePtrProc(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc; userRoutine: AECoercePtrUPP): OSErr;
  354.     {$IFC NOT GENERATINGCFM}
  355.     INLINE $205F, $4E90;
  356.     {$ENDC}
  357.     
  358. TYPE
  359.     AECoercionHandlerUPP = UniversalProcPtr;
  360.  
  361. {*************************************************************************
  362.  The following calls apply to any AEDesc. Every 'result' descriptor is
  363.  created for you, so you will be responsible for memory management
  364.  (including disposing) of the descriptors so created. Note: purgeable
  365.  descriptor data is not supported - the AEM does not call LoadResource.  
  366. *************************************************************************}
  367.  
  368. FUNCTION AECreateDesc(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; VAR result: AEDesc): OSErr;
  369.     {$IFC NOT GENERATINGCFM}
  370.     INLINE $303C, $0825, $A816;
  371.     {$ENDC}
  372. FUNCTION AECoercePtr(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; VAR result: AEDesc): OSErr;
  373.     {$IFC NOT GENERATINGCFM}
  374.     INLINE $303C, $0A02, $A816;
  375.     {$ENDC}
  376. FUNCTION AECoerceDesc({CONST}VAR theAEDesc: AEDesc; toType: DescType; VAR result: AEDesc): OSErr;
  377.     {$IFC NOT GENERATINGCFM}
  378.     INLINE $303C, $0603, $A816;
  379.     {$ENDC}
  380. FUNCTION AEDisposeDesc(VAR theAEDesc: AEDesc): OSErr;
  381.     {$IFC NOT GENERATINGCFM}
  382.     INLINE $303C, $0204, $A816;
  383.     {$ENDC}
  384. FUNCTION AEDuplicateDesc({CONST}VAR theAEDesc: AEDesc; VAR result: AEDesc): OSErr;
  385.     {$IFC NOT GENERATINGCFM}
  386.     INLINE $303C, $0405, $A816;
  387.     {$ENDC}
  388. {*************************************************************************
  389.   The following calls apply to AEDescList. Since AEDescList is a subtype of
  390.   AEDesc, the calls in the previous section can also be used for AEDescList.
  391.   All list and array indices are 1-based. If the data was greater than
  392.   maximumSize in the routines below, then actualSize will be greater than
  393.   maximumSize, but only maximumSize bytes will actually be retrieved.
  394. *************************************************************************}
  395. FUNCTION AECreateList(factoringPtr: UNIV Ptr; factoredSize: Size; isRecord: BOOLEAN; VAR resultList: AEDescList): OSErr;
  396.     {$IFC NOT GENERATINGCFM}
  397.     INLINE $303C, $0706, $A816;
  398.     {$ENDC}
  399. FUNCTION AECountItems({CONST}VAR theAEDescList: AEDescList; VAR theCount: LONGINT): OSErr;
  400.     {$IFC NOT GENERATINGCFM}
  401.     INLINE $303C, $0407, $A816;
  402.     {$ENDC}
  403. FUNCTION AEPutPtr(VAR theAEDescList: AEDescList; index: LONGINT; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  404.     {$IFC NOT GENERATINGCFM}
  405.     INLINE $303C, $0A08, $A816;
  406.     {$ENDC}
  407. FUNCTION AEPutDesc(VAR theAEDescList: AEDescList; index: LONGINT; {CONST}VAR theAEDesc: AEDesc): OSErr;
  408.     {$IFC NOT GENERATINGCFM}
  409.     INLINE $303C, $0609, $A816;
  410.     {$ENDC}
  411. FUNCTION AEGetNthPtr({CONST}VAR theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  412.     {$IFC NOT GENERATINGCFM}
  413.     INLINE $303C, $100A, $A816;
  414.     {$ENDC}
  415. FUNCTION AEGetNthDesc({CONST}VAR theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR result: AEDesc): OSErr;
  416.     {$IFC NOT GENERATINGCFM}
  417.     INLINE $303C, $0A0B, $A816;
  418.     {$ENDC}
  419. FUNCTION AESizeOfNthItem({CONST}VAR theAEDescList: AEDescList; index: LONGINT; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  420.     {$IFC NOT GENERATINGCFM}
  421.     INLINE $303C, $082A, $A816;
  422.     {$ENDC}
  423. FUNCTION AEGetArray({CONST}VAR theAEDescList: AEDescList; arrayType: ByteParameter; arrayPtr: AEArrayDataPointer; maximumSize: Size; VAR itemType: DescType; VAR itemSize: Size; VAR itemCount: LONGINT): OSErr;
  424.     {$IFC NOT GENERATINGCFM}
  425.     INLINE $303C, $0D0C, $A816;
  426.     {$ENDC}
  427. FUNCTION AEPutArray(VAR theAEDescList: AEDescList; arrayType: ByteParameter; {CONST}VAR arrayPtr: AEArrayData; itemType: DescType; itemSize: Size; itemCount: LONGINT): OSErr;
  428.     {$IFC NOT GENERATINGCFM}
  429.     INLINE $303C, $0B0D, $A816;
  430.     {$ENDC}
  431. FUNCTION AEDeleteItem(VAR theAEDescList: AEDescList; index: LONGINT): OSErr;
  432.     {$IFC NOT GENERATINGCFM}
  433.     INLINE $303C, $040E, $A816;
  434.     {$ENDC}
  435. {*************************************************************************
  436.  The following calls apply to AERecord. Since AERecord is a subtype of
  437.  AEDescList, the calls in the previous sections can also be used for
  438.  AERecord an AERecord can be created by using AECreateList with isRecord
  439.  set to true. 
  440. *************************************************************************}
  441. FUNCTION AEPutKeyPtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  442.     {$IFC NOT GENERATINGCFM}
  443.     INLINE $303C, $0A0F, $A816;
  444.     {$ENDC}
  445. FUNCTION AEPutKeyDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; {CONST}VAR theAEDesc: AEDesc): OSErr;
  446.     {$IFC NOT GENERATINGCFM}
  447.     INLINE $303C, $0610, $A816;
  448.     {$ENDC}
  449. FUNCTION AEGetKeyPtr({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  450.     {$IFC NOT GENERATINGCFM}
  451.     INLINE $303C, $0E11, $A816;
  452.     {$ENDC}
  453. FUNCTION AEGetKeyDesc({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr;
  454.     {$IFC NOT GENERATINGCFM}
  455.     INLINE $303C, $0812, $A816;
  456.     {$ENDC}
  457. FUNCTION AESizeOfKeyDesc({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  458.     {$IFC NOT GENERATINGCFM}
  459.     INLINE $303C, $0829, $A816;
  460.     {$ENDC}
  461. FUNCTION AEDeleteKeyDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr;
  462.     {$IFC NOT GENERATINGCFM}
  463.     INLINE $303C, $0413, $A816;
  464.     {$ENDC}
  465. FUNCTION AEPutParamPtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  466.     {$IFC NOT GENERATINGCFM}
  467.     INLINE $303C, $0A0F, $A816;
  468.     {$ENDC}
  469. FUNCTION AEPutParamDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; {CONST}VAR theAEDesc: AEDesc): OSErr;
  470.     {$IFC NOT GENERATINGCFM}
  471.     INLINE $303C, $0610, $A816;
  472.     {$ENDC}
  473. FUNCTION AEGetParamPtr({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  474.     {$IFC NOT GENERATINGCFM}
  475.     INLINE $303C, $0E11, $A816;
  476.     {$ENDC}
  477. FUNCTION AEGetParamDesc({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr;
  478.     {$IFC NOT GENERATINGCFM}
  479.     INLINE $303C, $0812, $A816;
  480.     {$ENDC}
  481. FUNCTION AESizeOfParam({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  482.     {$IFC NOT GENERATINGCFM}
  483.     INLINE $303C, $0829, $A816;
  484.     {$ENDC}
  485. FUNCTION AEDeleteParam(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr;
  486.     {$IFC NOT GENERATINGCFM}
  487.     INLINE $303C, $0413, $A816;
  488.     {$ENDC}
  489. {*************************************************************************
  490.  The following calls also apply to type AppleEvent. Message attributes are
  491.  far more restricted, and can only be accessed through the following 5
  492.  calls. The various list and record routines cannot be used to access the
  493.  attributes of an event. 
  494. *************************************************************************}
  495. FUNCTION AEGetAttributePtr({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  496.     {$IFC NOT GENERATINGCFM}
  497.     INLINE $303C, $0E15, $A816;
  498.     {$ENDC}
  499. FUNCTION AEGetAttributeDesc({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr;
  500.     {$IFC NOT GENERATINGCFM}
  501.     INLINE $303C, $0826, $A816;
  502.     {$ENDC}
  503. FUNCTION AESizeOfAttribute({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  504.     {$IFC NOT GENERATINGCFM}
  505.     INLINE $303C, $0828, $A816;
  506.     {$ENDC}
  507. FUNCTION AEPutAttributePtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  508.     {$IFC NOT GENERATINGCFM}
  509.     INLINE $303C, $0A16, $A816;
  510.     {$ENDC}
  511. FUNCTION AEPutAttributeDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; {CONST}VAR theAEDesc: AEDesc): OSErr;
  512.     {$IFC NOT GENERATINGCFM}
  513.     INLINE $303C, $0627, $A816;
  514.     {$ENDC}
  515. {*************************************************************************
  516.   The next couple of calls are basic routines used to create, send,
  517.   and process AppleEvents. 
  518. *************************************************************************}
  519. FUNCTION AECreateAppleEvent(theAEEventClass: AEEventClass; theAEEventID: AEEventID; {CONST}VAR target: AEAddressDesc; returnID: INTEGER; transactionID: LONGINT; VAR result: AppleEvent): OSErr;
  520.     {$IFC NOT GENERATINGCFM}
  521.     INLINE $303C, $0B14, $A816;
  522.     {$ENDC}
  523. FUNCTION AESend({CONST}VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; sendMode: AESendMode; sendPriority: AESendPriority; timeOutInTicks: LONGINT; idleProc: AEIdleUPP; filterProc: AEFilterUPP): OSErr;
  524.     {$IFC NOT GENERATINGCFM}
  525.     INLINE $303C, $0D17, $A816;
  526.     {$ENDC}
  527. FUNCTION AEProcessAppleEvent({CONST}VAR theEventRecord: EventRecord): OSErr;
  528.     {$IFC NOT GENERATINGCFM}
  529.     INLINE $303C, $021B, $A816;
  530.     {$ENDC}
  531.  Note: during event processing, an event handler may realize that it is likely
  532.  to exceed the client's timeout limit. Passing the reply to this
  533.  routine causes a wait event to be generated that asks the client
  534.  for more time. 
  535. }
  536. FUNCTION AEResetTimer({CONST}VAR reply: AppleEvent): OSErr;
  537.     {$IFC NOT GENERATINGCFM}
  538.     INLINE $303C, $0219, $A816;
  539.     {$ENDC}
  540. {*************************************************************************
  541.  The following four calls are available for applications which need more
  542.  sophisticated control over when and how events are processed. Applications
  543.  which implement multi-session servers or which implement their own
  544.  internal event queueing will probably be the major clients of these
  545.  routines. They can be called from within a handler to prevent the AEM from
  546.  disposing of the AppleEvent when the handler returns. They can be used to
  547.  asynchronously process the event (as MacApp does).
  548. *************************************************************************}
  549. FUNCTION AESuspendTheCurrentEvent({CONST}VAR theAppleEvent: AppleEvent): OSErr;
  550.     {$IFC NOT GENERATINGCFM}
  551.     INLINE $303C, $022B, $A816;
  552.     {$ENDC}
  553.  Note: The following routine tells the AppleEvent manager that processing
  554.  is either about to resume or has been completed on a previously suspended
  555.  event. The procPtr passed in as the dispatcher parameter will be called to
  556.  attempt to redispatch the event. Several constants for the dispatcher
  557.  parameter allow special behavior. They are:
  558.       - kAEUseStandardDispatch means redispatch as if the event was just
  559.       received, using the standard AppleEvent dispatch mechanism.
  560.       - kAENoDispatch means ignore the parameter.
  561.          Use this in the case where the event has been handled and no
  562.       redispatch is needed.
  563.       - non nil means call the routine which the dispatcher points to.
  564. }
  565. FUNCTION AEResumeTheCurrentEvent({CONST}VAR theAppleEvent: AppleEvent; {CONST}VAR reply: AppleEvent; dispatcher: AEEventHandlerUPP; handlerRefcon: LONGINT): OSErr;
  566.     {$IFC NOT GENERATINGCFM}
  567.     INLINE $303C, $0818, $A816;
  568.     {$ENDC}
  569. FUNCTION AEGetTheCurrentEvent(VAR theAppleEvent: AppleEvent): OSErr;
  570.     {$IFC NOT GENERATINGCFM}
  571.     INLINE $303C, $021A, $A816;
  572.     {$ENDC}
  573. FUNCTION AESetTheCurrentEvent({CONST}VAR theAppleEvent: AppleEvent): OSErr;
  574.     {$IFC NOT GENERATINGCFM}
  575.     INLINE $303C, $022C, $A816;
  576.     {$ENDC}
  577. {*************************************************************************
  578.   The following three calls are used to allow applications to behave
  579.   courteously when a user interaction such as a dialog box is needed. 
  580. *************************************************************************}
  581. FUNCTION AEGetInteractionAllowed(VAR level: AEInteractAllowed): OSErr;
  582.     {$IFC NOT GENERATINGCFM}
  583.     INLINE $303C, $021D, $A816;
  584.     {$ENDC}
  585. FUNCTION AESetInteractionAllowed(level: ByteParameter): OSErr;
  586.     {$IFC NOT GENERATINGCFM}
  587.     INLINE $303C, $011E, $A816;
  588.     {$ENDC}
  589. FUNCTION AEInteractWithUser(timeOutInTicks: LONGINT; nmReqPtr: NMRecPtr; idleProc: AEIdleUPP): OSErr;
  590.     {$IFC NOT GENERATINGCFM}
  591.     INLINE $303C, $061C, $A816;
  592.     {$ENDC}
  593. {*************************************************************************
  594.   These calls are used to set up and modify the event dispatch table.
  595. *************************************************************************}
  596. FUNCTION AEInstallEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr;
  597.     {$IFC NOT GENERATINGCFM}
  598.     INLINE $303C, $091F, $A816;
  599.     {$ENDC}
  600. FUNCTION AERemoveEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; isSysHandler: BOOLEAN): OSErr;
  601.     {$IFC NOT GENERATINGCFM}
  602.     INLINE $303C, $0720, $A816;
  603.     {$ENDC}
  604. FUNCTION AEGetEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; VAR handler: AEEventHandlerUPP; VAR handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr;
  605.     {$IFC NOT GENERATINGCFM}
  606.     INLINE $303C, $0921, $A816;
  607.     {$ENDC}
  608. {*************************************************************************
  609.   These calls are used to set up and modify the coercion dispatch table.
  610. *************************************************************************}
  611. FUNCTION AEInstallCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; handlerRefcon: LONGINT; fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr;
  612.     {$IFC NOT GENERATINGCFM}
  613.     INLINE $303C, $0A22, $A816;
  614.     {$ENDC}
  615. FUNCTION AERemoveCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; isSysHandler: BOOLEAN): OSErr;
  616.     {$IFC NOT GENERATINGCFM}
  617.     INLINE $303C, $0723, $A816;
  618.     {$ENDC}
  619. FUNCTION AEGetCoercionHandler(fromType: DescType; toType: DescType; VAR handler: AECoercionHandlerUPP; VAR handlerRefcon: LONGINT; VAR fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr;
  620.     {$IFC NOT GENERATINGCFM}
  621.     INLINE $303C, $0B24, $A816;
  622.     {$ENDC}
  623. {*************************************************************************
  624.   These calls are used to set up and modify special hooks into the
  625.   AppleEvent manager.
  626. *************************************************************************}
  627. FUNCTION AEInstallSpecialHandler(functionClass: AEKeyword; handler: UniversalProcPtr; isSysHandler: BOOLEAN): OSErr;
  628.     {$IFC NOT GENERATINGCFM}
  629.     INLINE $303C, $0500, $A816;
  630.     {$ENDC}
  631. FUNCTION AERemoveSpecialHandler(functionClass: AEKeyword; handler: UniversalProcPtr; isSysHandler: BOOLEAN): OSErr;
  632.     {$IFC NOT GENERATINGCFM}
  633.     INLINE $303C, $0501, $A816;
  634.     {$ENDC}
  635. FUNCTION AEGetSpecialHandler(functionClass: AEKeyword; VAR handler: UniversalProcPtr; isSysHandler: BOOLEAN): OSErr;
  636.     {$IFC NOT GENERATINGCFM}
  637.     INLINE $303C, $052D, $A816;
  638.     {$ENDC}
  639. {*************************************************************************
  640.   This call was added in version 1.0.1. If called with the keyword
  641.   keyAERecorderCount ('recr'), the number of recorders that are
  642.   currently active is returned in 'result'.
  643. *************************************************************************}
  644. { available only in vers 1.0.1 and greater }
  645. FUNCTION AEManagerInfo(keyWord: AEKeyword; VAR result: LONGINT): OSErr;
  646.     {$IFC NOT GENERATINGCFM}
  647.     INLINE $303C, $0441, $A816;
  648.     {$ENDC}
  649.  
  650. {$ALIGN RESET}
  651. {$POP}
  652.  
  653. {$SETC UsingIncludes := AppleEventsIncludes}
  654.  
  655. {$ENDC} {__APPLEEVENTS__}
  656.  
  657. {$IFC NOT UsingIncludes}
  658.  END.
  659. {$ENDC}
  660.