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