| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 Apple Inc. 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 30 matching lines...) Expand all Loading... |
| 41 { | 41 { |
| 42 setInvalid(); | 42 setInvalid(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 SVGRect::SVGRect(const FloatRect& rect) | 45 SVGRect::SVGRect(const FloatRect& rect) |
| 46 : m_isValid(true) | 46 : m_isValid(true) |
| 47 , m_value(rect) | 47 , m_value(rect) |
| 48 { | 48 { |
| 49 } | 49 } |
| 50 | 50 |
| 51 PassRefPtr<SVGRect> SVGRect::clone() const | 51 PassRefPtrWillBeRawPtr<SVGRect> SVGRect::clone() const |
| 52 { | 52 { |
| 53 return SVGRect::create(m_value); | 53 return SVGRect::create(m_value); |
| 54 } | 54 } |
| 55 | 55 |
| 56 template<typename CharType> | 56 template<typename CharType> |
| 57 void SVGRect::parse(const CharType*& ptr, const CharType* end, ExceptionState& e
xceptionState) | 57 void SVGRect::parse(const CharType*& ptr, const CharType* end, ExceptionState& e
xceptionState) |
| 58 { | 58 { |
| 59 const CharType* start = ptr; | 59 const CharType* start = ptr; |
| 60 | 60 |
| 61 skipOptionalSVGSpaces(ptr, end); | 61 skipOptionalSVGSpaces(ptr, end); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 builder.append(' '); | 118 builder.append(' '); |
| 119 builder.appendNumber(height()); | 119 builder.appendNumber(height()); |
| 120 return builder.toString(); | 120 return builder.toString(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void SVGRect::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*) | 123 void SVGRect::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*) |
| 124 { | 124 { |
| 125 m_value += toSVGRect(other)->value(); | 125 m_value += toSVGRect(other)->value(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void SVGRect::calculateAnimatedValue(SVGAnimationElement* animationElement, floa
t percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> fromValue, PassR
efPtr<SVGPropertyBase> toValue, PassRefPtr<SVGPropertyBase> toAtEndOfDurationVal
ue, SVGElement*) | 128 void SVGRect::calculateAnimatedValue(SVGAnimationElement* animationElement, floa
t percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from
Value, PassRefPtrWillBeRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<S
VGPropertyBase> toAtEndOfDurationValue, SVGElement*) |
| 129 { | 129 { |
| 130 ASSERT(animationElement); | 130 ASSERT(animationElement); |
| 131 RefPtr<SVGRect> fromRect = animationElement->animationMode() == ToAnimation
? this : toSVGRect(fromValue); | 131 RefPtrWillBeRawPtr<SVGRect> fromRect = animationElement->animationMode() ==
ToAnimation ? PassRefPtrWillBeRawPtr<SVGRect>(this) : toSVGRect(fromValue); |
| 132 RefPtr<SVGRect> toRect = toSVGRect(toValue); | 132 RefPtrWillBeRawPtr<SVGRect> toRect = toSVGRect(toValue); |
| 133 RefPtr<SVGRect> toAtEndOfDurationRect = toSVGRect(toAtEndOfDurationValue); | 133 RefPtrWillBeRawPtr<SVGRect> toAtEndOfDurationRect = toSVGRect(toAtEndOfDurat
ionValue); |
| 134 | 134 |
| 135 float animatedX = x(); | 135 float animatedX = x(); |
| 136 float animatedY = y(); | 136 float animatedY = y(); |
| 137 float animatedWidth = width(); | 137 float animatedWidth = width(); |
| 138 float animatedHeight = height(); | 138 float animatedHeight = height(); |
| 139 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->x
(), toRect->x(), toAtEndOfDurationRect->x(), animatedX); | 139 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->x
(), toRect->x(), toAtEndOfDurationRect->x(), animatedX); |
| 140 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->y
(), toRect->y(), toAtEndOfDurationRect->y(), animatedY); | 140 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->y
(), toRect->y(), toAtEndOfDurationRect->y(), animatedY); |
| 141 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->w
idth(), toRect->width(), toAtEndOfDurationRect->width(), animatedWidth); | 141 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->w
idth(), toRect->width(), toAtEndOfDurationRect->width(), animatedWidth); |
| 142 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->h
eight(), toRect->height(), toAtEndOfDurationRect->height(), animatedHeight); | 142 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->h
eight(), toRect->height(), toAtEndOfDurationRect->height(), animatedHeight); |
| 143 | 143 |
| 144 m_value = FloatRect(animatedX, animatedY, animatedWidth, animatedHeight); | 144 m_value = FloatRect(animatedX, animatedY, animatedWidth, animatedHeight); |
| 145 } | 145 } |
| 146 | 146 |
| 147 float SVGRect::calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement* con
textElement) | 147 float SVGRect::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVG
Element* contextElement) |
| 148 { | 148 { |
| 149 // FIXME: Distance calculation is not possible for SVGRect right now. We nee
d the distance for every single value. | 149 // FIXME: Distance calculation is not possible for SVGRect right now. We nee
d the distance for every single value. |
| 150 return -1; | 150 return -1; |
| 151 } | 151 } |
| 152 | 152 |
| 153 void SVGRect::setInvalid() | 153 void SVGRect::setInvalid() |
| 154 { | 154 { |
| 155 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); | 155 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); |
| 156 m_isValid = false; | 156 m_isValid = false; |
| 157 } | 157 } |
| 158 | 158 |
| 159 } | 159 } |
| OLD | NEW |