OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. 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 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 virtual ListProperty* animVal() | 50 virtual ListProperty* animVal() |
51 { | 51 { |
52 if (!m_animVal) | 52 if (!m_animVal) |
53 m_animVal = ListPropertyTearOff::create(this, AnimValRole, m_values,
m_wrappers); | 53 m_animVal = ListPropertyTearOff::create(this, AnimValRole, m_values,
m_wrappers); |
54 return static_cast<ListProperty*>(m_animVal.get()); | 54 return static_cast<ListProperty*>(m_animVal.get()); |
55 } | 55 } |
56 | 56 |
57 virtual bool isAnimatedListTearOff() const { return true; } | 57 virtual bool isAnimatedListTearOff() const { return true; } |
58 | 58 |
59 int removeItemFromList(SVGProperty* property, bool shouldSynchronizeWrappers
) | 59 int findItem(SVGProperty* property) const |
60 { | 60 { |
61 // This should ever be called for our baseVal, as animVal can't modify t
he list. | 61 // This should ever be called for our baseVal, as animVal can't modify t
he list. |
62 // It's safe to cast to ListPropertyTearOff here as all classes inheriti
ng from us supply their own removeItemFromList() method. | 62 // It's safe to cast to ListPropertyTearOff here as all classes inheriti
ng from us supply their own removeItemFromList() method. |
63 typedef SVGPropertyTearOff<typename SVGPropertyTraits<PropertyType>::Lis
tItemType> ListItemTearOff; | 63 typedef SVGPropertyTearOff<typename SVGPropertyTraits<PropertyType>::Lis
tItemType> ListItemTearOff; |
64 return static_cast<ListPropertyTearOff*>(m_baseVal.get())->removeItemFro
mList(static_cast<ListItemTearOff*>(property), shouldSynchronizeWrappers); | 64 return static_cast<ListPropertyTearOff*>(m_baseVal.get())->findItem(stat
ic_cast<ListItemTearOff*>(property)); |
| 65 } |
| 66 |
| 67 void removeItemFromList(size_t itemIndex, bool shouldSynchronizeWrappers) |
| 68 { |
| 69 // This should ever be called for our baseVal, as animVal can't modify t
he list. |
| 70 // It's safe to cast to ListPropertyTearOff here as all classes inheriti
ng from us supply their own removeItemFromList() method. |
| 71 static_cast<ListPropertyTearOff*>(m_baseVal.get())->removeItemFromList(i
temIndex, shouldSynchronizeWrappers); |
65 } | 72 } |
66 | 73 |
67 void detachListWrappers(unsigned newListSize) | 74 void detachListWrappers(unsigned newListSize) |
68 { | 75 { |
69 ListProperty::detachListWrappersAndResize(&m_wrappers, newListSize); | 76 ListProperty::detachListWrappersAndResize(&m_wrappers, newListSize); |
70 } | 77 } |
71 | 78 |
72 PropertyType& currentAnimatedValue() | 79 PropertyType& currentAnimatedValue() |
73 { | 80 { |
74 ASSERT(m_isAnimating); | 81 ASSERT(m_isAnimating); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 ListWrapperCache m_animatedWrappers; | 175 ListWrapperCache m_animatedWrappers; |
169 | 176 |
170 RefPtr<SVGProperty> m_baseVal; | 177 RefPtr<SVGProperty> m_baseVal; |
171 RefPtr<SVGProperty> m_animVal; | 178 RefPtr<SVGProperty> m_animVal; |
172 }; | 179 }; |
173 | 180 |
174 } | 181 } |
175 | 182 |
176 #endif // ENABLE(SVG) | 183 #endif // ENABLE(SVG) |
177 #endif // SVGAnimatedListPropertyTearOff_h | 184 #endif // SVGAnimatedListPropertyTearOff_h |
OLD | NEW |