| 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 systems to generate | 6 """This module provides shared functionality for systems to generate |
| 7 Dart APIs from the IDL database.""" | 7 Dart APIs from the IDL database.""" |
| 8 | 8 |
| 9 import copy | 9 import copy |
| 10 import json | 10 import json |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 "@SupportedBrowser(SupportedBrowser.CHROME)", | 697 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 698 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 698 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 699 "@SupportedBrowser(SupportedBrowser.IE)", | 699 "@SupportedBrowser(SupportedBrowser.IE)", |
| 700 ] | 700 ] |
| 701 | 701 |
| 702 _speech_recognition_annotations = [ | 702 _speech_recognition_annotations = [ |
| 703 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 703 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 704 "@Experimental", | 704 "@Experimental", |
| 705 ] | 705 ] |
| 706 | 706 |
| 707 _web_sql_annotations = [ |
| 708 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 709 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 710 "@Experimental", |
| 711 ] |
| 712 |
| 707 # Annotations to be placed on generated members. | 713 # Annotations to be placed on generated members. |
| 708 # The table is indexed as: | 714 # The table is indexed as: |
| 709 # INTERFACE: annotations to be added to the interface declaration | 715 # INTERFACE: annotations to be added to the interface declaration |
| 710 # INTERFACE.MEMBER: annotation to be added to the member declaration | 716 # INTERFACE.MEMBER: annotation to be added to the member declaration |
| 711 dart_annotations = { | 717 dart_annotations = { |
| 712 'ArrayBuffer': _all_but_ie9_annotations, | 718 'ArrayBuffer': _all_but_ie9_annotations, |
| 713 'ArrayBufferView': _all_but_ie9_annotations, | 719 'ArrayBufferView': _all_but_ie9_annotations, |
| 720 'Database': _web_sql_annotations, |
| 721 'DatabaseSync': _web_sql_annotations, |
| 714 'DOMApplicationCache': [ | 722 'DOMApplicationCache': [ |
| 715 "@SupportedBrowser(SupportedBrowser.CHROME)", | 723 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 716 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 724 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 717 "@SupportedBrowser(SupportedBrowser.IE, '10')", | 725 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 718 "@SupportedBrowser(SupportedBrowser.OPERA)", | 726 "@SupportedBrowser(SupportedBrowser.OPERA)", |
| 719 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 727 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 720 ], | 728 ], |
| 721 'DOMWindow.indexedDB': _indexed_db_annotations, | 729 'DOMWindow.indexedDB': _indexed_db_annotations, |
| 730 'DOMWindow.openDatabase': _web_sql_annotations, |
| 722 'DOMWindow.performance': _performance_annotations, | 731 'DOMWindow.performance': _performance_annotations, |
| 723 'DOMWindow.webkitNotifications': _webkit_experimental_annotations, | 732 'DOMWindow.webkitNotifications': _webkit_experimental_annotations, |
| 724 'DOMWindow.webkitRequestFileSystem': _file_system_annotations, | 733 'DOMWindow.webkitRequestFileSystem': _file_system_annotations, |
| 725 'DOMWindow.webkitResolveLocalFileSystemURL': _file_system_annotations, | 734 'DOMWindow.webkitResolveLocalFileSystemURL': _file_system_annotations, |
| 726 'Element.webkitCreateShadowRoot': [ | 735 'Element.webkitCreateShadowRoot': [ |
| 727 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 736 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 728 "@Experimental", | 737 "@Experimental", |
| 729 ], | 738 ], |
| 730 'FileSystem': _file_system_annotations, | 739 'FileSystem': _file_system_annotations, |
| 731 'FileSystemSync': _file_system_annotations, | 740 'FileSystemSync': _file_system_annotations, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 'PopStateEvent': _history_annotations, | 795 'PopStateEvent': _history_annotations, |
| 787 'ShadowRoot': [ | 796 'ShadowRoot': [ |
| 788 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 797 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 789 "@Experimental", | 798 "@Experimental", |
| 790 ], | 799 ], |
| 791 'SpeechRecognition': _speech_recognition_annotations, | 800 'SpeechRecognition': _speech_recognition_annotations, |
| 792 'SpeechRecognitionAlternative': _speech_recognition_annotations, | 801 'SpeechRecognitionAlternative': _speech_recognition_annotations, |
| 793 'SpeechRecognitionError': _speech_recognition_annotations, | 802 'SpeechRecognitionError': _speech_recognition_annotations, |
| 794 'SpeechRecognitionEvent': _speech_recognition_annotations, | 803 'SpeechRecognitionEvent': _speech_recognition_annotations, |
| 795 'SpeechRecognitionResult': _speech_recognition_annotations, | 804 'SpeechRecognitionResult': _speech_recognition_annotations, |
| 805 'SQLTransaction': _web_sql_annotations, |
| 806 'SQLTransactionSync': _web_sql_annotations, |
| 796 'WebSocket': _all_but_ie9_annotations, | 807 'WebSocket': _all_but_ie9_annotations, |
| 797 'WorkerContext.indexedDB': _indexed_db_annotations, | 808 'WorkerContext.indexedDB': _indexed_db_annotations, |
| 809 'WorkerContext.openDatabase': _web_sql_annotations, |
| 810 'WorkerContext.openDatabaseSync': _web_sql_annotations, |
| 798 'WorkerContext.webkitRequestFileSystem': _file_system_annotations, | 811 'WorkerContext.webkitRequestFileSystem': _file_system_annotations, |
| 799 'WorkerContext.webkitRequestFileSystemSync': _file_system_annotations, | 812 'WorkerContext.webkitRequestFileSystemSync': _file_system_annotations, |
| 800 'WorkerContext.webkitResolveLocalFileSystemSyncURL': _file_system_annotations, | 813 'WorkerContext.webkitResolveLocalFileSystemSyncURL': _file_system_annotations, |
| 801 'WorkerContext.webkitResolveLocalFileSystemURL': _file_system_annotations, | 814 'WorkerContext.webkitResolveLocalFileSystemURL': _file_system_annotations, |
| 802 'XMLHttpRequestProgressEvent': _webkit_experimental_annotations, | 815 'XMLHttpRequestProgressEvent': _webkit_experimental_annotations, |
| 803 } | 816 } |
| 804 | 817 |
| 805 def GetComments(interface_name, member_name=None, library_name=None): | 818 def GetComments(interface_name, member_name=None, library_name=None): |
| 806 """ Finds all comments for the interface or member and returns a list. """ | 819 """ Finds all comments for the interface or member and returns a list. """ |
| 807 | 820 |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 self) | 1434 self) |
| 1422 | 1435 |
| 1423 if type_data.clazz == 'SVGTearOff': | 1436 if type_data.clazz == 'SVGTearOff': |
| 1424 dart_interface_name = self._renamer.RenameInterface( | 1437 dart_interface_name = self._renamer.RenameInterface( |
| 1425 self._database.GetInterface(type_name)) | 1438 self._database.GetInterface(type_name)) |
| 1426 return SVGTearOffIDLTypeInfo( | 1439 return SVGTearOffIDLTypeInfo( |
| 1427 type_name, type_data, dart_interface_name, self) | 1440 type_name, type_data, dart_interface_name, self) |
| 1428 | 1441 |
| 1429 class_name = '%sIDLTypeInfo' % type_data.clazz | 1442 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1430 return globals()[class_name](type_name, type_data) | 1443 return globals()[class_name](type_name, type_data) |
| OLD | NEW |