Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1277)

Side by Side Diff: tools/dom/scripts/generator.py

Issue 25785003: "Reverting 28184" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/lib/math/rectangle_test.dart ('k') | tools/dom/src/CssRectangle.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 webcore_setter_name='setUnsignedIntegralAttribute' ), 1057 webcore_setter_name='setUnsignedIntegralAttribute' ),
1058 'long long': TypeData(clazz='Primitive', dart_type='int'), 1058 'long long': TypeData(clazz='Primitive', dart_type='int'),
1059 'unsigned long long': TypeData(clazz='Primitive', dart_type='int'), 1059 'unsigned long long': TypeData(clazz='Primitive', dart_type='int'),
1060 'float': TypeData(clazz='Primitive', dart_type='num', native_type='double'), 1060 'float': TypeData(clazz='Primitive', dart_type='num', native_type='double'),
1061 'double': TypeData(clazz='Primitive', dart_type='num'), 1061 'double': TypeData(clazz='Primitive', dart_type='num'),
1062 1062
1063 'any': TypeData(clazz='Primitive', dart_type='Object', native_type='ScriptVa lue'), 1063 'any': TypeData(clazz='Primitive', dart_type='Object', native_type='ScriptVa lue'),
1064 'Array': TypeData(clazz='Primitive', dart_type='List'), 1064 'Array': TypeData(clazz='Primitive', dart_type='List'),
1065 'custom': TypeData(clazz='Primitive', dart_type='dynamic'), 1065 'custom': TypeData(clazz='Primitive', dart_type='dynamic'),
1066 'ClientRect': TypeData(clazz='Interface', 1066 'ClientRect': TypeData(clazz='Interface',
1067 dart_type='Rectangle', suppress_interface=True), 1067 dart_type='Rect', suppress_interface=True),
1068 'Date': TypeData(clazz='Primitive', dart_type='DateTime', native_type='doubl e'), 1068 'Date': TypeData(clazz='Primitive', dart_type='DateTime', native_type='doubl e'),
1069 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc riptValue'), 1069 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc riptValue'),
1070 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St ring'), 1070 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St ring'),
1071 # TODO(vsm): This won't actually work until we convert the Map to 1071 # TODO(vsm): This won't actually work until we convert the Map to
1072 # a native JS Map for JS DOM. 1072 # a native JS Map for JS DOM.
1073 'Dictionary': TypeData(clazz='Primitive', dart_type='Map'), 1073 'Dictionary': TypeData(clazz='Primitive', dart_type='Map'),
1074 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un signed long long'), 1074 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un signed long long'),
1075 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip tValue'), 1075 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip tValue'),
1076 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'), 1076 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'),
1077 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'), 1077 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'),
(...skipping 14 matching lines...) Expand all
1092 'EventTarget': TypeData(clazz='Interface', custom_to_native=True), 1092 'EventTarget': TypeData(clazz='Interface', custom_to_native=True),
1093 'HTMLElement': TypeData(clazz='Interface', merged_into='Element', 1093 'HTMLElement': TypeData(clazz='Interface', merged_into='Element',
1094 custom_to_dart=True), 1094 custom_to_dart=True),
1095 'IDBAny': TypeData(clazz='Interface', dart_type='dynamic', custom_to_native= True), 1095 'IDBAny': TypeData(clazz='Interface', dart_type='dynamic', custom_to_native= True),
1096 'MutationRecordArray': TypeData(clazz='Interface', # C++ pass by pointer. 1096 'MutationRecordArray': TypeData(clazz='Interface', # C++ pass by pointer.
1097 native_type='MutationRecordArray', dart_type='List<MutationRecord>'), 1097 native_type='MutationRecordArray', dart_type='List<MutationRecord>'),
1098 'StyleSheet': TypeData(clazz='Interface', conversion_includes=['CSSStyleShee t']), 1098 'StyleSheet': TypeData(clazz='Interface', conversion_includes=['CSSStyleShee t']),
1099 'SVGElement': TypeData(clazz='Interface', custom_to_dart=True), 1099 'SVGElement': TypeData(clazz='Interface', custom_to_dart=True),
1100 1100
1101 'ClientRectList': TypeData(clazz='Interface', 1101 'ClientRectList': TypeData(clazz='Interface',
1102 item_type='ClientRect', dart_type='List<Rectangle>', 1102 item_type='ClientRect', dart_type='List<Rect>', suppress_interface=True) ,
1103 suppress_interface=True),
1104 'CSSRuleList': TypeData(clazz='Interface', 1103 'CSSRuleList': TypeData(clazz='Interface',
1105 item_type='CSSRule', suppress_interface=True), 1104 item_type='CSSRule', suppress_interface=True),
1106 'CSSValueList': TypeData(clazz='Interface', 1105 'CSSValueList': TypeData(clazz='Interface',
1107 item_type='CSSValue', suppress_interface=True), 1106 item_type='CSSValue', suppress_interface=True),
1108 'MimeTypeArray': TypeData(clazz='Interface', item_type='MimeType'), 1107 'MimeTypeArray': TypeData(clazz='Interface', item_type='MimeType'),
1109 'PluginArray': TypeData(clazz='Interface', item_type='Plugin'), 1108 'PluginArray': TypeData(clazz='Interface', item_type='Plugin'),
1110 'DOMStringList': TypeData(clazz='Interface', item_type='DOMString', 1109 'DOMStringList': TypeData(clazz='Interface', item_type='DOMString',
1111 dart_type='List<String>', custom_to_native=True), 1110 dart_type='List<String>', custom_to_native=True),
1112 'FileList': TypeData(clazz='Interface', item_type='File', 1111 'FileList': TypeData(clazz='Interface', item_type='File',
1113 dart_type='List<File>'), 1112 dart_type='List<File>'),
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 if type_data.clazz == 'BasicTypedList': 1241 if type_data.clazz == 'BasicTypedList':
1243 if type_name == 'ArrayBuffer': 1242 if type_name == 'ArrayBuffer':
1244 dart_interface_name = 'ByteBuffer' 1243 dart_interface_name = 'ByteBuffer'
1245 else: 1244 else:
1246 dart_interface_name = self._renamer.RenameInterfaceId(type_name) 1245 dart_interface_name = self._renamer.RenameInterfaceId(type_name)
1247 return BasicTypedListIDLTypeInfo( 1246 return BasicTypedListIDLTypeInfo(
1248 type_name, type_data, dart_interface_name, self) 1247 type_name, type_data, dart_interface_name, self)
1249 1248
1250 class_name = '%sIDLTypeInfo' % type_data.clazz 1249 class_name = '%sIDLTypeInfo' % type_data.clazz
1251 return globals()[class_name](type_name, type_data) 1250 return globals()[class_name](type_name, type_data)
OLDNEW
« no previous file with comments | « tests/lib/math/rectangle_test.dart ('k') | tools/dom/src/CssRectangle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698