| 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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 if output_conversion: | 775 if output_conversion: |
| 776 call = '%s(%s)' % (output_conversion.function_name, call) | 776 call = '%s(%s)' % (output_conversion.function_name, call) |
| 777 | 777 |
| 778 if operation.type.id == 'void': | 778 if operation.type.id == 'void': |
| 779 call_emitter.Emit('$(INDENT)$CALL;\n$(INDENT)return;\n', | 779 call_emitter.Emit('$(INDENT)$CALL;\n$(INDENT)return;\n', |
| 780 CALL=call) | 780 CALL=call) |
| 781 else: | 781 else: |
| 782 call_emitter.Emit('$(INDENT)return $CALL;\n', CALL=call) | 782 call_emitter.Emit('$(INDENT)return $CALL;\n', CALL=call) |
| 783 | 783 |
| 784 self._members_emitter.Emit( | 784 self._members_emitter.Emit( |
| 785 ' $TYPE$TARGET($PARAMS) native "$NATIVE";\n', | 785 ' $MODIFIERS$TYPE$TARGET($PARAMS) native "$NATIVE";\n', |
| 786 MODIFIERS='static ' if info.IsStatic() else '', |
| 786 TYPE=TypeOrNothing(native_return_type), | 787 TYPE=TypeOrNothing(native_return_type), |
| 787 TARGET=target, | 788 TARGET=target, |
| 788 PARAMS=', '.join(target_parameters), | 789 PARAMS=', '.join(target_parameters), |
| 789 NATIVE=info.declared_name) | 790 NATIVE=info.declared_name) |
| 790 | 791 |
| 791 def GenerateChecksAndCall(operation, argument_count): | 792 def GenerateChecksAndCall(operation, argument_count): |
| 792 checks = [] | 793 checks = [] |
| 793 for i in range(0, argument_count): | 794 for i in range(0, argument_count): |
| 794 argument = operation.arguments[i] | 795 argument = operation.arguments[i] |
| 795 parameter_name = parameter_names[i] | 796 parameter_name = parameter_names[i] |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 'svg': DartLibrary('svg', template_loader, library_type, output_dir), | 974 'svg': DartLibrary('svg', template_loader, library_type, output_dir), |
| 974 'html': DartLibrary('html', template_loader, library_type, output_dir), | 975 'html': DartLibrary('html', template_loader, library_type, output_dir), |
| 975 } | 976 } |
| 976 | 977 |
| 977 def AddFile(self, basename, library_name, path): | 978 def AddFile(self, basename, library_name, path): |
| 978 self._libraries[library_name].AddFile(path) | 979 self._libraries[library_name].AddFile(path) |
| 979 | 980 |
| 980 def Emit(self, emitter, auxiliary_dir): | 981 def Emit(self, emitter, auxiliary_dir): |
| 981 for lib in self._libraries.values(): | 982 for lib in self._libraries.values(): |
| 982 lib.Emit(emitter, auxiliary_dir) | 983 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |