| 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 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 'WheelEvent.wheelDeltaX', | 35 'WheelEvent.wheelDeltaX', |
| 36 'WheelEvent.wheelDeltaY', | 36 'WheelEvent.wheelDeltaY', |
| 37 'Window.cancelAnimationFrame', | 37 'Window.cancelAnimationFrame', |
| 38 'Window.document', | 38 'Window.document', |
| 39 'Window.indexedDB', | 39 'Window.indexedDB', |
| 40 'Window.location', | 40 'Window.location', |
| 41 'Window.open', | 41 'Window.open', |
| 42 'Window.requestAnimationFrame', | 42 'Window.requestAnimationFrame', |
| 43 'Window.webkitCancelAnimationFrame', | 43 'Window.webkitCancelAnimationFrame', |
| 44 'Window.webkitRequestAnimationFrame', | 44 'Window.webkitRequestAnimationFrame', |
| 45 'WorkerContext.indexedDB', |
| 45 ]) | 46 ]) |
| 46 | 47 |
| 47 | 48 |
| 48 # Classes that offer only static methods, and therefore we should suppress | 49 # Classes that offer only static methods, and therefore we should suppress |
| 49 # constructor creation. | 50 # constructor creation. |
| 50 _static_classes = set(['Url']) | 51 _static_classes = set(['Url']) |
| 51 | 52 |
| 52 # Information for generating element constructors. | 53 # Information for generating element constructors. |
| 53 # | 54 # |
| 54 # TODO(sra): maybe remove all the argument complexity and use cascades. | 55 # TODO(sra): maybe remove all the argument complexity and use cascades. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 'TitleElement': 'title', | 197 'TitleElement': 'title', |
| 197 'TRefElement': 'tref', | 198 'TRefElement': 'tref', |
| 198 'TSpanElement': 'tspan', | 199 'TSpanElement': 'tspan', |
| 199 'UseElement': 'use', | 200 'UseElement': 'use', |
| 200 'ViewElement': 'view', | 201 'ViewElement': 'view', |
| 201 'VKernElement': 'vkern', | 202 'VKernElement': 'vkern', |
| 202 } | 203 } |
| 203 | 204 |
| 204 _element_constructors = { | 205 _element_constructors = { |
| 205 'html': _html_element_constructors, | 206 'html': _html_element_constructors, |
| 207 'indexed_db': {}, |
| 206 'svg': _svg_element_constructors, | 208 'svg': _svg_element_constructors, |
| 207 'web_audio': {}, | 209 'web_audio': {}, |
| 208 } | 210 } |
| 209 | 211 |
| 210 _factory_ctr_strings = { | 212 _factory_ctr_strings = { |
| 211 'html': { | 213 'html': { |
| 212 'provider_name': 'document', | 214 'provider_name': 'document', |
| 213 'constructor_name': '$dom_createElement' | 215 'constructor_name': '$dom_createElement' |
| 214 }, | 216 }, |
| 217 'indexed_db': { |
| 218 'provider_name': 'document', |
| 219 'constructor_name': '$dom_createElement' |
| 220 }, |
| 215 'svg': { | 221 'svg': { |
| 216 'provider_name': '_SvgElementFactoryProvider', | 222 'provider_name': '_SvgElementFactoryProvider', |
| 217 'constructor_name': 'createSvgElement_tag', | 223 'constructor_name': 'createSvgElement_tag', |
| 218 }, | 224 }, |
| 219 'web_audio': { | 225 'web_audio': { |
| 220 'provider_name': 'document', | 226 'provider_name': 'document', |
| 221 'constructor_name': '$dom_createElement' | 227 'constructor_name': '$dom_createElement' |
| 222 }, | 228 }, |
| 223 } | 229 } |
| 224 | 230 |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 for library_name in libraries: | 988 for library_name in libraries: |
| 983 self._libraries[library_name] = DartLibrary( | 989 self._libraries[library_name] = DartLibrary( |
| 984 library_name, template_loader, library_type, output_dir) | 990 library_name, template_loader, library_type, output_dir) |
| 985 | 991 |
| 986 def AddFile(self, basename, library_name, path): | 992 def AddFile(self, basename, library_name, path): |
| 987 self._libraries[library_name].AddFile(path) | 993 self._libraries[library_name].AddFile(path) |
| 988 | 994 |
| 989 def Emit(self, emitter, auxiliary_dir): | 995 def Emit(self, emitter, auxiliary_dir): |
| 990 for lib in self._libraries.values(): | 996 for lib in self._libraries.values(): |
| 991 lib.Emit(emitter, auxiliary_dir) | 997 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |