| 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 monitored | 10 import monitored |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 implements.append(secure_base_name) | 508 implements.append(secure_base_name) |
| 509 | 509 |
| 510 implements_str = '' | 510 implements_str = '' |
| 511 if implements: | 511 if implements: |
| 512 implements_str = ' implements ' + ', '.join(set(implements)) | 512 implements_str = ' implements ' + ', '.join(set(implements)) |
| 513 | 513 |
| 514 annotations = FormatAnnotationsAndComments( | 514 annotations = FormatAnnotationsAndComments( |
| 515 GetAnnotationsAndComments(self._library_name, | 515 GetAnnotationsAndComments(self._library_name, |
| 516 self._interface.doc_js_name), '') | 516 self._interface.doc_js_name), '') |
| 517 | 517 |
| 518 class_modifiers = '' |
| 519 if self._renamer.ShouldSuppressInterface(self._interface): |
| 520 class_modifiers = 'abstract ' |
| 521 |
| 518 self._implementation_members_emitter = implementation_emitter.Emit( | 522 self._implementation_members_emitter = implementation_emitter.Emit( |
| 519 self._backend.ImplementationTemplate(), | 523 self._backend.ImplementationTemplate(), |
| 520 LIBRARYNAME='dart.dom.%s' % self._library_name, | 524 LIBRARYNAME='dart.dom.%s' % self._library_name, |
| 521 ANNOTATIONS=annotations, | 525 ANNOTATIONS=annotations, |
| 526 CLASS_MODIFIERS=class_modifiers, |
| 522 CLASSNAME=self._interface_type_info.implementation_name(), | 527 CLASSNAME=self._interface_type_info.implementation_name(), |
| 523 EXTENDS=' extends %s' % base_class if base_class else '', | 528 EXTENDS=' extends %s' % base_class if base_class else '', |
| 524 IMPLEMENTS=implements_str, | 529 IMPLEMENTS=implements_str, |
| 525 DOMNAME=self._interface.doc_js_name, | 530 DOMNAME=self._interface.doc_js_name, |
| 526 NATIVESPEC=self._backend.NativeSpec()) | 531 NATIVESPEC=self._backend.NativeSpec()) |
| 527 self._backend.StartInterface(self._implementation_members_emitter) | 532 self._backend.StartInterface(self._implementation_members_emitter) |
| 528 | 533 |
| 529 self._backend.EmitHelpers(base_class) | 534 self._backend.EmitHelpers(base_class) |
| 530 self._event_generator.EmitStreamProviders( | 535 self._event_generator.EmitStreamProviders( |
| 531 self._interface, | 536 self._interface, |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 for library_name in libraries: | 1152 for library_name in libraries: |
| 1148 self._libraries[library_name] = DartLibrary( | 1153 self._libraries[library_name] = DartLibrary( |
| 1149 library_name, template_loader, library_type, output_dir) | 1154 library_name, template_loader, library_type, output_dir) |
| 1150 | 1155 |
| 1151 def AddFile(self, basename, library_name, path): | 1156 def AddFile(self, basename, library_name, path): |
| 1152 self._libraries[library_name].AddFile(path) | 1157 self._libraries[library_name].AddFile(path) |
| 1153 | 1158 |
| 1154 def Emit(self, emitter, auxiliary_dir): | 1159 def Emit(self, emitter, auxiliary_dir): |
| 1155 for lib in self._libraries.values(): | 1160 for lib in self._libraries.values(): |
| 1156 lib.Emit(emitter, auxiliary_dir) | 1161 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |