| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 # Custom native specs for the Frog dom. | 121 # Custom native specs for the Frog dom. |
| 122 # | 122 # |
| 123 _frog_dom_custom_native_specs = { | 123 _frog_dom_custom_native_specs = { |
| 124 # Decorate the singleton Console object, if present (workers do not have a | 124 # Decorate the singleton Console object, if present (workers do not have a |
| 125 # console). | 125 # console). |
| 126 'Console': "=(typeof console == 'undefined' ? {} : console)", | 126 'Console': "=(typeof console == 'undefined' ? {} : console)", |
| 127 | 127 |
| 128 # DOMWindow aliased with global scope. | 128 # DOMWindow aliased with global scope. |
| 129 'DOMWindow': '@*DOMWindow', | 129 'DOMWindow': '@*DOMWindow', |
| 130 | 130 |
| 131 # Temporary hack: make these not be 'hidden', so that static methods can be | 131 # Temporary hack: make these be 'hidden'. |
| 132 # put on them. Frog should be fixed to generate working code for static | 132 'SVGPathSeg': '*SVGPathSeg', |
| 133 # methods on hidden classes. Meantime, programs will not work on IE9. | |
| 134 'Float32Array': 'Float32Array', | |
| 135 'Float64Array': 'Float64Array', | |
| 136 'Int8Array': 'Int8Array', | |
| 137 'Int16Array': 'Int16Array', | |
| 138 'Int32Array': 'Int32Array', | |
| 139 'Uint8Array': 'Uint8Array', | |
| 140 'Uint16Array': 'Uint16Array', | |
| 141 'Uint32Array': 'Uint32Array', | |
| 142 } | 133 } |
| 143 | 134 |
| 144 # | 135 # |
| 145 # Publically visible types common across all supported browsers. | 136 # Publically visible types common across all supported browsers. |
| 146 # | 137 # |
| 147 _BROWSER_SHARED_TYPES = [ | 138 _BROWSER_SHARED_TYPES = [ |
| 148 'Attr', | 139 'Attr', |
| 149 'CDATASection', | 140 'CDATASection', |
| 150 'CSSFontFaceRule', | 141 'CSSFontFaceRule', |
| 151 'CSSImportRule', | 142 'CSSImportRule', |
| (...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 Arguments: | 2489 Arguments: |
| 2499 info: An OperationInfo object. | 2490 info: An OperationInfo object. |
| 2500 """ | 2491 """ |
| 2501 # TODO(vsm): Handle overloads. | 2492 # TODO(vsm): Handle overloads. |
| 2502 self._members_emitter.Emit( | 2493 self._members_emitter.Emit( |
| 2503 '\n' | 2494 '\n' |
| 2504 ' $TYPE $NAME($ARGS) native;\n', | 2495 ' $TYPE $NAME($ARGS) native;\n', |
| 2505 TYPE=info.type_name, | 2496 TYPE=info.type_name, |
| 2506 NAME=info.name, | 2497 NAME=info.name, |
| 2507 ARGS=info.arg_implementation_declaration) | 2498 ARGS=info.arg_implementation_declaration) |
| OLD | NEW |