Don't reference removed files in Makefile
[python/dscho.git] / Mac / Modules / win / winscan.py
blob8d089a341c767349d5fa4d3f96df08ec74a52575
1 # Scan an Apple header file, generating a Python file of generator calls.
3 from scantools import Scanner
5 def main():
6 input = "Windows.h"
7 output = "wingen.py"
8 defsoutput = "Windows.py"
9 scanner = MyScanner(input, output, defsoutput)
10 scanner.scan()
11 scanner.close()
12 print "=== Done scanning and generating, now importing the generated code... ==="
13 import winsupport
14 print "=== Done. It's up to you to compile it now! ==="
16 class MyScanner(Scanner):
18 def destination(self, type, name, arglist):
19 classname = "Function"
20 listname = "functions"
21 if arglist:
22 t, n, m = arglist[0]
23 if t in ("WindowPtr", "WindowPeek") and m == "InMode":
24 classname = "Method"
25 listname = "methods"
26 return classname, listname
28 def makeblacklistnames(self):
29 return [
30 'DisposeWindow', # Implied when the object is deleted
31 'CloseWindow',
34 def makeblacklisttypes(self):
35 return [
36 'ProcPtr',
37 'GrafPtr',
38 'CGrafPtr',
39 'RgnHandle',
40 'PicHandle',
41 'WCTabHandle',
42 'AuxWinHandle',
43 'PixPatHandle',
46 def makerepairinstructions(self):
47 return [
49 # GetWTitle
50 ([("Str255", "*", "InMode")],
51 [("*", "*", "OutMode")]),
53 ([("void_ptr", "*", "InMode"), ("long", "*", "InMode")],
54 [("InBuffer", "*", "*")]),
56 ([("void", "*", "OutMode"), ("long", "*", "InMode"),
57 ("long", "*", "OutMode")],
58 [("VarVarOutBuffer", "*", "InOutMode")]),
60 ([("void", "wStorage", "OutMode")],
61 [("NullStorage", "*", "InMode")]),
63 ([("WindowPtr", "*", "OutMode")],
64 [("ExistingWindowPtr", "*", "*")]),
66 ([("WindowPtr", "FrontWindow", "ReturnMode")],
67 [("ExistingWindowPtr", "*", "*")]),
70 if __name__ == "__main__":
71 main()