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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 typedef_name = self._renamer.RenameInterface(self._interface) | 319 typedef_name = self._renamer.RenameInterface(self._interface) |
320 code.Emit('typedef void $NAME($PARAMS);\n', | 320 code.Emit('typedef void $NAME($PARAMS);\n', |
321 NAME=typedef_name, | 321 NAME=typedef_name, |
322 PARAMS=info.ParametersDeclaration(self._DartType)) | 322 PARAMS=info.ParametersDeclaration(self._DartType)) |
323 self._backend.GenerateCallback(info) | 323 self._backend.GenerateCallback(info) |
324 | 324 |
325 def GenerateInterface(self): | 325 def GenerateInterface(self): |
326 interface_name = self._interface_type_info.interface_name() | 326 interface_name = self._interface_type_info.interface_name() |
327 | 327 |
| 328 # Check the interface to see if should be removed. |
| 329 if self._renamer.FindInterface(interface_name): |
| 330 return None |
| 331 |
328 factory_provider = None | 332 factory_provider = None |
329 if interface_name in interface_factories: | 333 if interface_name in interface_factories: |
330 factory_provider = interface_factories[interface_name] | 334 factory_provider = interface_factories[interface_name] |
331 factory_constructor_name = None | 335 factory_constructor_name = None |
332 | 336 |
333 constructors = [] | 337 constructors = [] |
334 if interface_name in _static_classes: | 338 if interface_name in _static_classes: |
335 constructor_info = None | 339 constructor_info = None |
336 else: | 340 else: |
337 constructor_info = AnalyzeConstructor(self._interface) | 341 constructor_info = AnalyzeConstructor(self._interface) |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 for library_name in libraries: | 1048 for library_name in libraries: |
1045 self._libraries[library_name] = DartLibrary( | 1049 self._libraries[library_name] = DartLibrary( |
1046 library_name, template_loader, library_type, output_dir) | 1050 library_name, template_loader, library_type, output_dir) |
1047 | 1051 |
1048 def AddFile(self, basename, library_name, path): | 1052 def AddFile(self, basename, library_name, path): |
1049 self._libraries[library_name].AddFile(path) | 1053 self._libraries[library_name].AddFile(path) |
1050 | 1054 |
1051 def Emit(self, emitter, auxiliary_dir): | 1055 def Emit(self, emitter, auxiliary_dir): |
1052 for lib in self._libraries.values(): | 1056 for lib in self._libraries.values(): |
1053 lib.Emit(emitter, auxiliary_dir) | 1057 lib.Emit(emitter, auxiliary_dir) |
OLD | NEW |