| OLD | NEW |
| 1 {% from "module_macros.tmpl" import enum_values %} | 1 {% from "module_macros.tmpl" import enum_values %} |
| 2 {% from "module_macros.tmpl" import struct_descriptor %} | 2 {% from "module_macros.tmpl" import struct_descriptor %} |
| 3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 import mojo_bindings.descriptor as _descriptor | 7 import mojo_bindings.descriptor as _descriptor |
| 8 import mojo_bindings.reflection as _reflection | 8 import mojo_bindings.reflection as _reflection |
| 9 {% if imports %} | 9 {% if imports %} |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 DESCRIPTOR = {{struct_descriptor(struct)|indent(2)}} | 32 DESCRIPTOR = {{struct_descriptor(struct)|indent(2)}} |
| 33 {% endfor %} | 33 {% endfor %} |
| 34 {% for interface in interfaces %} | 34 {% for interface in interfaces %} |
| 35 | 35 |
| 36 class {{interface|name}}(object): | 36 class {{interface|name}}(object): |
| 37 __metaclass__ = _reflection.MojoInterfaceType | 37 __metaclass__ = _reflection.MojoInterfaceType |
| 38 DESCRIPTOR = { | 38 DESCRIPTOR = { |
| 39 {% if interface.client %} | 39 {% if interface.client %} |
| 40 'client': lambda: {{interface.qualified_client|fully_qualified_name}}, | 40 'client': lambda: {{interface.qualified_client|fully_qualified_name}}, |
| 41 {% endif %} | 41 {% endif %} |
| 42 'fully_qualified_name': '{% if namespace %}{{namespace|replace(".","::")}}::
{% endif %}{{interface|fully_qualified_name|replace(".","::")}}', |
| 42 'methods': [ | 43 'methods': [ |
| 43 {% for method in interface.methods %} | 44 {% for method in interface.methods %} |
| 44 { | 45 { |
| 45 'name': '{{method|name}}', | 46 'name': '{{method|name}}', |
| 46 'ordinal': {{method.ordinal}}, | 47 'ordinal': {{method.ordinal}}, |
| 47 {% set request_struct = method|struct_from_method %} | 48 {% set request_struct = method|struct_from_method %} |
| 48 'parameters': {{struct_descriptor(request_struct)|indent(8)}}, | 49 'parameters': {{struct_descriptor(request_struct)|indent(8)}}, |
| 49 {% if method.response_parameters != None %} | 50 {% if method.response_parameters != None %} |
| 50 {% set response_struct = method|response_struct_from_method %} | 51 {% set response_struct = method|response_struct_from_method %} |
| 51 'responses': {{struct_descriptor(response_struct)|indent(8)}}, | 52 'responses': {{struct_descriptor(response_struct)|indent(8)}}, |
| 52 {% endif %} | 53 {% endif %} |
| 53 }, | 54 }, |
| 54 {% endfor %} | 55 {% endfor %} |
| 55 ], | 56 ], |
| 56 } | 57 } |
| 57 {% endfor %} | 58 {% endfor %} |
| OLD | NEW |