1 # Scan <Menus.h>, generating menugen.py.
3 addpack
.addpack(':Tools:bgen:bgen')
5 from scantools
import Scanner
10 defsoutput
= "Menus.py"
11 scanner
= MyScanner(input, output
, defsoutput
)
14 print "=== Done scanning and generating, now doing 'import menusupport' ==="
16 print "=== Done. It's up to you to compile Menumodule.c ==="
18 class MyScanner(Scanner
):
20 def destination(self
, type, name
, arglist
):
21 classname
= "Function"
22 listname
= "functions"
25 if t
in ("MenuHandle", "MenuRef") and m
== "InMode":
28 return classname
, listname
30 def makeblacklistnames(self
):
34 def makeblacklisttypes(self
):
41 def makerepairinstructions(self
):
43 ([("Str255", "itemString", "InMode")],
44 [("*", "*", "OutMode")]),
46 ([("void_ptr", "*", "InMode"), ("long", "*", "InMode")],
47 [("InBuffer", "*", "*")]),
49 ([("void", "*", "OutMode"), ("long", "*", "InMode"),
50 ("long", "*", "OutMode")],
51 [("VarVarOutBuffer", "*", "InOutMode")]),
54 if __name__
== "__main__":