| 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 systems to generate | 6 """This module provides shared functionality for the systems to generate |
| 7 native binding from the IDL database.""" | 7 native binding from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 import os | 10 import os |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 cpp_impl_path = self._FilePathForCppImplementation(self._interface.id) | 123 cpp_impl_path = self._FilePathForCppImplementation(self._interface.id) |
| 124 self._cpp_impl_files.append(cpp_impl_path) | 124 self._cpp_impl_files.append(cpp_impl_path) |
| 125 cpp_impl_emitter = self._emitters.FileEmitter(cpp_impl_path) | 125 cpp_impl_emitter = self._emitters.FileEmitter(cpp_impl_path) |
| 126 cpp_impl_emitter.Emit( | 126 cpp_impl_emitter.Emit( |
| 127 self._templates.Load('cpp_callback_implementation.template'), | 127 self._templates.Load('cpp_callback_implementation.template'), |
| 128 INCLUDES=_GenerateCPPIncludes(cpp_impl_includes), | 128 INCLUDES=_GenerateCPPIncludes(cpp_impl_includes), |
| 129 INTERFACE=self._interface.id, | 129 INTERFACE=self._interface.id, |
| 130 HANDLERS=cpp_impl_handlers_emitter.Fragments()) | 130 HANDLERS=cpp_impl_handlers_emitter.Fragments()) |
| 131 | 131 |
| 132 def GenerateLibraries(self, lib_dir): | 132 def GenerateLibraries(self): |
| 133 auxiliary_dir = os.path.relpath(self._auxiliary_dir, self._output_dir) | 133 auxiliary_dir = os.path.relpath(self._auxiliary_dir, self._output_dir) |
| 134 | 134 |
| 135 # Generate dom_public.dart. | 135 # Generate dom_public.dart. |
| 136 self._GenerateLibFile( | 136 self._GenerateLibFile( |
| 137 'dom_public.darttemplate', | 137 'dom_public.darttemplate', |
| 138 os.path.join(self._output_dir, 'dom_public.dart'), | 138 os.path.join(self._output_dir, 'dom_public.dart'), |
| 139 self._dom_public_files, | 139 self._dom_public_files, |
| 140 AUXILIARY_DIR=MassagePath(auxiliary_dir)); | 140 AUXILIARY_DIR=MassagePath(auxiliary_dir)); |
| 141 | 141 |
| 142 # Generate dom_impl.dart. | 142 # Generate dom_impl.dart. |
| (...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 for parent in interface.parents: | 1211 for parent in interface.parents: |
| 1212 parent_name = parent.type.id | 1212 parent_name = parent.type.id |
| 1213 if not database.HasInterface(parent.type.id): | 1213 if not database.HasInterface(parent.type.id): |
| 1214 continue | 1214 continue |
| 1215 parent_interface = database.GetInterface(parent.type.id) | 1215 parent_interface = database.GetInterface(parent.type.id) |
| 1216 if callback(parent_interface): | 1216 if callback(parent_interface): |
| 1217 return parent_interface | 1217 return parent_interface |
| 1218 parent_interface = _FindParent(parent_interface, database, callback) | 1218 parent_interface = _FindParent(parent_interface, database, callback) |
| 1219 if parent_interface: | 1219 if parent_interface: |
| 1220 return parent_interface | 1220 return parent_interface |
| OLD | NEW |