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 logging | 10 import logging |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 | 643 |
644 | 644 |
645 # ------------------------------------------------------------------------------ | 645 # ------------------------------------------------------------------------------ |
646 | 646 |
647 class Dart2JSBackend(HtmlDartGenerator): | 647 class Dart2JSBackend(HtmlDartGenerator): |
648 """Generates a dart2js class for the dart:html library from a DOM IDL | 648 """Generates a dart2js class for the dart:html library from a DOM IDL |
649 interface. | 649 interface. |
650 """ | 650 """ |
651 | 651 |
652 def __init__(self, interface, options): | 652 def __init__(self, interface, options): |
653 super(Dart2JSBackend, self).__init__(interface, options) | 653 super(Dart2JSBackend, self).__init__(interface, options, False) |
654 | 654 |
655 self._database = options.database | 655 self._database = options.database |
656 self._template_loader = options.templates | 656 self._template_loader = options.templates |
657 self._type_registry = options.type_registry | 657 self._type_registry = options.type_registry |
658 self._renamer = options.renamer | 658 self._renamer = options.renamer |
659 self._metadata = options.metadata | 659 self._metadata = options.metadata |
660 self._interface_type_info = self._type_registry.TypeInfo(self._interface.id) | 660 self._interface_type_info = self._type_registry.TypeInfo(self._interface.id) |
661 self._current_secondary_parent = None | 661 self._current_secondary_parent = None |
662 self._library_name = self._renamer.GetLibraryName(self._interface) | 662 self._library_name = self._renamer.GetLibraryName(self._interface) |
663 | 663 |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 for library_name in libraries: | 1243 for library_name in libraries: |
1244 self._libraries[library_name] = DartLibrary( | 1244 self._libraries[library_name] = DartLibrary( |
1245 library_name, template_loader, library_type, output_dir) | 1245 library_name, template_loader, library_type, output_dir) |
1246 | 1246 |
1247 def AddFile(self, basename, library_name, path): | 1247 def AddFile(self, basename, library_name, path): |
1248 self._libraries[library_name].AddFile(path) | 1248 self._libraries[library_name].AddFile(path) |
1249 | 1249 |
1250 def Emit(self, emitter, auxiliary_dir): | 1250 def Emit(self, emitter, auxiliary_dir): |
1251 for lib in self._libraries.values(): | 1251 for lib in self._libraries.values(): |
1252 lib.Emit(emitter, auxiliary_dir) | 1252 lib.Emit(emitter, auxiliary_dir) |
OLD | NEW |