Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: client/dom/scripts/generator.py

Issue 9623003: Rename DOMWindow to Window in Dartium bindings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/dom/scripts/dartdomgenerator.py ('k') | client/dom/src/native_DOMImplementation.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 re 9 import re
10 10
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 wrapper_type = 'Dart%s' % self.idl_type() 481 wrapper_type = 'Dart%s' % self.idl_type()
482 adapter_type = 'ParameterAdapter<%s, %s>' % (native_type, wrapper_type) 482 adapter_type = 'ParameterAdapter<%s, %s>' % (native_type, wrapper_type)
483 return (adapter_type, wrapper_type) 483 return (adapter_type, wrapper_type)
484 return ('ParameterAdapter< %s >' % native_type, self._idl_type) 484 return ('ParameterAdapter< %s >' % native_type, self._idl_type)
485 485
486 def parameter_type(self): 486 def parameter_type(self):
487 return '%s*' % self.native_type() 487 return '%s*' % self.native_type()
488 488
489 def webcore_includes(self): 489 def webcore_includes(self):
490 if not self._idl_type.startswith('SVG'): 490 if not self._idl_type.startswith('SVG'):
491 return [self._idl_type] 491 return [self.native_type()]
492 492
493 if self._idl_type in ['SVGNumber', 'SVGPoint']: 493 if self._idl_type in ['SVGNumber', 'SVGPoint']:
494 return [] 494 return []
495 if self._idl_type.startswith('SVGPathSeg'): 495 if self._idl_type.startswith('SVGPathSeg'):
496 include = self._idl_type.replace('Abs', '').replace('Rel', '') 496 include = self._idl_type.replace('Abs', '').replace('Rel', '')
497 else: 497 else:
498 include = self._idl_type 498 include = self._idl_type
499 return [include] + _svg_supplemental_includes 499 return [include] + _svg_supplemental_includes
500 500
501 def receiver(self): 501 def receiver(self):
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa ce 601 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa ce
602 'Flags': PrimitiveIDLTypeInfo('Flags', dart_type='Object'), 602 'Flags': PrimitiveIDLTypeInfo('Flags', dart_type='Object'),
603 'List<String>': PrimitiveIDLTypeInfo('DOMStringList', dart_type='List<String >'), 603 'List<String>': PrimitiveIDLTypeInfo('DOMStringList', dart_type='List<String >'),
604 'DOMTimeStamp': PrimitiveIDLTypeInfo('DOMTimeStamp', dart_type='int'), 604 'DOMTimeStamp': PrimitiveIDLTypeInfo('DOMTimeStamp', dart_type='int'),
605 'object': PrimitiveIDLTypeInfo('object', dart_type='Object', native_type='Sc riptValue'), 605 'object': PrimitiveIDLTypeInfo('object', dart_type='Object', native_type='Sc riptValue'),
606 'SerializedScriptValue': PrimitiveIDLTypeInfo('SerializedScriptValue', dart_ type='Dynamic', ref_counted=True), 606 'SerializedScriptValue': PrimitiveIDLTypeInfo('SerializedScriptValue', dart_ type='Dynamic', ref_counted=True),
607 'WebKitFlags': PrimitiveIDLTypeInfo('WebKitFlags', dart_type='Object'), 607 'WebKitFlags': PrimitiveIDLTypeInfo('WebKitFlags', dart_type='Object'),
608 608
609 'CSSRule': IDLTypeInfo('CSSRule', conversion_includes=['CSSImportRule']), 609 'CSSRule': IDLTypeInfo('CSSRule', conversion_includes=['CSSImportRule']),
610 'DOMException': IDLTypeInfo('DOMCoreException', dart_type='DOMException'), 610 'DOMException': IDLTypeInfo('DOMCoreException', dart_type='DOMException'),
611 'DOMWindow': IDLTypeInfo('DOMWindow', custom_to_dart=True),
612 'Element': IDLTypeInfo('Element', custom_to_dart=True), 611 'Element': IDLTypeInfo('Element', custom_to_dart=True),
613 'EventListener': IDLTypeInfo('EventListener', has_dart_wrapper=False), 612 'EventListener': IDLTypeInfo('EventListener', has_dart_wrapper=False),
614 'EventTarget': IDLTypeInfo('EventTarget', has_dart_wrapper=False), 613 'EventTarget': IDLTypeInfo('EventTarget', has_dart_wrapper=False),
615 'HTMLElement': IDLTypeInfo('HTMLElement', custom_to_dart=True), 614 'HTMLElement': IDLTypeInfo('HTMLElement', custom_to_dart=True),
616 'MediaQueryListListener': IDLTypeInfo('MediaQueryListListener', has_dart_wra pper=False), 615 'MediaQueryListListener': IDLTypeInfo('MediaQueryListListener', has_dart_wra pper=False),
617 'OptionsObject': IDLTypeInfo('OptionsObject', has_dart_wrapper=False), 616 'OptionsObject': IDLTypeInfo('OptionsObject', has_dart_wrapper=False),
618 'StyleSheet': IDLTypeInfo('StyleSheet', conversion_includes=['CSSStyleSheet' ]), 617 'StyleSheet': IDLTypeInfo('StyleSheet', conversion_includes=['CSSStyleSheet' ]),
619 'SVGElement': IDLTypeInfo('SVGElement', custom_to_dart=True), 618 'SVGElement': IDLTypeInfo('SVGElement', custom_to_dart=True),
619 'Window': IDLTypeInfo('Window', native_type='DOMWindow', custom_to_dart=True ),
620 620
621 'SVGAngle': SVGTearOffIDLTypeInfo('SVGAngle'), 621 'SVGAngle': SVGTearOffIDLTypeInfo('SVGAngle'),
622 'SVGLength': SVGTearOffIDLTypeInfo('SVGLength'), 622 'SVGLength': SVGTearOffIDLTypeInfo('SVGLength'),
623 'SVGLengthList': SVGTearOffIDLTypeInfo('SVGLengthList', ref_counted=False), 623 'SVGLengthList': SVGTearOffIDLTypeInfo('SVGLengthList', ref_counted=False),
624 'SVGMatrix': SVGTearOffIDLTypeInfo('SVGMatrix'), 624 'SVGMatrix': SVGTearOffIDLTypeInfo('SVGMatrix'),
625 'SVGNumber': SVGTearOffIDLTypeInfo('SVGNumber', native_type='SVGPropertyTear Off<float>'), 625 'SVGNumber': SVGTearOffIDLTypeInfo('SVGNumber', native_type='SVGPropertyTear Off<float>'),
626 'SVGNumberList': SVGTearOffIDLTypeInfo('SVGNumberList', ref_counted=False), 626 'SVGNumberList': SVGTearOffIDLTypeInfo('SVGNumberList', ref_counted=False),
627 'SVGPathSegList': SVGTearOffIDLTypeInfo('SVGPathSegList', native_type='SVGPa thSegListPropertyTearOff', ref_counted=False), 627 'SVGPathSegList': SVGTearOffIDLTypeInfo('SVGPathSegList', native_type='SVGPa thSegListPropertyTearOff', ref_counted=False),
628 'SVGPoint': SVGTearOffIDLTypeInfo('SVGPoint', native_type='SVGPropertyTearOf f<FloatPoint>'), 628 'SVGPoint': SVGTearOffIDLTypeInfo('SVGPoint', native_type='SVGPropertyTearOf f<FloatPoint>'),
629 'SVGPointList': SVGTearOffIDLTypeInfo('SVGPointList', ref_counted=False), 629 'SVGPointList': SVGTearOffIDLTypeInfo('SVGPointList', ref_counted=False),
630 'SVGPreserveAspectRatio': SVGTearOffIDLTypeInfo('SVGPreserveAspectRatio'), 630 'SVGPreserveAspectRatio': SVGTearOffIDLTypeInfo('SVGPreserveAspectRatio'),
631 'SVGRect': SVGTearOffIDLTypeInfo('SVGRect', native_type='SVGPropertyTearOff< FloatRect>'), 631 'SVGRect': SVGTearOffIDLTypeInfo('SVGRect', native_type='SVGPropertyTearOff< FloatRect>'),
632 'SVGStringList': SVGTearOffIDLTypeInfo('SVGStringList', native_type='SVGStat icListPropertyTearOff<SVGStringList>', ref_counted=False), 632 'SVGStringList': SVGTearOffIDLTypeInfo('SVGStringList', native_type='SVGStat icListPropertyTearOff<SVGStringList>', ref_counted=False),
633 'SVGTransform': SVGTearOffIDLTypeInfo('SVGTransform'), 633 'SVGTransform': SVGTearOffIDLTypeInfo('SVGTransform'),
634 'SVGTransformList': SVGTearOffIDLTypeInfo('SVGTransformList', native_type='S VGTransformListPropertyTearOff', ref_counted=False) 634 'SVGTransformList': SVGTearOffIDLTypeInfo('SVGTransformList', native_type='S VGTransformListPropertyTearOff', ref_counted=False)
635 } 635 }
636 636
637 _svg_supplemental_includes = [ 637 _svg_supplemental_includes = [
638 'SVGAnimatedPropertyTearOff', 638 'SVGAnimatedPropertyTearOff',
639 'SVGAnimatedListPropertyTearOff', 639 'SVGAnimatedListPropertyTearOff',
640 'SVGStaticListPropertyTearOff', 640 'SVGStaticListPropertyTearOff',
641 'SVGAnimatedListPropertyTearOff', 641 'SVGAnimatedListPropertyTearOff',
642 'SVGTransformListPropertyTearOff', 642 'SVGTransformListPropertyTearOff',
643 'SVGPathSegListPropertyTearOff', 643 'SVGPathSegListPropertyTearOff',
644 ] 644 ]
645 645
646 def GetIDLTypeInfo(idl_type_name): 646 def GetIDLTypeInfo(idl_type_name):
647 return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name)) 647 return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name))
OLDNEW
« no previous file with comments | « client/dom/scripts/dartdomgenerator.py ('k') | client/dom/src/native_DOMImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698