| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 self._interface, self._database) | 334 self._interface, self._database) |
| 335 if element_type: | 335 if element_type: |
| 336 self._members_emitter.Emit( | 336 self._members_emitter.Emit( |
| 337 '\n' | 337 '\n' |
| 338 ' factory $CTOR(int length) =>\n' | 338 ' factory $CTOR(int length) =>\n' |
| 339 ' $FACTORY.create$(CTOR)(length);\n' | 339 ' $FACTORY.create$(CTOR)(length);\n' |
| 340 '\n' | 340 '\n' |
| 341 ' factory $CTOR.fromList(List<$TYPE> list) =>\n' | 341 ' factory $CTOR.fromList(List<$TYPE> list) =>\n' |
| 342 ' $FACTORY.create$(CTOR)_fromList(list);\n' | 342 ' $FACTORY.create$(CTOR)_fromList(list);\n' |
| 343 '\n' | 343 '\n' |
| 344 ' factory $CTOR.fromBuffer(ArrayBuffer buffer, [int byteOffset, int l
ength]) => \n' | 344 ' factory $CTOR.fromBuffer(ArrayBuffer buffer, [int byteOffset, int l
ength]) =>\n' |
| 345 ' $FACTORY.create$(CTOR)_fromBuffer(buffer, byteOffset, length);\n'
, | 345 ' $FACTORY.create$(CTOR)_fromBuffer(buffer, byteOffset, length);\n'
, |
| 346 CTOR=self._interface.id, | 346 CTOR=self._interface.id, |
| 347 TYPE=self._DartType(element_type), | 347 TYPE=self._DartType(element_type), |
| 348 FACTORY=factory_provider) | 348 FACTORY=factory_provider) |
| 349 | 349 |
| 350 events_interface = self._event_generator.ProcessInterface( | 350 events_interface = self._event_generator.ProcessInterface( |
| 351 self._interface, self._html_interface_name, | 351 self._interface, self._html_interface_name, |
| 352 self._backend.CustomJSMembers(), | 352 self._backend.CustomJSMembers(), |
| 353 interface_emitter, implementation_emitter) | 353 interface_emitter, implementation_emitter) |
| 354 if events_interface: | 354 if events_interface: |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 | 1124 |
| 1125 library_emitter = self._multiemitter.FileEmitter(library_file_path) | 1125 library_emitter = self._multiemitter.FileEmitter(library_file_path) |
| 1126 library_file_dir = os.path.dirname(library_file_path) | 1126 library_file_dir = os.path.dirname(library_file_path) |
| 1127 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) | 1127 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) |
| 1128 imports_emitter = library_emitter.Emit( | 1128 imports_emitter = library_emitter.Emit( |
| 1129 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) | 1129 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) |
| 1130 for path in sorted(self._path_to_emitter.keys()): | 1130 for path in sorted(self._path_to_emitter.keys()): |
| 1131 relpath = os.path.relpath(path, library_file_dir) | 1131 relpath = os.path.relpath(path, library_file_dir) |
| 1132 imports_emitter.Emit( | 1132 imports_emitter.Emit( |
| 1133 "#source('$PATH');\n", PATH=massage_path(relpath)) | 1133 "#source('$PATH');\n", PATH=massage_path(relpath)) |
| OLD | NEW |