| 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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 703 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 704 "@Experimental", | 704 "@Experimental", |
| 705 ] | 705 ] |
| 706 | 706 |
| 707 _web_sql_annotations = [ | 707 _web_sql_annotations = [ |
| 708 "@SupportedBrowser(SupportedBrowser.CHROME)", | 708 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 709 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 709 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 710 "@Experimental", | 710 "@Experimental", |
| 711 ] | 711 ] |
| 712 | 712 |
| 713 _webgl_annotations = [ |
| 714 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 715 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 716 "@Experimental", |
| 717 ] |
| 718 |
| 713 # Annotations to be placed on generated members. | 719 # Annotations to be placed on generated members. |
| 714 # The table is indexed as: | 720 # The table is indexed as: |
| 715 # INTERFACE: annotations to be added to the interface declaration | 721 # INTERFACE: annotations to be added to the interface declaration |
| 716 # INTERFACE.MEMBER: annotation to be added to the member declaration | 722 # INTERFACE.MEMBER: annotation to be added to the member declaration |
| 717 dart_annotations = { | 723 dart_annotations = { |
| 718 'ArrayBuffer': _all_but_ie9_annotations, | 724 'ArrayBuffer': _all_but_ie9_annotations, |
| 719 'ArrayBufferView': _all_but_ie9_annotations, | 725 'ArrayBufferView': _all_but_ie9_annotations, |
| 720 'Database': _web_sql_annotations, | 726 'Database': _web_sql_annotations, |
| 721 'DatabaseSync': _web_sql_annotations, | 727 'DatabaseSync': _web_sql_annotations, |
| 722 'DOMApplicationCache': [ | 728 'DOMApplicationCache': [ |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 805 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 800 "@Experimental", | 806 "@Experimental", |
| 801 ], | 807 ], |
| 802 'SpeechRecognition': _speech_recognition_annotations, | 808 'SpeechRecognition': _speech_recognition_annotations, |
| 803 'SpeechRecognitionAlternative': _speech_recognition_annotations, | 809 'SpeechRecognitionAlternative': _speech_recognition_annotations, |
| 804 'SpeechRecognitionError': _speech_recognition_annotations, | 810 'SpeechRecognitionError': _speech_recognition_annotations, |
| 805 'SpeechRecognitionEvent': _speech_recognition_annotations, | 811 'SpeechRecognitionEvent': _speech_recognition_annotations, |
| 806 'SpeechRecognitionResult': _speech_recognition_annotations, | 812 'SpeechRecognitionResult': _speech_recognition_annotations, |
| 807 'SQLTransaction': _web_sql_annotations, | 813 'SQLTransaction': _web_sql_annotations, |
| 808 'SQLTransactionSync': _web_sql_annotations, | 814 'SQLTransactionSync': _web_sql_annotations, |
| 815 'WebGLRenderingContext': _webgl_annotations, |
| 809 'WebKitCSSMatrix': _webkit_experimental_annotations, | 816 'WebKitCSSMatrix': _webkit_experimental_annotations, |
| 810 'WebKitPoint': _webkit_experimental_annotations, | 817 'WebKitPoint': _webkit_experimental_annotations, |
| 811 'WebSocket': _all_but_ie9_annotations, | 818 'WebSocket': _all_but_ie9_annotations, |
| 812 'WorkerContext.indexedDB': _indexed_db_annotations, | 819 'WorkerContext.indexedDB': _indexed_db_annotations, |
| 813 'WorkerContext.openDatabase': _web_sql_annotations, | 820 'WorkerContext.openDatabase': _web_sql_annotations, |
| 814 'WorkerContext.openDatabaseSync': _web_sql_annotations, | 821 'WorkerContext.openDatabaseSync': _web_sql_annotations, |
| 815 'WorkerContext.webkitRequestFileSystem': _file_system_annotations, | 822 'WorkerContext.webkitRequestFileSystem': _file_system_annotations, |
| 816 'WorkerContext.webkitRequestFileSystemSync': _file_system_annotations, | 823 'WorkerContext.webkitRequestFileSystemSync': _file_system_annotations, |
| 817 'WorkerContext.webkitResolveLocalFileSystemSyncURL': _file_system_annotations, | 824 'WorkerContext.webkitResolveLocalFileSystemSyncURL': _file_system_annotations, |
| 818 'WorkerContext.webkitResolveLocalFileSystemURL': _file_system_annotations, | 825 'WorkerContext.webkitResolveLocalFileSystemURL': _file_system_annotations, |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 self) | 1450 self) |
| 1444 | 1451 |
| 1445 if type_data.clazz == 'SVGTearOff': | 1452 if type_data.clazz == 'SVGTearOff': |
| 1446 dart_interface_name = self._renamer.RenameInterface( | 1453 dart_interface_name = self._renamer.RenameInterface( |
| 1447 self._database.GetInterface(type_name)) | 1454 self._database.GetInterface(type_name)) |
| 1448 return SVGTearOffIDLTypeInfo( | 1455 return SVGTearOffIDLTypeInfo( |
| 1449 type_name, type_data, dart_interface_name, self) | 1456 type_name, type_data, dart_interface_name, self) |
| 1450 | 1457 |
| 1451 class_name = '%sIDLTypeInfo' % type_data.clazz | 1458 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1452 return globals()[class_name](type_name, type_data) | 1459 return globals()[class_name](type_name, type_data) |
| OLD | NEW |