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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 'Element.insertAdjacentElement', | 51 'Element.insertAdjacentElement', |
52 'Element.insertAdjacentHTML', | 52 'Element.insertAdjacentHTML', |
53 'Element.insertAdjacentText', | 53 'Element.insertAdjacentText', |
54 'Element.webkitMatchesSelector', | 54 'Element.webkitMatchesSelector', |
55 'Element.remove', | 55 'Element.remove', |
56 'ElementEvents.mouseWheel', | 56 'ElementEvents.mouseWheel', |
57 'ElementEvents.transitionEnd', | 57 'ElementEvents.transitionEnd', |
58 'DOMException.name', | 58 'DOMException.name', |
59 'HTMLTableElement.createTBody', | 59 'HTMLTableElement.createTBody', |
60 'IDBDatabase.transaction', | 60 'IDBDatabase.transaction', |
| 61 'IDBDatabase.transactionList', |
| 62 'IDBDatabase.transactionStore', |
| 63 'IDBDatabase.transactionStores', |
61 'KeyboardEvent.initKeyboardEvent', | 64 'KeyboardEvent.initKeyboardEvent', |
62 'Location.origin', | 65 'Location.origin', |
63 'MouseEvent.offsetX', | 66 'MouseEvent.offsetX', |
64 'MouseEvent.offsetY', | 67 'MouseEvent.offsetY', |
65 'Navigator.language', | 68 'Navigator.language', |
66 'Navigator.webkitGetUserMedia', | 69 'Navigator.webkitGetUserMedia', |
67 'ScriptProcessorNode._setEventListener', | 70 'ScriptProcessorNode._setEventListener', |
68 'URL.createObjectURL', | 71 'URL.createObjectURL', |
| 72 'URL.createObjectUrlFromSource', |
| 73 'URL.createObjectUrlFromStream', |
| 74 'URL.createObjectUrlFromBlob', |
69 'URL.revokeObjectURL', | 75 'URL.revokeObjectURL', |
70 'WebGLRenderingContext.texImage2D', | 76 'WebGLRenderingContext.texImage2D', |
71 'WebGLRenderingContext.texSubImage2D', | 77 'WebGLRenderingContext.texSubImage2D', |
72 'WheelEvent.deltaMode', | 78 'WheelEvent.deltaMode', |
73 'WheelEvent.wheelDeltaX', | 79 'WheelEvent.wheelDeltaX', |
74 'WheelEvent.wheelDeltaY', | 80 'WheelEvent.wheelDeltaY', |
75 'Window.cancelAnimationFrame', | 81 'Window.cancelAnimationFrame', |
76 'Window.console', | 82 'Window.console', |
77 'Window.document', | 83 'Window.document', |
78 'Window.indexedDB', | 84 'Window.indexedDB', |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 | 961 |
956 parameter_names = [param_info.name for param_info in info.param_infos] | 962 parameter_names = [param_info.name for param_info in info.param_infos] |
957 parameter_types = [InputType(param_info.type_id) | 963 parameter_types = [InputType(param_info.type_id) |
958 for param_info in info.param_infos] | 964 for param_info in info.param_infos] |
959 operations = info.operations | 965 operations = info.operations |
960 | 966 |
961 temp_version = [0] | 967 temp_version = [0] |
962 | 968 |
963 def GenerateCall( | 969 def GenerateCall( |
964 stmts_emitter, call_emitter, version, operation, argument_count): | 970 stmts_emitter, call_emitter, version, operation, argument_count): |
965 target = '_%s_%d' % (html_name, version); | 971 target = '_%s_%d' % ( |
| 972 html_name[1:] if html_name.startswith('_') else html_name, version); |
966 arguments = [] | 973 arguments = [] |
967 target_parameters = [] | 974 target_parameters = [] |
968 for position, arg in enumerate(operation.arguments[:argument_count]): | 975 for position, arg in enumerate(operation.arguments[:argument_count]): |
969 conversion = self._InputConversion(arg.type.id, operation.id) | 976 conversion = self._InputConversion(arg.type.id, operation.id) |
970 param_name = operation.arguments[position].id | 977 param_name = operation.arguments[position].id |
971 if conversion: | 978 if conversion: |
972 temp_version[0] += 1 | 979 temp_version[0] += 1 |
973 temp_name = '%s_%s' % (param_name, temp_version[0]) | 980 temp_name = '%s_%s' % (param_name, temp_version[0]) |
974 temp_type = conversion.output_type | 981 temp_type = conversion.output_type |
975 stmts_emitter.Emit( | 982 stmts_emitter.Emit( |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 for library_name in libraries: | 1202 for library_name in libraries: |
1196 self._libraries[library_name] = DartLibrary( | 1203 self._libraries[library_name] = DartLibrary( |
1197 library_name, template_loader, library_type, output_dir) | 1204 library_name, template_loader, library_type, output_dir) |
1198 | 1205 |
1199 def AddFile(self, basename, library_name, path): | 1206 def AddFile(self, basename, library_name, path): |
1200 self._libraries[library_name].AddFile(path) | 1207 self._libraries[library_name].AddFile(path) |
1201 | 1208 |
1202 def Emit(self, emitter, auxiliary_dir): | 1209 def Emit(self, emitter, auxiliary_dir): |
1203 for lib in self._libraries.values(): | 1210 for lib in self._libraries.values(): |
1204 lib.Emit(emitter, auxiliary_dir) | 1211 lib.Emit(emitter, auxiliary_dir) |
OLD | NEW |