| 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 logging | 10 import logging |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 'SVGFESpecularLightingElement', | 399 'SVGFESpecularLightingElement', |
| 400 'SVGFESpotLightElement', | 400 'SVGFESpotLightElement', |
| 401 'SVGFETileElement', | 401 'SVGFETileElement', |
| 402 'SVGFETurbulenceElement', | 402 'SVGFETurbulenceElement', |
| 403 'SVGFilterElement', | 403 'SVGFilterElement', |
| 404 'SVGForeignObjectElement', | 404 'SVGForeignObjectElement', |
| 405 'SVGSetElement', | 405 'SVGSetElement', |
| 406 ] | 406 ] |
| 407 | 407 |
| 408 js_support_checks = dict({ | 408 js_support_checks = dict({ |
| 409 'AnimationPlayer': "JS('bool', '!!(document.body.animate)')", | 409 'Animation': "JS('bool', '!!(document.body.animate)')", |
| 410 'AudioContext': "JS('bool', '!!(window.AudioContext ||" | 410 'AudioContext': "JS('bool', '!!(window.AudioContext ||" |
| 411 " window.webkitAudioContext)')", | 411 " window.webkitAudioContext)')", |
| 412 'Crypto': | 412 'Crypto': |
| 413 "JS('bool', '!!(window.crypto && window.crypto.getRandomValues)')", | 413 "JS('bool', '!!(window.crypto && window.crypto.getRandomValues)')", |
| 414 'Database': "JS('bool', '!!(window.openDatabase)')", | 414 'Database': "JS('bool', '!!(window.openDatabase)')", |
| 415 'DOMPoint': "JS('bool', '!!(window.DOMPoint) || !!(window.WebKitPoint)')", | 415 'DOMPoint': "JS('bool', '!!(window.DOMPoint) || !!(window.WebKitPoint)')", |
| 416 'ApplicationCache': "JS('bool', '!!(window.applicationCache)')", | 416 'ApplicationCache': "JS('bool', '!!(window.applicationCache)')", |
| 417 'DOMFileSystem': "JS('bool', '!!(window.webkitRequestFileSystem)')", | 417 'DOMFileSystem': "JS('bool', '!!(window.webkitRequestFileSystem)')", |
| 418 'FormData': "JS('bool', '!!(window.FormData)')", | 418 'FormData': "JS('bool', '!!(window.FormData)')", |
| 419 'HashChangeEvent': "Device.isEventTypeSupported('HashChangeEvent')", | 419 'HashChangeEvent': "Device.isEventTypeSupported('HashChangeEvent')", |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 ' * This can only be called by subclasses from their created constru
ctor.\n' | 698 ' * This can only be called by subclasses from their created constru
ctor.\n' |
| 699 ' */\n' | 699 ' */\n' |
| 700 ' $CLASSNAME.created() : super.created();\n', | 700 ' $CLASSNAME.created() : super.created();\n', |
| 701 CLASSNAME=self._interface_type_info.implementation_name()) | 701 CLASSNAME=self._interface_type_info.implementation_name()) |
| 702 | 702 |
| 703 self._backend.EmitSupportCheck() | 703 self._backend.EmitSupportCheck() |
| 704 | 704 |
| 705 merged_interface = self._interface_type_info.merged_interface() | 705 merged_interface = self._interface_type_info.merged_interface() |
| 706 if merged_interface: | 706 if merged_interface: |
| 707 self._backend.AddMembers(self._database.GetInterface(merged_interface), | 707 self._backend.AddMembers(self._database.GetInterface(merged_interface), |
| 708 not self._backend.ImplementsMergedMembers()) | 708 not self._backend.ImplementsMergedMembers()) |
| 709 | 709 |
| 710 self._backend.AddMembers(self._interface, False, self._options.dart_js_inter
op) | 710 self._backend.AddMembers(self._interface, False, self._options.dart_js_inter
op) |
| 711 self._backend.AddSecondaryMembers(self._interface) | 711 self._backend.AddSecondaryMembers(self._interface) |
| 712 self._event_generator.EmitStreamGetters( | 712 self._event_generator.EmitStreamGetters( |
| 713 self._interface, | 713 self._interface, |
| 714 [], | 714 [], |
| 715 implementation_members_emitter, | 715 implementation_members_emitter, |
| 716 self._library_name, stream_getter_signatures_emitter, | 716 self._library_name, stream_getter_signatures_emitter, |
| 717 element_stream_getters_emitter) | 717 element_stream_getters_emitter) |
| 718 self._backend.FinishInterface() | 718 self._backend.FinishInterface() |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 | 1336 |
| 1337 def AddFile(self, basename, library_name, path): | 1337 def AddFile(self, basename, library_name, path): |
| 1338 self._libraries[library_name].AddFile(path) | 1338 self._libraries[library_name].AddFile(path) |
| 1339 | 1339 |
| 1340 def AddTypeEntry(self, library_name, idl_name, dart_name): | 1340 def AddTypeEntry(self, library_name, idl_name, dart_name): |
| 1341 self._libraries[library_name].AddTypeEntry(idl_name, dart_name) | 1341 self._libraries[library_name].AddTypeEntry(idl_name, dart_name) |
| 1342 | 1342 |
| 1343 def Emit(self, emitter, auxiliary_dir): | 1343 def Emit(self, emitter, auxiliary_dir): |
| 1344 for lib in self._libraries.values(): | 1344 for lib in self._libraries.values(): |
| 1345 lib.Emit(emitter, auxiliary_dir) | 1345 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |