| 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 re | 9 import re |
| 10 import string | 10 import string |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 'float': PrimitiveIDLTypeInfo('float', dart_type='num', native_type='double'
), | 614 'float': PrimitiveIDLTypeInfo('float', dart_type='num', native_type='double'
), |
| 615 'double': PrimitiveIDLTypeInfo('double', dart_type='num'), | 615 'double': PrimitiveIDLTypeInfo('double', dart_type='num'), |
| 616 | 616 |
| 617 'any': PrimitiveIDLTypeInfo('any', dart_type='Object'), | 617 'any': PrimitiveIDLTypeInfo('any', dart_type='Object'), |
| 618 'any[]': PrimitiveIDLTypeInfo('any[]', dart_type='List'), | 618 'any[]': PrimitiveIDLTypeInfo('any[]', dart_type='List'), |
| 619 'Array': PrimitiveIDLTypeInfo('Array', dart_type='List'), | 619 'Array': PrimitiveIDLTypeInfo('Array', dart_type='List'), |
| 620 'custom': PrimitiveIDLTypeInfo('custom', dart_type='Dynamic'), | 620 'custom': PrimitiveIDLTypeInfo('custom', dart_type='Dynamic'), |
| 621 'Date': PrimitiveIDLTypeInfo('Date', dart_type='Date', native_type='double')
, | 621 'Date': PrimitiveIDLTypeInfo('Date', dart_type='Date', native_type='double')
, |
| 622 'DOMObject': PrimitiveIDLTypeInfo('DOMObject', dart_type='Object', native_ty
pe='ScriptValue'), | 622 'DOMObject': PrimitiveIDLTypeInfo('DOMObject', dart_type='Object', native_ty
pe='ScriptValue'), |
| 623 'DOMString': PrimitiveIDLTypeInfo('DOMString', dart_type='String', native_ty
pe='String'), | 623 'DOMString': PrimitiveIDLTypeInfo('DOMString', dart_type='String', native_ty
pe='String'), |
| 624 'Dictionary': PrimitiveIDLTypeInfo('Dictionary', dart_type='Dictionary'), | 624 # TODO(vsm): This won't actually work until we convert the Map to |
| 625 # a native JS Map for JS DOM. |
| 626 'Dictionary': PrimitiveIDLTypeInfo('Dictionary', dart_type='Map'), |
| 625 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} | 627 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} |
| 626 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa
ce | 628 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa
ce |
| 627 'Flags': PrimitiveIDLTypeInfo('Flags', dart_type='Object'), | 629 'Flags': PrimitiveIDLTypeInfo('Flags', dart_type='Object'), |
| 628 'DOMTimeStamp': PrimitiveIDLTypeInfo('DOMTimeStamp', dart_type='int', native
_type='unsigned long long'), | 630 'DOMTimeStamp': PrimitiveIDLTypeInfo('DOMTimeStamp', dart_type='int', native
_type='unsigned long long'), |
| 629 'object': PrimitiveIDLTypeInfo('object', dart_type='Object', native_type='Sc
riptValue'), | 631 'object': PrimitiveIDLTypeInfo('object', dart_type='Object', native_type='Sc
riptValue'), |
| 630 # TODO(sra): Come up with some meaningful name so that where this appears in | 632 # TODO(sra): Come up with some meaningful name so that where this appears in |
| 631 # the documentation, the user is made aware that only a limited subset of | 633 # the documentation, the user is made aware that only a limited subset of |
| 632 # serializable types are actually permitted. | 634 # serializable types are actually permitted. |
| 633 'SerializedScriptValue': PrimitiveIDLTypeInfo('SerializedScriptValue', dart_
type='Dynamic', ref_counted=True), | 635 'SerializedScriptValue': PrimitiveIDLTypeInfo('SerializedScriptValue', dart_
type='Dynamic', ref_counted=True), |
| 634 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} | 636 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 '"SVGAnimatedListPropertyTearOff.h"', | 678 '"SVGAnimatedListPropertyTearOff.h"', |
| 677 '"SVGTransformListPropertyTearOff.h"', | 679 '"SVGTransformListPropertyTearOff.h"', |
| 678 '"SVGPathSegListPropertyTearOff.h"', | 680 '"SVGPathSegListPropertyTearOff.h"', |
| 679 ] | 681 ] |
| 680 | 682 |
| 681 def GetIDLTypeInfo(idl_type_name): | 683 def GetIDLTypeInfo(idl_type_name): |
| 682 match = re.match(r'sequence<(\w+)>$', idl_type_name) | 684 match = re.match(r'sequence<(\w+)>$', idl_type_name) |
| 683 if match: | 685 if match: |
| 684 return SequenceIDLTypeInfo(idl_type_name, GetIDLTypeInfo(match.group(1))) | 686 return SequenceIDLTypeInfo(idl_type_name, GetIDLTypeInfo(match.group(1))) |
| 685 return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name)) | 687 return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name)) |
| OLD | NEW |