OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> |
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
4 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 const SVGPropertyInfo* OwnerType::LowerProperty##PropertyInfo() { \ | 96 const SVGPropertyInfo* OwnerType::LowerProperty##PropertyInfo() { \ |
97 DEFINE_STATIC_LOCAL(const SVGPropertyInfo, s_propertyInfo, \ | 97 DEFINE_STATIC_LOCAL(const SVGPropertyInfo, s_propertyInfo, \ |
98 (AnimatedPropertyTypeEnum, \ | 98 (AnimatedPropertyTypeEnum, \ |
99 PropertyIsReadWrite, \ | 99 PropertyIsReadWrite, \ |
100 DOMAttribute, \ | 100 DOMAttribute, \ |
101 SVGDOMAttributeIdentifier, \ | 101 SVGDOMAttributeIdentifier, \ |
102 &OwnerType::synchronize##UpperProperty, \ | 102 &OwnerType::synchronize##UpperProperty, \ |
103 &OwnerType::lookupOrCreate##UpperProperty##Wrapper)); \ | 103 &OwnerType::lookupOrCreate##UpperProperty##Wrapper)); \ |
104 return &s_propertyInfo; \ | 104 return &s_propertyInfo; \ |
105 } \ | 105 } \ |
| 106 bool OwnerType::LowerProperty##Specified() const \ |
| 107 { \ |
| 108 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType,
TearOffType>(this, LowerProperty##PropertyInfo())) { \ |
| 109 if (wrapper->isAnimating()) \ |
| 110 return true; \ |
| 111 } \ |
| 112 return hasAttribute(SVGDOMAttributeIdentifier); \ |
| 113 } \ |
106 PropertyType& OwnerType::LowerProperty##CurrentValue() const \ | 114 PropertyType& OwnerType::LowerProperty##CurrentValue() const \ |
107 { \ | 115 { \ |
108 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType,
TearOffType>(this, LowerProperty##PropertyInfo())) { \ | 116 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType,
TearOffType>(this, LowerProperty##PropertyInfo())) { \ |
109 if (wrapper->isAnimating()) \ | 117 if (wrapper->isAnimating()) \ |
110 return wrapper->currentAnimatedValue(); \ | 118 return wrapper->currentAnimatedValue(); \ |
111 } \ | 119 } \ |
112 return m_##LowerProperty.value; \ | 120 return m_##LowerProperty.value; \ |
113 } \ | 121 } \ |
114 \ | 122 \ |
115 PropertyType& OwnerType::LowerProperty##BaseValue() const \ | 123 PropertyType& OwnerType::LowerProperty##BaseValue() const \ |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 #define BEGIN_DECLARE_ANIMATED_PROPERTIES(OwnerType) \ | 162 #define BEGIN_DECLARE_ANIMATED_PROPERTIES(OwnerType) \ |
155 public: \ | 163 public: \ |
156 static SVGAttributeToPropertyMap& attributeToPropertyMap(); \ | 164 static SVGAttributeToPropertyMap& attributeToPropertyMap(); \ |
157 virtual SVGAttributeToPropertyMap& localAttributeToPropertyMap() const; \ | 165 virtual SVGAttributeToPropertyMap& localAttributeToPropertyMap() const; \ |
158 void registerAnimatedPropertiesFor##OwnerType(); \ | 166 void registerAnimatedPropertiesFor##OwnerType(); \ |
159 typedef OwnerType UseOwnerType; | 167 typedef OwnerType UseOwnerType; |
160 | 168 |
161 #define DECLARE_ANIMATED_PROPERTY(TearOffType, PropertyType, UpperProperty, Lowe
rProperty) \ | 169 #define DECLARE_ANIMATED_PROPERTY(TearOffType, PropertyType, UpperProperty, Lowe
rProperty) \ |
162 public: \ | 170 public: \ |
163 static const SVGPropertyInfo* LowerProperty##PropertyInfo(); \ | 171 static const SVGPropertyInfo* LowerProperty##PropertyInfo(); \ |
| 172 bool LowerProperty##Specified() const; \ |
164 PropertyType& LowerProperty##CurrentValue() const; \ | 173 PropertyType& LowerProperty##CurrentValue() const; \ |
165 PropertyType& LowerProperty##BaseValue() const; \ | 174 PropertyType& LowerProperty##BaseValue() const; \ |
166 void set##UpperProperty##BaseValue(const PropertyType& type); \ | 175 void set##UpperProperty##BaseValue(const PropertyType& type); \ |
167 PassRefPtr<TearOffType> LowerProperty(); \ | 176 PassRefPtr<TearOffType> LowerProperty(); \ |
168 \ | 177 \ |
169 private: \ | 178 private: \ |
170 void synchronize##UpperProperty(); \ | 179 void synchronize##UpperProperty(); \ |
171 static PassRefPtr<SVGAnimatedProperty> lookupOrCreate##UpperProperty##Wrappe
r(SVGElement* maskedOwnerType); \ | 180 static PassRefPtr<SVGAnimatedProperty> lookupOrCreate##UpperProperty##Wrappe
r(SVGElement* maskedOwnerType); \ |
172 static void synchronize##UpperProperty(SVGElement* maskedOwnerType); \ | 181 static void synchronize##UpperProperty(SVGElement* maskedOwnerType); \ |
173 \ | 182 \ |
174 mutable SVGSynchronizableAnimatedProperty<PropertyType> m_##LowerProperty; | 183 mutable SVGSynchronizableAnimatedProperty<PropertyType> m_##LowerProperty; |
175 | 184 |
176 #define END_DECLARE_ANIMATED_PROPERTIES \ | 185 #define END_DECLARE_ANIMATED_PROPERTIES \ |
177 CleanUpAnimatedPropertiesCaller m_cleanupAnimatedPropertiesCaller; | 186 CleanUpAnimatedPropertiesCaller m_cleanupAnimatedPropertiesCaller; |
178 | 187 |
179 // List specific definition/declaration helpers | 188 // List specific definition/declaration helpers |
180 #define DECLARE_ANIMATED_LIST_PROPERTY(TearOffType, PropertyType, UpperProperty,
LowerProperty) \ | 189 #define DECLARE_ANIMATED_LIST_PROPERTY(TearOffType, PropertyType, UpperProperty,
LowerProperty) \ |
181 DECLARE_ANIMATED_PROPERTY(TearOffType, PropertyType, UpperProperty, LowerPropert
y) \ | 190 DECLARE_ANIMATED_PROPERTY(TearOffType, PropertyType, UpperProperty, LowerPropert
y) \ |
182 void detachAnimated##UpperProperty##ListWrappers(unsigned newListSize) \ | 191 void detachAnimated##UpperProperty##ListWrappers(unsigned newListSize) \ |
183 { \ | 192 { \ |
184 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType,
TearOffType>(this, LowerProperty##PropertyInfo())) \ | 193 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType,
TearOffType>(this, LowerProperty##PropertyInfo())) \ |
185 wrapper->detachListWrappers(newListSize); \ | 194 wrapper->detachListWrappers(newListSize); \ |
186 } | 195 } |
187 | 196 |
188 } | 197 } |
189 | 198 |
190 #endif // SVGAnimatedPropertyMacros_h | 199 #endif // SVGAnimatedPropertyMacros_h |
OLD | NEW |