Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: sdk/lib/html/scripts/systemhtml.py

Issue 11280103: Splitting out the Audio library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed dart:audio to dart:web_audio Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 'TitleElement': 'title', 195 'TitleElement': 'title',
196 'TRefElement': 'tref', 196 'TRefElement': 'tref',
197 'TSpanElement': 'tspan', 197 'TSpanElement': 'tspan',
198 'UseElement': 'use', 198 'UseElement': 'use',
199 'ViewElement': 'view', 199 'ViewElement': 'view',
200 'VKernElement': 'vkern', 200 'VKernElement': 'vkern',
201 } 201 }
202 202
203 _element_constructors = { 203 _element_constructors = {
204 'html': _html_element_constructors, 204 'html': _html_element_constructors,
205 'svg': _svg_element_constructors 205 'svg': _svg_element_constructors,
206 'web_audio': {},
206 } 207 }
207 208
208 _factory_ctr_strings = { 209 _factory_ctr_strings = {
209 'html': { 210 'html': {
210 'provider_name': 'document', 211 'provider_name': 'document',
211 'constructor_name': '$dom_createElement' 212 'constructor_name': '$dom_createElement'
212 }, 213 },
213 'svg': { 214 'svg': {
214 'provider_name': '_SvgElementFactoryProvider', 215 'provider_name': '_SvgElementFactoryProvider',
215 'constructor_name': 'createSvgElement_tag', 216 'constructor_name': 'createSvgElement_tag',
216 }, 217 },
218 'web_audio': {
219 'provider_name': 'document',
220 'constructor_name': '$dom_createElement'
221 },
217 } 222 }
218 223
219 def ElementConstructorInfos(typename, element_constructors, 224 def ElementConstructorInfos(typename, element_constructors,
220 factory_provider_name='_Elements'): 225 factory_provider_name='_Elements'):
221 """Returns list of ElementConstructorInfos about the convenience constructors 226 """Returns list of ElementConstructorInfos about the convenience constructors
222 for an Element or SvgElement.""" 227 for an Element or SvgElement."""
223 # TODO(sra): Handle multiple and named constructors. 228 # TODO(sra): Handle multiple and named constructors.
224 if typename not in element_constructors: 229 if typename not in element_constructors:
225 return [] 230 return []
226 infos = element_constructors[typename] 231 infos = element_constructors[typename]
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 for path in sorted(self._paths): 979 for path in sorted(self._paths):
975 relpath = os.path.relpath(path, library_file_dir) 980 relpath = os.path.relpath(path, library_file_dir)
976 imports_emitter.Emit( 981 imports_emitter.Emit(
977 "part '$PATH';\n", PATH=massage_path(relpath)) 982 "part '$PATH';\n", PATH=massage_path(relpath))
978 983
979 # ------------------------------------------------------------------------------ 984 # ------------------------------------------------------------------------------
980 985
981 class DartLibraries(): 986 class DartLibraries():
982 def __init__(self, template_loader, library_type, output_dir): 987 def __init__(self, template_loader, library_type, output_dir):
983 self._libraries = { 988 self._libraries = {
989 'html': DartLibrary('html', template_loader, library_type, output_dir),
984 'svg': DartLibrary('svg', template_loader, library_type, output_dir), 990 'svg': DartLibrary('svg', template_loader, library_type, output_dir),
985 'html': DartLibrary('html', template_loader, library_type, output_dir), 991 'web_audio': DartLibrary('web_audio', template_loader, library_type,
992 output_dir),
986 } 993 }
987 994
988 def AddFile(self, basename, library_name, path): 995 def AddFile(self, basename, library_name, path):
989 self._libraries[library_name].AddFile(path) 996 self._libraries[library_name].AddFile(path)
990 997
991 def Emit(self, emitter, auxiliary_dir): 998 def Emit(self, emitter, auxiliary_dir):
992 for lib in self._libraries.values(): 999 for lib in self._libraries.values():
993 lib.Emit(emitter, auxiliary_dir) 1000 lib.Emit(emitter, auxiliary_dir)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698