1 # Scan <Menus.h>, generating menugen.py.
3 addpack
.addpack(':Tools:bgen:bgen')
5 from scantools
import Scanner
6 from bgenlocations
import TOOLBOXDIR
11 defsoutput
= TOOLBOXDIR
+ "Menus.py"
12 scanner
= MyScanner(input, output
, defsoutput
)
15 print "=== Done scanning and generating, now doing 'import menusupport' ==="
17 print "=== Done. It's up to you to compile Menumodule.c ==="
19 class MyScanner(Scanner
):
21 def destination(self
, type, name
, arglist
):
22 classname
= "Function"
23 listname
= "functions"
26 if t
in ("MenuHandle", "MenuRef") and m
== "InMode":
29 return classname
, listname
31 def makeblacklistnames(self
):
35 def makeblacklisttypes(self
):
42 def makerepairinstructions(self
):
44 ([("Str255", "itemString", "InMode")],
45 [("*", "*", "OutMode")]),
47 ([("void_ptr", "*", "InMode"), ("long", "*", "InMode")],
48 [("InBuffer", "*", "*")]),
50 ([("void", "*", "OutMode"), ("long", "*", "InMode"),
51 ("long", "*", "OutMode")],
52 [("VarVarOutBuffer", "*", "InOutMode")]),
55 if __name__
== "__main__":