| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 def SetImplementationEmitter(self, implementation_emitter): | 31 def SetImplementationEmitter(self, implementation_emitter): |
| 32 self._dart_impl_emitter = implementation_emitter | 32 self._dart_impl_emitter = implementation_emitter |
| 33 | 33 |
| 34 def ImplementsMergedMembers(self): | 34 def ImplementsMergedMembers(self): |
| 35 # We could not add merged functions to implementation class because | 35 # We could not add merged functions to implementation class because |
| 36 # underlying c++ object doesn't implement them. Merged functions are | 36 # underlying c++ object doesn't implement them. Merged functions are |
| 37 # generated on merged interface implementation instead. | 37 # generated on merged interface implementation instead. |
| 38 return False | 38 return False |
| 39 | 39 |
| 40 def HasCustomEventImplementation(self, member_name): | 40 def CustomJSMembers(self): |
| 41 return False | 41 return {} |
| 42 | 42 |
| 43 def GenerateCallback(self, info): | 43 def GenerateCallback(self, info): |
| 44 if IsPureInterface(self._interface.id): | 44 if IsPureInterface(self._interface.id): |
| 45 return | 45 return |
| 46 | 46 |
| 47 cpp_impl_includes = set() | 47 cpp_impl_includes = set() |
| 48 cpp_header_handlers_emitter = emitter.Emitter() | 48 cpp_header_handlers_emitter = emitter.Emitter() |
| 49 cpp_impl_handlers_emitter = emitter.Emitter() | 49 cpp_impl_handlers_emitter = emitter.Emitter() |
| 50 class_name = 'Dart%s' % self._interface.id | 50 class_name = 'Dart%s' % self._interface.id |
| 51 for operation in self._interface.operations: | 51 for operation in self._interface.operations: |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 def EmitResolver(self, template, output_dir): | 885 def EmitResolver(self, template, output_dir): |
| 886 file_path = os.path.join(output_dir, 'DartResolver.cpp') | 886 file_path = os.path.join(output_dir, 'DartResolver.cpp') |
| 887 includes_emitter, body_emitter = self._emitters.FileEmitter(file_path).Emit(
template) | 887 includes_emitter, body_emitter = self._emitters.FileEmitter(file_path).Emit(
template) |
| 888 for header_file in self._headers_list: | 888 for header_file in self._headers_list: |
| 889 path = os.path.relpath(header_file, output_dir) | 889 path = os.path.relpath(header_file, output_dir) |
| 890 includes_emitter.Emit('#include "$PATH"\n', PATH=path) | 890 includes_emitter.Emit('#include "$PATH"\n', PATH=path) |
| 891 body_emitter.Emit( | 891 body_emitter.Emit( |
| 892 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argume
ntCount))\n' | 892 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argume
ntCount))\n' |
| 893 ' return func;\n', | 893 ' return func;\n', |
| 894 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) | 894 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) |
| OLD | NEW |