Commit c7cfb955 authored by Jack Jansen's avatar Jack Jansen

Rather massive changes:

- Make the stuff run on Jack's machine (and hopefully all machines) in
  stead of Guido's only (addpack stuff)
- Use the Universal Headers in stead of the Think headers
- Fixed the test programs to use the new routine names
parent f301dcac
......@@ -7,7 +7,7 @@ can have (without having to rely on Apple's implementation).
"""
import addpack
addpack.addpack('Demo')
addpack.addpack('Tools')
addpack.addpack('bgen')
addpack.addpack('ae')
addpack.addpack('evt')
......
# Generated from 'D:Development:THINK C:Mac #includes:Apple #includes:AppleEvents.h'
# Generated from 'Moes:CW5 GOLD \304:Metrowerks C/C++ \304:Headers \304:Universal Headers 2.0a3 \304:AppleEvents.h'
typeBoolean = 'bool'
typeChar = 'TEXT'
......@@ -28,6 +28,8 @@ typeKeyword = 'keyw'
typeSectionH = 'sect'
typeWildCard = '****'
typeApplSignature = 'sign'
typeQDRectangle = 'qdrt'
typeFixed = 'fixd'
typeSessionID = 'ssid'
typeTargetID = 'targ'
typeProcessSerialNumber = 'psn '
......@@ -79,26 +81,24 @@ kAnyTransactionID = 0
kAEDefaultTimeout = -1
kNoTimeOut = -2
kAENoDispatch = 0
kAEUseStandardDispatch = -1
errAECoercionFail = -1700
errAEDescNotFound = -1701
errAECorruptData = -1702
errAEWrongDataType = -1703
errAENotAEDesc = -1704
errAEBadListItem = -1705
errAENewerVersion = -1706
errAENotAppleEvent = -1707
errAEEventNotHandled = -1708
errAEReplyNotValid = -1709
errAEUnknownSendMode = -1710
errAEWaitCanceled = -1711
errAETimeout = -1712
errAENoUserInteraction = -1713
errAENotASpecialFunction = -1714
errAEParamMissed = -1715
errAEUnknownAddressType = -1716
errAEHandlerNotFound = -1717
errAEReplyNotArrived = -1718
errAEIllegalIndex = -1719
errAEUnknownObjectType = -1731
errAERecordingIsAlreadyOn = -1732
kAEUseStandardDispatch = 0xFFFFFFFF
kAEDoNotIgnoreHandler = 0x00000000
kAEIgnoreAppPhacHandler = 0x00000001
kAEIgnoreAppEventHandler = 0x00000002
kAEIgnoreSysPhacHandler = 0x00000004
kAEIgnoreSysEventHandler = 0x00000008
kAEIngoreBuiltInEventHandler = 0x00000010
kAEDontDisposeOnResume = 0x80000000
kAEInteractWithSelf = 0
kAEInteractWithLocal = 1
kAEInteractWithAll = 2
kAEUnknownSource = 0
kAEDirectCall = 1
kAESameProcess = 2
kAELocalProcess = 3
kAERemoteProcess = 4
kAEDataArray = 0
kAEPackedArray = 1
kAEHandleArray = 2
kAEDescArray = 3
kAEKeyDescArray = 4
......@@ -68,7 +68,7 @@ def pack(x, forcetype = None):
if t == DictionaryType:
record = AE.AECreateList('', 1)
for key, value in x.items():
record.AEPutKeyDesc(key, pack(value))
record.AEPutParamDesc(key, pack(value))
return record
if t == InstanceType and hasattr(x, '__aepack__'):
return x.__aepack__()
......
This diff is collapsed.
# Generated from 'D:Development:THINK C:Mac #includes:Apple #includes:AppleEvents.h'
# Generated from 'Moes:CW5 GOLD \304:Metrowerks C/C++ \304:Headers \304:Universal Headers 2.0a3 \304:AppleEvents.h'
f = AEFunction(OSErr, 'AECreateDesc',
(DescType, 'typeCode', InMode),
......@@ -41,20 +41,20 @@ f = AEMethod(OSErr, 'AECountItems',
)
aedescmethods.append(f)
f = AEMethod(OSErr, 'AEPutPtr',
(AEDescList_ptr, 'theAEDescList', InMode),
f = AEFunction(OSErr, 'AEPutPtr',
(AEDescList, 'theAEDescList', OutMode),
(long, 'index', InMode),
(DescType, 'typeCode', InMode),
(InBuffer, 'dataPtr', InMode),
)
aedescmethods.append(f)
functions.append(f)
f = AEMethod(OSErr, 'AEPutDesc',
(AEDescList_ptr, 'theAEDescList', InMode),
f = AEFunction(OSErr, 'AEPutDesc',
(AEDescList, 'theAEDescList', OutMode),
(long, 'index', InMode),
(AEDesc_ptr, 'theAEDesc', InMode),
)
aedescmethods.append(f)
functions.append(f)
f = AEMethod(OSErr, 'AEGetNthPtr',
(AEDescList_ptr, 'theAEDescList', InMode),
......@@ -83,57 +83,11 @@ f = AEMethod(OSErr, 'AESizeOfNthItem',
)
aedescmethods.append(f)
f = AEMethod(OSErr, 'AEDeleteItem',
(AEDescList_ptr, 'theAEDescList', InMode),
f = AEFunction(OSErr, 'AEDeleteItem',
(AEDescList, 'theAEDescList', OutMode),
(long, 'index', InMode),
)
aedescmethods.append(f)
f = AEMethod(OSErr, 'AEPutKeyPtr',
(AERecord_ptr, 'theAERecord', InMode),
(AEKeyword, 'theAEKeyword', InMode),
(DescType, 'typeCode', InMode),
(InBuffer, 'dataPtr', InMode),
)
aedescmethods.append(f)
f = AEMethod(OSErr, 'AEPutKeyDesc',
(AERecord_ptr, 'theAERecord', InMode),
(AEKeyword, 'theAEKeyword', InMode),
(AEDesc_ptr, 'theAEDesc', InMode),
)
aedescmethods.append(f)
f = AEMethod(OSErr, 'AEGetKeyPtr',
(AERecord_ptr, 'theAERecord', InMode),
(AEKeyword, 'theAEKeyword', InMode),
(DescType, 'desiredType', InMode),
(DescType, 'typeCode', OutMode),
(VarVarOutBuffer, 'dataPtr', InOutMode),
)
aedescmethods.append(f)
f = AEMethod(OSErr, 'AEGetKeyDesc',
(AERecord_ptr, 'theAERecord', InMode),
(AEKeyword, 'theAEKeyword', InMode),
(DescType, 'desiredType', InMode),
(AEDesc, 'result', OutMode),
)
aedescmethods.append(f)
f = AEMethod(OSErr, 'AESizeOfKeyDesc',
(AERecord_ptr, 'theAERecord', InMode),
(AEKeyword, 'theAEKeyword', InMode),
(DescType, 'typeCode', OutMode),
(Size, 'dataSize', OutMode),
)
aedescmethods.append(f)
f = AEMethod(OSErr, 'AEDeleteKeyDesc',
(AERecord_ptr, 'theAERecord', InMode),
(AEKeyword, 'theAEKeyword', InMode),
)
aedescmethods.append(f)
functions.append(f)
f = AEMethod(OSErr, 'AEPutParamPtr',
(AppleEvent_ptr, 'theAppleEvent', InMode),
......@@ -237,8 +191,8 @@ f = AEMethod(OSErr, 'AESend',
(AESendMode, 'sendMode', InMode),
(AESendPriority, 'sendPriority', InMode),
(long, 'timeOutInTicks', InMode),
(IdleProcPtr, 'idleProc', InMode),
(EventFilterProcPtr, 'filterProc', InMode),
(AEIdleUPP, 'idleProc', InMode),
(AEFilterUPP, 'filterProc', InMode),
)
aedescmethods.append(f)
......@@ -260,14 +214,15 @@ aedescmethods.append(f)
f = AEMethod(OSErr, 'AEResumeTheCurrentEvent',
(AppleEvent_ptr, 'theAppleEvent', InMode),
(AppleEvent_ptr, 'reply', InMode),
(EventHandler, 'dispatcher', InMode),
(AEEventHandlerUPP, 'dispatcher', InMode),
(long, 'handlerRefcon', InMode),
)
aedescmethods.append(f)
f = AEFunction(OSErr, 'AEGetTheCurrentEvent',
(AppleEvent, 'theAppleEvent', OutMode),
f = AEMethod(OSErr, 'AEGetTheCurrentEvent',
(AppleEvent_ptr, 'theAppleEvent', InMode),
)
functions.append(f)
aedescmethods.append(f)
f = AEMethod(OSErr, 'AESetTheCurrentEvent',
(AppleEvent_ptr, 'theAppleEvent', InMode),
......@@ -287,14 +242,15 @@ functions.append(f)
f = AEFunction(OSErr, 'AEInteractWithUser',
(long, 'timeOutInTicks', InMode),
(NMRecPtr, 'nmReqPtr', InMode),
(IdleProcPtr, 'idleProc', InMode),
(AEIdleUPP, 'idleProc', InMode),
)
functions.append(f)
f = AEFunction(OSErr, 'AEInstallEventHandler',
(AEEventClass, 'theAEEventClass', InMode),
(AEEventID, 'theAEEventID', InMode),
(EventHandler, 'handler', InMode),
(AEEventHandlerUPP, 'handler', InMode),
(long, 'handlerRefcon', InMode),
(AlwaysFalse, 'isSysHandler', InMode),
)
functions.append(f)
......@@ -302,7 +258,7 @@ functions.append(f)
f = AEFunction(OSErr, 'AERemoveEventHandler',
(AEEventClass, 'theAEEventClass', InMode),
(AEEventID, 'theAEEventID', InMode),
(EventHandlerProcPtr, 'handler', InMode),
(AEEventHandlerUPP, 'handler', InMode),
(AlwaysFalse, 'isSysHandler', InMode),
)
functions.append(f)
......
......@@ -2,6 +2,8 @@
# Then run aesupport to generate AEmodule.c.
0# (Should learn how to tell the compiler to compile it as well.)
import addpack
addpack.addpack(':Tools:bgen:bgen')
import sys
import os
import string
......@@ -46,6 +48,8 @@ class AppleEventsScanner(Scanner):
return [
"ProcPtr",
"AEArrayType",
"AECoercionHandlerUPP",
"UniversalProcPtr",
]
def makerepairinstructions(self):
......@@ -65,6 +69,9 @@ class AppleEventsScanner(Scanner):
([("void", "*", "OutMode"), ("Size", "*", "InMode"),
("Size", "*", "OutMode")],
[("VarVarOutBuffer", "*", "InOutMode")]),
([("AppleEvent", "theAppleEvent", "OutMode")],
[("AppleEvent_ptr", "*", "InMode")]),
]
if __name__ == "__main__":
......
......@@ -3,6 +3,8 @@
# It execs the file aegen.py which contain the function definitions
# (aegen.py was generated by aescan.py, scanning the <AppleEvents.h> header file).
import addpack
addpack.addpack(':Tools:bgen:bgen')
from macsupport import *
......@@ -65,9 +67,12 @@ EventHandlerNoRefCon = EHNoRefConType()
IdleProcPtr = FakeType("upp_AEIdleProc")
AEIdleUPP = IdleProcPtr
EventFilterProcPtr = FakeType("(AEFilterUPP)0")
AEFilterUPP = EventFilterProcPtr
NMRecPtr = FakeType("(NMRecPtr)0")
EventHandlerProcPtr = FakeType("upp_GenericEventHandler")
AEEventHandlerUPP = EventHandlerProcPtr
AlwaysFalse = FakeType("0")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment