| 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 frog binding from the IDL database.""" | 7 frog binding from the IDL database.""" |
| 8 | 8 |
| 9 import os | 9 import os |
| 10 from generator import * | 10 from generator import * |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 | 278 |
| 279 def AddSecondaryAttribute(self, interface, getter, setter): | 279 def AddSecondaryAttribute(self, interface, getter, setter): |
| 280 self._SecondaryContext(interface) | 280 self._SecondaryContext(interface) |
| 281 self.AddAttribute(getter, setter) | 281 self.AddAttribute(getter, setter) |
| 282 | 282 |
| 283 def AddSecondaryOperation(self, interface, info): | 283 def AddSecondaryOperation(self, interface, info): |
| 284 self._SecondaryContext(interface) | 284 self._SecondaryContext(interface) |
| 285 self.AddOperation(info) | 285 self.AddOperation(info) |
| 286 | 286 |
| 287 def AddEventAttributes(self, event_attrs): | |
| 288 pass | |
| 289 | |
| 290 def _SecondaryContext(self, interface): | 287 def _SecondaryContext(self, interface): |
| 291 if interface is not self._current_secondary_parent: | 288 if interface is not self._current_secondary_parent: |
| 292 self._current_secondary_parent = interface | 289 self._current_secondary_parent = interface |
| 293 self._members_emitter.Emit('\n // From $WHERE\n', WHERE=interface.id) | 290 self._members_emitter.Emit('\n // From $WHERE\n', WHERE=interface.id) |
| 294 | 291 |
| 295 def AddIndexer(self, element_type): | 292 def AddIndexer(self, element_type): |
| 296 """Adds all the methods required to complete implementation of List.""" | 293 """Adds all the methods required to complete implementation of List.""" |
| 297 # We would like to simply inherit the implementation of everything except | 294 # We would like to simply inherit the implementation of everything except |
| 298 # get length(), [], and maybe []=. It is possible to extend from a base | 295 # get length(), [], and maybe []=. It is possible to extend from a base |
| 299 # array implementation class only when there is no other implementation | 296 # array implementation class only when there is no other implementation |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 if native_body: | 361 if native_body: |
| 365 native_body = " '''" + native_body + "'''" | 362 native_body = " '''" + native_body + "'''" |
| 366 | 363 |
| 367 self._members_emitter.Emit( | 364 self._members_emitter.Emit( |
| 368 '\n' | 365 '\n' |
| 369 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n', | 366 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n', |
| 370 TYPE=self._NarrowOutputType(info.type_name), | 367 TYPE=self._NarrowOutputType(info.type_name), |
| 371 NAME=info.name, | 368 NAME=info.name, |
| 372 PARAMS=params, | 369 PARAMS=params, |
| 373 NATIVESTRING=native_body) | 370 NATIVESTRING=native_body) |
| OLD | NEW |