| 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 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 'custom': TypeData(clazz='Primitive', dart_type='dynamic'), | 1257 'custom': TypeData(clazz='Primitive', dart_type='dynamic'), |
| 1258 'ClientRect': TypeData(clazz='Interface', | 1258 'ClientRect': TypeData(clazz='Interface', |
| 1259 dart_type='Rectangle', suppress_interface=True), | 1259 dart_type='Rectangle', suppress_interface=True), |
| 1260 'Date': TypeData(clazz='Primitive', dart_type='DateTime', native_type='doubl
e'), | 1260 'Date': TypeData(clazz='Primitive', dart_type='DateTime', native_type='doubl
e'), |
| 1261 'Promise': TypeData(clazz='Primitive', dart_type='Future', native_type='Scri
ptPromise'), | 1261 'Promise': TypeData(clazz='Primitive', dart_type='Future', native_type='Scri
ptPromise'), |
| 1262 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc
riptValue'), | 1262 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc
riptValue'), |
| 1263 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St
ring'), | 1263 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St
ring'), |
| 1264 # TODO(vsm): This won't actually work until we convert the Map to | 1264 # TODO(vsm): This won't actually work until we convert the Map to |
| 1265 # a native JS Map for JS DOM. | 1265 # a native JS Map for JS DOM. |
| 1266 'Dictionary': TypeData(clazz='Primitive', dart_type='Map'), | 1266 'Dictionary': TypeData(clazz='Primitive', dart_type='Map'), |
| 1267 # TODO(terry): It's a dictionary but a very complex dictionary is multiple l
ists. |
| 1268 # Need to investigate a 1-off solution probably. |
| 1269 'MediaKeySystemConfiguration': TypeData(clazz='Primitive', dart_type='Map'), |
| 1267 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un
signed long long'), | 1270 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un
signed long long'), |
| 1268 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip
tValue'), | 1271 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip
tValue'), |
| 1269 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'), | 1272 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'), |
| 1270 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'), | 1273 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'), |
| 1271 # TODO(sra): Come up with some meaningful name so that where this appears in | 1274 # TODO(sra): Come up with some meaningful name so that where this appears in |
| 1272 # the documentation, the user is made aware that only a limited subset of | 1275 # the documentation, the user is made aware that only a limited subset of |
| 1273 # serializable types are actually permitted. | 1276 # serializable types are actually permitted. |
| 1274 'SerializedScriptValue': TypeData(clazz='Primitive', dart_type='dynamic'), | 1277 'SerializedScriptValue': TypeData(clazz='Primitive', dart_type='dynamic'), |
| 1275 'sequence': TypeData(clazz='Primitive', dart_type='List'), | 1278 'sequence': TypeData(clazz='Primitive', dart_type='List'), |
| 1276 'void': TypeData(clazz='Primitive', dart_type='void'), | 1279 'void': TypeData(clazz='Primitive', dart_type='void'), |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1518 return_type == 'Rectangle') | 1521 return_type == 'Rectangle') |
| 1519 | 1522 |
| 1520 def wrap_return_type_blink(return_type, type_name, type_registry): | 1523 def wrap_return_type_blink(return_type, type_name, type_registry): |
| 1521 """Returns True if we should wrap the returned value. This checks | 1524 """Returns True if we should wrap the returned value. This checks |
| 1522 a number of different variations, calling the more basic functions | 1525 a number of different variations, calling the more basic functions |
| 1523 above.""" | 1526 above.""" |
| 1524 return (wrap_unwrap_type_blink(return_type, type_registry) or | 1527 return (wrap_unwrap_type_blink(return_type, type_registry) or |
| 1525 wrap_unwrap_type_blink(type_name, type_registry) or | 1528 wrap_unwrap_type_blink(type_name, type_registry) or |
| 1526 wrap_type_blink(return_type, type_registry) or | 1529 wrap_type_blink(return_type, type_registry) or |
| 1527 wrap_unwrap_list_blink(return_type, type_registry)) | 1530 wrap_unwrap_list_blink(return_type, type_registry)) |
| OLD | NEW |