| 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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 webcore_setter_name='setIntegralAttribute'), | 766 webcore_setter_name='setIntegralAttribute'), |
| 767 'unsigned long': TypeData(clazz='Primitive', dart_type='int', | 767 'unsigned long': TypeData(clazz='Primitive', dart_type='int', |
| 768 native_type='unsigned', | 768 native_type='unsigned', |
| 769 webcore_getter_name='getUnsignedIntegralAttribute'
, | 769 webcore_getter_name='getUnsignedIntegralAttribute'
, |
| 770 webcore_setter_name='setUnsignedIntegralAttribute'
), | 770 webcore_setter_name='setUnsignedIntegralAttribute'
), |
| 771 'long long': TypeData(clazz='Primitive', dart_type='int'), | 771 'long long': TypeData(clazz='Primitive', dart_type='int'), |
| 772 'unsigned long long': TypeData(clazz='Primitive', dart_type='int'), | 772 'unsigned long long': TypeData(clazz='Primitive', dart_type='int'), |
| 773 'float': TypeData(clazz='Primitive', dart_type='num', native_type='double'), | 773 'float': TypeData(clazz='Primitive', dart_type='num', native_type='double'), |
| 774 'double': TypeData(clazz='Primitive', dart_type='num'), | 774 'double': TypeData(clazz='Primitive', dart_type='num'), |
| 775 | 775 |
| 776 'any': TypeData(clazz='Primitive', dart_type='Object', native_type='ScriptVa
lue'), | 776 'any': TypeData(clazz='Primitive', dart_type='Object', native_type='ScriptVa
lue', requires_v8_scope=True), |
| 777 'Array': TypeData(clazz='Primitive', dart_type='List'), | 777 'Array': TypeData(clazz='Primitive', dart_type='List'), |
| 778 'custom': TypeData(clazz='Primitive', dart_type='Dynamic'), | 778 'custom': TypeData(clazz='Primitive', dart_type='Dynamic'), |
| 779 'Date': TypeData(clazz='Primitive', dart_type='Date', native_type='double'), | 779 'Date': TypeData(clazz='Primitive', dart_type='Date', native_type='double'), |
| 780 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc
riptValue'), | 780 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc
riptValue'), |
| 781 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St
ring'), | 781 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St
ring'), |
| 782 # TODO(vsm): This won't actually work until we convert the Map to | 782 # TODO(vsm): This won't actually work until we convert the Map to |
| 783 # a native JS Map for JS DOM. | 783 # a native JS Map for JS DOM. |
| 784 'Dictionary': TypeData(clazz='Primitive', dart_type='Map', requires_v8_scope
=True), | 784 'Dictionary': TypeData(clazz='Primitive', dart_type='Map', requires_v8_scope
=True), |
| 785 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} | 785 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} |
| 786 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa
ce | 786 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa
ce |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 if match: | 868 if match: |
| 869 if type_name == 'DOMString[]': | 869 if type_name == 'DOMString[]': |
| 870 return DOMStringArrayTypeInfo(TypeData('Sequence'), self.TypeInfo('DOMSt
ring')) | 870 return DOMStringArrayTypeInfo(TypeData('Sequence'), self.TypeInfo('DOMSt
ring')) |
| 871 item_info = self.TypeInfo(match.group(1) or match.group(2)) | 871 item_info = self.TypeInfo(match.group(1) or match.group(2)) |
| 872 return SequenceIDLTypeInfo(type_name, TypeData('Sequence'), item_info) | 872 return SequenceIDLTypeInfo(type_name, TypeData('Sequence'), item_info) |
| 873 if not type_name in _idl_type_registry: | 873 if not type_name in _idl_type_registry: |
| 874 return InterfaceIDLTypeInfo(type_name, TypeData('Interface')) | 874 return InterfaceIDLTypeInfo(type_name, TypeData('Interface')) |
| 875 type_data = _idl_type_registry.get(type_name) | 875 type_data = _idl_type_registry.get(type_name) |
| 876 class_name = '%sIDLTypeInfo' % type_data.clazz | 876 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 877 return globals()[class_name](type_name, type_data) | 877 return globals()[class_name](type_name, type_data) |
| OLD | NEW |