| OLD | NEW |
| 1 {%- import "interface_macros.tmpl" as interface_macros %} | 1 {%- import "interface_macros.tmpl" as interface_macros %} |
| 2 {%- import "struct_macros.tmpl" as struct_macros %} | 2 {%- import "struct_macros.tmpl" as struct_macros %} |
| 3 {%- from "enum_macros.tmpl" import is_valid_enum_def %} | 3 {%- from "enum_macros.tmpl" import is_valid_enum_def %} |
| 4 {%- from "enum_macros.tmpl" import global_enum_operators_def %} |
| 4 | 5 |
| 5 {%- set class_name = interface.name %} | 6 {%- set class_name = interface.name %} |
| 6 {%- set proxy_name = interface.name ~ "Proxy" %} | 7 {%- set proxy_name = interface.name ~ "Proxy" %} |
| 7 {%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %} | 8 {%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %} |
| 8 | 9 |
| 9 {%- macro alloc_params(struct) %} | 10 {%- macro alloc_params(struct) %} |
| 10 {%- for param in struct.packed.packed_fields_in_ordinal_order %} | 11 {%- for param in struct.packed.packed_fields_in_ordinal_order %} |
| 11 {{param.field.kind|cpp_result_type}} p_{{param.field.name}} {}; | 12 {{param.field.kind|cpp_result_type}} p_{{param.field.name}} {}; |
| 12 {%- endfor %} | 13 {%- endfor %} |
| 13 {{struct_macros.deserialize(struct, "params", "p_%s")}} | 14 {{struct_macros.deserialize(struct, "params", "p_%s")}} |
| (...skipping 23 matching lines...) Expand all Loading... |
| 37 {%- for constant in interface.constants %} | 38 {%- for constant in interface.constants %} |
| 38 {%- if constant.kind|is_integral_kind %} | 39 {%- if constant.kind|is_integral_kind %} |
| 39 MOJO_STATIC_CONST_MEMBER_DEFINITION const {{constant.kind|cpp_pod_type}} {{inter
face.name}}::{{constant.name}}; | 40 MOJO_STATIC_CONST_MEMBER_DEFINITION const {{constant.kind|cpp_pod_type}} {{inter
face.name}}::{{constant.name}}; |
| 40 {%- else %} | 41 {%- else %} |
| 41 MOJO_STATIC_CONST_MEMBER_DEFINITION const {{constant.kind|cpp_pod_type}} {{inter
face.name}}::{{constant.name}} = {{constant|constant_value}}; | 42 MOJO_STATIC_CONST_MEMBER_DEFINITION const {{constant.kind|cpp_pod_type}} {{inter
face.name}}::{{constant.name}} = {{constant|constant_value}}; |
| 42 {%- endif %} | 43 {%- endif %} |
| 43 {%- endfor %} | 44 {%- endfor %} |
| 44 | 45 |
| 45 {#--- Enums #} | 46 {#--- Enums #} |
| 46 {%- for enum in interface.enums %} | 47 {%- for enum in interface.enums %} |
| 47 {{is_valid_enum_def(enum, class_name=interface.name)|indent(2)}} | 48 {{is_valid_enum_def(enum, class_name=interface.name)}} |
| 49 {{global_enum_operators_def(enum, class_name=interface.name)}} |
| 48 {%- endfor %} | 50 {%- endfor %} |
| 49 | 51 |
| 50 {#--- ForwardToCallback definition #} | 52 {#--- ForwardToCallback definition #} |
| 51 {%- for method in interface.methods -%} | 53 {%- for method in interface.methods -%} |
| 52 {%- if method.response_parameters != None %} | 54 {%- if method.response_parameters != None %} |
| 53 class {{class_name}}_{{method.name}}_ForwardToCallback | 55 class {{class_name}}_{{method.name}}_ForwardToCallback |
| 54 : public mojo::MessageReceiver { | 56 : public mojo::MessageReceiver { |
| 55 public: | 57 public: |
| 56 {{class_name}}_{{method.name}}_ForwardToCallback( | 58 {{class_name}}_{{method.name}}_ForwardToCallback( |
| 57 const {{class_name}}::{{method.name}}Callback& callback) | 59 const {{class_name}}::{{method.name}}Callback& callback) |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 default: | 315 default: |
| 314 break; | 316 break; |
| 315 } | 317 } |
| 316 | 318 |
| 317 // Unrecognized message. | 319 // Unrecognized message. |
| 318 ReportValidationError( | 320 ReportValidationError( |
| 319 mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD); | 321 mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD); |
| 320 return false; | 322 return false; |
| 321 } | 323 } |
| 322 {%- endif -%} | 324 {%- endif -%} |
| OLD | NEW |