Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl

Issue 268363003: Mojo: Add support for constants to the IDL compiler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: JS export constants Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 {%- import "interface_macros.tmpl" as interface_macros %} 1 {%- import "interface_macros.tmpl" as interface_macros %}
2 class {{interface.name}}Proxy; 2 class {{interface.name}}Proxy;
3 class {{interface.name}}Stub; 3 class {{interface.name}}Stub;
4 {% if interface.peer %} 4 {% if interface.peer %}
5 class {{interface.peer}}; 5 class {{interface.peer}};
6 {% endif %} 6 {% endif %}
7 7
8 class {{interface.name}} { 8 class {{interface.name}} {
9 public: 9 public:
10 typedef {{interface.name}}Proxy _Proxy; 10 typedef {{interface.name}}Proxy _Proxy;
11 typedef {{interface.name}}Stub _Stub; 11 typedef {{interface.name}}Stub _Stub;
12 {% if interface.peer %} 12 {% if interface.peer %}
13 typedef {{interface.peer}} _Peer; 13 typedef {{interface.peer}} _Peer;
14 {% else %} 14 {% else %}
15 typedef mojo::NoInterface _Peer; 15 typedef mojo::NoInterface _Peer;
16 {% endif %} 16 {% endif %}
17 17
18 {#--- Constants #}
19 {%- for constant in interface.constants %}
20 static const {{constant.kind|cpp_pod_type}} {{constant.name}};
21 {%- endfor %}
22
18 {#--- Enums #} 23 {#--- Enums #}
19 {%- for enum in interface.enums %} 24 {%- for enum in interface.enums %}
20 {% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %} 25 {% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %}
21 {{enum_def()|indent(2)}} 26 {{enum_def()|indent(2)}}
22 {%- endfor %} 27 {%- endfor %}
23 28
24 {#--- Methods #} 29 {#--- Methods #}
25 {%- for method in interface.methods %} 30 {%- for method in interface.methods %}
26 virtual void {{method.name}}({{interface_macros.declare_request_params("", met hod)}}) = 0; 31 virtual void {{method.name}}({{interface_macros.declare_request_params("", met hod)}}) = 0;
27 {%- endfor %} 32 {%- endfor %}
28 }; 33 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698