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 #include "core/svg/SVGElement.h" |
| 25 |
24 namespace blink { | 26 namespace blink { |
25 | 27 |
26 SVGAnimatedNumberOptionalNumber::SVGAnimatedNumberOptionalNumber(SVGElement* con
textElement, const QualifiedName& attributeName, float initialFirstValue, float
initialSecondValue) | 28 SVGAnimatedNumberOptionalNumber::SVGAnimatedNumberOptionalNumber(SVGElement* con
textElement, const QualifiedName& attributeName, float initialFirstValue, float
initialSecondValue) |
27 : SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>(contextElement, attribu
teName, | 29 : SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>(contextElement, attribu
teName, |
28 SVGNumberOptionalNumber::create(SVGNumber::create(initialFirstValue), SV
GNumber::create(initialSecondValue))) | 30 SVGNumberOptionalNumber::create(SVGNumber::create(initialFirstValue), SV
GNumber::create(initialSecondValue))) |
29 , m_firstNumber(SVGAnimatedNumber::create(contextElement, attributeName, bas
eValue()->firstNumber())) | 31 , m_firstNumber(SVGAnimatedNumber::create(contextElement, attributeName, bas
eValue()->firstNumber())) |
30 , m_secondNumber(SVGAnimatedNumber::create(contextElement, attributeName, ba
seValue()->secondNumber())) | 32 , m_secondNumber(SVGAnimatedNumber::create(contextElement, attributeName, ba
seValue()->secondNumber())) |
31 { | 33 { |
32 m_firstNumber->setParentOptionalNumber(this); | 34 m_firstNumber->setParentOptionalNumber(this); |
33 m_secondNumber->setParentOptionalNumber(this); | 35 m_secondNumber->setParentOptionalNumber(this); |
34 } | 36 } |
35 | 37 |
36 void SVGAnimatedNumberOptionalNumber::setAnimatedValue(PassRefPtr<SVGPropertyBas
e> value) | 38 void SVGAnimatedNumberOptionalNumber::trace(Visitor* visitor) |
| 39 { |
| 40 visitor->trace(m_firstNumber); |
| 41 visitor->trace(m_secondNumber); |
| 42 SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::trace(visitor); |
| 43 } |
| 44 |
| 45 void SVGAnimatedNumberOptionalNumber::setAnimatedValue(PassRefPtrWillBeRawPtr<SV
GPropertyBase> value) |
37 { | 46 { |
38 SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::setAnimatedValue(value); | 47 SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::setAnimatedValue(value); |
39 m_firstNumber->setAnimatedValue(currentValue()->firstNumber()); | 48 m_firstNumber->setAnimatedValue(currentValue()->firstNumber()); |
40 m_secondNumber->setAnimatedValue(currentValue()->secondNumber()); | 49 m_secondNumber->setAnimatedValue(currentValue()->secondNumber()); |
41 } | 50 } |
42 | 51 |
43 void SVGAnimatedNumberOptionalNumber::animationEnded() | 52 void SVGAnimatedNumberOptionalNumber::animationEnded() |
44 { | 53 { |
45 SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::animationEnded(); | 54 SVGAnimatedPropertyCommon<SVGNumberOptionalNumber>::animationEnded(); |
46 m_firstNumber->animationEnded(); | 55 m_firstNumber->animationEnded(); |
47 m_secondNumber->animationEnded(); | 56 m_secondNumber->animationEnded(); |
48 } | 57 } |
49 | 58 |
50 bool SVGAnimatedNumberOptionalNumber::needsSynchronizeAttribute() | 59 bool SVGAnimatedNumberOptionalNumber::needsSynchronizeAttribute() |
51 { | 60 { |
52 return m_firstNumber->needsSynchronizeAttribute() | 61 return m_firstNumber->needsSynchronizeAttribute() |
53 || m_secondNumber->needsSynchronizeAttribute(); | 62 || m_secondNumber->needsSynchronizeAttribute(); |
54 } | 63 } |
55 | 64 |
56 } | 65 } |
OLD | NEW |