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 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 'unsigned long long': TypeData(clazz='Primitive', dart_type='int'), | 1147 'unsigned long long': TypeData(clazz='Primitive', dart_type='int'), |
1148 'float': TypeData(clazz='Primitive', dart_type='num', native_type='double'), | 1148 'float': TypeData(clazz='Primitive', dart_type='num', native_type='double'), |
1149 'double': TypeData(clazz='Primitive', dart_type='num'), | 1149 'double': TypeData(clazz='Primitive', dart_type='num'), |
1150 | 1150 |
1151 'any': TypeData(clazz='Primitive', dart_type='Object', native_type='ScriptVa
lue'), | 1151 'any': TypeData(clazz='Primitive', dart_type='Object', native_type='ScriptVa
lue'), |
1152 'Array': TypeData(clazz='Primitive', dart_type='List'), | 1152 'Array': TypeData(clazz='Primitive', dart_type='List'), |
1153 'custom': TypeData(clazz='Primitive', dart_type='dynamic'), | 1153 'custom': TypeData(clazz='Primitive', dart_type='dynamic'), |
1154 'ClientRect': TypeData(clazz='Interface', | 1154 'ClientRect': TypeData(clazz='Interface', |
1155 dart_type='Rectangle', suppress_interface=True), | 1155 dart_type='Rectangle', suppress_interface=True), |
1156 'Date': TypeData(clazz='Primitive', dart_type='DateTime', native_type='doubl
e'), | 1156 'Date': TypeData(clazz='Primitive', dart_type='DateTime', native_type='doubl
e'), |
| 1157 'Promise': TypeData(clazz='Primitive', dart_type='Future', native_type='Scri
ptPromise'), |
1157 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc
riptValue'), | 1158 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc
riptValue'), |
1158 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St
ring'), | 1159 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St
ring'), |
1159 # TODO(vsm): This won't actually work until we convert the Map to | 1160 # TODO(vsm): This won't actually work until we convert the Map to |
1160 # a native JS Map for JS DOM. | 1161 # a native JS Map for JS DOM. |
1161 'Dictionary': TypeData(clazz='Primitive', dart_type='Map'), | 1162 'Dictionary': TypeData(clazz='Primitive', dart_type='Map'), |
1162 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un
signed long long'), | 1163 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un
signed long long'), |
1163 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip
tValue'), | 1164 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip
tValue'), |
1164 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'), | 1165 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'), |
1165 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'), | 1166 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'), |
1166 # TODO(sra): Come up with some meaningful name so that where this appears in | 1167 # TODO(sra): Come up with some meaningful name so that where this appears in |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 if type_data.clazz == 'BasicTypedList': | 1326 if type_data.clazz == 'BasicTypedList': |
1326 if type_name == 'ArrayBuffer': | 1327 if type_name == 'ArrayBuffer': |
1327 dart_interface_name = 'ByteBuffer' | 1328 dart_interface_name = 'ByteBuffer' |
1328 else: | 1329 else: |
1329 dart_interface_name = self._renamer.RenameInterfaceId(type_name) | 1330 dart_interface_name = self._renamer.RenameInterfaceId(type_name) |
1330 return BasicTypedListIDLTypeInfo( | 1331 return BasicTypedListIDLTypeInfo( |
1331 type_name, type_data, dart_interface_name, self) | 1332 type_name, type_data, dart_interface_name, self) |
1332 | 1333 |
1333 class_name = '%sIDLTypeInfo' % type_data.clazz | 1334 class_name = '%sIDLTypeInfo' % type_data.clazz |
1334 return globals()[class_name](type_name, type_data) | 1335 return globals()[class_name](type_name, type_data) |
OLD | NEW |