OLD | NEW |
1 {% from 'fields/field.tmpl' import encode, declare_storage, compare %} | 1 {% from 'fields/field.tmpl' import encode, declare_storage, compare %} |
2 {% from 'macros.tmpl' import print_if %} | 2 {% from 'macros.tmpl' import print_if %} |
3 {% macro declare_field_group_class(group): -%} | 3 {% macro declare_field_group_class(group): -%} |
4 class {{group.type_name}} : public RefCounted<{{group.type_name}}> { | 4 class {{group.type_name}} : public RefCounted<{{group.type_name}}> { |
5 public: | 5 public: |
6 static PassRefPtr<{{group.type_name}}> Create() { | 6 static PassRefPtr<{{group.type_name}}> Create() { |
7 return AdoptRef(new {{group.type_name}}); | 7 return AdoptRef(new {{group.type_name}}); |
8 } | 8 } |
9 PassRefPtr<{{group.type_name}}> Copy() const { | 9 PassRefPtr<{{group.type_name}}> Copy() const { |
10 return AdoptRef(new {{group.type_name}}(*this)); | 10 return AdoptRef(new {{group.type_name}}(*this)); |
11 } | 11 } |
12 | 12 |
13 bool operator==(const {{group.type_name}}& other) const { | 13 bool operator==(const {{group.type_name}}& other) const { |
14 return ( | 14 return ( |
15 {% for field in group.fields %} | 15 {% for field in group.fields if not field.custom_compare %} |
16 {{compare(field.wrapper_pointer_name, field.name, "other")}}{{print_if(not
loop.last, ' &&')}} | 16 {{compare(field.wrapper_pointer_name, field.name, "other")}}{{print_if(not
loop.last, ' &&')}} |
17 {% endfor %} | 17 {% endfor %} |
18 ); | 18 ); |
19 } | 19 } |
20 bool operator!=(const {{group.type_name}}& other) const { return !(*this == ot
her); } | 20 bool operator!=(const {{group.type_name}}& other) const { return !(*this == ot
her); } |
21 | 21 |
22 {% for field in group.fields %} | 22 {% for field in group.fields %} |
23 {{declare_storage(field)}} | 23 {{declare_storage(field)}} |
24 {% endfor %} | 24 {% endfor %} |
25 | 25 |
(...skipping 13 matching lines...) Expand all Loading... |
39 ComputedStyleBase::{{group.type_name}}::{{group.type_name}}(const {{group.type_n
ame}}& other) : | 39 ComputedStyleBase::{{group.type_name}}::{{group.type_name}}(const {{group.type_n
ame}}& other) : |
40 {% for field in group.fields %} | 40 {% for field in group.fields %} |
41 {% if field.wrapper_pointer_name %} | 41 {% if field.wrapper_pointer_name %} |
42 {{field.name}}(MemberCopy(other.{{field.name}})){{print_if(not loop.last,
',')}} | 42 {{field.name}}(MemberCopy(other.{{field.name}})){{print_if(not loop.last,
',')}} |
43 {% else %} | 43 {% else %} |
44 {{field.name}}(other.{{field.name}}){{print_if(not loop.last, ',')}} | 44 {{field.name}}(other.{{field.name}}){{print_if(not loop.last, ',')}} |
45 {% endif %} | 45 {% endif %} |
46 {% endfor %} | 46 {% endfor %} |
47 {} | 47 {} |
48 {%- endmacro %} | 48 {%- endmacro %} |
OLD | NEW |