| 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 26 matching lines...) Expand all Loading... |
| 37 """.""" | 37 """.""" |
| 38 template_file = 'impl_%s.darttemplate' % interface.id | 38 template_file = 'impl_%s.darttemplate' % interface.id |
| 39 template = self._templates.TryLoad(template_file) | 39 template = self._templates.TryLoad(template_file) |
| 40 if not template: | 40 if not template: |
| 41 template = self._templates.Load('frog_impl.darttemplate') | 41 template = self._templates.Load('frog_impl.darttemplate') |
| 42 | 42 |
| 43 dart_code = self._ImplFileEmitter(interface.id) | 43 dart_code = self._ImplFileEmitter(interface.id) |
| 44 return FrogInterfaceGenerator(self, interface, template, | 44 return FrogInterfaceGenerator(self, interface, template, |
| 45 super_interface_name, dart_code) | 45 super_interface_name, dart_code) |
| 46 | 46 |
| 47 def GenerateLibraries(self, lib_dir): | 47 def GenerateLibraries(self): |
| 48 self._GenerateLibFile( | 48 self._GenerateLibFile( |
| 49 'frog_dom.darttemplate', | 49 'frog_dom.darttemplate', |
| 50 os.path.join(lib_dir, 'dom_frog.dart'), | 50 os.path.join(self._output_dir, 'dom_frog.dart'), |
| 51 (self._interface_system._dart_interface_file_paths + | 51 (self._interface_system._dart_interface_file_paths + |
| 52 self._interface_system._dart_callback_file_paths + | 52 self._interface_system._dart_callback_file_paths + |
| 53 self._impl_file_paths)) | 53 self._impl_file_paths)) |
| 54 | 54 |
| 55 def Finish(self): | 55 def Finish(self): |
| 56 pass | 56 pass |
| 57 | 57 |
| 58 def _ImplFileEmitter(self, name): | 58 def _ImplFileEmitter(self, name): |
| 59 """Returns the file emitter of the Frog implementation file.""" | 59 """Returns the file emitter of the Frog implementation file.""" |
| 60 path = os.path.join(self._output_dir, 'src', 'frog', '%s.dart' % name) | 60 path = os.path.join(self._output_dir, 'src', 'frog', '%s.dart' % name) |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 self._members_emitter.Emit( | 368 self._members_emitter.Emit( |
| 369 '\n' | 369 '\n' |
| 370 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n', | 370 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n', |
| 371 TYPE=self._NarrowOutputType(info.type_name), | 371 TYPE=self._NarrowOutputType(info.type_name), |
| 372 NAME=info.name, | 372 NAME=info.name, |
| 373 PARAMS=params, | 373 PARAMS=params, |
| 374 NATIVESTRING=native_string) | 374 NATIVESTRING=native_string) |
| 375 | 375 |
| 376 def AddStaticOperation(self, info): | 376 def AddStaticOperation(self, info): |
| 377 pass | 377 pass |
| OLD | NEW |