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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 # | 470 # |
471 | 471 |
472 _serialize_SSV = Conversion('_convertDartToNative_SerializedScriptValue', | 472 _serialize_SSV = Conversion('_convertDartToNative_SerializedScriptValue', |
473 'dynamic', 'dynamic') | 473 'dynamic', 'dynamic') |
474 | 474 |
475 dart2js_conversions = { | 475 dart2js_conversions = { |
476 # Wrap non-local Windows. We need to check EventTarget (the base type) | 476 # Wrap non-local Windows. We need to check EventTarget (the base type) |
477 # as well. Note, there are no functions that take a non-local Window | 477 # as well. Note, there are no functions that take a non-local Window |
478 # as a parameter / setter. | 478 # as a parameter / setter. |
479 'DOMWindow get': | 479 'DOMWindow get': |
480 Conversion('_convertNativeToDart_Window', 'Window', 'Window'), | 480 Conversion('_convertNativeToDart_Window', 'dynamic', 'Window'), |
481 'EventTarget get': | 481 'EventTarget get': |
482 Conversion('_convertNativeToDart_EventTarget', 'EventTarget', | 482 Conversion('_convertNativeToDart_EventTarget', 'dynamic', |
483 'EventTarget'), | 483 'EventTarget'), |
484 'EventTarget set': | 484 'EventTarget set': |
485 Conversion('_convertDartToNative_EventTarget', 'EventTarget', | 485 Conversion('_convertDartToNative_EventTarget', 'EventTarget', |
486 'EventTarget'), | 486 'dynamic'), |
487 | 487 |
488 'IDBKey get': | 488 'IDBKey get': |
489 Conversion('_convertNativeToDart_IDBKey', 'dynamic', 'dynamic'), | 489 Conversion('_convertNativeToDart_IDBKey', 'dynamic', 'dynamic'), |
490 'IDBKey set': | 490 'IDBKey set': |
491 Conversion('_convertDartToNative_IDBKey', 'dynamic', 'dynamic'), | 491 Conversion('_convertDartToNative_IDBKey', 'dynamic', 'dynamic'), |
492 | 492 |
493 'ImageData get': | 493 'ImageData get': |
494 Conversion('_convertNativeToDart_ImageData', 'dynamic', 'ImageData'), | 494 Conversion('_convertNativeToDart_ImageData', 'dynamic', 'ImageData'), |
495 'ImageData set': | 495 'ImageData set': |
496 Conversion('_convertDartToNative_ImageData', 'ImageData', 'dynamic'), | 496 Conversion('_convertDartToNative_ImageData', 'ImageData', 'dynamic'), |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 else: | 1092 else: |
1093 dart_interface_name = type_name | 1093 dart_interface_name = type_name |
1094 return InterfaceIDLTypeInfo(type_name, type_data, dart_interface_name, | 1094 return InterfaceIDLTypeInfo(type_name, type_data, dart_interface_name, |
1095 self) | 1095 self) |
1096 | 1096 |
1097 if type_data.clazz == 'SVGTearOff': | 1097 if type_data.clazz == 'SVGTearOff': |
1098 return SVGTearOffIDLTypeInfo(type_name, type_data, self) | 1098 return SVGTearOffIDLTypeInfo(type_name, type_data, self) |
1099 | 1099 |
1100 class_name = '%sIDLTypeInfo' % type_data.clazz | 1100 class_name = '%sIDLTypeInfo' % type_data.clazz |
1101 return globals()[class_name](type_name, type_data) | 1101 return globals()[class_name](type_name, type_data) |
OLD | NEW |