| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 name = _dart_attribute_renames.get(name, name) | 251 name = _dart_attribute_renames.get(name, name) |
| 252 name = attr.ext_attrs.get('DartName', None) or name | 252 name = attr.ext_attrs.get('DartName', None) or name |
| 253 return name | 253 return name |
| 254 | 254 |
| 255 | 255 |
| 256 def TypeOrNothing(dart_type, comment=None): | 256 def TypeOrNothing(dart_type, comment=None): |
| 257 """Returns string for declaring something with |dart_type| in a context | 257 """Returns string for declaring something with |dart_type| in a context |
| 258 where a type may be omitted. | 258 where a type may be omitted. |
| 259 The string is empty or has a trailing space. | 259 The string is empty or has a trailing space. |
| 260 """ | 260 """ |
| 261 if dart_type == 'Dynamic': | 261 if dart_type == 'dynamic': |
| 262 if comment: | 262 if comment: |
| 263 return '/*%s*/ ' % comment # Just a comment foo(/*T*/ x) | 263 return '/*%s*/ ' % comment # Just a comment foo(/*T*/ x) |
| 264 else: | 264 else: |
| 265 return '' # foo(x) looks nicer than foo(Dynamic x) | 265 return '' # foo(x) looks nicer than foo(var|dynamic x) |
| 266 else: | 266 else: |
| 267 return dart_type + ' ' | 267 return dart_type + ' ' |
| 268 | 268 |
| 269 | 269 |
| 270 def TypeOrVar(dart_type, comment=None): | 270 def TypeOrVar(dart_type, comment=None): |
| 271 """Returns string for declaring something with |dart_type| in a context | 271 """Returns string for declaring something with |dart_type| in a context |
| 272 where if a type is omitted, 'var' must be used instead.""" | 272 where if a type is omitted, 'var' must be used instead.""" |
| 273 if dart_type == 'Dynamic': | 273 if dart_type == 'dynamic': |
| 274 if comment: | 274 if comment: |
| 275 return 'var /*%s*/' % comment # e.g. var /*T*/ x; | 275 return 'var /*%s*/' % comment # e.g. var /*T*/ x; |
| 276 else: | 276 else: |
| 277 return 'var' # e.g. var x; | 277 return 'var' # e.g. var x; |
| 278 else: | 278 else: |
| 279 return dart_type | 279 return dart_type |
| 280 | 280 |
| 281 | 281 |
| 282 class OperationInfo(object): | 282 class OperationInfo(object): |
| 283 """Holder for various derived information from a set of overloaded operations. | 283 """Holder for various derived information from a set of overloaded operations. |
| 284 | 284 |
| 285 Attributes: | 285 Attributes: |
| 286 overloads: A list of IDL operation overloads with the same name. | 286 overloads: A list of IDL operation overloads with the same name. |
| 287 name: A string, the simple name of the operation. | 287 name: A string, the simple name of the operation. |
| 288 constructor_name: A string, the name of the constructor iff the constructor | 288 constructor_name: A string, the name of the constructor iff the constructor |
| 289 is named, e.g. 'fromList' in Int8Array.fromList(list). | 289 is named, e.g. 'fromList' in Int8Array.fromList(list). |
| 290 type_name: A string, the name of the return type of the operation. | 290 type_name: A string, the name of the return type of the operation. |
| 291 param_infos: A list of ParamInfo. | 291 param_infos: A list of ParamInfo. |
| 292 """ | 292 """ |
| 293 | 293 |
| 294 def ParametersDeclaration(self, rename_type, force_optional=False): | 294 def ParametersDeclaration(self, rename_type, force_optional=False): |
| 295 def FormatParam(param): | 295 def FormatParam(param): |
| 296 dart_type = rename_type(param.type_id) if param.type_id else 'Dynamic' | 296 dart_type = rename_type(param.type_id) if param.type_id else 'dynamic' |
| 297 return '%s%s' % (TypeOrNothing(dart_type, param.type_id), param.name) | 297 return '%s%s' % (TypeOrNothing(dart_type, param.type_id), param.name) |
| 298 | 298 |
| 299 required = [] | 299 required = [] |
| 300 optional = [] | 300 optional = [] |
| 301 for param_info in self.param_infos: | 301 for param_info in self.param_infos: |
| 302 if param_info.is_optional: | 302 if param_info.is_optional: |
| 303 optional.append(param_info) | 303 optional.append(param_info) |
| 304 else: | 304 else: |
| 305 if optional: | 305 if optional: |
| 306 raise Exception('Optional parameters cannot precede required ones: ' | 306 raise Exception('Optional parameters cannot precede required ones: ' |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 FACTORY=factory_provider, | 380 FACTORY=factory_provider, |
| 381 CTOR_FACTORY_NAME=factory_name, | 381 CTOR_FACTORY_NAME=factory_name, |
| 382 FACTORY_PARAMS=self.ParametersAsArgumentList(index)) | 382 FACTORY_PARAMS=self.ParametersAsArgumentList(index)) |
| 383 | 383 |
| 384 for index, param_info in enumerate(self.param_infos): | 384 for index, param_info in enumerate(self.param_infos): |
| 385 if param_info.is_optional: | 385 if param_info.is_optional: |
| 386 EmitOptionalParameterInvocation(index) | 386 EmitOptionalParameterInvocation(index) |
| 387 | 387 |
| 388 | 388 |
| 389 def CopyAndWidenDefaultParameters(self): | 389 def CopyAndWidenDefaultParameters(self): |
| 390 """Returns equivalent OperationInfo, but default parameters are Dynamic.""" | 390 """Returns equivalent OperationInfo, but default parameters are dynamic.""" |
| 391 info = copy.copy(self) | 391 info = copy.copy(self) |
| 392 info.param_infos = [param.Copy() for param in self.param_infos] | 392 info.param_infos = [param.Copy() for param in self.param_infos] |
| 393 for param in info.param_infos: | 393 for param in info.param_infos: |
| 394 if param.is_optional: | 394 if param.is_optional: |
| 395 param.type_id = None | 395 param.type_id = None |
| 396 return info | 396 return info |
| 397 | 397 |
| 398 | 398 |
| 399 def ConstantOutputOrder(a, b): | 399 def ConstantOutputOrder(a, b): |
| 400 """Canonical output ordering for constants.""" | 400 """Canonical output ordering for constants.""" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 420 if line.strip(): | 420 if line.strip(): |
| 421 return '%s%s\n' % (indent, line) | 421 return '%s%s\n' % (indent, line) |
| 422 else: | 422 else: |
| 423 return '\n' | 423 return '\n' |
| 424 return ''.join(FormatLine(line) for line in text.split('\n')) | 424 return ''.join(FormatLine(line) for line in text.split('\n')) |
| 425 | 425 |
| 426 # Given a sorted sequence of type identifiers, return an appropriate type | 426 # Given a sorted sequence of type identifiers, return an appropriate type |
| 427 # name | 427 # name |
| 428 def TypeName(type_ids, interface): | 428 def TypeName(type_ids, interface): |
| 429 # Dynamically type this field for now. | 429 # Dynamically type this field for now. |
| 430 return 'Dynamic' | 430 return 'dynamic' |
| 431 | 431 |
| 432 def ImplementationClassNameForInterfaceName(interface_name): | 432 def ImplementationClassNameForInterfaceName(interface_name): |
| 433 return '_%sImpl' % interface_name | 433 return '_%sImpl' % interface_name |
| 434 | 434 |
| 435 # ------------------------------------------------------------------------------ | 435 # ------------------------------------------------------------------------------ |
| 436 | 436 |
| 437 class Conversion(object): | 437 class Conversion(object): |
| 438 """Represents a way of converting between types.""" | 438 """Represents a way of converting between types.""" |
| 439 def __init__(self, name, input_type, output_type): | 439 def __init__(self, name, input_type, output_type): |
| 440 # input_type is the type of the API input (and the argument type of the | 440 # input_type is the type of the API input (and the argument type of the |
| 441 # conversion function) | 441 # conversion function) |
| 442 # output_type is the type of the API output (and the result type of the | 442 # output_type is the type of the API output (and the result type of the |
| 443 # conversion function) | 443 # conversion function) |
| 444 self.function_name = name | 444 self.function_name = name |
| 445 self.input_type = input_type | 445 self.input_type = input_type |
| 446 self.output_type = output_type | 446 self.output_type = output_type |
| 447 | 447 |
| 448 # "TYPE DIRECTION INTERFACE.MEMBER" -> conversion | 448 # "TYPE DIRECTION INTERFACE.MEMBER" -> conversion |
| 449 # Specific member of interface | 449 # Specific member of interface |
| 450 # "TYPE DIRECTION INTERFACE.*" -> conversion | 450 # "TYPE DIRECTION INTERFACE.*" -> conversion |
| 451 # All members of interface getting (setting) with type. | 451 # All members of interface getting (setting) with type. |
| 452 # "TYPE DIRECTION" -> conversion | 452 # "TYPE DIRECTION" -> conversion |
| 453 # All getters (setters) of type. | 453 # All getters (setters) of type. |
| 454 # | 454 # |
| 455 # where DIRECTION is 'get' for getters and operation return values, 'set' for | 455 # where DIRECTION is 'get' for getters and operation return values, 'set' for |
| 456 # setters and operation arguments. INTERFACE and MEMBER are the idl names. | 456 # setters and operation arguments. INTERFACE and MEMBER are the idl names. |
| 457 # | 457 # |
| 458 | 458 |
| 459 _serialize_SSV = Conversion('_convertDartToNative_SerializedScriptValue', | 459 _serialize_SSV = Conversion('_convertDartToNative_SerializedScriptValue', |
| 460 'Dynamic', 'Dynamic') | 460 'dynamic', 'dynamic') |
| 461 | 461 |
| 462 dart2js_conversions = { | 462 dart2js_conversions = { |
| 463 # Wrap non-local Windows. We need to check EventTarget (the base type) | 463 # Wrap non-local Windows. We need to check EventTarget (the base type) |
| 464 # as well. Note, there are no functions that take a non-local Window | 464 # as well. Note, there are no functions that take a non-local Window |
| 465 # as a parameter / setter. | 465 # as a parameter / setter. |
| 466 'DOMWindow get': | 466 'DOMWindow get': |
| 467 Conversion('_convertNativeToDart_Window', 'Window', 'Window'), | 467 Conversion('_convertNativeToDart_Window', 'Window', 'Window'), |
| 468 'EventTarget get': | 468 'EventTarget get': |
| 469 Conversion('_convertNativeToDart_EventTarget', 'EventTarget', | 469 Conversion('_convertNativeToDart_EventTarget', 'EventTarget', |
| 470 'EventTarget'), | 470 'EventTarget'), |
| 471 'EventTarget set': | 471 'EventTarget set': |
| 472 Conversion('_convertDartToNative_EventTarget', 'EventTarget', | 472 Conversion('_convertDartToNative_EventTarget', 'EventTarget', |
| 473 'EventTarget'), | 473 'EventTarget'), |
| 474 | 474 |
| 475 'IDBKey get': | 475 'IDBKey get': |
| 476 Conversion('_convertNativeToDart_IDBKey', 'Dynamic', 'Dynamic'), | 476 Conversion('_convertNativeToDart_IDBKey', 'dynamic', 'dynamic'), |
| 477 'IDBKey set': | 477 'IDBKey set': |
| 478 Conversion('_convertDartToNative_IDBKey', 'Dynamic', 'Dynamic'), | 478 Conversion('_convertDartToNative_IDBKey', 'dynamic', 'dynamic'), |
| 479 | 479 |
| 480 'ImageData get': | 480 'ImageData get': |
| 481 Conversion('_convertNativeToDart_ImageData', 'Dynamic', 'ImageData'), | 481 Conversion('_convertNativeToDart_ImageData', 'dynamic', 'ImageData'), |
| 482 'ImageData set': | 482 'ImageData set': |
| 483 Conversion('_convertDartToNative_ImageData', 'ImageData', 'Dynamic'), | 483 Conversion('_convertDartToNative_ImageData', 'ImageData', 'dynamic'), |
| 484 | 484 |
| 485 'Dictionary get': | 485 'Dictionary get': |
| 486 Conversion('_convertNativeToDart_Dictionary', 'Dynamic', 'Map'), | 486 Conversion('_convertNativeToDart_Dictionary', 'dynamic', 'Map'), |
| 487 'Dictionary set': | 487 'Dictionary set': |
| 488 Conversion('_convertDartToNative_Dictionary', 'Map', 'Dynamic'), | 488 Conversion('_convertDartToNative_Dictionary', 'Map', 'dynamic'), |
| 489 | 489 |
| 490 'DOMString[] set': | 490 'DOMString[] set': |
| 491 Conversion('_convertDartToNative_StringArray', 'List<String>', 'List'), | 491 Conversion('_convertDartToNative_StringArray', 'List<String>', 'List'), |
| 492 | 492 |
| 493 'any set IDBObjectStore.add': _serialize_SSV, | 493 'any set IDBObjectStore.add': _serialize_SSV, |
| 494 'any set IDBObjectStore.put': _serialize_SSV, | 494 'any set IDBObjectStore.put': _serialize_SSV, |
| 495 'any set IDBCursor.update': _serialize_SSV, | 495 'any set IDBCursor.update': _serialize_SSV, |
| 496 | 496 |
| 497 # postMessage | 497 # postMessage |
| 498 'any set DedicatedWorkerContext.postMessage': _serialize_SSV, | 498 'any set DedicatedWorkerContext.postMessage': _serialize_SSV, |
| 499 'any set MessagePort.postMessage': _serialize_SSV, | 499 'any set MessagePort.postMessage': _serialize_SSV, |
| 500 'SerializedScriptValue set DOMWindow.postMessage': _serialize_SSV, | 500 'SerializedScriptValue set DOMWindow.postMessage': _serialize_SSV, |
| 501 'SerializedScriptValue set Worker.postMessage': _serialize_SSV, | 501 'SerializedScriptValue set Worker.postMessage': _serialize_SSV, |
| 502 | 502 |
| 503 # receiving message via MessageEvent | 503 # receiving message via MessageEvent |
| 504 'DOMObject get MessageEvent.data': | 504 'DOMObject get MessageEvent.data': |
| 505 Conversion('_convertNativeToDart_SerializedScriptValue', | 505 Conversion('_convertNativeToDart_SerializedScriptValue', |
| 506 'Dynamic', 'Dynamic'), | 506 'dynamic', 'dynamic'), |
| 507 | 507 |
| 508 | 508 |
| 509 # IDBAny is problematic. Some uses are just a union of other IDB types, | 509 # IDBAny is problematic. Some uses are just a union of other IDB types, |
| 510 # which need no conversion.. Others include data values which require | 510 # which need no conversion.. Others include data values which require |
| 511 # serialized script value processing. | 511 # serialized script value processing. |
| 512 'IDBAny get IDBCursorWithValue.value': | 512 'IDBAny get IDBCursorWithValue.value': |
| 513 Conversion('_convertNativeToDart_IDBAny', 'Dynamic', 'Dynamic'), | 513 Conversion('_convertNativeToDart_IDBAny', 'dynamic', 'dynamic'), |
| 514 | 514 |
| 515 # This is problematic. The result property of IDBRequest is used for | 515 # This is problematic. The result property of IDBRequest is used for |
| 516 # all requests. Read requests like IDBDataStore.getObject need | 516 # all requests. Read requests like IDBDataStore.getObject need |
| 517 # conversion, but other requests like opening a database return | 517 # conversion, but other requests like opening a database return |
| 518 # something that does not need conversion. | 518 # something that does not need conversion. |
| 519 'IDBAny get IDBRequest.result': | 519 'IDBAny get IDBRequest.result': |
| 520 Conversion('_convertNativeToDart_IDBAny', 'Dynamic', 'Dynamic'), | 520 Conversion('_convertNativeToDart_IDBAny', 'dynamic', 'dynamic'), |
| 521 | 521 |
| 522 # "source: On getting, returns the IDBObjectStore or IDBIndex that the | 522 # "source: On getting, returns the IDBObjectStore or IDBIndex that the |
| 523 # cursor is iterating. ...". So we should not try to convert it. | 523 # cursor is iterating. ...". So we should not try to convert it. |
| 524 'IDBAny get IDBCursor.source': None, | 524 'IDBAny get IDBCursor.source': None, |
| 525 | 525 |
| 526 # Should be either a DOMString, an Array of DOMStrings or null. | 526 # Should be either a DOMString, an Array of DOMStrings or null. |
| 527 'IDBAny get IDBObjectStore.keyPath': None, | 527 'IDBAny get IDBObjectStore.keyPath': None, |
| 528 } | 528 } |
| 529 | 529 |
| 530 def FindConversion(idl_type, direction, interface, member): | 530 def FindConversion(idl_type, direction, interface, member): |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 native_type='unsigned', | 899 native_type='unsigned', |
| 900 webcore_getter_name='getUnsignedIntegralAttribute'
, | 900 webcore_getter_name='getUnsignedIntegralAttribute'
, |
| 901 webcore_setter_name='setUnsignedIntegralAttribute'
), | 901 webcore_setter_name='setUnsignedIntegralAttribute'
), |
| 902 'long long': TypeData(clazz='Primitive', dart_type='int'), | 902 'long long': TypeData(clazz='Primitive', dart_type='int'), |
| 903 'unsigned long long': TypeData(clazz='Primitive', dart_type='int'), | 903 'unsigned long long': TypeData(clazz='Primitive', dart_type='int'), |
| 904 'float': TypeData(clazz='Primitive', dart_type='num', native_type='double'), | 904 'float': TypeData(clazz='Primitive', dart_type='num', native_type='double'), |
| 905 'double': TypeData(clazz='Primitive', dart_type='num'), | 905 'double': TypeData(clazz='Primitive', dart_type='num'), |
| 906 | 906 |
| 907 'any': TypeData(clazz='Primitive', dart_type='Object', native_type='ScriptVa
lue', requires_v8_scope=True), | 907 'any': TypeData(clazz='Primitive', dart_type='Object', native_type='ScriptVa
lue', requires_v8_scope=True), |
| 908 'Array': TypeData(clazz='Primitive', dart_type='List'), | 908 'Array': TypeData(clazz='Primitive', dart_type='List'), |
| 909 'custom': TypeData(clazz='Primitive', dart_type='Dynamic'), | 909 'custom': TypeData(clazz='Primitive', dart_type='dynamic'), |
| 910 'Date': TypeData(clazz='Primitive', dart_type='Date', native_type='double'), | 910 'Date': TypeData(clazz='Primitive', dart_type='Date', native_type='double'), |
| 911 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc
riptValue'), | 911 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc
riptValue'), |
| 912 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St
ring'), | 912 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St
ring'), |
| 913 # TODO(vsm): This won't actually work until we convert the Map to | 913 # TODO(vsm): This won't actually work until we convert the Map to |
| 914 # a native JS Map for JS DOM. | 914 # a native JS Map for JS DOM. |
| 915 'Dictionary': TypeData(clazz='Primitive', dart_type='Map', requires_v8_scope
=True), | 915 'Dictionary': TypeData(clazz='Primitive', dart_type='Map', requires_v8_scope
=True), |
| 916 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} | 916 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} |
| 917 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa
ce | 917 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa
ce |
| 918 'Flags': TypeData(clazz='Primitive', dart_type='Object'), | 918 'Flags': TypeData(clazz='Primitive', dart_type='Object'), |
| 919 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un
signed long long'), | 919 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un
signed long long'), |
| 920 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip
tValue'), | 920 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip
tValue'), |
| 921 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'), | 921 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'), |
| 922 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'), | 922 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'), |
| 923 # TODO(sra): Come up with some meaningful name so that where this appears in | 923 # TODO(sra): Come up with some meaningful name so that where this appears in |
| 924 # the documentation, the user is made aware that only a limited subset of | 924 # the documentation, the user is made aware that only a limited subset of |
| 925 # serializable types are actually permitted. | 925 # serializable types are actually permitted. |
| 926 'SerializedScriptValue': TypeData(clazz='Primitive', dart_type='Dynamic'), | 926 'SerializedScriptValue': TypeData(clazz='Primitive', dart_type='dynamic'), |
| 927 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} | 927 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} |
| 928 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa
ce | 928 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa
ce |
| 929 'WebKitFlags': TypeData(clazz='Primitive', dart_type='Object'), | 929 'WebKitFlags': TypeData(clazz='Primitive', dart_type='Object'), |
| 930 | 930 |
| 931 'sequence': TypeData(clazz='Primitive', dart_type='List'), | 931 'sequence': TypeData(clazz='Primitive', dart_type='List'), |
| 932 'void': TypeData(clazz='Primitive', dart_type='void'), | 932 'void': TypeData(clazz='Primitive', dart_type='void'), |
| 933 | 933 |
| 934 'CSSRule': TypeData(clazz='Interface', conversion_includes=['CSSImportRule']
), | 934 'CSSRule': TypeData(clazz='Interface', conversion_includes=['CSSImportRule']
), |
| 935 'DOMException': TypeData(clazz='Interface', native_type='DOMCoreException'), | 935 'DOMException': TypeData(clazz='Interface', native_type='DOMCoreException'), |
| 936 'DOMStringMap': TypeData(clazz='Interface', dart_type='Map<String, String>')
, | 936 'DOMStringMap': TypeData(clazz='Interface', dart_type='Map<String, String>')
, |
| 937 'DOMWindow': TypeData(clazz='Interface', custom_to_dart=True), | 937 'DOMWindow': TypeData(clazz='Interface', custom_to_dart=True), |
| 938 'Document': TypeData(clazz='Interface', merged_interface='HTMLDocument'), | 938 'Document': TypeData(clazz='Interface', merged_interface='HTMLDocument'), |
| 939 'Element': TypeData(clazz='Interface', merged_interface='HTMLElement', | 939 'Element': TypeData(clazz='Interface', merged_interface='HTMLElement', |
| 940 custom_to_dart=True), | 940 custom_to_dart=True), |
| 941 'EventListener': TypeData(clazz='Interface', custom_to_native=True), | 941 'EventListener': TypeData(clazz='Interface', custom_to_native=True), |
| 942 'EventTarget': TypeData(clazz='Interface', custom_to_native=True), | 942 'EventTarget': TypeData(clazz='Interface', custom_to_native=True), |
| 943 'HTMLDocument': TypeData(clazz='Interface', merged_into='Document'), | 943 'HTMLDocument': TypeData(clazz='Interface', merged_into='Document'), |
| 944 'HTMLElement': TypeData(clazz='Interface', merged_into='Element', | 944 'HTMLElement': TypeData(clazz='Interface', merged_into='Element', |
| 945 custom_to_dart=True), | 945 custom_to_dart=True), |
| 946 'IDBAny': TypeData(clazz='Interface', dart_type='Dynamic', custom_to_native=
True), | 946 'IDBAny': TypeData(clazz='Interface', dart_type='dynamic', custom_to_native=
True), |
| 947 'IDBKey': TypeData(clazz='Interface', dart_type='Dynamic', custom_to_native=
True), | 947 'IDBKey': TypeData(clazz='Interface', dart_type='dynamic', custom_to_native=
True), |
| 948 'MutationRecordArray': TypeData(clazz='Interface', # C++ pass by pointer. | 948 'MutationRecordArray': TypeData(clazz='Interface', # C++ pass by pointer. |
| 949 native_type='MutationRecordArray', dart_type='List<MutationRecord>'), | 949 native_type='MutationRecordArray', dart_type='List<MutationRecord>'), |
| 950 'StyleSheet': TypeData(clazz='Interface', conversion_includes=['CSSStyleShee
t']), | 950 'StyleSheet': TypeData(clazz='Interface', conversion_includes=['CSSStyleShee
t']), |
| 951 'SVGElement': TypeData(clazz='Interface', custom_to_dart=True), | 951 'SVGElement': TypeData(clazz='Interface', custom_to_dart=True), |
| 952 | 952 |
| 953 'ClientRectList': TypeData(clazz='Interface', | 953 'ClientRectList': TypeData(clazz='Interface', |
| 954 item_type='ClientRect', suppress_interface=True), | 954 item_type='ClientRect', suppress_interface=True), |
| 955 'CSSRuleList': TypeData(clazz='Interface', | 955 'CSSRuleList': TypeData(clazz='Interface', |
| 956 item_type='CSSRule', suppress_interface=True), | 956 item_type='CSSRule', suppress_interface=True), |
| 957 'CSSValueList': TypeData(clazz='Interface', | 957 'CSSValueList': TypeData(clazz='Interface', |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 else: | 1075 else: |
| 1076 dart_interface_name = type_name | 1076 dart_interface_name = type_name |
| 1077 return InterfaceIDLTypeInfo(type_name, type_data, dart_interface_name, | 1077 return InterfaceIDLTypeInfo(type_name, type_data, dart_interface_name, |
| 1078 self) | 1078 self) |
| 1079 | 1079 |
| 1080 if type_data.clazz == 'SVGTearOff': | 1080 if type_data.clazz == 'SVGTearOff': |
| 1081 return SVGTearOffIDLTypeInfo(type_name, type_data, self) | 1081 return SVGTearOffIDLTypeInfo(type_name, type_data, self) |
| 1082 | 1082 |
| 1083 class_name = '%sIDLTypeInfo' % type_data.clazz | 1083 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1084 return globals()[class_name](type_name, type_data) | 1084 return globals()[class_name](type_name, type_data) |
| OLD | NEW |