| 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 24 matching lines...) Expand all Loading... |
| 35 import name_macros | 35 import name_macros |
| 36 import name_utilities | 36 import name_utilities |
| 37 import template_expander | 37 import template_expander |
| 38 | 38 |
| 39 | 39 |
| 40 def case_insensitive_matching(name): | 40 def case_insensitive_matching(name): |
| 41 return (name == ('HTMLEvents') | 41 return (name == ('HTMLEvents') |
| 42 or name == 'Event' | 42 or name == 'Event' |
| 43 or name == 'Events' | 43 or name == 'Events' |
| 44 or name.startswith('UIEvent') | 44 or name.startswith('UIEvent') |
| 45 or name.startswith('CustomEvent') | 45 or name.startswith('CustomEvent')) |
| 46 or name.startswith('MouseEvent')) | |
| 47 | 46 |
| 48 class EventFactoryWriter(name_macros.Writer): | 47 class EventFactoryWriter(name_macros.Writer): |
| 49 defaults = { | 48 defaults = { |
| 50 'ImplementedAs': None, | 49 'ImplementedAs': None, |
| 51 'Conditional': None, | 50 'Conditional': None, |
| 52 'RuntimeEnabled': None, | 51 'RuntimeEnabled': None, |
| 53 } | 52 } |
| 54 default_parameters = { | 53 default_parameters = { |
| 55 'namespace': '', | 54 'namespace': '', |
| 56 'suffix': '', | 55 'suffix': '', |
| (...skipping 16 matching lines...) Expand all Loading... |
| 73 def generate_implementation(self): | 72 def generate_implementation(self): |
| 74 return { | 73 return { |
| 75 'namespace': self.namespace, | 74 'namespace': self.namespace, |
| 76 'suffix': self.suffix, | 75 'suffix': self.suffix, |
| 77 'events': self.in_file.name_dictionaries, | 76 'events': self.in_file.name_dictionaries, |
| 78 } | 77 } |
| 79 | 78 |
| 80 | 79 |
| 81 if __name__ == "__main__": | 80 if __name__ == "__main__": |
| 82 name_macros.Maker(EventFactoryWriter).main(sys.argv) | 81 name_macros.Maker(EventFactoryWriter).main(sys.argv) |
| OLD | NEW |