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