1 # Scan <Controls.h>, generating ctlgen.py.
3 addpack
.addpack(':Tools:bgen:bgen')
5 from scantools
import Scanner
6 from bgenlocations
import TOOLBOXDIR
11 defsoutput
= TOOLBOXDIR
+ "Controls.py"
12 scanner
= MyScanner(input, output
, defsoutput
)
15 print "=== Done scanning and generating, now doing 'import ctlsupport' ==="
17 print "=== Done. It's up to you to compile Ctlmodule.c ==="
19 class MyScanner(Scanner
):
21 def destination(self
, type, name
, arglist
):
22 classname
= "Function"
23 listname
= "functions"
26 if t
in ("ControlHandle", "ControlRef") and m
== "InMode":
29 return classname
, listname
31 def makeblacklistnames(self
):
33 'DisposeControl' # Implied by deletion of control object
34 'KillControls', # Implied by close of dialog
38 def makeblacklisttypes(self
):
46 def makerepairinstructions(self
):
48 ([("void_ptr", "*", "InMode"), ("long", "*", "InMode")],
49 [("InBuffer", "*", "*")]),
51 ([("void", "*", "OutMode"), ("long", "*", "InMode"),
52 ("long", "*", "OutMode")],
53 [("VarVarOutBuffer", "*", "InOutMode")]),
56 ([("ProcPtr", "actionProc", "InMode")],
57 [("FakeType('(ControlActionUPP)0')", "*", "*")]),
58 ([("ControlActionUPP", "actionProc", "InMode")],
59 [("FakeType('(ControlActionUPP)0')", "*", "*")]),
61 ([("ControlHandle", "*", "OutMode")],
62 [("ExistingControlHandle", "*", "*")]),
63 ([("ControlRef", "*", "OutMode")], # Ditto, for Universal Headers
64 [("ExistingControlHandle", "*", "*")]),
67 if __name__
== "__main__":