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 = "MOJO_GENERATED_BINDINGS_%s_%s_H_"| | 5 {%- set header_guard = "MOJO_GENERATED_BINDINGS_%s_%s_H_"| |
6 format(module_name|upper, module_name|upper) %} | 6 format(module_name|upper, module_name|upper) %} |
7 | 7 |
8 #ifndef {{header_guard}} | 8 #ifndef {{header_guard}} |
9 #define {{header_guard}} | 9 #define {{header_guard}} |
10 | 10 |
11 #include "mojo/public/bindings/lib/bindings.h" | 11 #include "mojo/public/bindings/lib/bindings.h" |
12 #include "mojo/public/bindings/lib/message.h" | 12 #include "mojo/public/bindings/lib/message.h" |
13 #include "./{{module_name|camel_to_underscores}}_internal.h" | 13 #include "./{{module_name|camel_to_underscores}}_internal.h" |
14 | 14 |
15 namespace {{namespace}} { | 15 namespace {{namespace}} { |
16 | 16 |
17 {#--- Enums #} | 17 {#--- Enums #} |
18 {%- for enum in enums %} | 18 {% for enum in enums %} |
19 | 19 {% include "enum_declaration.tmpl" %} |
20 enum {{enum.name}} { | |
21 {%- for field in enum.fields %} | |
22 {%- if field.value %} | |
23 {{field.name}} = {{field.value}}, | |
24 {%- else %} | |
25 {{field.name}}, | |
26 {%- endif %} | |
27 {%- endfor %} | |
28 }; | |
29 {%- endfor %} | 20 {%- endfor %} |
30 | 21 |
31 {#--- Structs #} | 22 {#--- Structs #} |
32 {% for struct in structs %} | 23 {% for struct in structs %} |
33 {% include "wrapper_class_declaration.tmpl" -%} | 24 {% include "wrapper_class_declaration.tmpl" %} |
34 {%- endfor %} | 25 {%- endfor %} |
35 | 26 |
36 {#--- Interfaces -#} | 27 {#--- Interfaces -#} |
37 {% for interface in interfaces %} | 28 {% for interface in interfaces %} |
38 {% include "interface_declaration.tmpl" -%} | 29 {% include "interface_declaration.tmpl" %} |
39 {%- endfor %} | 30 {%- endfor %} |
40 | 31 |
41 {#--- Interface Proxies -#} | 32 {#--- Interface Proxies -#} |
42 {% for interface in interfaces %} | 33 {% for interface in interfaces %} |
43 {% include "interface_proxy_declaration.tmpl" -%} | 34 {% include "interface_proxy_declaration.tmpl" %} |
44 {%- endfor %} | 35 {%- endfor %} |
45 | 36 |
46 {#--- Interface Stubs -#} | 37 {#--- Interface Stubs -#} |
47 {% for interface in interfaces %} | 38 {% for interface in interfaces %} |
48 {% include "interface_stub_declaration.tmpl" -%} | 39 {% include "interface_stub_declaration.tmpl" %} |
49 {%- endfor %} | 40 {%- endfor %} |
50 | 41 |
51 } // namespace {{namespace}} | 42 } // namespace {{namespace}} |
52 | 43 |
53 #endif // {{header_guard}} | 44 #endif // {{header_guard}} |
OLD | NEW |