OLD | NEW |
1 {% from "constant_definition.tmpl" import constant_def %} | 1 {% from "constant_definition.tmpl" import constant_def %} |
2 {% from "enum_definition.tmpl" import enum_def %} | 2 {% from "enum_definition.tmpl" import enum_def %} |
3 | 3 |
4 {%- macro declare_params(parameters) %} | 4 {%- macro declare_params(parameters) %} |
5 {%- for param in parameters -%} | 5 {%- for param in parameters -%} |
6 {{param.kind|java_type(False)}} {{param|name}} | 6 {{param.kind|java_type(False)}} {{param|name}} |
7 {%- if not loop.last %}, {% endif %} | 7 {%- if not loop.last %}, {% endif %} |
8 {%- endfor %} | 8 {%- endfor %} |
9 {%- endmacro %} | 9 {%- endmacro %} |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 {%- macro super_class(client) -%} | 28 {%- macro super_class(client) -%} |
29 {%- if client -%} | 29 {%- if client -%} |
30 org.chromium.mojo.bindings.InterfaceWithClient<{{client|java_type}}> | 30 org.chromium.mojo.bindings.InterfaceWithClient<{{client|java_type}}> |
31 {%- else -%} | 31 {%- else -%} |
32 org.chromium.mojo.bindings.Interface | 32 org.chromium.mojo.bindings.Interface |
33 {%- endif -%} | 33 {%- endif -%} |
34 {%- endmacro -%} | 34 {%- endmacro -%} |
35 | 35 |
36 {% macro interface_def(interface, client) %} | 36 {% macro interface_def(interface, client) %} |
37 public interface {{interface|name}} extends {{super_class(client)}} { | 37 public interface {{interface|name}} extends {{super_class(client)}} { |
| 38 |
| 39 public static final Object BUILDER = new Object(); |
| 40 |
38 {% for constant in interface.constants %} | 41 {% for constant in interface.constants %} |
39 | 42 |
40 {{constant_def(constant)|indent(4)}} | 43 {{constant_def(constant)|indent(4)}} |
41 {% endfor %} | 44 {% endfor %} |
42 {% for enum in interface.enums %} | 45 {% for enum in interface.enums %} |
43 | 46 |
44 {{enum_def(enum, false)|indent(4)}} | 47 {{enum_def(enum, false)|indent(4)}} |
45 {% endfor %} | 48 {% endfor %} |
46 {% for method in interface.methods %} | 49 {% for method in interface.methods %} |
47 | 50 |
48 void {{method|name}}({{declare_request_params(method)}}); | 51 void {{method|name}}({{declare_request_params(method)}}); |
49 {% if method.response_parameters %} | 52 {% if method.response_parameters %} |
50 {{declare_callback(method)|indent(4)}} | 53 {{declare_callback(method)|indent(4)}} |
51 {% endif %} | 54 {% endif %} |
52 {% endfor %} | 55 {% endfor %} |
53 | 56 |
54 } | 57 } |
55 {% endmacro %} | 58 {% endmacro %} |
OLD | NEW |