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 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 PARAMS=constructor_info.ParametersInterfaceDeclaration()); | 141 PARAMS=constructor_info.ParametersInterfaceDeclaration()); |
142 | 142 |
143 element_type = MaybeTypedArrayElementType(self._interface) | 143 element_type = MaybeTypedArrayElementType(self._interface) |
144 if element_type: | 144 if element_type: |
145 self._members_emitter.Emit( | 145 self._members_emitter.Emit( |
146 '\n' | 146 '\n' |
147 ' $CTOR(int length);\n' | 147 ' $CTOR(int length);\n' |
148 '\n' | 148 '\n' |
149 ' $CTOR.fromList(List<$TYPE> list);\n' | 149 ' $CTOR.fromList(List<$TYPE> list);\n' |
150 '\n' | 150 '\n' |
151 ' $CTOR.fromBuffer(ArrayBuffer buffer,' | 151 ' $CTOR.fromBuffer(ArrayBuffer buffer);\n', |
152 ' [int byteOffset, int length]);\n', | |
153 CTOR=self._interface.id, | 152 CTOR=self._interface.id, |
154 TYPE=DartType(element_type)) | 153 TYPE=DartType(element_type)) |
155 | 154 |
156 | 155 |
157 def FinishInterface(self): | 156 def FinishInterface(self): |
158 # TODO(vsm): Use typedef if / when that is supported in Dart. | 157 # TODO(vsm): Use typedef if / when that is supported in Dart. |
159 # Define variant as subtype. | 158 # Define variant as subtype. |
160 if (self._super_interface and | 159 if (self._super_interface and |
161 self._interface.id is not self._super_interface): | 160 self._interface.id is not self._super_interface): |
162 consts_emitter = self._top_level_emitter.Emit( | 161 consts_emitter = self._top_level_emitter.Emit( |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 TYPE=info.type_name, | 208 TYPE=info.type_name, |
210 NAME=info.name, | 209 NAME=info.name, |
211 PARAMS=info.ParametersInterfaceDeclaration()) | 210 PARAMS=info.ParametersInterfaceDeclaration()) |
212 | 211 |
213 # Interfaces get secondary members directly via the superinterfaces. | 212 # Interfaces get secondary members directly via the superinterfaces. |
214 def AddSecondaryAttribute(self, interface, getter, setter): | 213 def AddSecondaryAttribute(self, interface, getter, setter): |
215 pass | 214 pass |
216 | 215 |
217 def AddSecondaryOperation(self, interface, attr): | 216 def AddSecondaryOperation(self, interface, attr): |
218 pass | 217 pass |
OLD | NEW |