| 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 re | 10 import re |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 # All getters (setters) of type. | 530 # All getters (setters) of type. |
| 531 # | 531 # |
| 532 # where DIRECTION is 'get' for getters and operation return values, 'set' for | 532 # where DIRECTION is 'get' for getters and operation return values, 'set' for |
| 533 # setters and operation arguments. INTERFACE and MEMBER are the idl names. | 533 # setters and operation arguments. INTERFACE and MEMBER are the idl names. |
| 534 # | 534 # |
| 535 | 535 |
| 536 _serialize_SSV = Conversion('_convertDartToNative_SerializedScriptValue', | 536 _serialize_SSV = Conversion('_convertDartToNative_SerializedScriptValue', |
| 537 'Dynamic', 'Dynamic') | 537 'Dynamic', 'Dynamic') |
| 538 | 538 |
| 539 dart2js_conversions = { | 539 dart2js_conversions = { |
| 540 # Wrap non-local Windows. We need to check EventTarget (the base type) |
| 541 # as well. Note, there are no functions that take a non-local Window |
| 542 # as a parameter / setter. |
| 543 'DOMWindow get': |
| 544 Conversion('_convertNativeToDart_Window', 'Window', 'Window'), |
| 545 'EventTarget get': |
| 546 Conversion('_convertNativeToDart_EventTarget', 'EventTarget', |
| 547 'EventTarget'), |
| 548 'EventTarget set': |
| 549 Conversion('_convertDartToNative_EventTarget', 'EventTarget', |
| 550 'EventTarget'), |
| 551 |
| 540 'IDBKey get': | 552 'IDBKey get': |
| 541 Conversion('_convertNativeToDart_IDBKey', 'Dynamic', 'Dynamic'), | 553 Conversion('_convertNativeToDart_IDBKey', 'Dynamic', 'Dynamic'), |
| 542 'IDBKey set': | 554 'IDBKey set': |
| 543 Conversion('_convertDartToNative_IDBKey', 'Dynamic', 'Dynamic'), | 555 Conversion('_convertDartToNative_IDBKey', 'Dynamic', 'Dynamic'), |
| 544 | 556 |
| 545 'ImageData get': | 557 'ImageData get': |
| 546 Conversion('_convertNativeToDart_ImageData', 'Dynamic', 'ImageData'), | 558 Conversion('_convertNativeToDart_ImageData', 'Dynamic', 'ImageData'), |
| 547 'ImageData set': | 559 'ImageData set': |
| 548 Conversion('_convertDartToNative_ImageData', 'ImageData', 'Dynamic'), | 560 Conversion('_convertDartToNative_ImageData', 'ImageData', 'Dynamic'), |
| 549 | 561 |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 if type_data.clazz == 'Interface': | 1041 if type_data.clazz == 'Interface': |
| 1030 if self._database.HasInterface(type_name): | 1042 if self._database.HasInterface(type_name): |
| 1031 dart_interface_name = self._renamer.RenameInterface( | 1043 dart_interface_name = self._renamer.RenameInterface( |
| 1032 self._database.GetInterface(type_name)) | 1044 self._database.GetInterface(type_name)) |
| 1033 else: | 1045 else: |
| 1034 dart_interface_name = type_name | 1046 dart_interface_name = type_name |
| 1035 return InterfaceIDLTypeInfo(type_name, type_data, dart_interface_name) | 1047 return InterfaceIDLTypeInfo(type_name, type_data, dart_interface_name) |
| 1036 | 1048 |
| 1037 class_name = '%sIDLTypeInfo' % type_data.clazz | 1049 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1038 return globals()[class_name](type_name, type_data) | 1050 return globals()[class_name](type_name, type_data) |
| OLD | NEW |