| 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 native binding from the IDL database.""" | 7 native binding from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 import os | 10 import os |
| (...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1224 e.Emit(' bool is_node;\n'); | 1224 e.Emit(' bool is_node;\n'); |
| 1225 e.Emit(' bool is_active;\n'); | 1225 e.Emit(' bool is_active;\n'); |
| 1226 e.Emit(' bool is_event;\n'); | 1226 e.Emit(' bool is_event;\n'); |
| 1227 e.Emit('} _Classinfo;\n'); | 1227 e.Emit('} _Classinfo;\n'); |
| 1228 e.Emit('typedef _Classinfo _DartWebkitClassInfo[NumWebkitClassIds];\n'); | 1228 e.Emit('typedef _Classinfo _DartWebkitClassInfo[NumWebkitClassIds];\n'); |
| 1229 e.Emit('\n'); | 1229 e.Emit('\n'); |
| 1230 e.Emit('extern _DartWebkitClassInfo DartWebkitClassInfo;\n'); | 1230 e.Emit('extern _DartWebkitClassInfo DartWebkitClassInfo;\n'); |
| 1231 e.Emit('\n'); | 1231 e.Emit('\n'); |
| 1232 e.Emit('} // namespace WebCore\n'); | 1232 e.Emit('} // namespace WebCore\n'); |
| 1233 e.Emit('#endif // DartWebkitClassIds_h\n'); | 1233 e.Emit('#endif // DartWebkitClassIds_h\n'); |
| 1234 self._emitters.Flush() | |
| 1235 | 1234 |
| 1236 path = os.path.join(output_dir, 'DartWebkitClassIds.cpp') | 1235 path = os.path.join(output_dir, 'DartWebkitClassIds.cpp') |
| 1237 e = self._emitters.FileEmitter(path) | 1236 e = self._emitters.FileEmitter(path) |
| 1238 e.Emit('// Copyright (c) 2013, the Dart project authors. Please see the AUT
HORS file\n'); | 1237 e.Emit('// Copyright (c) 2013, the Dart project authors. Please see the AUT
HORS file\n'); |
| 1239 e.Emit('// for details. All rights reserved. Use of this source code is gove
rned by a\n'); | 1238 e.Emit('// for details. All rights reserved. Use of this source code is gove
rned by a\n'); |
| 1240 e.Emit('// BSD-style license that can be found in the LICENSE file.\n'); | 1239 e.Emit('// BSD-style license that can be found in the LICENSE file.\n'); |
| 1241 e.Emit('// WARNING: Do not edit - generated code.\n'); | 1240 e.Emit('// WARNING: Do not edit - generated code.\n'); |
| 1242 e.Emit('// See dart/tools/dom/scripts/systemnative.py\n'); | 1241 e.Emit('// See dart/tools/dom/scripts/systemnative.py\n'); |
| 1243 e.Emit('\n'); | 1242 e.Emit('\n'); |
| 1244 e.Emit('#include "DartWebkitClassIds.h"\n'); | 1243 e.Emit('#include "DartWebkitClassIds.h"\n'); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1274 e.Emit(' %sClassId,\n' % supertype) | 1273 e.Emit(' %sClassId,\n' % supertype) |
| 1275 else: | 1274 else: |
| 1276 e.Emit(' -1,') | 1275 e.Emit(' -1,') |
| 1277 e.Emit(" %s," % TypeCheckHelper(is_node_test)) | 1276 e.Emit(" %s," % TypeCheckHelper(is_node_test)) |
| 1278 e.Emit(" %s," % TypeCheckHelper(is_active_test)) | 1277 e.Emit(" %s," % TypeCheckHelper(is_active_test)) |
| 1279 e.Emit(" %s," % TypeCheckHelper(is_event_target_test)) | 1278 e.Emit(" %s," % TypeCheckHelper(is_event_target_test)) |
| 1280 e.Emit(" },\n") | 1279 e.Emit(" },\n") |
| 1281 e.Emit("};\n"); | 1280 e.Emit("};\n"); |
| 1282 e.Emit('\n'); | 1281 e.Emit('\n'); |
| 1283 e.Emit('} // namespace WebCore\n'); | 1282 e.Emit('} // namespace WebCore\n'); |
| 1284 self._emitters.Flush() | |
| 1285 | 1283 |
| 1286 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): | 1284 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): |
| 1287 return ( | 1285 return ( |
| 1288 interface.id.endswith('Event') and | 1286 interface.id.endswith('Event') and |
| 1289 operation.id.startswith('init') and | 1287 operation.id.startswith('init') and |
| 1290 argument.ext_attrs.get('Default') == 'Undefined' and | 1288 argument.ext_attrs.get('Default') == 'Undefined' and |
| 1291 argument.type.id == 'DOMString') | 1289 argument.type.id == 'DOMString') |
| OLD | NEW |