| 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, typed_array_renames | 14 from htmlrenamer import html_interface_renames, typed_array_renames |
| 15 | 15 |
| 16 _pure_interfaces = monitored.Set('generator._pure_interfaces', [ | 16 _pure_interfaces = monitored.Set('generator._pure_interfaces', [ |
| 17 # TODO(sra): DOMStringMap should be a class implementing Map<String,String>. | 17 # TODO(sra): DOMStringMap should be a class implementing Map<String,String>. |
| 18 'DOMStringMap', | 18 'DOMStringMap', |
| 19 'ChildNode', | 19 'ChildNode', |
| 20 'EventListener', | 20 'EventListener', |
| 21 'EventHandler', | |
| 22 'MediaQueryListListener', | 21 'MediaQueryListListener', |
| 23 'MutationCallback', | 22 'MutationCallback', |
| 24 'NavigatorID', | 23 'NavigatorID', |
| 25 'NavigatorOnLine', | 24 'NavigatorOnLine', |
| 26 'ParentNode', | 25 'ParentNode', |
| 27 'SVGExternalResourcesRequired', | 26 'SVGExternalResourcesRequired', |
| 28 'SVGFilterPrimitiveStandardAttributes', | 27 'SVGFilterPrimitiveStandardAttributes', |
| 29 'SVGFitToViewBox', | 28 'SVGFitToViewBox', |
| 30 'SVGTests', | 29 'SVGTests', |
| 31 'SVGURIReference', | 30 'SVGURIReference', |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 'RTCSessionDescription': 'RTCSessionDescription,mozRTCSessionDescription', | 129 'RTCSessionDescription': 'RTCSessionDescription,mozRTCSessionDescription', |
| 131 | 130 |
| 132 'RTCDataChannel': 'RTCDataChannel,DataChannel', | 131 'RTCDataChannel': 'RTCDataChannel,DataChannel', |
| 133 | 132 |
| 134 'ScriptProcessorNode': 'ScriptProcessorNode,JavaScriptAudioNode', | 133 'ScriptProcessorNode': 'ScriptProcessorNode,JavaScriptAudioNode', |
| 135 | 134 |
| 136 'TransitionEvent': 'TransitionEvent,WebKitTransitionEvent', | 135 'TransitionEvent': 'TransitionEvent,WebKitTransitionEvent', |
| 137 | 136 |
| 138 'WebGLLoseContext': 'WebGLLoseContext,WebGLExtensionLoseContext', | 137 'WebGLLoseContext': 'WebGLLoseContext,WebGLExtensionLoseContext', |
| 139 | 138 |
| 140 'WebKitCSSKeyframeRule': | 139 'CSSKeyframeRule': |
| 141 'CSSKeyframeRule,MozCSSKeyframeRule,WebKitCSSKeyframeRule', | 140 'CSSKeyframeRule,MozCSSKeyframeRule,WebKitCSSKeyframeRule', |
| 142 | 141 |
| 143 'WebKitCSSKeyframesRule': | 142 'CSSKeyframesRule': |
| 144 'CSSKeyframesRule,MozCSSKeyframesRule,WebKitCSSKeyframesRule', | 143 'CSSKeyframesRule,MozCSSKeyframesRule,WebKitCSSKeyframesRule', |
| 145 | 144 |
| 146 'WheelEvent': 'WheelEvent,MouseWheelEvent,MouseScrollEvent', | 145 'WheelEvent': 'WheelEvent,MouseWheelEvent,MouseScrollEvent', |
| 147 | 146 |
| 148 'XMLHttpRequestUpload': 'XMLHttpRequestUpload,XMLHttpRequestEventTarget', | 147 'XMLHttpRequestUpload': 'XMLHttpRequestUpload,XMLHttpRequestEventTarget', |
| 149 | 148 |
| 150 }, dart2jsOnly=True) | 149 }, dart2jsOnly=True) |
| 151 | 150 |
| 152 def IsRegisteredType(type_name): | 151 def IsRegisteredType(type_name): |
| 153 return type_name in _idl_type_registry | 152 return type_name in _idl_type_registry |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 'ClientRectList': TypeData(clazz='Interface', | 1055 'ClientRectList': TypeData(clazz='Interface', |
| 1057 item_type='ClientRect', dart_type='List<Rect>', suppress_interface=True)
, | 1056 item_type='ClientRect', dart_type='List<Rect>', suppress_interface=True)
, |
| 1058 'CSSRuleList': TypeData(clazz='Interface', | 1057 'CSSRuleList': TypeData(clazz='Interface', |
| 1059 item_type='CSSRule', suppress_interface=True), | 1058 item_type='CSSRule', suppress_interface=True), |
| 1060 'CSSValueList': TypeData(clazz='Interface', | 1059 'CSSValueList': TypeData(clazz='Interface', |
| 1061 item_type='CSSValue', suppress_interface=True), | 1060 item_type='CSSValue', suppress_interface=True), |
| 1062 'MimeTypeArray': TypeData(clazz='Interface', item_type='MimeType'), | 1061 'MimeTypeArray': TypeData(clazz='Interface', item_type='MimeType'), |
| 1063 'PluginArray': TypeData(clazz='Interface', item_type='Plugin'), | 1062 'PluginArray': TypeData(clazz='Interface', item_type='Plugin'), |
| 1064 'DOMStringList': TypeData(clazz='Interface', item_type='DOMString', | 1063 'DOMStringList': TypeData(clazz='Interface', item_type='DOMString', |
| 1065 dart_type='List<String>', custom_to_native=True), | 1064 dart_type='List<String>', custom_to_native=True), |
| 1066 'EntryArray': TypeData(clazz='Interface', item_type='Entry', | |
| 1067 suppress_interface=True), | |
| 1068 'EntryArraySync': TypeData(clazz='Interface', item_type='EntrySync', | |
| 1069 suppress_interface=True), | |
| 1070 'FileList': TypeData(clazz='Interface', item_type='File', | 1065 'FileList': TypeData(clazz='Interface', item_type='File', |
| 1071 dart_type='List<File>'), | 1066 dart_type='List<File>'), |
| 1072 'Future': TypeData(clazz='Interface', dart_type='Future'), | 1067 'Future': TypeData(clazz='Interface', dart_type='Future'), |
| 1073 'GamepadList': TypeData(clazz='Interface', item_type='Gamepad', | 1068 'GamepadList': TypeData(clazz='Interface', item_type='Gamepad', |
| 1074 suppress_interface=True), | 1069 suppress_interface=True), |
| 1075 'GLenum': TypeData(clazz='Primitive', dart_type='int', | 1070 'GLenum': TypeData(clazz='Primitive', dart_type='int', |
| 1076 native_type='unsigned'), | 1071 native_type='unsigned'), |
| 1077 'HTMLAllCollection': TypeData(clazz='Interface', item_type='Node'), | 1072 'HTMLAllCollection': TypeData(clazz='Interface', item_type='Node'), |
| 1078 'HTMLCollection': TypeData(clazz='Interface', item_type='Node'), | 1073 'HTMLCollection': TypeData(clazz='Interface', item_type='Node'), |
| 1079 'NamedNodeMap': TypeData(clazz='Interface', item_type='Node'), | 1074 'NamedNodeMap': TypeData(clazz='Interface', item_type='Node'), |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 if type_data.clazz == 'BasicTypedList': | 1195 if type_data.clazz == 'BasicTypedList': |
| 1201 if type_name == 'ArrayBuffer': | 1196 if type_name == 'ArrayBuffer': |
| 1202 dart_interface_name = 'ByteBuffer' | 1197 dart_interface_name = 'ByteBuffer' |
| 1203 else: | 1198 else: |
| 1204 dart_interface_name = self._renamer.RenameInterfaceId(type_name) | 1199 dart_interface_name = self._renamer.RenameInterfaceId(type_name) |
| 1205 return BasicTypedListIDLTypeInfo( | 1200 return BasicTypedListIDLTypeInfo( |
| 1206 type_name, type_data, dart_interface_name, self) | 1201 type_name, type_data, dart_interface_name, self) |
| 1207 | 1202 |
| 1208 class_name = '%sIDLTypeInfo' % type_data.clazz | 1203 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1209 return globals()[class_name](type_name, type_data) | 1204 return globals()[class_name](type_name, type_data) |
| OLD | NEW |