| 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 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 self.custom_to_native = custom_to_native | 1338 self.custom_to_native = custom_to_native |
| 1339 self.conversion_includes = conversion_includes | 1339 self.conversion_includes = conversion_includes |
| 1340 self.webcore_getter_name = webcore_getter_name | 1340 self.webcore_getter_name = webcore_getter_name |
| 1341 self.webcore_setter_name = webcore_setter_name | 1341 self.webcore_setter_name = webcore_setter_name |
| 1342 self.item_type = item_type | 1342 self.item_type = item_type |
| 1343 self.suppress_interface = suppress_interface | 1343 self.suppress_interface = suppress_interface |
| 1344 self.is_typed_array = is_typed_array | 1344 self.is_typed_array = is_typed_array |
| 1345 | 1345 |
| 1346 | 1346 |
| 1347 def TypedArrayTypeData(item_type): | 1347 def TypedArrayTypeData(item_type): |
| 1348 return TypeData(clazz='Interface', item_type=item_type, is_typed_array=True) | 1348 return TypeData( |
| 1349 clazz='Interface', |
| 1350 dart_type='List<%s>' % item_type, # TODO(antonm): proper typeddata interfa
ces. |
| 1351 item_type=item_type, |
| 1352 is_typed_array=True) |
| 1349 | 1353 |
| 1350 | 1354 |
| 1351 _idl_type_registry = monitored.Dict('generator._idl_type_registry', { | 1355 _idl_type_registry = monitored.Dict('generator._idl_type_registry', { |
| 1352 'boolean': TypeData(clazz='Primitive', dart_type='bool', native_type='bool', | 1356 'boolean': TypeData(clazz='Primitive', dart_type='bool', native_type='bool', |
| 1353 webcore_getter_name='hasAttribute', | 1357 webcore_getter_name='hasAttribute', |
| 1354 webcore_setter_name='setBooleanAttribute'), | 1358 webcore_setter_name='setBooleanAttribute'), |
| 1355 'byte': TypeData(clazz='Primitive', dart_type='int', native_type='int'), | 1359 'byte': TypeData(clazz='Primitive', dart_type='int', native_type='int'), |
| 1356 'octet': TypeData(clazz='Primitive', dart_type='int', native_type='int'), | 1360 'octet': TypeData(clazz='Primitive', dart_type='int', native_type='int'), |
| 1357 'short': TypeData(clazz='Primitive', dart_type='int', native_type='int'), | 1361 'short': TypeData(clazz='Primitive', dart_type='int', native_type='int'), |
| 1358 'unsigned short': TypeData(clazz='Primitive', dart_type='int', | 1362 'unsigned short': TypeData(clazz='Primitive', dart_type='int', |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 self) | 1538 self) |
| 1535 | 1539 |
| 1536 if type_data.clazz == 'SVGTearOff': | 1540 if type_data.clazz == 'SVGTearOff': |
| 1537 dart_interface_name = self._renamer.RenameInterface( | 1541 dart_interface_name = self._renamer.RenameInterface( |
| 1538 self._database.GetInterface(type_name)) | 1542 self._database.GetInterface(type_name)) |
| 1539 return SVGTearOffIDLTypeInfo( | 1543 return SVGTearOffIDLTypeInfo( |
| 1540 type_name, type_data, dart_interface_name, self) | 1544 type_name, type_data, dart_interface_name, self) |
| 1541 | 1545 |
| 1542 class_name = '%sIDLTypeInfo' % type_data.clazz | 1546 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1543 return globals()[class_name](type_name, type_data) | 1547 return globals()[class_name](type_name, type_data) |
| OLD | NEW |