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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #endif // %(namespace)s%(suffix)sHeaders_h | 46 #endif // %(namespace)s%(suffix)sHeaders_h |
47 """ | 47 """ |
48 | 48 |
49 | 49 |
50 def case_insensitive_matching(name): | 50 def case_insensitive_matching(name): |
51 return (name == ('HTMLEvents') | 51 return (name == ('HTMLEvents') |
52 or name == 'Event' | 52 or name == 'Event' |
53 or name == 'Events' | 53 or name == 'Events' |
54 or name.startswith('UIEvent') | 54 or name.startswith('UIEvent') |
55 or name.startswith('CustomEvent') | 55 or name.startswith('CustomEvent') |
56 or name.startswith('MouseEvent')) | 56 or name == 'KeyboardEvent' |
| 57 or name == 'MessageEvent' |
| 58 or name.startswith('MouseEvent') |
| 59 or name == 'TouchEvent') |
57 | 60 |
58 | 61 |
59 class EventFactoryWriter(in_generator.Writer): | 62 class EventFactoryWriter(in_generator.Writer): |
60 defaults = { | 63 defaults = { |
61 'ImplementedAs': None, | 64 'ImplementedAs': None, |
62 'Conditional': None, | 65 'Conditional': None, |
63 'RuntimeEnabled': None, | 66 'RuntimeEnabled': None, |
64 } | 67 } |
65 default_parameters = { | 68 default_parameters = { |
66 'export': '', | 69 'export': '', |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 def generate_implementation(self): | 150 def generate_implementation(self): |
148 return { | 151 return { |
149 'namespace': self.namespace, | 152 'namespace': self.namespace, |
150 'suffix': self.suffix, | 153 'suffix': self.suffix, |
151 'events': self.in_file.name_dictionaries, | 154 'events': self.in_file.name_dictionaries, |
152 } | 155 } |
153 | 156 |
154 | 157 |
155 if __name__ == "__main__": | 158 if __name__ == "__main__": |
156 in_generator.Maker(EventFactoryWriter).main(sys.argv) | 159 in_generator.Maker(EventFactoryWriter).main(sys.argv) |
OLD | NEW |