| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 super_database.HasInterface(super_name)): | 216 super_database.HasInterface(super_name)): |
| 217 interface.ext_attrs['synthesizedSuperInterfaceName'] = super_name | 217 interface.ext_attrs['synthesizedSuperInterfaceName'] = super_name |
| 218 | 218 |
| 219 interface_name = interface.id | 219 interface_name = interface.id |
| 220 auxiliary_file = self._auxiliary_files.get(interface_name) | 220 auxiliary_file = self._auxiliary_files.get(interface_name) |
| 221 if auxiliary_file is not None: | 221 if auxiliary_file is not None: |
| 222 _logger.info('Skipping %s because %s exists' % ( | 222 _logger.info('Skipping %s because %s exists' % ( |
| 223 interface_name, auxiliary_file)) | 223 interface_name, auxiliary_file)) |
| 224 continue | 224 continue |
| 225 | 225 |
| 226 info = RecognizeCallback(interface) | 226 if 'Callback' in interface.ext_attrs: |
| 227 if info: | 227 handlers = [op for op in interface.operations if op.id == 'handleEvent'] |
| 228 system.ProcessCallback(interface, info) | 228 if not handlers: |
| 229 # FIXME: fix MutationCallback and assert(handlers). |
| 230 _logger.info('Malformed callback: %s' % interface.id) |
| 231 continue |
| 232 info = AnalyzeOperation(interface, handlers) |
| 233 system.ProcessCallback(interface, info) |
| 229 else: | 234 else: |
| 230 if 'Callback' in interface.ext_attrs: | |
| 231 _logger.info('Malformed callback: %s' % interface.id) | |
| 232 _logger.info('Generating %s' % interface.id) | 235 _logger.info('Generating %s' % interface.id) |
| 233 system.ProcessInterface(interface) | 236 system.ProcessInterface(interface) |
| 234 | 237 |
| 235 system.GenerateLibraries() | 238 system.GenerateLibraries() |
| 236 system.Finish() | 239 system.Finish() |
| 237 | 240 |
| 238 def _PreOrderInterfaces(self, interfaces): | 241 def _PreOrderInterfaces(self, interfaces): |
| 239 """Returns the interfaces in pre-order, i.e. parents first.""" | 242 """Returns the interfaces in pre-order, i.e. parents first.""" |
| 240 seen = set() | 243 seen = set() |
| 241 ordered = [] | 244 ordered = [] |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 PARAMETERS=constructor_info.ParametersImplementationDeclaration(DartType
)) | 339 PARAMETERS=constructor_info.ParametersImplementationDeclaration(DartType
)) |
| 337 | 340 |
| 338 def FinishInterface(self): | 341 def FinishInterface(self): |
| 339 pass | 342 pass |
| 340 | 343 |
| 341 def AddTypedArrayConstructors(self, element_type): | 344 def AddTypedArrayConstructors(self, element_type): |
| 342 pass | 345 pass |
| 343 | 346 |
| 344 def AddEventAttributes(self, event_attrs): | 347 def AddEventAttributes(self, event_attrs): |
| 345 pass | 348 pass |
| OLD | NEW |