| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, 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 generates Dart APIs from the IDL database.""" | 6 """This module generates Dart APIs from the IDL database.""" |
| 7 | 7 |
| 8 import emitter | 8 import emitter |
| 9 import idlnode | 9 import idlnode |
| 10 import logging | 10 import logging |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 'float': 'num', | 32 'float': 'num', |
| 33 'int': 'int', | 33 'int': 'int', |
| 34 # Map to extra precision - int is a bignum in Dart. | 34 # Map to extra precision - int is a bignum in Dart. |
| 35 'long': 'int', | 35 'long': 'int', |
| 36 'long long': 'int', | 36 'long long': 'int', |
| 37 'object': 'Object', | 37 'object': 'Object', |
| 38 # Map to extra precision - int is a bignum in Dart. | 38 # Map to extra precision - int is a bignum in Dart. |
| 39 'short': 'int', | 39 'short': 'int', |
| 40 'string': 'String', | 40 'string': 'String', |
| 41 'void': 'void', | 41 'void': 'void', |
| 42 'Array': 'List', |
| 42 'sequence': 'List', | 43 'sequence': 'List', |
| 43 # TODO(vsm): We need to support other types. We could weaken to | 44 # TODO(vsm): We need to support other types. We could weaken to |
| 44 # Object, or inject SSV into the appropriate types. | 45 # Object, or inject SSV into the appropriate types. |
| 45 'SerializedScriptValue': 'String', | 46 'SerializedScriptValue': 'String', |
| 46 # TODO(vsm): Automatically recognize types defined in src. | 47 # TODO(vsm): Automatically recognize types defined in src. |
| 47 'TimeoutHandler': 'TimeoutHandler', | 48 'TimeoutHandler': 'TimeoutHandler', |
| 48 'RequestAnimationFrameCallback': 'RequestAnimationFrameCallback', | 49 'RequestAnimationFrameCallback': 'RequestAnimationFrameCallback', |
| 49 } | 50 } |
| 50 | 51 |
| 51 _dart_to_idl_type_conversions = dict((v,k) for k, v in | 52 _dart_to_idl_type_conversions = dict((v,k) for k, v in |
| (...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1948 Arguments: | 1949 Arguments: |
| 1949 info: An OperationInfo object. | 1950 info: An OperationInfo object. |
| 1950 """ | 1951 """ |
| 1951 # TODO(vsm): Handle overloads. | 1952 # TODO(vsm): Handle overloads. |
| 1952 self._members_emitter.Emit( | 1953 self._members_emitter.Emit( |
| 1953 '\n' | 1954 '\n' |
| 1954 ' $TYPE $NAME($ARGS) native;\n', | 1955 ' $TYPE $NAME($ARGS) native;\n', |
| 1955 TYPE=info.type_name, | 1956 TYPE=info.type_name, |
| 1956 NAME=info.name, | 1957 NAME=info.name, |
| 1957 ARGS=info.arg_implementation_declaration) | 1958 ARGS=info.arg_implementation_declaration) |
| OLD | NEW |