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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 | 602 |
603 js_interop_equivalence_op = \ | 603 js_interop_equivalence_op = \ |
604 ' bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || ide
ntical(this, other);\n' \ | 604 ' bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || ide
ntical(this, other);\n' \ |
605 + ' int get hashCode => unwrap_jso(this).hashCode;\n' | 605 + ' int get hashCode => unwrap_jso(this).hashCode;\n' |
606 # ClientRect overrides the equivalence operator. | 606 # ClientRect overrides the equivalence operator. |
607 if interface_name == 'ClientRect' or interface_name == 'DomRectReadOnly': | 607 if interface_name == 'ClientRect' or interface_name == 'DomRectReadOnly': |
608 js_interop_equivalence_op = '' | 608 js_interop_equivalence_op = '' |
609 | 609 |
610 js_interop_wrapper = ''' | 610 js_interop_wrapper = ''' |
611 | 611 |
| 612 @Deprecated("Internal Use Only") |
612 static {0} internalCreate{0}() {{ | 613 static {0} internalCreate{0}() {{ |
613 return new {0}._internalWrap(); | 614 return new {0}._internalWrap(); |
614 }} | 615 }} |
615 | 616 |
616 factory {0}._internalWrap() {{ | 617 factory {0}._internalWrap() {{ |
617 return new {0}.internal_(); | 618 return new {0}.internal_(); |
618 }} | 619 }} |
619 | 620 |
620 {0}.internal_() : super.internal_(); | 621 {0}.internal_() : super.internal_(); |
621 | 622 |
622 '''.format(class_name) | 623 '''.format(class_name) |
623 if base_class == 'NativeFieldWrapperClass2' or base_class == 'DartHtmlDomObj
ect': | 624 if base_class == 'NativeFieldWrapperClass2' or base_class == 'DartHtmlDomObj
ect': |
624 js_interop_wrapper = ''' | 625 js_interop_wrapper = ''' |
| 626 @Deprecated("Internal Use Only") |
625 static {0} internalCreate{0}() {{ | 627 static {0} internalCreate{0}() {{ |
626 return new {0}._internalWrap(); | 628 return new {0}._internalWrap(); |
627 }} | 629 }} |
628 | 630 |
629 factory {0}._internalWrap() {{ | 631 factory {0}._internalWrap() {{ |
630 return new {0}.internal_(); | 632 return new {0}.internal_(); |
631 }} | 633 }} |
632 | 634 |
633 {0}.internal_() {{ }} | 635 {0}.internal_() {{ }} |
634 | 636 |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 | 1336 |
1335 def AddFile(self, basename, library_name, path): | 1337 def AddFile(self, basename, library_name, path): |
1336 self._libraries[library_name].AddFile(path) | 1338 self._libraries[library_name].AddFile(path) |
1337 | 1339 |
1338 def AddTypeEntry(self, library_name, idl_name, dart_name): | 1340 def AddTypeEntry(self, library_name, idl_name, dart_name): |
1339 self._libraries[library_name].AddTypeEntry(idl_name, dart_name) | 1341 self._libraries[library_name].AddTypeEntry(idl_name, dart_name) |
1340 | 1342 |
1341 def Emit(self, emitter, auxiliary_dir): | 1343 def Emit(self, emitter, auxiliary_dir): |
1342 for lib in self._libraries.values(): | 1344 for lib in self._libraries.values(): |
1343 lib.Emit(emitter, auxiliary_dir) | 1345 lib.Emit(emitter, auxiliary_dir) |
OLD | NEW |