2002-08-04 18:34:24 -03:00
|
|
|
# IBCarbonscan.py
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import string
|
|
|
|
|
2002-08-05 12:39:30 -03:00
|
|
|
from bgenlocations import TOOLBOXDIR, BGENDIR
|
2002-08-04 18:34:24 -03:00
|
|
|
sys.path.append(BGENDIR)
|
|
|
|
|
|
|
|
from scantools import Scanner_OSX
|
|
|
|
|
|
|
|
def main():
|
2004-07-18 03:16:08 -03:00
|
|
|
print "---Scanning IBCarbonRuntime.h---"
|
|
|
|
input = ["IBCarbonRuntime.h"]
|
|
|
|
output = "IBCarbongen.py"
|
|
|
|
defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py"
|
|
|
|
scanner = IBCarbon_Scanner(input, output, defsoutput)
|
|
|
|
scanner.scan()
|
|
|
|
scanner.close()
|
|
|
|
print "=== Testing definitions output code ==="
|
2007-08-11 21:43:29 -03:00
|
|
|
exec(open(defsoutput).read(), {}, {})
|
2004-07-18 03:16:08 -03:00
|
|
|
print "--done scanning, importing--"
|
|
|
|
import IBCarbonsupport
|
|
|
|
print "done"
|
2002-08-04 18:34:24 -03:00
|
|
|
|
|
|
|
class IBCarbon_Scanner(Scanner_OSX):
|
2002-08-04 18:59:37 -03:00
|
|
|
|
2004-07-18 03:16:08 -03:00
|
|
|
def destination(self, type, name, arglist):
|
|
|
|
classname = "IBCarbonFunction"
|
|
|
|
listname = "functions"
|
|
|
|
if arglist:
|
|
|
|
t, n, m = arglist[0]
|
|
|
|
if t == "IBNibRef" and m == "InMode":
|
|
|
|
classname = "IBCarbonMethod"
|
|
|
|
listname = "methods"
|
|
|
|
return classname, listname
|
|
|
|
|
|
|
|
def makeblacklistnames(self):
|
|
|
|
return [
|
|
|
|
"DisposeNibReference", # taken care of by destructor
|
|
|
|
"CreateNibReferenceWithCFBundle", ## need to wrap CFBundle.h properly first
|
|
|
|
]
|
|
|
|
|
|
|
|
def makerepairinstructions(self):
|
|
|
|
return []
|
2002-08-04 18:59:37 -03:00
|
|
|
|
2002-08-04 18:34:24 -03:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2004-07-18 03:16:08 -03:00
|
|
|
main()
|