OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 || unitType == LengthTypeCHS; | 100 || unitType == LengthTypeCHS; |
101 } | 101 } |
102 inline bool isRelative() const { return isRelativeUnit(unitType()); } | 102 inline bool isRelative() const { return isRelativeUnit(unitType()); } |
103 | 103 |
104 bool isZero() const | 104 bool isZero() const |
105 { | 105 { |
106 return !m_valueInSpecifiedUnits; | 106 return !m_valueInSpecifiedUnits; |
107 } | 107 } |
108 | 108 |
109 static PassRefPtrWillBeRawPtr<SVGLength> fromCSSPrimitiveValue(CSSPrimitiveV
alue*); | 109 static PassRefPtrWillBeRawPtr<SVGLength> fromCSSPrimitiveValue(CSSPrimitiveV
alue*); |
110 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> toCSSPrimitiveValue(PassRef
PtrWillBeRawPtr<SVGLength>); | 110 static CSSPrimitiveValue toCSSPrimitiveValue(PassRefPtrWillBeRawPtr<SVGLengt
h>); |
111 static SVGLengthMode lengthModeForAnimatedLengthAttribute(const QualifiedNam
e&); | 111 static SVGLengthMode lengthModeForAnimatedLengthAttribute(const QualifiedNam
e&); |
112 | 112 |
113 PassRefPtrWillBeRawPtr<SVGLength> blend(PassRefPtrWillBeRawPtr<SVGLength> fr
om, float progress) const; | 113 PassRefPtrWillBeRawPtr<SVGLength> blend(PassRefPtrWillBeRawPtr<SVGLength> fr
om, float progress) const; |
114 | 114 |
115 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 115 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; |
116 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement* contextElement) override; | 116 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement* contextElement) override; |
117 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt* contextElement) override; | 117 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt* contextElement) override; |
118 | 118 |
119 static AnimatedPropertyType classType() { return AnimatedLength; } | 119 static AnimatedPropertyType classType() { return AnimatedLength; } |
120 | 120 |
121 private: | 121 private: |
122 SVGLength(SVGLengthMode); | 122 SVGLength(SVGLengthMode); |
123 SVGLength(const SVGLength&); | 123 SVGLength(const SVGLength&); |
124 | 124 |
125 float m_valueInSpecifiedUnits; | 125 float m_valueInSpecifiedUnits; |
126 unsigned m_unitMode : 2; | 126 unsigned m_unitMode : 2; |
127 unsigned m_unitType : 4; | 127 unsigned m_unitType : 4; |
128 }; | 128 }; |
129 | 129 |
130 inline PassRefPtrWillBeRawPtr<SVGLength> toSVGLength(PassRefPtrWillBeRawPtr<SVGP
ropertyBase> passBase) | 130 inline PassRefPtrWillBeRawPtr<SVGLength> toSVGLength(PassRefPtrWillBeRawPtr<SVGP
ropertyBase> passBase) |
131 { | 131 { |
132 RefPtrWillBeRawPtr<SVGPropertyBase> base = passBase; | 132 RefPtrWillBeRawPtr<SVGPropertyBase> base = passBase; |
133 ASSERT(base->type() == SVGLength::classType()); | 133 ASSERT(base->type() == SVGLength::classType()); |
134 return static_pointer_cast<SVGLength>(base.release()); | 134 return static_pointer_cast<SVGLength>(base.release()); |
135 } | 135 } |
136 | 136 |
137 } // namespace blink | 137 } // namespace blink |
138 | 138 |
139 #endif // SVGLength_h | 139 #endif // SVGLength_h |
OLD | NEW |