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 |
11 #include "mojo/public/cpp/bindings/array.h" | 11 #include "mojo/public/cpp/bindings/array.h" |
12 #include "mojo/public/cpp/bindings/callback.h" | 12 #include "mojo/public/cpp/bindings/callback.h" |
13 #include "mojo/public/cpp/bindings/interface.h" | 13 #include "mojo/public/cpp/bindings/interface.h" |
| 14 #include "mojo/public/cpp/bindings/interface_ptr.h" |
14 #include "{{module.path}}-internal.h" | 15 #include "{{module.path}}-internal.h" |
15 {%- for import in imports %} | 16 {%- for import in imports %} |
16 #include "{{import.module.path}}.h" | 17 #include "{{import.module.path}}.h" |
17 {%- endfor %} | 18 {%- endfor %} |
18 | 19 |
19 {%- for namespace in namespaces_as_array %} | 20 {%- for namespace in namespaces_as_array %} |
20 namespace {{namespace}} { | 21 namespace {{namespace}} { |
21 {%- endfor %} | 22 {%- endfor %} |
22 | 23 |
23 {#--- Enums #} | 24 {#--- Enums #} |
24 {% for enum in enums %} | 25 {% for enum in enums %} |
25 {% include "enum_declaration.tmpl" %} | 26 {% include "enum_declaration.tmpl" %} |
26 {%- endfor %} | 27 {%- endfor %} |
27 | 28 |
28 {#--- Interface Forward Declarations -#} | 29 {#--- Interface Forward Declarations -#} |
29 {% for interface in interfaces %} | 30 {% for interface in interfaces %} |
30 class {{interface.name}}; | 31 class {{interface.name}}; |
31 // A typesafe variant of MessagePipeHandle: | 32 typedef mojo::InterfacePtr<{{interface.name}}> {{interface.name}}Ptr; |
32 typedef mojo::Interface<{{interface.name}}>::Handle {{interface.name}}Handle; | |
33 // A typesafe variant of ScopedMessagePipeHandle: | |
34 typedef mojo::Interface<{{interface.name}}>::ScopedHandle Scoped{{interface.name
}}Handle; | |
35 {% endfor %} | 33 {% endfor %} |
36 | 34 |
37 {#--- Structs #} | 35 {#--- Structs #} |
38 {% for struct in structs %} | 36 {% for struct in structs %} |
39 {% include "wrapper_class_declaration.tmpl" %} | 37 {% include "wrapper_class_declaration.tmpl" %} |
40 {%- endfor %} | 38 {%- endfor %} |
41 | 39 |
42 {#--- Interfaces -#} | 40 {#--- Interfaces -#} |
43 {% for interface in interfaces %} | 41 {% for interface in interfaces %} |
44 {% include "interface_declaration.tmpl" %} | 42 {% include "interface_declaration.tmpl" %} |
(...skipping 18 matching lines...) Expand all Loading... |
63 namespace mojo { | 61 namespace mojo { |
64 namespace internal { | 62 namespace internal { |
65 {% for enum in enums %} | 63 {% for enum in enums %} |
66 {% include "enum_traits.tmpl" %} | 64 {% include "enum_traits.tmpl" %} |
67 {%- endfor %} | 65 {%- endfor %} |
68 } // namespace internal | 66 } // namespace internal |
69 } // namespace mojo | 67 } // namespace mojo |
70 {%- endif %} | 68 {%- endif %} |
71 | 69 |
72 #endif // {{header_guard}} | 70 #endif // {{header_guard}} |
OLD | NEW |