OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 SVGElement*) override; | 69 SVGElement*) override; |
70 float calculateDistance(SVGPropertyBase* to, SVGElement*) override; | 70 float calculateDistance(SVGPropertyBase* to, SVGElement*) override; |
71 | 71 |
72 static AnimatedPropertyType classType() { return AnimatedEnumeration; } | 72 static AnimatedPropertyType classType() { return AnimatedEnumeration; } |
73 AnimatedPropertyType type() const override { return classType(); } | 73 AnimatedPropertyType type() const override { return classType(); } |
74 | 74 |
75 static unsigned short valueOfLastEnum(const StringEntries& entries) { | 75 static unsigned short valueOfLastEnum(const StringEntries& entries) { |
76 return entries.last().first; | 76 return entries.last().first; |
77 } | 77 } |
78 | 78 |
79 // This is the maximum value that is exposed as an IDL constant on the relevan
t interface. | 79 // This is the maximum value that is exposed as an IDL constant on the |
| 80 // relevant interface. |
80 unsigned short maxExposedEnumValue() const { return m_maxExposed; } | 81 unsigned short maxExposedEnumValue() const { return m_maxExposed; } |
81 | 82 |
82 protected: | 83 protected: |
83 SVGEnumerationBase(unsigned short value, | 84 SVGEnumerationBase(unsigned short value, |
84 const StringEntries& entries, | 85 const StringEntries& entries, |
85 unsigned short maxExposed) | 86 unsigned short maxExposed) |
86 : m_value(value), m_maxExposed(maxExposed), m_entries(entries) {} | 87 : m_value(value), m_maxExposed(maxExposed), m_entries(entries) {} |
87 | 88 |
88 // This is the maximum value of all the internal enumeration values. | 89 // This is the maximum value of all the internal enumeration values. |
89 // This assumes that |m_entries| are sorted. | 90 // This assumes that |m_entries| are sorted. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 protected: | 132 protected: |
132 explicit SVGEnumeration(Enum newValue) | 133 explicit SVGEnumeration(Enum newValue) |
133 : SVGEnumerationBase(newValue, | 134 : SVGEnumerationBase(newValue, |
134 getStaticStringEntries<Enum>(), | 135 getStaticStringEntries<Enum>(), |
135 getMaxExposedEnumValue<Enum>()) {} | 136 getMaxExposedEnumValue<Enum>()) {} |
136 }; | 137 }; |
137 | 138 |
138 } // namespace blink | 139 } // namespace blink |
139 | 140 |
140 #endif // SVGEnumeration_h | 141 #endif // SVGEnumeration_h |
OLD | NEW |