| OLD | NEW |
| 1 {%- import "interface_macros.tmpl" as interface_macros %} | 1 {%- import "interface_macros.tmpl" as interface_macros %} |
| 2 class {{interface.name}}Proxy; | 2 class {{interface.name}}Proxy; |
| 3 class {{interface.name}}Stub; | 3 class {{interface.name}}Stub; |
| 4 {% if interface.client %} | 4 {% if interface.client %} |
| 5 class {{interface.client}}; | 5 class {{interface.client}}; |
| 6 {% endif %} | 6 {% endif %} |
| 7 | 7 |
| 8 class {{interface.name}} { | 8 class {{interface.name}} { |
| 9 public: | 9 public: |
| 10 typedef {{interface.name}}Proxy Proxy_; | 10 typedef {{interface.name}}Proxy Proxy_; |
| 11 typedef {{interface.name}}Stub Stub_; | 11 typedef {{interface.name}}Stub Stub_; |
| 12 {% if interface.client %} | 12 {% if interface.client %} |
| 13 typedef {{interface.client}} Client_; | 13 typedef {{interface.client}} Client; |
| 14 {% else %} | 14 {% else %} |
| 15 typedef mojo::NoInterface Client_; | 15 typedef mojo::NoInterface Client; |
| 16 {% endif %} | 16 {% endif %} |
| 17 | 17 |
| 18 {#--- Constants #} | 18 {#--- Constants #} |
| 19 {%- for constant in interface.constants %} | 19 {%- for constant in interface.constants %} |
| 20 static const {{constant.kind|cpp_pod_type}} {{constant.name}}; | 20 static const {{constant.kind|cpp_pod_type}} {{constant.name}}; |
| 21 {%- endfor %} | 21 {%- endfor %} |
| 22 | 22 |
| 23 {#--- Enums #} | 23 {#--- Enums #} |
| 24 {%- for enum in interface.enums %} | 24 {%- for enum in interface.enums %} |
| 25 {% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %} | 25 {% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %} |
| 26 {{enum_def()|indent(2)}} | 26 {{enum_def()|indent(2)}} |
| 27 {%- endfor %} | 27 {%- endfor %} |
| 28 | 28 |
| 29 {#--- Methods #} | 29 {#--- Methods #} |
| 30 virtual ~{{interface.name}}() {} | 30 virtual ~{{interface.name}}() {} |
| 31 {%- if interface.client %} | 31 {%- if interface.client %} |
| 32 // Called once before any other method. | 32 // Called once before any other method. |
| 33 virtual void SetClient({{interface.client}}* client) = 0; | 33 virtual void SetClient({{interface.client}}* client) = 0; |
| 34 {%- else %} | 34 {%- else %} |
| 35 virtual void SetClient(mojo::NoInterface* client) {} | 35 virtual void SetClient(mojo::NoInterface* client) {} |
| 36 {%- endif %} | 36 {%- endif %} |
| 37 {%- for method in interface.methods %} | 37 {%- for method in interface.methods %} |
| 38 virtual void {{method.name}}({{interface_macros.declare_request_params("", met
hod)}}) = 0; | 38 virtual void {{method.name}}({{interface_macros.declare_request_params("", met
hod)}}) = 0; |
| 39 {%- endfor %} | 39 {%- endfor %} |
| 40 }; | 40 }; |
| OLD | NEW |