| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, 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 generates Dart APIs from the IDL database.""" | 6 """This module generates Dart APIs from the IDL database.""" |
| 7 | 7 |
| 8 import emitter | 8 import emitter |
| 9 import idlnode | 9 import idlnode |
| 10 import logging | 10 import logging |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 ]) | 65 ]) |
| 66 | 66 |
| 67 # | 67 # |
| 68 # Custom methods that must be implemented by hand. | 68 # Custom methods that must be implemented by hand. |
| 69 # | 69 # |
| 70 _custom_methods = set([ | 70 _custom_methods = set([ |
| 71 ('DOMWindow', 'setInterval'), | 71 ('DOMWindow', 'setInterval'), |
| 72 ('DOMWindow', 'setTimeout'), | 72 ('DOMWindow', 'setTimeout'), |
| 73 ('WorkerContext', 'setInterval'), | 73 ('WorkerContext', 'setInterval'), |
| 74 ('WorkerContext', 'setTimeout'), | 74 ('WorkerContext', 'setTimeout'), |
| 75 ('CanvasRenderingContext2D', 'setFillStyle'), | |
| 76 ('CanvasRenderingContext2D', 'setStrokeStyle'), | |
| 77 ('CanvasRenderingContext2D', 'setFillStyle'), | |
| 78 ]) | 75 ]) |
| 79 | 76 |
| 80 # | 77 # |
| 81 # Custom getters that must be implemented by hand. | 78 # Custom getters that must be implemented by hand. |
| 82 # | 79 # |
| 83 _custom_getters = set([ | 80 _custom_getters = set([ |
| 84 ('DOMWindow', 'localStorage'), | 81 ('DOMWindow', 'localStorage'), |
| 85 ]) | 82 ]) |
| 86 | 83 |
| 87 # | 84 # |
| (...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1998 Arguments: | 1995 Arguments: |
| 1999 info: An OperationInfo object. | 1996 info: An OperationInfo object. |
| 2000 """ | 1997 """ |
| 2001 # TODO(vsm): Handle overloads. | 1998 # TODO(vsm): Handle overloads. |
| 2002 self._members_emitter.Emit( | 1999 self._members_emitter.Emit( |
| 2003 '\n' | 2000 '\n' |
| 2004 ' $TYPE $NAME($ARGS) native;\n', | 2001 ' $TYPE $NAME($ARGS) native;\n', |
| 2005 TYPE=info.type_name, | 2002 TYPE=info.type_name, |
| 2006 NAME=info.name, | 2003 NAME=info.name, |
| 2007 ARGS=info.arg_implementation_declaration) | 2004 ARGS=info.arg_implementation_declaration) |
| OLD | NEW |