| 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 | 10 |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 self._AddRenamingGetter(attribute, html_name) | 958 self._AddRenamingGetter(attribute, html_name) |
| 959 if not read_only: | 959 if not read_only: |
| 960 self._AddRenamingSetter(attribute, html_name) | 960 self._AddRenamingSetter(attribute, html_name) |
| 961 | 961 |
| 962 def _AddRenamingGetter(self, attr, html_name): | 962 def _AddRenamingGetter(self, attr, html_name): |
| 963 conversion = self._OutputConversion(attr.type.id, attr.id) | 963 conversion = self._OutputConversion(attr.type.id, attr.id) |
| 964 if conversion: | 964 if conversion: |
| 965 return self._AddConvertingGetter(attr, html_name, conversion) | 965 return self._AddConvertingGetter(attr, html_name, conversion) |
| 966 return_type = self._NarrowOutputType(attr.type.id) | 966 return_type = self._NarrowOutputType(attr.type.id) |
| 967 self._members_emitter.Emit( | 967 self._members_emitter.Emit( |
| 968 '\n $TYPE get $HTML_NAME native "return this.$NAME;";\n', | 968 '\n $TYPE get $HTML_NAME() native "return this.$NAME;";\n', |
| 969 HTML_NAME=html_name, | 969 HTML_NAME=html_name, |
| 970 NAME=attr.id, | 970 NAME=attr.id, |
| 971 TYPE=return_type) | 971 TYPE=return_type) |
| 972 | 972 |
| 973 def _AddRenamingSetter(self, attr, html_name): | 973 def _AddRenamingSetter(self, attr, html_name): |
| 974 conversion = self._InputConversion(attr.type.id, attr.id) | 974 conversion = self._InputConversion(attr.type.id, attr.id) |
| 975 if conversion: | 975 if conversion: |
| 976 return self._AddConvertingSetter(attr, html_name, conversion) | 976 return self._AddConvertingSetter(attr, html_name, conversion) |
| 977 self._members_emitter.Emit( | 977 self._members_emitter.Emit( |
| 978 '\n void set $HTML_NAME($TYPE value)' | 978 '\n void set $HTML_NAME($TYPE value)' |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 return HtmlDart2JSClassGenerator(self, interface) | 1233 return HtmlDart2JSClassGenerator(self, interface) |
| 1234 | 1234 |
| 1235 def GenerateLibraries(self, dart_files): | 1235 def GenerateLibraries(self, dart_files): |
| 1236 self._GenerateLibFile( | 1236 self._GenerateLibFile( |
| 1237 'html_dart2js.darttemplate', | 1237 'html_dart2js.darttemplate', |
| 1238 os.path.join(self._output_dir, 'html_dart2js.dart'), | 1238 os.path.join(self._output_dir, 'html_dart2js.dart'), |
| 1239 dart_files) | 1239 dart_files) |
| 1240 | 1240 |
| 1241 def Finish(self): | 1241 def Finish(self): |
| 1242 pass | 1242 pass |
| OLD | NEW |