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 systems to generate | 6 """This module provides shared functionality for systems to generate |
7 Dart APIs from the IDL database.""" | 7 Dart APIs from the IDL database.""" |
8 | 8 |
9 import copy | 9 import copy |
10 import json | 10 import json |
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 native_type='SVGPathSegListPropertyTearOff'), | 1371 native_type='SVGPathSegListPropertyTearOff'), |
1372 'SVGPoint': TypeData(clazz='SVGTearOff', native_type='SVGPointTearOff'), | 1372 'SVGPoint': TypeData(clazz='SVGTearOff', native_type='SVGPointTearOff'), |
1373 'SVGPointList': TypeData(clazz='SVGTearOff', native_type='SVGPointListTearOf
f'), | 1373 'SVGPointList': TypeData(clazz='SVGTearOff', native_type='SVGPointListTearOf
f'), |
1374 'SVGPreserveAspectRatio': TypeData(clazz='SVGTearOff', native_type='SVGPrese
rveAspectRatioTearOff'), | 1374 'SVGPreserveAspectRatio': TypeData(clazz='SVGTearOff', native_type='SVGPrese
rveAspectRatioTearOff'), |
1375 'SVGRect': TypeData(clazz='SVGTearOff', native_type='SVGRectTearOff'), | 1375 'SVGRect': TypeData(clazz='SVGTearOff', native_type='SVGRectTearOff'), |
1376 'SVGStringList': TypeData(clazz='SVGTearOff', item_type='DOMString', | 1376 'SVGStringList': TypeData(clazz='SVGTearOff', item_type='DOMString', |
1377 native_type='SVGStringListTearOff'), | 1377 native_type='SVGStringListTearOff'), |
1378 'SVGTransform': TypeData(clazz='SVGTearOff', native_type="SVGPropertyTearOff
<SVGTransform>"), | 1378 'SVGTransform': TypeData(clazz='SVGTearOff', native_type="SVGPropertyTearOff
<SVGTransform>"), |
1379 'SVGTransformList': TypeData(clazz='SVGTearOff', item_type='SVGTransform', | 1379 'SVGTransformList': TypeData(clazz='SVGTearOff', item_type='SVGTransform', |
1380 native_type='SVGTransformListPropertyTearOff'), | 1380 native_type='SVGTransformListPropertyTearOff'), |
1381 | |
1382 # TODO(alanknight): A better way to handle typedef ordering issues. | |
1383 'DOMHighResTimeStamp': TypeData(clazz='Primitive', dart_type='num', native_t
ype='double'), | |
1384 'PerformanceEntryList': TypeData(clazz='Interface', dart_type='List<Performa
nceEntry>'), | |
1385 'JSON': TypeData(clazz='Primitive', dart_type='Object'), | |
1386 }) | 1381 }) |
1387 | 1382 |
1388 _svg_supplemental_includes = [ | 1383 _svg_supplemental_includes = [ |
1389 '"core/svg/properties/SVGPropertyTraits.h"', | 1384 '"core/svg/properties/SVGPropertyTraits.h"', |
1390 ] | 1385 ] |
1391 | 1386 |
1392 class TypeRegistry(object): | 1387 class TypeRegistry(object): |
1393 def __init__(self, database, renamer=None): | 1388 def __init__(self, database, renamer=None): |
1394 self._database = database | 1389 self._database = database |
1395 self._renamer = renamer | 1390 self._renamer = renamer |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 return_type == 'Rectangle') | 1521 return_type == 'Rectangle') |
1527 | 1522 |
1528 def wrap_return_type_blink(return_type, type_name, type_registry): | 1523 def wrap_return_type_blink(return_type, type_name, type_registry): |
1529 """Returns True if we should wrap the returned value. This checks | 1524 """Returns True if we should wrap the returned value. This checks |
1530 a number of different variations, calling the more basic functions | 1525 a number of different variations, calling the more basic functions |
1531 above.""" | 1526 above.""" |
1532 return (wrap_unwrap_type_blink(return_type, type_registry) or | 1527 return (wrap_unwrap_type_blink(return_type, type_registry) or |
1533 wrap_unwrap_type_blink(type_name, type_registry) or | 1528 wrap_unwrap_type_blink(type_name, type_registry) or |
1534 wrap_type_blink(return_type, type_registry) or | 1529 wrap_type_blink(return_type, type_registry) or |
1535 wrap_unwrap_list_blink(return_type, type_registry)) | 1530 wrap_unwrap_list_blink(return_type, type_registry)) |
OLD | NEW |