| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 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 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2008 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2008 Cameron McCormack <cam@mcc.id.au> |
| 7 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| 11 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
| 12 * version 2 of the License, or (at your option) any later version. | 12 * version 2 of the License, or (at your option) any later version. |
| 13 * | 13 * |
| 14 * This library is distributed in the hope that it will be useful, | 14 * This library is distributed in the hope that it will be useful, |
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 * Library General Public License for more details. | 17 * Library General Public License for more details. |
| 18 * | 18 * |
| 19 * You should have received a copy of the GNU Library General Public License | 19 * You should have received a copy of the GNU Library General Public License |
| 20 * along with this library; see the file COPYING.LIB. If not, write to | 20 * along with this library; see the file COPYING.LIB. If not, write to |
| 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef SVGAnimationElement_h | 25 #ifndef SVGAnimationElement_h |
| 26 #define SVGAnimationElement_h | 26 #define SVGAnimationElement_h |
| 27 | 27 |
| 28 #include "core/svg/SVGAnimatedBoolean.h" | 28 #include "core/svg/SVGAnimatedBoolean.h" |
| 29 #include "core/svg/SVGExternalResourcesRequired.h" | |
| 30 #include "core/svg/SVGTests.h" | 29 #include "core/svg/SVGTests.h" |
| 31 #include "core/svg/animation/SVGSMILElement.h" | 30 #include "core/svg/animation/SVGSMILElement.h" |
| 32 #include "platform/animation/UnitBezier.h" | 31 #include "platform/animation/UnitBezier.h" |
| 33 | 32 |
| 34 namespace WebCore { | 33 namespace WebCore { |
| 35 | 34 |
| 36 enum AnimationMode { | 35 enum AnimationMode { |
| 37 NoAnimation, | 36 NoAnimation, |
| 38 FromToAnimation, | 37 FromToAnimation, |
| 39 FromByAnimation, | 38 FromByAnimation, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 56 CalcModeLinear, | 55 CalcModeLinear, |
| 57 CalcModePaced, | 56 CalcModePaced, |
| 58 CalcModeSpline | 57 CalcModeSpline |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 class ConditionEventListener; | 60 class ConditionEventListener; |
| 62 class TimeContainer; | 61 class TimeContainer; |
| 63 class SVGAnimatedType; | 62 class SVGAnimatedType; |
| 64 | 63 |
| 65 class SVGAnimationElement : public SVGSMILElement, | 64 class SVGAnimationElement : public SVGSMILElement, |
| 66 public SVGTests, | 65 public SVGTests { |
| 67 public SVGExternalResourcesRequired { | |
| 68 public: | 66 public: |
| 69 // SVGAnimationElement | 67 // SVGAnimationElement |
| 70 float getStartTime() const; | 68 float getStartTime() const; |
| 71 float getCurrentTime() const; | 69 float getCurrentTime() const; |
| 72 float getSimpleDuration() const; | 70 float getSimpleDuration() const; |
| 73 | 71 |
| 74 void beginElement(); | 72 void beginElement(); |
| 75 void beginElementAt(float offset); | 73 void beginElementAt(float offset); |
| 76 void endElement(); | 74 void endElement(); |
| 77 void endElementAt(float offset); | 75 void endElementAt(float offset); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 float calculatePercentFromKeyPoints(float percent) const; | 214 float calculatePercentFromKeyPoints(float percent) const; |
| 217 void currentValuesFromKeyPoints(float percent, float& effectivePercent, Stri
ng& from, String& to) const; | 215 void currentValuesFromKeyPoints(float percent, float& effectivePercent, Stri
ng& from, String& to) const; |
| 218 float calculatePercentForSpline(float percent, unsigned splineIndex) const; | 216 float calculatePercentForSpline(float percent, unsigned splineIndex) const; |
| 219 float calculatePercentForFromTo(float percent) const; | 217 float calculatePercentForFromTo(float percent) const; |
| 220 unsigned calculateKeyTimesIndex(float percent) const; | 218 unsigned calculateKeyTimesIndex(float percent) const; |
| 221 | 219 |
| 222 void applyAnimatedValue(ShouldApplyAnimation, SVGElement* targetElement, con
st QualifiedName& attributeName, SVGAnimatedType*); | 220 void applyAnimatedValue(ShouldApplyAnimation, SVGElement* targetElement, con
st QualifiedName& attributeName, SVGAnimatedType*); |
| 223 void adjustForInheritance(SVGElement* targetElement, const QualifiedName& at
tributeName, String&); | 221 void adjustForInheritance(SVGElement* targetElement, const QualifiedName& at
tributeName, String&); |
| 224 | 222 |
| 225 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAnimationElement) | 223 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAnimationElement) |
| 226 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesReq
uired) | |
| 227 END_DECLARE_ANIMATED_PROPERTIES | 224 END_DECLARE_ANIMATED_PROPERTIES |
| 228 | 225 |
| 229 // SVGTests | 226 // SVGTests |
| 230 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFe
atures(this); } | 227 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFe
atures(this); } |
| 231 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequired
Extensions(this); } | 228 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequired
Extensions(this); } |
| 232 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLangua
ge(this); } | 229 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLangua
ge(this); } |
| 233 | 230 |
| 234 void setCalcMode(const AtomicString&); | 231 void setCalcMode(const AtomicString&); |
| 235 | 232 |
| 236 bool m_animationValid; | 233 bool m_animationValid; |
| 237 | 234 |
| 238 AttributeType m_attributeType; | 235 AttributeType m_attributeType; |
| 239 Vector<String> m_values; | 236 Vector<String> m_values; |
| 240 // FIXME: We should probably use doubles for this, but there's no point | 237 // FIXME: We should probably use doubles for this, but there's no point |
| 241 // making such a change unless all SVG logic for sampling animations is | 238 // making such a change unless all SVG logic for sampling animations is |
| 242 // changed to use doubles. | 239 // changed to use doubles. |
| 243 Vector<float> m_keyTimes; | 240 Vector<float> m_keyTimes; |
| 244 Vector<float> m_keyPoints; | 241 Vector<float> m_keyPoints; |
| 245 Vector<UnitBezier> m_keySplines; | 242 Vector<UnitBezier> m_keySplines; |
| 246 String m_lastValuesAnimationFrom; | 243 String m_lastValuesAnimationFrom; |
| 247 String m_lastValuesAnimationTo; | 244 String m_lastValuesAnimationTo; |
| 248 bool m_hasInvalidCSSAttributeType; | 245 bool m_hasInvalidCSSAttributeType; |
| 249 CalcMode m_calcMode; | 246 CalcMode m_calcMode; |
| 250 AnimationMode m_animationMode; | 247 AnimationMode m_animationMode; |
| 251 }; | 248 }; |
| 252 | 249 |
| 253 } // namespace WebCore | 250 } // namespace WebCore |
| 254 | 251 |
| 255 #endif // SVGAnimationElement_h | 252 #endif // SVGAnimationElement_h |
| OLD | NEW |