sys7.1-doc-wip/Toolbox/AppleEventMgr/AEDFGlue.a
2019-07-27 22:37:48 +08:00

171 lines
4.4 KiB
Plaintext

;
; File: AEDFGlue.a
;
; Contains: xxx put contents here xxx
;
; Written by: xxx put writers here xxx
;
; Copyright: © 1990 by Apple Computer, Inc., all rights reserved.
;
; This file is used in these builds: MacPP
;
; Change History (most recent first):
;
; <5> 12/13/90 Lai Put back header comment missed in the last Check in. Add
; extension proc support and entry point for hashing functions.
;
; To Do:
;
;
; <3> 9/19/90 Lai There should be 46 entries in the dispatch table instead of 45
; <2> 9/14/90 Lai Change size of system global handle
; <1> 9/7/90 Lai first checked in
;
; To Do:
;
; =======================================================================================
; Files needed by this Package
; =======================================================================================
PRINT OFF
LOAD 'StandardEqu.d'
PRINT ON
STRING ASIS
; =======================================================================================
; routines that are called by this code
; =======================================================================================
MACRO
JT &entry
IMPORT &entry
DC.W &entry - TableBase
ENDM
; =======================================================================================
; record structure of the global record
; =======================================================================================
aeGlobalRec RECORD 0
aeHashTable DS.L 1
coercionHashTable DS.L 1
kurtHashTable DS.L 1
phacProcPtr DS.L 1
selhProcPtr DS.L 1
blockingPtr DS.L 1
unblockingPtr DS.L 1
diposeTokenProcPtr DS.L 1
AENonAevtHandler DS.L 1
ENDR
; =======================================================================================
; Main entry point for the AppleEvent manager Package
; =======================================================================================
AEMgr main
; PROC Export
DC.W $A9FF
DC.B 'PACK' ; resource type
DC.W 8 ; pack 8
DC.W 1 ; version 1
TableBase DC.W 0 ; flags
DC.B 0
DC.B (TableEnd-TableBegin)/2-1
TableBegin EQU *
JT AE_InstallSpecialHandler
JT AE_RemoveSpecialHandler
JT AE_CoercePtr
JT AE_CoerceDesc
JT AE_DisposeDesc
JT AE_DuplicateDesc
JT AE_CreateList
JT AE_CountItems
JT AE_PutPtr
JT AE_PutDesc
JT AE_GetNthPtr
JT AE_GetNthDesc
JT AE_GetArray
JT AE_PutArray
JT AE_DeleteItem
JT AE_PutKeyPtr
JT AE_PutKeyDesc
JT AE_GetKeyPtr
JT AE_GetKeyDesc
JT AE_DeleteKeyDesc
JT AE_CreateAppleEvent
JT AE_GetAttributePtr
JT AE_PutAttributePtr
JT AE_Send
JT AE_ResumeTheCurrentEvent
JT AE_ResetTimer
JT AE_GetTheCurrentEvent
JT AE_ProcessAppleEvent
JT AE_InteractWithUser
JT AE_GetInteractionAllowed
JT AE_SetInteractionAllowed
JT AE_InstallEventHandler
JT AE_RemoveEventHandler
JT AE_GetEventHandler
JT AE_InstallCoercionHandler
JT AE_RemoveCoercionHandler
JT AE_GetCoercionHandler
JT AE_CreateDesc
JT AE_GetAttributeDesc
JT AE_PutAttributeDesc
JT AE_SizeOfAttribute
JT AE_SizeOfKeyDesc
JT AE_SizeOfNthItem
JT AE_SuspendTheCurrentEvent
JT AE_SetTheCurrentEvent
JT AE_GetSpecialHandler
JT NewHashTable
JT DisposeHashTable
JT AddKeyEntry
JT ReplaceEntry
JT RemoveKeyEntry
JT GetKeyValue
JT GetIndexedEntry
DC.W ExtensionProc-TableBase
DC.W ExtensionProc-TableBase
DC.W ExtensionProc-TableBase
DC.W ExtensionProc-TableBase
DC.W ExtensionProc-TableBase
DC.W ExtensionProc-TableBase
DC.W ExtensionProc-TableBase
DC.W ExtensionProc-TableBase
DC.W ExtensionProc-TableBase
DC.W ExtensionProc-TableBase
TableEnd EQU *
ExtensionProc
MOVE.L ExpandMem,A0 ; get expanded memory area
MOVE.L ExpandMemRec.emAppleEvents(A0),D1 ; get application globals location
BEQ.S noApplSelh ; no application glboal yet
MOVE.L D1,A1
MOVE.L (A1),A1 ; dereference it
MOVE.L aeGlobalRec.selhProcPtr(A1),D1; get the actual selector proc
BNE.S goExecIt
noApplSelh MOVE.L ExpandMemRec.emAppleEventsGlobal(A0),D1 ; get system globals location
BEQ.S noSysSelh ; no system glboal yet
MOVE.L D1,A1
MOVE.L (A1),A1 ; dereference it
MOVE.L aeGlobalRec.selhProcPtr(A1),D1; get the actual selector proc
BEQ.S noSysSelh
goExecIt MOVE.L D1,A0 ; the execution address
LEA noSysSelh,A1
JMP (A0)
; if called by the selh proc, they must preserve D0
noSysSelh MOVE.L (SP)+,A0 ; A1 = return address
LSR.W #8,D0 ; D0.W = words of parameters
ADD.W D0,D0 ; D0.W = bytes of parameters
ADD.W D0,SP ; strip off parameters
MOVE.W #paramErr,(SP) ; return parameter error
JMP (A0) ; return to caller
ENDP
END