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 |
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 'Dictionary': TypeData(clazz='Primitive', dart_type='Map'), | 1153 'Dictionary': TypeData(clazz='Primitive', dart_type='Map'), |
1154 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un
signed long long'), | 1154 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un
signed long long'), |
1155 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip
tValue'), | 1155 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip
tValue'), |
1156 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'), | 1156 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'), |
1157 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'), | 1157 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'), |
1158 # TODO(sra): Come up with some meaningful name so that where this appears in | 1158 # TODO(sra): Come up with some meaningful name so that where this appears in |
1159 # the documentation, the user is made aware that only a limited subset of | 1159 # the documentation, the user is made aware that only a limited subset of |
1160 # serializable types are actually permitted. | 1160 # serializable types are actually permitted. |
1161 'SerializedScriptValue': TypeData(clazz='Primitive', dart_type='dynamic'), | 1161 'SerializedScriptValue': TypeData(clazz='Primitive', dart_type='dynamic'), |
1162 'sequence': TypeData(clazz='Primitive', dart_type='List'), | 1162 'sequence': TypeData(clazz='Primitive', dart_type='List'), |
| 1163 'union': TypeData(clazz='Primitive', dart_type='dynamic'), |
1163 'void': TypeData(clazz='Primitive', dart_type='void'), | 1164 'void': TypeData(clazz='Primitive', dart_type='void'), |
1164 | 1165 |
1165 'CSSRule': TypeData(clazz='Interface', conversion_includes=['CSSImportRule']
), | 1166 'CSSRule': TypeData(clazz='Interface', conversion_includes=['CSSImportRule']
), |
1166 'DOMStringMap': TypeData(clazz='Interface', dart_type='Map<String, String>')
, | 1167 'DOMStringMap': TypeData(clazz='Interface', dart_type='Map<String, String>')
, |
1167 'Window': TypeData(clazz='Interface', custom_to_dart=True), | 1168 'Window': TypeData(clazz='Interface', custom_to_dart=True), |
1168 'Element': TypeData(clazz='Interface', merged_interface='HTMLElement', | 1169 'Element': TypeData(clazz='Interface', merged_interface='HTMLElement', |
1169 custom_to_dart=True), | 1170 custom_to_dart=True), |
1170 'EventListener': TypeData(clazz='Interface', custom_to_native=True), | 1171 'EventListener': TypeData(clazz='Interface', custom_to_native=True), |
1171 'EventHandler': TypeData(clazz='Interface', custom_to_native=True), | 1172 'EventHandler': TypeData(clazz='Interface', custom_to_native=True), |
1172 'EventTarget': TypeData(clazz='Interface', custom_to_native=True), | 1173 'EventTarget': TypeData(clazz='Interface', custom_to_native=True), |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 if type_data.clazz == 'BasicTypedList': | 1318 if type_data.clazz == 'BasicTypedList': |
1318 if type_name == 'ArrayBuffer': | 1319 if type_name == 'ArrayBuffer': |
1319 dart_interface_name = 'ByteBuffer' | 1320 dart_interface_name = 'ByteBuffer' |
1320 else: | 1321 else: |
1321 dart_interface_name = self._renamer.RenameInterfaceId(type_name) | 1322 dart_interface_name = self._renamer.RenameInterfaceId(type_name) |
1322 return BasicTypedListIDLTypeInfo( | 1323 return BasicTypedListIDLTypeInfo( |
1323 type_name, type_data, dart_interface_name, self) | 1324 type_name, type_data, dart_interface_name, self) |
1324 | 1325 |
1325 class_name = '%sIDLTypeInfo' % type_data.clazz | 1326 class_name = '%sIDLTypeInfo' % type_data.clazz |
1326 return globals()[class_name](type_name, type_data) | 1327 return globals()[class_name](type_name, type_data) |
OLD | NEW |