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

Side by Side Diff: sdk/lib/html/scripts/generator.py

Issue 11642035: Renaming Window to WindowBase and LocalWindow to Window. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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
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 re 10 import re
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 # 501 #
502 502
503 _serialize_SSV = Conversion('convertDartToNative_SerializedScriptValue', 503 _serialize_SSV = Conversion('convertDartToNative_SerializedScriptValue',
504 'dynamic', 'dynamic') 504 'dynamic', 'dynamic')
505 505
506 dart2js_conversions = { 506 dart2js_conversions = {
507 # Wrap non-local Windows. We need to check EventTarget (the base type) 507 # Wrap non-local Windows. We need to check EventTarget (the base type)
508 # as well. Note, there are no functions that take a non-local Window 508 # as well. Note, there are no functions that take a non-local Window
509 # as a parameter / setter. 509 # as a parameter / setter.
510 'DOMWindow get': 510 'DOMWindow get':
511 Conversion('_convertNativeToDart_Window', 'dynamic', 'Window'), 511 Conversion('_convertNativeToDart_Window', 'dynamic', 'WindowBase'),
512 'EventTarget get': 512 'EventTarget get':
513 Conversion('_convertNativeToDart_EventTarget', 'dynamic', 513 Conversion('_convertNativeToDart_EventTarget', 'dynamic',
514 'EventTarget'), 514 'EventTarget'),
515 'EventTarget set': 515 'EventTarget set':
516 Conversion('_convertDartToNative_EventTarget', 'EventTarget', 516 Conversion('_convertDartToNative_EventTarget', 'EventTarget',
517 'dynamic'), 517 'dynamic'),
518 518
519 'IDBKey get': 519 'IDBKey get':
520 Conversion('_convertNativeToDart_IDBKey', 'dynamic', 'dynamic'), 520 Conversion('_convertNativeToDart_IDBKey', 'dynamic', 'dynamic'),
521 'IDBKey set': 521 'IDBKey set':
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 "@Creates('String|CanvasGradient|CanvasPattern') " 612 "@Creates('String|CanvasGradient|CanvasPattern') "
613 "@Returns('String|CanvasGradient|CanvasPattern')", 613 "@Returns('String|CanvasGradient|CanvasPattern')",
614 614
615 'CanvasRenderingContext2D.strokeStyle': 615 'CanvasRenderingContext2D.strokeStyle':
616 "@Creates('String|CanvasGradient|CanvasPattern') " 616 "@Creates('String|CanvasGradient|CanvasPattern') "
617 "@Returns('String|CanvasGradient|CanvasPattern')", 617 "@Returns('String|CanvasGradient|CanvasPattern')",
618 618
619 # Methods returning Window can return a local window, or a cross-frame 619 # Methods returning Window can return a local window, or a cross-frame
620 # window (=Object) that needs wrapping. 620 # window (=Object) that needs wrapping.
621 'DOMWindow': 621 'DOMWindow':
622 "@Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object')", 622 "@Creates('Window|=Object') @Returns('Window|=Object')",
623 623
624 'DOMWindow.openDatabase': "@Creates('Database') @Creates('DatabaseSync')", 624 'DOMWindow.openDatabase': "@Creates('Database') @Creates('DatabaseSync')",
625 625
626 # Cross-frame windows are EventTargets. 626 # Cross-frame windows are EventTargets.
627 '-EventTarget': 627 '-EventTarget':
628 "@Creates('EventTarget|=Object') @Returns('EventTarget|=Object')", 628 "@Creates('EventTarget|=Object') @Returns('EventTarget|=Object')",
629 629
630 # To be in callback with the browser-created Event, we had to have called 630 # To be in callback with the browser-created Event, we had to have called
631 # addEventListener on the target, so we avoid 631 # addEventListener on the target, so we avoid
632 'Event.currentTarget': 632 'Event.currentTarget':
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 self) 1249 self)
1250 1250
1251 if type_data.clazz == 'SVGTearOff': 1251 if type_data.clazz == 'SVGTearOff':
1252 dart_interface_name = self._renamer.RenameInterface( 1252 dart_interface_name = self._renamer.RenameInterface(
1253 self._database.GetInterface(type_name)) 1253 self._database.GetInterface(type_name))
1254 return SVGTearOffIDLTypeInfo( 1254 return SVGTearOffIDLTypeInfo(
1255 type_name, type_data, dart_interface_name, self) 1255 type_name, type_data, dart_interface_name, self)
1256 1256
1257 class_name = '%sIDLTypeInfo' % type_data.clazz 1257 class_name = '%sIDLTypeInfo' % type_data.clazz
1258 return globals()[class_name](type_name, type_data) 1258 return globals()[class_name](type_name, type_data)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698