home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 August / macformat-027.iso / mac / Shareware City / Developers / Oberon⁄F / Mac / Mod / AEventMgr (.txt) next >
Encoding:
Oberon Document  |  1994-06-07  |  5.5 KB  |  116 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Geneva
  16. Geneva
  17. StdStamps.StdViewDesc
  18. Geneva
  19. Geneva
  20. MODULE MacAEventMgr;
  21. (* cp 
  22.     IMPORT SYSTEM, MacTypes, MacEventMgr;
  23.     CONST
  24.         typeAEList* = 6C697374H;    (** "list" **)
  25.         typeFSS* = 66737320H;    (** "fss " **)
  26.         keyDirectObject* = 2D2D2D2DH;    (** "----" **)
  27.         kCoreEventClass* = 61657674H;    (** "aevt" **)
  28.         kAEOpenApplication* = 6F617070H;    (** "oapp" **)
  29.         kAEOpenDocuments* = 6F646F63H;    (** "odoc" **)
  30.         kAEPrintDocuments* = 70646F63H;    (** "pdoc" **)
  31.         kAEQuitApplication* = 71756974H;    (** "quit" **)
  32.         kAEAnswer* = 616E7372H;    (** "ansr" **)
  33.         kAEApplicationDied* = 6F626974H;    (** "obit" **)
  34.         UNTAGGED = 1;
  35.         CODE = 1; NOSTKCHK = 4;
  36.     TYPE
  37.         DescType* = LONGINT;
  38.         AEEventClass* = LONGINT;
  39.         AEEventID* = LONGINT;
  40.         AEKeyword* = LONGINT;
  41.         AEDesc* = RECORD (MacTypes.Data)
  42.             descKey*: AEKeyword;
  43.             dataHandle*: MacTypes.Handle
  44.         END;
  45.         AEDescList* = AEDesc;
  46.         AERecord* = AEDescList;
  47.         AppleEvent* = AERecord;
  48.         EventHandler* = PROCEDURE (aevt, reply: AppleEvent; refcon: LONGINT): INTEGER;
  49.     PROCEDURE [CODE] aeInstallEventHandler (theAEEventClass: AEEventClass;
  50.                             theAEEventID: AEEventID; handler: EventHandler;
  51.                             handlerRefcon: LONGINT; isSysHandler: INTEGER): INTEGER 0A8H, 016H;
  52.     PROCEDURE [CODE] aeProcessAppleEvent (theEventRecord: MacEventMgr.EventRecord): INTEGER 0A8H, 016H;
  53.     PROCEDURE [CODE] aeGetParamDesc (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword;
  54.                             desiredType: DescType; VAR result: AEDesc): INTEGER 0A8H, 016H;
  55.     PROCEDURE [CODE] aeCountItems (theAEDescList: AEDescList; VAR theCount: LONGINT): INTEGER 0A8H, 016H;
  56.     PROCEDURE [CODE] aeGetNthPtr (theAEDescList: AEDescList; index: LONGINT;
  57.                             desiredType: DescType; VAR theAEKeyword: AEKeyword;
  58.                             VAR typeCode: DescType; dataPtr: MacTypes.Ptr; maximumSize: LONGINT;
  59.                             VAR actualSize: LONGINT): INTEGER 0A8H, 016H;
  60.     PROCEDURE [CODE] aeDisposeDesc (VAR theAEDesc: AEDesc): INTEGER 0A8H, 016H;
  61.     (** Creating and Managing the Apple Event Dispatch Tables **)
  62.     PROCEDURE [NOSTKCHK] AEInstallEventHandler* (theAEEventClass: AEEventClass;
  63.                         theAEEventID: AEEventID; handler: EventHandler;
  64.                         handlerRefcon: LONGINT; isSysHandler: BOOLEAN): INTEGER;
  65.     BEGIN
  66.         SYSTEM.PUTREG(0, LONG(091FH));
  67.         RETURN aeInstallEventHandler(theAEEventClass, theAEEventID, handler, handlerRefcon, 0)
  68.     END AEInstallEventHandler;
  69.     (** Dispatching Apple Events **)
  70.     PROCEDURE [NOSTKCHK] AEProcessAppleEvent* (theEventRecord: MacEventMgr.EventRecord): INTEGER;
  71.     BEGIN
  72.         SYSTEM.PUTREG(0, LONG(021BH));
  73.         RETURN aeProcessAppleEvent(theEventRecord)
  74.     END AEProcessAppleEvent;
  75.     (** Getting Parameters and Attributes From Apple Events **)
  76.     PROCEDURE [NOSTKCHK] AEGetParamDesc* (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword;
  77.                         desiredType: DescType; VAR result: AEDesc): INTEGER;
  78.     BEGIN
  79.         SYSTEM.PUTREG(0, LONG(0812H));
  80.         RETURN aeGetParamDesc(theAppleEvent, theAEKeyword, desiredType, result)
  81.     END AEGetParamDesc;
  82.     (** Counting the Items in Descriptor Lists **)
  83.     PROCEDURE [NOSTKCHK] AECountItems* (theAEDescList: AEDescList; VAR theCount: LONGINT): INTEGER;
  84.     BEGIN
  85.         SYSTEM.PUTREG(0, LONG(0407H));
  86.         RETURN aeCountItems(theAEDescList, theCount)
  87.     END AECountItems;
  88.     (** Getting Items From Descriptor Lists **)
  89.     PROCEDURE [NOSTKCHK] AEGetNthPtr* (theAEDescList: AEDescList; index: LONGINT;
  90.                         desiredType: DescType; VAR theAEKeyword: AEKeyword;
  91.                         VAR typeCode: DescType; dataPtr: MacTypes.Ptr; maximumSize: LONGINT;
  92.                         VAR actualSize: LONGINT): INTEGER;
  93.     BEGIN
  94.         SYSTEM.PUTREG(0, LONG(100AH));
  95.         RETURN aeGetNthPtr(theAEDescList, index, desiredType, theAEKeyword, typeCode,
  96.                         dataPtr, maximumSize, actualSize)
  97.     END AEGetNthPtr;
  98.     (** Deallocating Memory for Descriptor Records **)
  99.     PROCEDURE [NOSTKCHK] AEDisposeDesc* (VAR theAEDesc: AEDesc): INTEGER;
  100.     BEGIN
  101.         SYSTEM.PUTREG(0, LONG(0204H));
  102.         RETURN aeDisposeDesc(theAEDesc)
  103.     END AEDisposeDesc;
  104. END MacAEventMgr.
  105. TextControllers.StdCtrlDesc
  106. TextControllers.ControllerDesc
  107. Containers.ControllerDesc
  108. Controllers.ControllerDesc
  109. TextRulers.StdRulerDesc
  110. TextRulers.RulerDesc
  111. TextRulers.StdStyleDesc
  112. TextRulers.StyleDesc
  113. TextRulers.AttributesDesc
  114. Geneva
  115. Documents.ControllerDesc
  116.