blob: 96f9b55b854bf7298331763cb4ad968aea97d029 [file] [log] [blame]
Jack Jansen52e90452001-11-05 14:44:23 +00001# IBCarbonscan.py
2
3import sys
4import os
5import string
6import MacOS
7
8BGENDIR= '/Users/dsp/Documents/python/dist/src/Tools/bgen/bgen'
9sys.path.append(BGENDIR)
10
11from bgenlocations import TOOLBOXDIR
12
13from scantools import Scanner, Scanner_OSX
14
15def main():
16 print "---Scanning CarbonEvents.h---"
17 input = ["CarbonEvents.h"]
18 output = "CarbonEventsgen.py"
19 defsoutput = TOOLBOXDIR + "CarbonEvents.py"
20 scanner = CarbonEvents_Scanner(input, output, defsoutput)
21 scanner.scan()
22 scanner.close()
23 print "--done scanning, importing--"
24 import CarbonEventssupport
25 print "done"
26
27RefObjectTypes = ["EventRef",
28 "EventQueueRef",
29 "EventLoopRef",
30 "EventLoopTimerRef",
31 "EventHandlerRef",
32 "EventHandlerCallRef",
33 "EventTargetRef",
34 "EventHotKeyRef",
35 ]
36
37class CarbonEvents_Scanner(Scanner):
38 def destination(self, type, name, arglist):
39 classname = "CarbonEventsFunction"
40 listname = "functions"
41 if arglist:
42 t, n, m = arglist[0]
43 print "*********", t,
44 if t in RefObjectTypes and m == "InMode":
45 print "method"
46 classname = "CarbonEventsMethod"
47 listname = t + "methods"
48 else:
49 print "not method"
50 return classname, listname
51
52 def makeblacklistnames(self):
53 return [
54 "MacCreateEvent",
55 "TrackMouseLocationWithOptions",
56 "TrackMouseLocation",
57 "TrackMouseRegion",
58 "RegisterToolboxObjectClass",
59 "UnregisterToolboxObjectClass",
60 "ProcessHICommand",
61 "GetCFRunLoopFromEventLoop",
62
63 "InvokeEventHandlerUPP",
64 "InvokeEventComparatorUPP",
65 "InvokeEventLoopTimerUPP",
66
67 # Wrote by hand
68 "InstallEventHandler",
69 "RunApplicationEventLoop",
70
71 # Write by hand?
72 "GetEventParameter",
73 "FlushSpecificEventsFromQueue",
74 "FindSpecificEventInQueue",
75 "InstallEventLoopTimer",
76
77 # Don't do these because they require a CFRelease
78 "CreateTypeStringWithOSType",
79 "CopyEvent",
80 ]
81
82# def makeblacklisttypes(self):
83# return ["EventComparatorUPP",
84# "EventLoopTimerUPP",
85# #"EventHandlerUPP",
86# "EventComparatorProcPtr",
87# "EventLoopTimerProcPtr",
88# "EventHandlerProcPtr",
89# ]
90if __name__ == "__main__":
91 main()