| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """This module provides shared functionality for systems to generate | 6 """This module provides shared functionality for systems to generate |
| 7 Dart APIs from the IDL database.""" | 7 Dart APIs from the IDL database.""" |
| 8 | 8 |
| 9 import copy | 9 import copy |
| 10 import json | 10 import json |
| 11 import monitored | 11 import monitored |
| 12 import os | 12 import os |
| 13 import re | 13 import re |
| 14 from htmlrenamer import html_interface_renames, renamed_html_members, \ | 14 from htmlrenamer import html_interface_renames, typed_array_renames |
| 15 typed_array_renames | |
| 16 | 15 |
| 17 _pure_interfaces = monitored.Set('generator._pure_interfaces', [ | 16 _pure_interfaces = monitored.Set('generator._pure_interfaces', [ |
| 18 # TODO(sra): DOMStringMap should be a class implementing Map<String,String>. | 17 # TODO(sra): DOMStringMap should be a class implementing Map<String,String>. |
| 19 'DOMStringMap', | 18 'DOMStringMap', |
| 20 'ElementTimeControl', | 19 'ElementTimeControl', |
| 21 'ElementTraversal', | 20 'ElementTraversal', |
| 22 'EventListener', | 21 'EventListener', |
| 23 'MediaQueryListListener', | 22 'MediaQueryListListener', |
| 24 'MutationCallback', | 23 'MutationCallback', |
| 25 'SVGExternalResourcesRequired', | 24 'SVGExternalResourcesRequired', |
| (...skipping 28 matching lines...) Expand all Loading... |
| 54 def IsCustomType(interface_name): | 53 def IsCustomType(interface_name): |
| 55 return interface_name in _custom_types | 54 return interface_name in _custom_types |
| 56 | 55 |
| 57 _methods_with_named_formals = monitored.Set( | 56 _methods_with_named_formals = monitored.Set( |
| 58 'generator._methods_with_named_formals', [ | 57 'generator._methods_with_named_formals', [ |
| 59 'DirectoryEntry.getDirectory', | 58 'DirectoryEntry.getDirectory', |
| 60 'DirectoryEntry.getFile', | 59 'DirectoryEntry.getFile', |
| 61 'Entry.copyTo', | 60 'Entry.copyTo', |
| 62 'Entry.moveTo', | 61 'Entry.moveTo', |
| 63 'HTMLInputElement.setRangeText', | 62 'HTMLInputElement.setRangeText', |
| 63 'HTMLTextAreaElement.setRangeText', |
| 64 'XMLHttpRequest.open', | 64 'XMLHttpRequest.open', |
| 65 ]) | 65 ]) |
| 66 | 66 |
| 67 # | 67 # |
| 68 # Renames for attributes that have names that are not legal Dart names. | 68 # Renames for attributes that have names that are not legal Dart names. |
| 69 # | 69 # |
| 70 _dart_attribute_renames = monitored.Dict('generator._dart_attribute_renames', { | 70 _dart_attribute_renames = monitored.Dict('generator._dart_attribute_renames', { |
| 71 'default': 'defaultValue', | 71 'default': 'defaultValue', |
| 72 }) | 72 }) |
| 73 | 73 |
| (...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 type_name, type_data, dart_interface_name, self) | 1153 type_name, type_data, dart_interface_name, self) |
| 1154 | 1154 |
| 1155 if type_data.clazz == 'BasicTypedList': | 1155 if type_data.clazz == 'BasicTypedList': |
| 1156 dart_interface_name = self._renamer.RenameInterface( | 1156 dart_interface_name = self._renamer.RenameInterface( |
| 1157 self._database.GetInterface(type_name)) | 1157 self._database.GetInterface(type_name)) |
| 1158 return BasicTypedListIDLTypeInfo( | 1158 return BasicTypedListIDLTypeInfo( |
| 1159 type_name, type_data, dart_interface_name, self) | 1159 type_name, type_data, dart_interface_name, self) |
| 1160 | 1160 |
| 1161 class_name = '%sIDLTypeInfo' % type_data.clazz | 1161 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1162 return globals()[class_name](type_name, type_data) | 1162 return globals()[class_name](type_name, type_data) |
| OLD | NEW |