OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 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 | 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, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #include "config.h" | 20 #include "config.h" |
21 | 21 |
22 #include "core/svg/SVGAnimatedNumberOptionalNumber.h" | 22 #include "core/svg/SVGAnimatedNumberOptionalNumber.h" |
23 | 23 |
24 namespace WebCore { | 24 namespace WebCore { |
25 | 25 |
26 SVGAnimatedNumberOptionalNumber::SVGAnimatedNumberOptionalNumber(SVGElement* con
textElement, const QualifiedName& attributeName, float initialFirstValue, float
initialSecondValue) | 26 SVGAnimatedNumberOptionalNumber::SVGAnimatedNumberOptionalNumber(SVGElement* con
textElement, const QualifiedName& attributeName, float initialFirstValue, float
initialSecondValue) |
27 : NewSVGAnimatedPropertyCommon<SVGNumberOptionalNumber>(contextElement, attr
ibuteName, | 27 : SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>(contextElement, attribu
teName, |
28 SVGNumberOptionalNumber::create(SVGNumber::create(initialFirstValue), SV
GNumber::create(initialSecondValue))) | 28 SVGNumberOptionalNumber::create(SVGNumber::create(initialFirstValue), SV
GNumber::create(initialSecondValue))) |
29 , m_firstNumber(SVGAnimatedNumber::create(contextElement, attributeName, bas
eValue()->firstNumber())) | 29 , m_firstNumber(SVGAnimatedNumber::create(contextElement, attributeName, bas
eValue()->firstNumber())) |
30 , m_secondNumber(SVGAnimatedNumber::create(contextElement, attributeName, ba
seValue()->secondNumber())) | 30 , m_secondNumber(SVGAnimatedNumber::create(contextElement, attributeName, ba
seValue()->secondNumber())) |
31 { | 31 { |
32 m_firstNumber->setParentOptionalNumber(this); | 32 m_firstNumber->setParentOptionalNumber(this); |
33 m_secondNumber->setParentOptionalNumber(this); | 33 m_secondNumber->setParentOptionalNumber(this); |
34 } | 34 } |
35 | 35 |
36 void SVGAnimatedNumberOptionalNumber::animationStarted() | 36 void SVGAnimatedNumberOptionalNumber::animationStarted() |
37 { | 37 { |
38 NewSVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::animationStarted(); | 38 SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::animationStarted(); |
39 m_firstNumber->animationStarted(); | 39 m_firstNumber->animationStarted(); |
40 m_secondNumber->animationStarted(); | 40 m_secondNumber->animationStarted(); |
41 } | 41 } |
42 | 42 |
43 void SVGAnimatedNumberOptionalNumber::setAnimatedValue(PassRefPtr<NewSVGProperty
Base> value) | 43 void SVGAnimatedNumberOptionalNumber::setAnimatedValue(PassRefPtr<SVGPropertyBas
e> value) |
44 { | 44 { |
45 NewSVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::setAnimatedValue(valu
e); | 45 SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::setAnimatedValue(value); |
46 m_firstNumber->setAnimatedValue(currentValue()->firstNumber()); | 46 m_firstNumber->setAnimatedValue(currentValue()->firstNumber()); |
47 m_secondNumber->setAnimatedValue(currentValue()->secondNumber()); | 47 m_secondNumber->setAnimatedValue(currentValue()->secondNumber()); |
48 } | 48 } |
49 | 49 |
50 void SVGAnimatedNumberOptionalNumber::animationEnded() | 50 void SVGAnimatedNumberOptionalNumber::animationEnded() |
51 { | 51 { |
52 NewSVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::animationEnded(); | 52 SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::animationEnded(); |
53 m_firstNumber->animationEnded(); | 53 m_firstNumber->animationEnded(); |
54 m_secondNumber->animationEnded(); | 54 m_secondNumber->animationEnded(); |
55 } | 55 } |
56 | 56 |
57 bool SVGAnimatedNumberOptionalNumber::needsSynchronizeAttribute() | 57 bool SVGAnimatedNumberOptionalNumber::needsSynchronizeAttribute() |
58 { | 58 { |
59 return m_firstNumber->needsSynchronizeAttribute() | 59 return m_firstNumber->needsSynchronizeAttribute() |
60 || m_secondNumber->needsSynchronizeAttribute(); | 60 || m_secondNumber->needsSynchronizeAttribute(); |
61 } | 61 } |
62 | 62 |
63 } | 63 } |
OLD | NEW |