| 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 | 4 |
| 5 {%- macro pass_params(parameters) %} | 5 {%- macro pass_params(parameters) %} |
| 6 {%- for param in parameters %} | 6 {%- for param in parameters %} |
| 7 {%- if param.kind|is_object_kind -%} | 7 {%- if param.kind|is_object_kind -%} |
| 8 mojo::internal::Wrap(params->{{param.name}}()) | 8 mojo::internal::Wrap(params->{{param.name}}()) |
| 9 {%- elif param.kind|is_handle_kind -%} | 9 {%- elif param.kind|is_handle_kind -%} |
| 10 mojo::MakePassable(params->{{param.name}}()).Pass() | 10 mojo::MakePassable(params->{{param.name}}()).Pass() |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 params->set_{{param.name}}(in_{{param.name}}.release()); | 42 params->set_{{param.name}}(in_{{param.name}}.release()); |
| 43 {%- else %} | 43 {%- else %} |
| 44 params->set_{{param.name}}(in_{{param.name}}); | 44 params->set_{{param.name}}(in_{{param.name}}); |
| 45 {%- endif %} | 45 {%- endif %} |
| 46 {%- endfor %} | 46 {%- endfor %} |
| 47 mojo::Message message; | 47 mojo::Message message; |
| 48 params->EncodePointersAndHandles(message.mutable_handles()); | 48 params->EncodePointersAndHandles(message.mutable_handles()); |
| 49 builder.Finish(&message); | 49 builder.Finish(&message); |
| 50 {%- endmacro %} | 50 {%- endmacro %} |
| 51 | 51 |
| 52 {#--- Begin #} |
| 53 |
| 54 {#--- Constants #} |
| 55 {% for constant in interface.constants %} |
| 56 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}} = {{c
onstant.value|expression_to_text(module)}}; |
| 57 {%- endfor %} |
| 58 |
| 52 {#--- ForwardToCallback definition #} | 59 {#--- ForwardToCallback definition #} |
| 53 {%- for method in interface.methods -%} | 60 {%- for method in interface.methods -%} |
| 54 {%- if method.response_parameters != None %} | 61 {%- if method.response_parameters != None %} |
| 55 class {{class_name}}_{{method.name}}_ForwardToCallback | 62 class {{class_name}}_{{method.name}}_ForwardToCallback |
| 56 : public mojo::MessageReceiver { | 63 : public mojo::MessageReceiver { |
| 57 public: | 64 public: |
| 58 {{class_name}}_{{method.name}}_ForwardToCallback( | 65 {{class_name}}_{{method.name}}_ForwardToCallback( |
| 59 const {{interface_macros.declare_callback(method)}}& callback) | 66 const {{interface_macros.declare_callback(method)}}& callback) |
| 60 : callback_(callback) { | 67 : callback_(callback) { |
| 61 } | 68 } |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 return true; | 226 return true; |
| 220 {%- else %} | 227 {%- else %} |
| 221 break; | 228 break; |
| 222 {%- endif %} | 229 {%- endif %} |
| 223 } | 230 } |
| 224 {%- endfor %} | 231 {%- endfor %} |
| 225 } | 232 } |
| 226 {%- endif %} | 233 {%- endif %} |
| 227 return false; | 234 return false; |
| 228 } | 235 } |
| OLD | NEW |