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

Side by Side Diff: Source/build/scripts/templates/SettingsMacros.h.tmpl

Issue 236673002: Simplify whitespace handling in build/ Jinja templates (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: One more FIXME Created 6 years, 8 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 {% from "macros.tmpl" import license -%} 1 {% from "macros.tmpl" import license %}
2 {{ license() }} 2 {{ license() }}
3 3
4 #ifndef SettingsMacros_h 4 #ifndef SettingsMacros_h
5 #define SettingsMacros_h 5 #define SettingsMacros_h
6 6
7 #define SETTINGS_GETTERS_AND_SETTERS \ 7 #define SETTINGS_GETTERS_AND_SETTERS \
8 {%- for setting in settings %} 8 {% for setting in settings %}
9 {{setting.type|to_passing_type}} {{setting.name}}() const { return m_{{setti ng.name}}; } \ 9 {{setting.type|to_passing_type}} {{setting.name}}() const { return m_{{setti ng.name}}; } \
10 void set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{sett ing.name}}); \ 10 void set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{sett ing.name}}); \
11 {%- endfor %} 11 {% endfor %}
12 // End of SETTINGS_GETTERS_AND_SETTERS. 12 // End of SETTINGS_GETTERS_AND_SETTERS.
13 13
14 #define SETTINGS_MEMBER_VARIABLES \ 14 #define SETTINGS_MEMBER_VARIABLES \
15 {%- for setting in settings if setting.type != "bool" %} 15 {% for setting in settings if setting.type != 'bool' %}
16 {{setting.type}} m_{{setting.name}}; \ 16 {{setting.type}} m_{{setting.name}}; \
17 {%- endfor %} 17 {% endfor %}
18 {%- for setting in settings if setting.type == "bool" %} 18 {% for setting in settings if setting.type == 'bool' %}
19 bool m_{{setting.name}} : 1; \ 19 bool m_{{setting.name}} : 1; \
20 {%- endfor %} 20 {% endfor %}
21 // End of SETTINGS_MEMBER_VARIABLES. 21 // End of SETTINGS_MEMBER_VARIABLES.
22 22
23 #define SETTINGS_INITIALIZER_LIST \ 23 #define SETTINGS_INITIALIZER_LIST \
24 {%- for setting in settings if setting.initial and setting.type != "bool" %} 24 {% for setting in settings if setting.initial and setting.type != 'bool' %}
25 , m_{{setting.name}}({{setting.initial}}) \ 25 , m_{{setting.name}}({{setting.initial}}) \
26 {%- endfor %} 26 {% endfor %}
27 {%- for setting in settings if setting.initial and setting.type == "bool" %} 27 {% for setting in settings if setting.initial and setting.type == 'bool' %}
28 , m_{{setting.name}}({{setting.initial}}) \ 28 , m_{{setting.name}}({{setting.initial}}) \
29 {%- endfor %} 29 {% endfor %}
30 // End of SETTINGS_INITIALIZER_LIST. 30 // End of SETTINGS_INITIALIZER_LIST.
31 31
32 #define SETTINGS_SETTER_BODIES \ 32 #define SETTINGS_SETTER_BODIES \
33 {%- for setting in settings %} 33 {% for setting in settings %}
34 void Settings::set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{setting.name}}) \ 34 void Settings::set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{setting.name}}) \
35 { \ 35 { \
36 if (m_{{setting.name}} == {{setting.name}}) \ 36 if (m_{{setting.name}} == {{setting.name}}) \
37 return; \ 37 return; \
38 m_{{setting.name}} = {{setting.name}}; \ 38 m_{{setting.name}} = {{setting.name}}; \
39 {%- if setting.invalidate %} 39 {% if setting.invalidate %}
40 invalidate(SettingsDelegate::{{setting.invalidate}}Change); \ 40 invalidate(SettingsDelegate::{{setting.invalidate}}Change); \
41 {%- endif %} 41 {% endif %}
42 } \ 42 } \
43 {%- endfor %} 43 {% endfor %}
44 // End of SETTINGS_SETTER_BODIES. 44 // End of SETTINGS_SETTER_BODIES.
45 45
46 #endif // SettingsMacros_h 46 #endif // SettingsMacros_h
OLDNEW
« no previous file with comments | « Source/build/scripts/templates/RuntimeEnabledFeatures.h.tmpl ('k') | Source/build/scripts/templates/StyleBuilder.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698