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 from systemfrog import * | 9 from systemfrog import * |
10 from systeminterface import * | 10 from systeminterface import * |
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 if interface.parents: | 1274 if interface.parents: |
1275 supertype = interface.parents[0].type.id | 1275 supertype = interface.parents[0].type.id |
1276 if not IsDartListType(supertype): | 1276 if not IsDartListType(supertype): |
1277 base = self._ImplClassName(supertype) | 1277 base = self._ImplClassName(supertype) |
1278 if IsDartCollectionType(supertype): | 1278 if IsDartCollectionType(supertype): |
1279 # List methods are injected in AddIndexer. | 1279 # List methods are injected in AddIndexer. |
1280 pass | 1280 pass |
1281 else: | 1281 else: |
1282 base = self._ImplClassName(supertype) | 1282 base = self._ImplClassName(supertype) |
1283 | 1283 |
1284 # TODO(jacobr): this is fragile. There isn't a guarantee that dart:dom | 1284 # TODO(jacobr): this is fragile. There isn't a guarantee that dart:dom_depre
cated |
1285 # will continue to exactly match the IDL names. | 1285 # will continue to exactly match the IDL names. |
1286 dom_name = interface.javascript_binding_name | 1286 dom_name = interface.javascript_binding_name |
1287 self._system._wrap_cases.append( | 1287 self._system._wrap_cases.append( |
1288 " case '%s': return new %s._wrap(domObject);" % | 1288 " case '%s': return new %s._wrap(domObject);" % |
1289 (dom_name, self._class_name)) | 1289 (dom_name, self._class_name)) |
1290 | 1290 |
1291 extends = ' extends ' + base if base else ' extends _DOMTypeBase' | 1291 extends = ' extends ' + base if base else ' extends _DOMTypeBase' |
1292 | 1292 |
1293 # TODO: Include all implemented interfaces, including other Lists. | 1293 # TODO: Include all implemented interfaces, including other Lists. |
1294 implements = [interface_name] | 1294 implements = [interface_name] |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 self._members_emitter.Emit( | 1575 self._members_emitter.Emit( |
1576 '\n' | 1576 '\n' |
1577 ' $TYPE $HTML_NAME($PARAMS) => $FUNCTION_CALL;\n', | 1577 ' $TYPE $HTML_NAME($PARAMS) => $FUNCTION_CALL;\n', |
1578 TYPE=info.type_name, | 1578 TYPE=info.type_name, |
1579 HTML_NAME=html_name, | 1579 HTML_NAME=html_name, |
1580 PARAMS=info.ParametersImplementationDeclaration(), | 1580 PARAMS=info.ParametersImplementationDeclaration(), |
1581 FUNCTION_CALL=function_call) | 1581 FUNCTION_CALL=function_call) |
1582 | 1582 |
1583 def AddStaticOperation(self, info): | 1583 def AddStaticOperation(self, info): |
1584 pass | 1584 pass |
OLD | NEW |