1# IBCarbonscan.py
2
3import sys
4
5from bgenlocations import TOOLBOXDIR, BGENDIR
6sys.path.append(BGENDIR)
7
8from scantools import Scanner_OSX
9
10def main():
11    print "---Scanning IBCarbonRuntime.h---"
12    input = ["IBCarbonRuntime.h"]
13    output = "IBCarbongen.py"
14    defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py"
15    scanner = IBCarbon_Scanner(input, output, defsoutput)
16    scanner.scan()
17    scanner.close()
18    print "=== Testing definitions output code ==="
19    execfile(defsoutput, {}, {})
20    print "--done scanning, importing--"
21    import IBCarbonsupport
22    print "done"
23
24class IBCarbon_Scanner(Scanner_OSX):
25
26    def destination(self, type, name, arglist):
27        classname = "IBCarbonFunction"
28        listname = "functions"
29        if arglist:
30            t, n, m = arglist[0]
31            if t == "IBNibRef" and m == "InMode":
32                classname = "IBCarbonMethod"
33                listname = "methods"
34        return classname, listname
35
36    def makeblacklistnames(self):
37        return [
38                "DisposeNibReference",                          # taken care of by destructor
39                "CreateNibReferenceWithCFBundle",  ## need to wrap CFBundle.h properly first
40                ]
41
42    def makerepairinstructions(self):
43        return []
44
45
46if __name__ == "__main__":
47    main()
48