1 # Scan AppleEvents.h header file, generate aegen.py and AppleEvents.py files.
2 # Then run aesupport to generate AEmodule.c.
3 0# (Should learn how to tell the compiler to compile it as well.)
12 from scantools
import Scanner
15 input = "AppleEvents.h"
17 defsoutput
= "AppleEvents.py"
18 scanner
= AppleEventsScanner(input, output
, defsoutput
)
21 print "=== Done Scanning and Generating, now doing 'import aesupport' ==="
23 print "=== Done 'import aesupport'. It's up to you to compile AEmodule.c ==="
25 class AppleEventsScanner(Scanner
):
27 def destination(self
, type, name
, arglist
):
28 classname
= "AEFunction"
29 listname
= "functions"
32 if t
[-4:] == "_ptr" and m
== "InMode" and \
33 t
[:-4] in ("AEDesc", "AEAddressDesc", "AEDescList",
34 "AERecord", "AppleEvent"):
35 classname
= "AEMethod"
36 listname
= "aedescmethods"
37 return classname
, listname
39 def makeblacklistnames(self
):
45 def makeblacklisttypes(self
):
51 def makerepairinstructions(self
):
53 ([("Boolean", "isSysHandler", "InMode")],
54 [("AlwaysFalse", "*", "*")]),
56 ([("void_ptr", "*", "InMode"), ("Size", "*", "InMode")],
57 [("InBuffer", "*", "*")]),
59 ([("EventHandlerProcPtr", "*", "InMode"), ("long", "*", "InMode")],
60 [("EventHandler", "*", "*")]),
62 ([("EventHandlerProcPtr", "*", "OutMode"), ("long", "*", "OutMode")],
63 [("EventHandler", "*", "*")]),
65 ([("void", "*", "OutMode"), ("Size", "*", "InMode"),
66 ("Size", "*", "OutMode")],
67 [("VarVarOutBuffer", "*", "InOutMode")]),
70 if __name__
== "__main__":