OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (C) 2013 Google Inc. All rights reserved. | 2 # Copyright (C) 2013 Google Inc. All rights reserved. |
3 # | 3 # |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 or name == 'MutationEvent' | 85 or name == 'MutationEvent' |
86 or name == 'MutationEvents' | 86 or name == 'MutationEvents' |
87 or name == 'PageTransitionEvent' | 87 or name == 'PageTransitionEvent' |
88 or name == 'PopStateEvent' | 88 or name == 'PopStateEvent' |
89 or name == 'StorageEvent' | 89 or name == 'StorageEvent' |
90 or name == 'SVGEvents' | 90 or name == 'SVGEvents' |
91 or name == 'TextEvent' | 91 or name == 'TextEvent' |
92 or name == 'TrackEvent' | 92 or name == 'TrackEvent' |
93 or name == 'TransitionEvent' | 93 or name == 'TransitionEvent' |
94 or name == 'WebGLContextEvent' | 94 or name == 'WebGLContextEvent' |
95 or name == 'WebKitAnimationEvent' | |
96 or name == 'WebKitTransitionEvent' | 95 or name == 'WebKitTransitionEvent' |
97 or name == 'WheelEvent') | 96 or name == 'WheelEvent') |
98 | 97 |
99 | 98 |
100 def measure_name(name): | 99 def measure_name(name): |
101 return 'DocumentCreateEvent' + name | 100 return 'DocumentCreateEvent' + name |
102 | 101 |
103 | 102 |
104 class EventFactoryWriter(json5_generator.Writer): | 103 class EventFactoryWriter(json5_generator.Writer): |
105 default_parameters = { | 104 default_parameters = { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 def generate_implementation(self): | 175 def generate_implementation(self): |
177 return { | 176 return { |
178 'namespace': self.namespace, | 177 'namespace': self.namespace, |
179 'suffix': self.suffix, | 178 'suffix': self.suffix, |
180 'events': self.json5_file.name_dictionaries, | 179 'events': self.json5_file.name_dictionaries, |
181 } | 180 } |
182 | 181 |
183 | 182 |
184 if __name__ == "__main__": | 183 if __name__ == "__main__": |
185 json5_generator.Maker(EventFactoryWriter).main() | 184 json5_generator.Maker(EventFactoryWriter).main() |
OLD | NEW |