| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 {%- set header_guard = "%s_H_"| | 5 {%- set header_guard = "%s_H_"| |
| 6 format(module.path|upper|replace("/","_")|replace(".","_")) %} | 6 format(module.path|upper|replace("/","_")|replace(".","_")) %} |
| 7 | 7 |
| 8 #ifndef {{header_guard}} | 8 #ifndef {{header_guard}} |
| 9 #define {{header_guard}} | 9 #define {{header_guard}} |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 {#--- Struct Forward Declarations -#} | 46 {#--- Struct Forward Declarations -#} |
| 47 {% for struct in structs %} | 47 {% for struct in structs %} |
| 48 class {{struct.name}}; | 48 class {{struct.name}}; |
| 49 {% if struct|should_inline %} | 49 {% if struct|should_inline %} |
| 50 typedef mojo::InlinedStructPtr<{{struct.name}}> {{struct.name}}Ptr; | 50 typedef mojo::InlinedStructPtr<{{struct.name}}> {{struct.name}}Ptr; |
| 51 {% else %} | 51 {% else %} |
| 52 typedef mojo::StructPtr<{{struct.name}}> {{struct.name}}Ptr; | 52 typedef mojo::StructPtr<{{struct.name}}> {{struct.name}}Ptr; |
| 53 {% endif %} | 53 {% endif %} |
| 54 {% endfor %} | 54 {% endfor %} |
| 55 | 55 |
| 56 {#--- Union Forward Declarations -#} | |
| 57 {% for union in unions %} | |
| 58 class {{union.name}}; | |
| 59 {% if union|should_inline %} | |
| 60 typedef mojo::InlinedStructPtr<{{union.name}}> {{union.name}}Ptr; | |
| 61 {% else %} | |
| 62 typedef mojo::StructPtr<{{union.name}}> {{union.name}}Ptr; | |
| 63 {% endif %} | |
| 64 {%- endfor %} | |
| 65 | |
| 66 {#--- NOTE: Non-inlined structs may have pointers to inlined structs, so we #} | 56 {#--- NOTE: Non-inlined structs may have pointers to inlined structs, so we #} |
| 67 {#--- need to fully define inlined structs ahead of the others. #} | 57 {#--- need to fully define inlined structs ahead of the others. #} |
| 68 | 58 |
| 69 {#--- Inlined structs #} | 59 {#--- Inlined structs #} |
| 70 {% for struct in structs %} | 60 {% for struct in structs %} |
| 71 {% if struct|should_inline %} | 61 {% if struct|should_inline %} |
| 72 {% include "wrapper_class_declaration.tmpl" %} | 62 {% include "wrapper_class_declaration.tmpl" %} |
| 73 {% endif %} | 63 {% endif %} |
| 74 {%- endfor %} | 64 {%- endfor %} |
| 75 | 65 |
| 76 {#--- Non-inlined structs #} | 66 {#--- Non-inlined structs #} |
| 77 {% for struct in structs %} | 67 {% for struct in structs %} |
| 78 {% if not struct|should_inline %} | 68 {% if not struct|should_inline %} |
| 79 {% include "wrapper_class_declaration.tmpl" %} | 69 {% include "wrapper_class_declaration.tmpl" %} |
| 80 {% endif %} | 70 {% endif %} |
| 81 {%- endfor %} | 71 {%- endfor %} |
| 82 | 72 |
| 83 {#--- Unions #} | |
| 84 {% for union in unions %} | |
| 85 {% include "wrapper_union_class_declaration.tmpl" %} | |
| 86 {%- endfor %} | |
| 87 | |
| 88 {#--- Interfaces -#} | 73 {#--- Interfaces -#} |
| 89 {% for interface in interfaces %} | 74 {% for interface in interfaces %} |
| 90 {% include "interface_declaration.tmpl" %} | 75 {% include "interface_declaration.tmpl" %} |
| 91 {%- endfor %} | 76 {%- endfor %} |
| 92 | 77 |
| 93 {#--- Interface Proxies -#} | 78 {#--- Interface Proxies -#} |
| 94 {% for interface in interfaces %} | 79 {% for interface in interfaces %} |
| 95 {% include "interface_proxy_declaration.tmpl" %} | 80 {% include "interface_proxy_declaration.tmpl" %} |
| 96 {%- endfor %} | 81 {%- endfor %} |
| 97 | 82 |
| 98 {#--- Interface Stubs -#} | 83 {#--- Interface Stubs -#} |
| 99 {% for interface in interfaces %} | 84 {% for interface in interfaces %} |
| 100 {% include "interface_stub_declaration.tmpl" %} | 85 {% include "interface_stub_declaration.tmpl" %} |
| 101 {%- endfor %} | 86 {%- endfor %} |
| 102 | 87 |
| 103 {#--- Interface Request Validators -#} | 88 {#--- Interface Request Validators -#} |
| 104 {% for interface in interfaces %} | 89 {% for interface in interfaces %} |
| 105 {% include "interface_request_validator_declaration.tmpl" %} | 90 {% include "interface_request_validator_declaration.tmpl" %} |
| 106 {%- endfor %} | 91 {%- endfor %} |
| 107 | 92 |
| 108 {#--- Interface Response Validators -#} | 93 {#--- Interface Response Validators -#} |
| 109 {% for interface in interfaces if interface|has_callbacks %} | 94 {% for interface in interfaces if interface|has_callbacks %} |
| 110 {% include "interface_response_validator_declaration.tmpl" %} | 95 {% include "interface_response_validator_declaration.tmpl" %} |
| 111 {%- endfor %} | 96 {%- endfor %} |
| 112 | 97 |
| 113 {%- import "serialization_macros.tmpl" as serialization_macros %} | |
| 114 {#--- Struct Serialization Helpers -#} | 98 {#--- Struct Serialization Helpers -#} |
| 115 {% if structs %} | 99 {% if structs %} |
| 116 {% for struct in structs %} | 100 {% for struct in structs %} |
| 117 {{ serialization_macros.declare_serialization(struct.name) }} | 101 {% include "struct_serialization_declaration.tmpl" %} |
| 118 {%- endfor %} | 102 {%- endfor %} |
| 119 {%- endif %} | 103 {%- endif %} |
| 120 | 104 |
| 121 {#--- Union Serialization Helpers -#} | |
| 122 {% if unions %} | |
| 123 {% for union in unions %} | |
| 124 {{ serialization_macros.declare_serialization(union.name) }} | |
| 125 {%- endfor %} | |
| 126 {%- endif %} | |
| 127 | |
| 128 {%- for namespace in namespaces_as_array|reverse %} | 105 {%- for namespace in namespaces_as_array|reverse %} |
| 129 } // namespace {{namespace}} | 106 } // namespace {{namespace}} |
| 130 {%- endfor %} | 107 {%- endfor %} |
| 131 | 108 |
| 132 #endif // {{header_guard}} | 109 #endif // {{header_guard}} |
| OLD | NEW |