| 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 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 | 924 |
| 925 self._members_emitter.Emit( | 925 self._members_emitter.Emit( |
| 926 ' $RENAME$ANNOTATIONS$MODIFIERS$TYPE$TARGET($PARAMS) native;\n', | 926 ' $RENAME$ANNOTATIONS$MODIFIERS$TYPE$TARGET($PARAMS) native;\n', |
| 927 RENAME=self._RenamingAnnotation(info.declared_name, target), | 927 RENAME=self._RenamingAnnotation(info.declared_name, target), |
| 928 ANNOTATIONS=self._Annotations(info.type_name, info.declared_name), | 928 ANNOTATIONS=self._Annotations(info.type_name, info.declared_name), |
| 929 MODIFIERS='static ' if info.IsStatic() else '', | 929 MODIFIERS='static ' if info.IsStatic() else '', |
| 930 TYPE=TypeOrNothing(native_return_type), | 930 TYPE=TypeOrNothing(native_return_type), |
| 931 TARGET=target, | 931 TARGET=target, |
| 932 PARAMS=', '.join(target_parameters)) | 932 PARAMS=', '.join(target_parameters)) |
| 933 | 933 |
| 934 declaration = '%s%s%s %s(%s)' % ( | 934 declaration = '%s%s %s(%s)' % ( |
| 935 self._Annotations(info.type_name, info.declared_name), | |
| 936 'static ' if info.IsStatic() else '', | 935 'static ' if info.IsStatic() else '', |
| 937 return_type, | 936 return_type, |
| 938 html_name, | 937 html_name, |
| 939 info.ParametersDeclaration(InputType)) | 938 info.ParametersDeclaration(InputType)) |
| 940 self._GenerateDispatcherBody( | 939 self._GenerateDispatcherBody( |
| 941 operations, | 940 operations, |
| 942 parameter_names, | 941 parameter_names, |
| 943 declaration, | 942 declaration, |
| 944 GenerateCall, | 943 GenerateCall, |
| 945 self._IsOptional, | 944 self._IsOptional, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 for library_name in libraries: | 1106 for library_name in libraries: |
| 1108 self._libraries[library_name] = DartLibrary( | 1107 self._libraries[library_name] = DartLibrary( |
| 1109 library_name, template_loader, library_type, output_dir) | 1108 library_name, template_loader, library_type, output_dir) |
| 1110 | 1109 |
| 1111 def AddFile(self, basename, library_name, path): | 1110 def AddFile(self, basename, library_name, path): |
| 1112 self._libraries[library_name].AddFile(path) | 1111 self._libraries[library_name].AddFile(path) |
| 1113 | 1112 |
| 1114 def Emit(self, emitter, auxiliary_dir): | 1113 def Emit(self, emitter, auxiliary_dir): |
| 1115 for lib in self._libraries.values(): | 1114 for lib in self._libraries.values(): |
| 1116 lib.Emit(emitter, auxiliary_dir) | 1115 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |