zimmermann@webkit.org | f08b5ba | 2010-10-30 13:23:55 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Library General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Library General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Library General Public License |
| 15 | * along with this library; see the file COPYING.LIB. If not, write to |
| 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
commit-queue@webkit.org | 46c0f52 | 2016-11-13 10:05:43 +0000 | [diff] [blame] | 20 | #pragma once |
zimmermann@webkit.org | f08b5ba | 2010-10-30 13:23:55 +0000 | [diff] [blame] | 21 | |
zimmermann@webkit.org | e5a72c6 | 2010-12-01 16:36:29 +0000 | [diff] [blame] | 22 | #include "SVGAnimatedPropertyMacros.h" |
krit@webkit.org | 1c0529c | 2010-12-22 12:25:23 +0000 | [diff] [blame] | 23 | #include "SVGAnimatedStaticPropertyTearOff.h" |
krit@webkit.org | ba28704 | 2011-06-23 17:42:16 +0000 | [diff] [blame] | 24 | #include "SVGAnimatedTypeAnimator.h" |
zimmermann@webkit.org | f08b5ba | 2010-10-30 13:23:55 +0000 | [diff] [blame] | 25 | |
| 26 | namespace WebCore { |
| 27 | |
| 28 | typedef SVGAnimatedStaticPropertyTearOff<float> SVGAnimatedNumber; |
| 29 | |
zimmermann@webkit.org | e5a72c6 | 2010-12-01 16:36:29 +0000 | [diff] [blame] | 30 | // Helper macros to declare/define a SVGAnimatedNumber object |
| 31 | #define DECLARE_ANIMATED_NUMBER(UpperProperty, LowerProperty) \ |
zandobersek@gmail.com | 7d97f1c | 2015-06-12 13:44:43 +0000 | [diff] [blame] | 32 | DECLARE_ANIMATED_PROPERTY(SVGAnimatedNumber, float, UpperProperty, LowerProperty, ) |
zimmermann@webkit.org | e5a72c6 | 2010-12-01 16:36:29 +0000 | [diff] [blame] | 33 | |
| 34 | #define DEFINE_ANIMATED_NUMBER(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \ |
commit-queue@webkit.org | afac005 | 2017-10-30 23:41:01 +0000 | [diff] [blame] | 35 | DEFINE_ANIMATED_PROPERTY(AnimatedNumber, OwnerType, DOMAttribute, DOMAttribute->localName(), UpperProperty, LowerProperty) |
zimmermann@webkit.org | e5a72c6 | 2010-12-01 16:36:29 +0000 | [diff] [blame] | 36 | |
| 37 | #define DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) \ |
zimmermann@webkit.org | a285742 | 2011-07-09 11:26:10 +0000 | [diff] [blame] | 38 | DEFINE_ANIMATED_PROPERTY(AnimatedNumberOptionalNumber, OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) |
zimmermann@webkit.org | e5a72c6 | 2010-12-01 16:36:29 +0000 | [diff] [blame] | 39 | |
krit@webkit.org | ba28704 | 2011-06-23 17:42:16 +0000 | [diff] [blame] | 40 | class SVGAnimationElement; |
| 41 | |
andersca@apple.com | 16d2dd4 | 2014-01-16 23:08:24 +0000 | [diff] [blame] | 42 | class SVGAnimatedNumberAnimator final : public SVGAnimatedTypeAnimator { |
krit@webkit.org | c589d8c | 2011-06-19 20:11:24 +0000 | [diff] [blame] | 43 | public: |
krit@webkit.org | ba28704 | 2011-06-23 17:42:16 +0000 | [diff] [blame] | 44 | SVGAnimatedNumberAnimator(SVGAnimationElement*, SVGElement*); |
paroga@webkit.org | 09d08d6 | 2011-06-30 11:41:14 +0000 | [diff] [blame] | 45 | |
darin@apple.com | 11ff47c | 2016-03-04 16:47:55 +0000 | [diff] [blame] | 46 | std::unique_ptr<SVGAnimatedType> constructFromString(const String&) override; |
| 47 | std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) override; |
| 48 | void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) override; |
| 49 | void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) override; |
| 50 | void animValWillChange(const SVGElementAnimatedPropertyList&) override; |
| 51 | void animValDidChange(const SVGElementAnimatedPropertyList&) override; |
paroga@webkit.org | 09d08d6 | 2011-06-30 11:41:14 +0000 | [diff] [blame] | 52 | |
darin@apple.com | 11ff47c | 2016-03-04 16:47:55 +0000 | [diff] [blame] | 53 | void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) override; |
| 54 | void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) override; |
| 55 | float calculateDistance(const String& fromString, const String& toString) override; |
krit@webkit.org | c589d8c | 2011-06-19 20:11:24 +0000 | [diff] [blame] | 56 | }; |
paroga@webkit.org | 09d08d6 | 2011-06-30 11:41:14 +0000 | [diff] [blame] | 57 | |
zimmermann@webkit.org | f08b5ba | 2010-10-30 13:23:55 +0000 | [diff] [blame] | 58 | } // namespace WebCore |