| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 class SVGMarkerOrientEnumeration : public SVGEnumeration<SVGMarkerOrientType> { | 39 class SVGMarkerOrientEnumeration : public SVGEnumeration<SVGMarkerOrientType> { |
| 40 public: | 40 public: |
| 41 static PassRefPtr<SVGMarkerOrientEnumeration> create(SVGAngle* angle) | 41 static PassRefPtr<SVGMarkerOrientEnumeration> create(SVGAngle* angle) |
| 42 { | 42 { |
| 43 return adoptRef(new SVGMarkerOrientEnumeration(angle)); | 43 return adoptRef(new SVGMarkerOrientEnumeration(angle)); |
| 44 } | 44 } |
| 45 | 45 |
| 46 virtual ~SVGMarkerOrientEnumeration(); | 46 virtual ~SVGMarkerOrientEnumeration(); |
| 47 | 47 |
| 48 virtual void add(PassRefPtr<NewSVGPropertyBase>, SVGElement*) OVERRIDE; | 48 virtual void add(PassRefPtr<SVGPropertyBase>, SVGElement*) OVERRIDE; |
| 49 virtual void calculateAnimatedValue(SVGAnimationElement*, float, unsigned, P
assRefPtr<NewSVGPropertyBase>, PassRefPtr<NewSVGPropertyBase>, PassRefPtr<NewSVG
PropertyBase>, SVGElement*) OVERRIDE; | 49 virtual void calculateAnimatedValue(SVGAnimationElement*, float, unsigned, P
assRefPtr<SVGPropertyBase>, PassRefPtr<SVGPropertyBase>, PassRefPtr<SVGPropertyB
ase>, SVGElement*) OVERRIDE; |
| 50 virtual float calculateDistance(PassRefPtr<NewSVGPropertyBase>, SVGElement*)
OVERRIDE; | 50 virtual float calculateDistance(PassRefPtr<SVGPropertyBase>, SVGElement*) OV
ERRIDE; |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 SVGMarkerOrientEnumeration(SVGAngle*); | 53 SVGMarkerOrientEnumeration(SVGAngle*); |
| 54 | 54 |
| 55 virtual void notifyChange() OVERRIDE; | 55 virtual void notifyChange() OVERRIDE; |
| 56 | 56 |
| 57 // FIXME: oilpan: This is kept as raw-ptr to avoid reference cycles. Should
be Member in oilpan. | 57 // FIXME: oilpan: This is kept as raw-ptr to avoid reference cycles. Should
be Member in oilpan. |
| 58 SVGAngle* m_angle; | 58 SVGAngle* m_angle; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class SVGAngle : public NewSVGPropertyBase { | 61 class SVGAngle : public SVGPropertyBase { |
| 62 public: | 62 public: |
| 63 typedef SVGAngleTearOff TearOffType; | 63 typedef SVGAngleTearOff TearOffType; |
| 64 | 64 |
| 65 enum SVGAngleType { | 65 enum SVGAngleType { |
| 66 SVG_ANGLETYPE_UNKNOWN = 0, | 66 SVG_ANGLETYPE_UNKNOWN = 0, |
| 67 SVG_ANGLETYPE_UNSPECIFIED = 1, | 67 SVG_ANGLETYPE_UNSPECIFIED = 1, |
| 68 SVG_ANGLETYPE_DEG = 2, | 68 SVG_ANGLETYPE_DEG = 2, |
| 69 SVG_ANGLETYPE_RAD = 3, | 69 SVG_ANGLETYPE_RAD = 3, |
| 70 SVG_ANGLETYPE_GRAD = 4 | 70 SVG_ANGLETYPE_GRAD = 4 |
| 71 }; | 71 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 84 | 84 |
| 85 void setValueInSpecifiedUnits(float valueInSpecifiedUnits) { m_valueInSpecif
iedUnits = valueInSpecifiedUnits; } | 85 void setValueInSpecifiedUnits(float valueInSpecifiedUnits) { m_valueInSpecif
iedUnits = valueInSpecifiedUnits; } |
| 86 float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; } | 86 float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; } |
| 87 | 87 |
| 88 void newValueSpecifiedUnits(SVGAngleType unitType, float valueInSpecifiedUni
ts); | 88 void newValueSpecifiedUnits(SVGAngleType unitType, float valueInSpecifiedUni
ts); |
| 89 void convertToSpecifiedUnits(SVGAngleType unitType, ExceptionState&); | 89 void convertToSpecifiedUnits(SVGAngleType unitType, ExceptionState&); |
| 90 | 90 |
| 91 SVGEnumeration<SVGMarkerOrientType>* orientType() { return m_orientType.get(
); } | 91 SVGEnumeration<SVGMarkerOrientType>* orientType() { return m_orientType.get(
); } |
| 92 void orientTypeChanged(); | 92 void orientTypeChanged(); |
| 93 | 93 |
| 94 // NewSVGPropertyBase: | 94 // SVGPropertyBase: |
| 95 | 95 |
| 96 PassRefPtr<SVGAngle> clone() const; | 96 PassRefPtr<SVGAngle> clone() const; |
| 97 virtual PassRefPtr<NewSVGPropertyBase> cloneForAnimation(const String&) cons
t OVERRIDE; | 97 virtual PassRefPtr<SVGPropertyBase> cloneForAnimation(const String&) const O
VERRIDE; |
| 98 | 98 |
| 99 virtual String valueAsString() const OVERRIDE; | 99 virtual String valueAsString() const OVERRIDE; |
| 100 void setValueAsString(const String&, ExceptionState&); | 100 void setValueAsString(const String&, ExceptionState&); |
| 101 | 101 |
| 102 virtual void add(PassRefPtr<NewSVGPropertyBase>, SVGElement*) OVERRIDE; | 102 virtual void add(PassRefPtr<SVGPropertyBase>, SVGElement*) OVERRIDE; |
| 103 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage,
unsigned repeatCount, PassRefPtr<NewSVGPropertyBase> from, PassRefPtr<NewSVGProp
ertyBase> to, PassRefPtr<NewSVGPropertyBase> toAtEndOfDurationValue, SVGElement*
contextElement) OVERRIDE; | 103 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage,
unsigned repeatCount, PassRefPtr<SVGPropertyBase> from, PassRefPtr<SVGPropertyBa
se> to, PassRefPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement* contextE
lement) OVERRIDE; |
| 104 virtual float calculateDistance(PassRefPtr<NewSVGPropertyBase> to, SVGElemen
t* contextElement) OVERRIDE; | 104 virtual float calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement*
contextElement) OVERRIDE; |
| 105 | 105 |
| 106 static AnimatedPropertyType classType() { return AnimatedAngle; } | 106 static AnimatedPropertyType classType() { return AnimatedAngle; } |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 SVGAngle(); | 109 SVGAngle(); |
| 110 SVGAngle(SVGAngleType, float, SVGMarkerOrientType); | 110 SVGAngle(SVGAngleType, float, SVGMarkerOrientType); |
| 111 | 111 |
| 112 SVGAngleType m_unitType; | 112 SVGAngleType m_unitType; |
| 113 float m_valueInSpecifiedUnits; | 113 float m_valueInSpecifiedUnits; |
| 114 RefPtr<SVGMarkerOrientEnumeration> m_orientType; | 114 RefPtr<SVGMarkerOrientEnumeration> m_orientType; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 inline PassRefPtr<SVGAngle> toSVGAngle(PassRefPtr<NewSVGPropertyBase> passBase) | 117 inline PassRefPtr<SVGAngle> toSVGAngle(PassRefPtr<SVGPropertyBase> passBase) |
| 118 { | 118 { |
| 119 RefPtr<NewSVGPropertyBase> base = passBase; | 119 RefPtr<SVGPropertyBase> base = passBase; |
| 120 ASSERT(base->type() == SVGAngle::classType()); | 120 ASSERT(base->type() == SVGAngle::classType()); |
| 121 return static_pointer_cast<SVGAngle>(base.release()); | 121 return static_pointer_cast<SVGAngle>(base.release()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace WebCore | 124 } // namespace WebCore |
| 125 | 125 |
| 126 #endif // SVGAngle_h | 126 #endif // SVGAngle_h |
| OLD | NEW |