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 providesfunctionality for systems to generate | 6 """This module providesfunctionality for systems to generate |
7 Dart interfaces from the IDL database.""" | 7 Dart interfaces from the IDL database.""" |
8 | 8 |
9 import os | 9 import os |
10 import systembase | 10 import systembase |
11 from generator import * | 11 from generator import * |
12 | 12 |
13 class InterfacesSystem(systembase.System): | 13 class InterfacesSystem(systembase.System): |
14 | 14 |
15 def __init__(self, templates, database, emitters, output_dir): | 15 def __init__(self, options): |
16 super(InterfacesSystem, self).__init__( | 16 super(InterfacesSystem, self).__init__(options) |
17 templates, database, emitters, output_dir) | |
18 self._dart_interface_file_paths = [] | 17 self._dart_interface_file_paths = [] |
19 | 18 |
20 | 19 |
21 def ProcessInterface(self, interface): | 20 def ProcessInterface(self, interface): |
22 """.""" | 21 """.""" |
23 interface_name = interface.id | 22 interface_name = interface.id |
24 dart_interface_file_path = self._FilePathForDartInterface(interface_name) | 23 dart_interface_file_path = self._FilePathForDartInterface(interface_name) |
25 | 24 |
26 self._dart_interface_file_paths.append(dart_interface_file_path) | 25 self._dart_interface_file_paths.append(dart_interface_file_path) |
27 | 26 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 """ | 191 """ |
193 Arguments: | 192 Arguments: |
194 operations - contains the overloads, one or more operations with the same | 193 operations - contains the overloads, one or more operations with the same |
195 name. | 194 name. |
196 """ | 195 """ |
197 self._members_emitter.Emit('\n' | 196 self._members_emitter.Emit('\n' |
198 ' $TYPE $NAME($PARAMS);\n', | 197 ' $TYPE $NAME($PARAMS);\n', |
199 TYPE=info.type_name, | 198 TYPE=info.type_name, |
200 NAME=info.name, | 199 NAME=info.name, |
201 PARAMS=info.ParametersInterfaceDeclaration()) | 200 PARAMS=info.ParametersInterfaceDeclaration()) |
OLD | NEW |