| OLD | NEW |
| 1 {%- import "interface_macros.tmpl" as interface_macros %} | 1 {%- import "interface_macros.tmpl" as interface_macros %} |
| 2 {%- set class_name = interface.name %} | 2 {%- set class_name = interface.name %} |
| 3 {%- set proxy_name = interface.name ~ "Proxy" %} | 3 {%- set proxy_name = interface.name ~ "Proxy" %} |
| 4 {%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %} | 4 {%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %} |
| 5 | 5 |
| 6 {%- macro alloc_params(parameters) %} | 6 {%- macro alloc_params(parameters) %} |
| 7 {%- for param in parameters %} | 7 {%- for param in parameters %} |
| 8 {%- if param.kind|is_object_kind %} | 8 {%- if param.kind|is_object_kind %} |
| 9 {{param.kind|cpp_result_type}} p{{loop.index}}; | 9 {{param.kind|cpp_result_type}} p{{loop.index}}; |
| 10 Deserialize_(params->{{param.name}}.ptr, &p{{loop.index}}); | 10 Deserialize_(params->{{param.name}}.ptr, &p{{loop.index}}); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 {%- endfor %} | 69 {%- endfor %} |
| 70 mojo::Message message; | 70 mojo::Message message; |
| 71 params->EncodePointersAndHandles(message.mutable_handles()); | 71 params->EncodePointersAndHandles(message.mutable_handles()); |
| 72 builder.Finish(&message); | 72 builder.Finish(&message); |
| 73 {%- endmacro %} | 73 {%- endmacro %} |
| 74 | 74 |
| 75 {#--- Begin #} | 75 {#--- Begin #} |
| 76 const char* {{class_name}}::Name_ = "{{namespace_as_string}}::{{class_name}}"; | 76 const char* {{class_name}}::Name_ = "{{namespace_as_string}}::{{class_name}}"; |
| 77 {#--- Constants #} | 77 {#--- Constants #} |
| 78 {% for constant in interface.constants %} | 78 {% for constant in interface.constants %} |
| 79 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}} = {{c
onstant.value|expression_to_text}}; | 79 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}} = {{c
onstant|constant_value}}; |
| 80 {%- endfor %} | 80 {%- endfor %} |
| 81 | 81 |
| 82 {#--- ForwardToCallback definition #} | 82 {#--- ForwardToCallback definition #} |
| 83 {%- for method in interface.methods -%} | 83 {%- for method in interface.methods -%} |
| 84 {%- if method.response_parameters != None %} | 84 {%- if method.response_parameters != None %} |
| 85 class {{class_name}}_{{method.name}}_ForwardToCallback | 85 class {{class_name}}_{{method.name}}_ForwardToCallback |
| 86 : public mojo::MessageReceiver { | 86 : public mojo::MessageReceiver { |
| 87 public: | 87 public: |
| 88 {{class_name}}_{{method.name}}_ForwardToCallback( | 88 {{class_name}}_{{method.name}}_ForwardToCallback( |
| 89 const {{interface_macros.declare_callback(method)}}& callback) | 89 const {{interface_macros.declare_callback(method)}}& callback) |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 } | 306 } |
| 307 break; | 307 break; |
| 308 } | 308 } |
| 309 {%- endfor %} | 309 {%- endfor %} |
| 310 } | 310 } |
| 311 {%- endif %} | 311 {%- endif %} |
| 312 | 312 |
| 313 return sink_->Accept(message); | 313 return sink_->Accept(message); |
| 314 } | 314 } |
| 315 {%- endif -%} | 315 {%- endif -%} |
| OLD | NEW |