| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 # interface and member name, and by IDL return or field type name. Both are | 546 # interface and member name, and by IDL return or field type name. Both are |
| 547 # used to assemble the annotations: | 547 # used to assemble the annotations: |
| 548 # | 548 # |
| 549 # INTERFACE.MEMBER: annotations for member. | 549 # INTERFACE.MEMBER: annotations for member. |
| 550 # +TYPE: add annotations only if there are member annotations. | 550 # +TYPE: add annotations only if there are member annotations. |
| 551 # -TYPE: add annotations only if there are no member annotations. | 551 # -TYPE: add annotations only if there are no member annotations. |
| 552 # TYPE: add regardless of member annotations. | 552 # TYPE: add regardless of member annotations. |
| 553 | 553 |
| 554 dart2js_annotations = monitored.Dict('generator.dart2js_annotations', { | 554 dart2js_annotations = monitored.Dict('generator.dart2js_annotations', { |
| 555 | 555 |
| 556 'ArrayBuffer': [ |
| 557 "@Creates('ArrayBuffer')", |
| 558 "@Returns('ArrayBuffer|Null')", |
| 559 ], |
| 560 |
| 561 'ArrayBufferView': [ |
| 562 "@Creates('ArrayBufferView')", |
| 563 "@Returns('ArrayBufferView|Null')", |
| 564 ], |
| 565 |
| 556 'CanvasRenderingContext2D.createImageData': [ | 566 'CanvasRenderingContext2D.createImageData': [ |
| 557 "@Creates('ImageData|=Object')", | 567 "@Creates('ImageData|=Object')", |
| 558 ], | 568 ], |
| 559 | 569 |
| 560 'CanvasRenderingContext2D.getImageData': [ | 570 'CanvasRenderingContext2D.getImageData': [ |
| 561 "@Creates('ImageData|=Object')", | 571 "@Creates('ImageData|=Object')", |
| 562 ], | 572 ], |
| 563 | 573 |
| 564 'CanvasRenderingContext2D.webkitGetImageDataHD': [ | 574 'CanvasRenderingContext2D.webkitGetImageDataHD': [ |
| 565 "@Creates('ImageData|=Object')", | 575 "@Creates('ImageData|=Object')", |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 "@Creates('Node')", | 614 "@Creates('Node')", |
| 605 "@Returns('EventTarget|=Object')", | 615 "@Returns('EventTarget|=Object')", |
| 606 ], | 616 ], |
| 607 | 617 |
| 608 # Touch targets are Elements in a Document, or the Document. | 618 # Touch targets are Elements in a Document, or the Document. |
| 609 'Touch.target': [ | 619 'Touch.target': [ |
| 610 "@Creates('Element|Document')", | 620 "@Creates('Element|Document')", |
| 611 "@Returns('Element|Document')", | 621 "@Returns('Element|Document')", |
| 612 ], | 622 ], |
| 613 | 623 |
| 614 | |
| 615 'FileReader.result': ["@Creates('String|ArrayBuffer|Null')"], | 624 'FileReader.result': ["@Creates('String|ArrayBuffer|Null')"], |
| 616 | 625 |
| 617 # Rather than have the result of an IDBRequest as a union over all possible | 626 # Rather than have the result of an IDBRequest as a union over all possible |
| 618 # results, we mark the result as instantiating any classes, and mark | 627 # results, we mark the result as instantiating any classes, and mark |
| 619 # each operation with the classes that it could cause to be asynchronously | 628 # each operation with the classes that it could cause to be asynchronously |
| 620 # instantiated. | 629 # instantiated. |
| 621 'IDBRequest.result': ["@Creates('Null')"], | 630 'IDBRequest.result': ["@Creates('Null')"], |
| 622 | 631 |
| 623 # The source is usually a participant in the operation that generated the | 632 # The source is usually a participant in the operation that generated the |
| 624 # IDBRequest. | 633 # IDBRequest. |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1556 self) | 1565 self) |
| 1557 | 1566 |
| 1558 if type_data.clazz == 'SVGTearOff': | 1567 if type_data.clazz == 'SVGTearOff': |
| 1559 dart_interface_name = self._renamer.RenameInterface( | 1568 dart_interface_name = self._renamer.RenameInterface( |
| 1560 self._database.GetInterface(type_name)) | 1569 self._database.GetInterface(type_name)) |
| 1561 return SVGTearOffIDLTypeInfo( | 1570 return SVGTearOffIDLTypeInfo( |
| 1562 type_name, type_data, dart_interface_name, self) | 1571 type_name, type_data, dart_interface_name, self) |
| 1563 | 1572 |
| 1564 class_name = '%sIDLTypeInfo' % type_data.clazz | 1573 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1565 return globals()[class_name](type_name, type_data) | 1574 return globals()[class_name](type_name, type_data) |
| OLD | NEW |