| 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 the system to generate | 6 """This module provides shared functionality for the system to generate |
| 7 Dart:html APIs from the IDL database.""" | 7 Dart:html APIs from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 import os | 10 import os |
| 11 from generator import * | 11 from generator import * |
| 12 | 12 |
| 13 _js_custom_members = set([ | 13 _js_custom_members = set([ |
| 14 'AudioBufferSourceNode.start', | 14 'AudioBufferSourceNode.start', |
| 15 'AudioBufferSourceNode.stop', | 15 'AudioBufferSourceNode.stop', |
| 16 'CSSStyleDeclaration.setProperty', | 16 'CSSStyleDeclaration.setProperty', |
| 17 'Element.insertAdjacentElement', | 17 'Element.insertAdjacentElement', |
| 18 'Element.insertAdjacentHTML', | 18 'Element.insertAdjacentHTML', |
| 19 'Element.insertAdjacentText', | 19 'Element.insertAdjacentText', |
| 20 'Element.remove', | 20 'Element.remove', |
| 21 'ElementEvents.mouseWheel', | 21 'ElementEvents.mouseWheel', |
| 22 'IDBDatabase.transaction', | 22 'IDBDatabase.transaction', |
| 23 'IFrameElement.contentWindow', | |
| 24 'MouseEvent.offsetX', | 23 'MouseEvent.offsetX', |
| 25 'MouseEvent.offsetY', | 24 'MouseEvent.offsetY', |
| 26 'SelectElement.options', | 25 'SelectElement.options', |
| 27 'SelectElement.selectedOptions', | 26 'SelectElement.selectedOptions', |
| 28 'TableElement.createTBody', | 27 'TableElement.createTBody', |
| 29 'LocalWindow.document', | 28 'LocalWindow.document', |
| 30 'LocalWindow.indexedDB', | 29 'LocalWindow.indexedDB', |
| 31 'LocalWindow.location', | 30 'LocalWindow.location', |
| 32 'LocalWindow.open', | 31 'LocalWindow.open', |
| 33 'LocalWindow.top', | |
| 34 'LocalWindow.webkitCancelAnimationFrame', | 32 'LocalWindow.webkitCancelAnimationFrame', |
| 35 'LocalWindow.webkitRequestAnimationFrame', | 33 'LocalWindow.webkitRequestAnimationFrame', |
| 36 ]) | 34 ]) |
| 37 | 35 |
| 38 # This map controls merging of interfaces in dart:html library. | 36 # This map controls merging of interfaces in dart:html library. |
| 39 # All constants, attributes, and operations of merged interface (key) are | 37 # All constants, attributes, and operations of merged interface (key) are |
| 40 # added to target interface (value). All references to the merged interface | 38 # added to target interface (value). All references to the merged interface |
| 41 # (e.g. parameter types, return types, parent interfaces) are replaced with | 39 # (e.g. parameter types, return types, parent interfaces) are replaced with |
| 42 # target interface. There are two important restrictions: | 40 # target interface. There are two important restrictions: |
| 43 # 1) Merged and target interfaces shouldn't have common members, otherwise there | 41 # 1) Merged and target interfaces shouldn't have common members, otherwise there |
| (...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 | 1129 |
| 1132 library_emitter = self._multiemitter.FileEmitter(library_file_path) | 1130 library_emitter = self._multiemitter.FileEmitter(library_file_path) |
| 1133 library_file_dir = os.path.dirname(library_file_path) | 1131 library_file_dir = os.path.dirname(library_file_path) |
| 1134 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) | 1132 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) |
| 1135 imports_emitter = library_emitter.Emit( | 1133 imports_emitter = library_emitter.Emit( |
| 1136 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) | 1134 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) |
| 1137 for path in sorted(self._path_to_emitter.keys()): | 1135 for path in sorted(self._path_to_emitter.keys()): |
| 1138 relpath = os.path.relpath(path, library_file_dir) | 1136 relpath = os.path.relpath(path, library_file_dir) |
| 1139 imports_emitter.Emit( | 1137 imports_emitter.Emit( |
| 1140 "#source('$PATH');\n", PATH=massage_path(relpath)) | 1138 "#source('$PATH');\n", PATH=massage_path(relpath)) |
| OLD | NEW |