| 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 systems to generate | 6 """This module provides shared functionality for the systems to generate |
| 7 native binding from the IDL database.""" | 7 native binding from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 import os | 10 import os |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 if is_custom: | 423 if is_custom: |
| 424 return | 424 return |
| 425 | 425 |
| 426 if 'Reflect' in attr.ext_attrs: | 426 if 'Reflect' in attr.ext_attrs: |
| 427 webcore_function_name = self._TypeInfo(attr.type.id).webcore_getter_name() | 427 webcore_function_name = self._TypeInfo(attr.type.id).webcore_getter_name() |
| 428 if 'URL' in attr.ext_attrs: | 428 if 'URL' in attr.ext_attrs: |
| 429 if 'NonEmpty' in attr.ext_attrs: | 429 if 'NonEmpty' in attr.ext_attrs: |
| 430 webcore_function_name = 'getNonEmptyURLAttribute' | 430 webcore_function_name = 'getNonEmptyURLAttribute' |
| 431 else: | 431 else: |
| 432 webcore_function_name = 'getURLAttribute' | 432 webcore_function_name = 'getURLAttribute' |
| 433 elif 'ImplementedAs' in attr.ext_attrs: |
| 434 webcore_function_name = attr.ext_attrs['ImplementedAs'] |
| 433 else: | 435 else: |
| 434 if attr.id == 'operator': | 436 if attr.id == 'operator': |
| 435 webcore_function_name = '_operator' | 437 webcore_function_name = '_operator' |
| 436 elif attr.id == 'target' and attr.type.id == 'SVGAnimatedString': | 438 elif attr.id == 'target' and attr.type.id == 'SVGAnimatedString': |
| 437 webcore_function_name = 'svgTarget' | 439 webcore_function_name = 'svgTarget' |
| 438 else: | 440 else: |
| 439 webcore_function_name = _ToWebKitName(attr.id) | 441 webcore_function_name = _ToWebKitName(attr.id) |
| 440 if attr.type.id.startswith('SVGAnimated'): | 442 if attr.type.id.startswith('SVGAnimated'): |
| 441 webcore_function_name += 'Animated' | 443 webcore_function_name += 'Animated' |
| 442 | 444 |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 parent_interface = _FindInHierarchy(database, parent_interface, test) | 949 parent_interface = _FindInHierarchy(database, parent_interface, test) |
| 948 if parent_interface: | 950 if parent_interface: |
| 949 return parent_interface | 951 return parent_interface |
| 950 | 952 |
| 951 def _ToWebKitName(name): | 953 def _ToWebKitName(name): |
| 952 name = name[0].lower() + name[1:] | 954 name = name[0].lower() + name[1:] |
| 953 name = re.sub(r'^(hTML|uRL|jS|xML|xSLT)', lambda s: s.group(1).lower(), | 955 name = re.sub(r'^(hTML|uRL|jS|xML|xSLT)', lambda s: s.group(1).lower(), |
| 954 name) | 956 name) |
| 955 return re.sub(r'^(create|exclusive)', lambda s: 'is' + s.group(1).capitalize()
, | 957 return re.sub(r'^(create|exclusive)', lambda s: 'is' + s.group(1).capitalize()
, |
| 956 name) | 958 name) |
| OLD | NEW |