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 generates Dart APIs from the IDL database.""" | 6 """This module generates Dart APIs from the IDL database.""" |
7 | 7 |
8 import emitter | 8 import emitter |
9 import idlnode | 9 import idlnode |
10 import logging | 10 import logging |
(...skipping 2690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2701 self._members_emitter = emitter.Emitter() | 2701 self._members_emitter = emitter.Emitter() |
2702 self._cpp_declarations_emitter = emitter.Emitter() | 2702 self._cpp_declarations_emitter = emitter.Emitter() |
2703 self._cpp_impl_includes = {} | 2703 self._cpp_impl_includes = {} |
2704 self._cpp_definitions_emitter = emitter.Emitter() | 2704 self._cpp_definitions_emitter = emitter.Emitter() |
2705 self._cpp_resolver_emitter = emitter.Emitter() | 2705 self._cpp_resolver_emitter = emitter.Emitter() |
2706 | 2706 |
2707 # Generate constructor. | 2707 # Generate constructor. |
2708 # FIXME: add proper support for non-custom constructors. | 2708 # FIXME: add proper support for non-custom constructors. |
2709 if ('CustomConstructor' in self._interface.ext_attrs or | 2709 if ('CustomConstructor' in self._interface.ext_attrs or |
2710 'V8CustomConstructor' in self._interface.ext_attrs or | 2710 'V8CustomConstructor' in self._interface.ext_attrs or |
2711 self._interface.id in ['FileReader', 'WebKitCSSMatrix']): | 2711 self._interface.id in ['FileReader', 'WebKitCSSMatrix', 'XSLTProcessor'] ): |
podivilov
2012/02/15 17:31:03
Could you please check if 'Constructor' in interfa
antonm
2012/02/15 18:21:43
I will, but I don't aim for generic ctor support w
| |
2712 self._cpp_resolver_emitter.Emit( | 2712 self._cpp_resolver_emitter.Emit( |
2713 ' if (name == "$(INTERFACE_NAME)_constructor_Callback")\n' | 2713 ' if (name == "$(INTERFACE_NAME)_constructor_Callback")\n' |
2714 ' return Dart$(INTERFACE_NAME)Internal::constructorCallback;\n' , | 2714 ' return Dart$(INTERFACE_NAME)Internal::constructorCallback;\n' , |
2715 INTERFACE_NAME=self._interface.id) | 2715 INTERFACE_NAME=self._interface.id) |
2716 self._cpp_declarations_emitter.Emit( | 2716 self._cpp_declarations_emitter.Emit( |
2717 '\n' | 2717 '\n' |
2718 'void constructorCallback(Dart_NativeArguments);\n') | 2718 'void constructorCallback(Dart_NativeArguments);\n') |
2719 | 2719 |
2720 def _ImplClassName(self, interface_name): | 2720 def _ImplClassName(self, interface_name): |
2721 return interface_name + 'Implementation' | 2721 return interface_name + 'Implementation' |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3165 namespace = 'HTMLNames' | 3165 namespace = 'HTMLNames' |
3166 svg_exceptions = ['class', 'id', 'onabort', 'onclick', 'onerror', 'onload', | 3166 svg_exceptions = ['class', 'id', 'onabort', 'onclick', 'onerror', 'onload', |
3167 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', | 3167 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', |
3168 'onmouseup', 'onresize', 'onscroll', 'onunload'] | 3168 'onmouseup', 'onresize', 'onscroll', 'onunload'] |
3169 if self._interface.id.startswith('SVG') and not attr.id in svg_exceptions: | 3169 if self._interface.id.startswith('SVG') and not attr.id in svg_exceptions: |
3170 namespace = 'SVGNames' | 3170 namespace = 'SVGNames' |
3171 self._cpp_impl_includes[namespace] = 1 | 3171 self._cpp_impl_includes[namespace] = 1 |
3172 | 3172 |
3173 attribute_name = attr.ext_attrs['Reflect'] or attr.id.lower() | 3173 attribute_name = attr.ext_attrs['Reflect'] or attr.id.lower() |
3174 return 'WebCore::%s::%sAttr' % (namespace, attribute_name) | 3174 return 'WebCore::%s::%sAttr' % (namespace, attribute_name) |
OLD | NEW |