| 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 25 matching lines...) Expand all Loading... |
| 36 SVGMarkerOrientUnknown = 0, | 36 SVGMarkerOrientUnknown = 0, |
| 37 SVGMarkerOrientAuto, | 37 SVGMarkerOrientAuto, |
| 38 SVGMarkerOrientAngle, | 38 SVGMarkerOrientAngle, |
| 39 SVGMarkerOrientAutoStartReverse | 39 SVGMarkerOrientAutoStartReverse |
| 40 }; | 40 }; |
| 41 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGMarkerOr
ientType>(); | 41 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGMarkerOr
ientType>(); |
| 42 template<> unsigned short getMaxExposedEnumValue<SVGMarkerOrientType>(); | 42 template<> unsigned short getMaxExposedEnumValue<SVGMarkerOrientType>(); |
| 43 | 43 |
| 44 class SVGMarkerOrientEnumeration : public SVGEnumeration<SVGMarkerOrientType> { | 44 class SVGMarkerOrientEnumeration : public SVGEnumeration<SVGMarkerOrientType> { |
| 45 public: | 45 public: |
| 46 static PassRefPtrWillBeRawPtr<SVGMarkerOrientEnumeration> create(SVGAngle* a
ngle) | 46 static RawPtr<SVGMarkerOrientEnumeration> create(SVGAngle* angle) |
| 47 { | 47 { |
| 48 return adoptRefWillBeNoop(new SVGMarkerOrientEnumeration(angle)); | 48 return new SVGMarkerOrientEnumeration(angle); |
| 49 } | 49 } |
| 50 | 50 |
| 51 ~SVGMarkerOrientEnumeration() override; | 51 ~SVGMarkerOrientEnumeration() override; |
| 52 | 52 |
| 53 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 53 void add(RawPtr<SVGPropertyBase>, SVGElement*) override; |
| 54 void calculateAnimatedValue(SVGAnimationElement*, float, unsigned, PassRefPt
rWillBeRawPtr<SVGPropertyBase>, PassRefPtrWillBeRawPtr<SVGPropertyBase>, PassRef
PtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 54 void calculateAnimatedValue(SVGAnimationElement*, float, unsigned, RawPtr<SV
GPropertyBase>, RawPtr<SVGPropertyBase>, RawPtr<SVGPropertyBase>, SVGElement*) o
verride; |
| 55 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*
) override; | 55 float calculateDistance(RawPtr<SVGPropertyBase>, SVGElement*) override; |
| 56 | 56 |
| 57 DECLARE_VIRTUAL_TRACE(); | 57 DECLARE_VIRTUAL_TRACE(); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 SVGMarkerOrientEnumeration(SVGAngle*); | 60 SVGMarkerOrientEnumeration(SVGAngle*); |
| 61 | 61 |
| 62 void notifyChange() override; | 62 void notifyChange() override; |
| 63 | 63 |
| 64 RawPtrWillBeMember<SVGAngle> m_angle; | 64 Member<SVGAngle> m_angle; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 class SVGAngle : public SVGPropertyHelper<SVGAngle> { | 67 class SVGAngle : public SVGPropertyHelper<SVGAngle> { |
| 68 public: | 68 public: |
| 69 typedef SVGAngleTearOff TearOffType; | 69 typedef SVGAngleTearOff TearOffType; |
| 70 | 70 |
| 71 enum SVGAngleType { | 71 enum SVGAngleType { |
| 72 SVG_ANGLETYPE_UNKNOWN = 0, | 72 SVG_ANGLETYPE_UNKNOWN = 0, |
| 73 SVG_ANGLETYPE_UNSPECIFIED = 1, | 73 SVG_ANGLETYPE_UNSPECIFIED = 1, |
| 74 SVG_ANGLETYPE_DEG = 2, | 74 SVG_ANGLETYPE_DEG = 2, |
| 75 SVG_ANGLETYPE_RAD = 3, | 75 SVG_ANGLETYPE_RAD = 3, |
| 76 SVG_ANGLETYPE_GRAD = 4, | 76 SVG_ANGLETYPE_GRAD = 4, |
| 77 SVG_ANGLETYPE_TURN = 5 | 77 SVG_ANGLETYPE_TURN = 5 |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 static PassRefPtrWillBeRawPtr<SVGAngle> create() | 80 static RawPtr<SVGAngle> create() |
| 81 { | 81 { |
| 82 return adoptRefWillBeNoop(new SVGAngle()); | 82 return new SVGAngle(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 ~SVGAngle() override; | 85 ~SVGAngle() override; |
| 86 | 86 |
| 87 SVGAngleType unitType() const { return m_unitType; } | 87 SVGAngleType unitType() const { return m_unitType; } |
| 88 | 88 |
| 89 void setValue(float); | 89 void setValue(float); |
| 90 float value() const; | 90 float value() const; |
| 91 | 91 |
| 92 void setValueInSpecifiedUnits(float valueInSpecifiedUnits) { m_valueInSpecif
iedUnits = valueInSpecifiedUnits; } | 92 void setValueInSpecifiedUnits(float valueInSpecifiedUnits) { m_valueInSpecif
iedUnits = valueInSpecifiedUnits; } |
| 93 float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; } | 93 float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; } |
| 94 | 94 |
| 95 void newValueSpecifiedUnits(SVGAngleType unitType, float valueInSpecifiedUni
ts); | 95 void newValueSpecifiedUnits(SVGAngleType unitType, float valueInSpecifiedUni
ts); |
| 96 void convertToSpecifiedUnits(SVGAngleType unitType); | 96 void convertToSpecifiedUnits(SVGAngleType unitType); |
| 97 | 97 |
| 98 SVGEnumeration<SVGMarkerOrientType>* orientType() { return m_orientType.get(
); } | 98 SVGEnumeration<SVGMarkerOrientType>* orientType() { return m_orientType.get(
); } |
| 99 const SVGEnumeration<SVGMarkerOrientType>* orientType() const { return m_ori
entType.get(); } | 99 const SVGEnumeration<SVGMarkerOrientType>* orientType() const { return m_ori
entType.get(); } |
| 100 void orientTypeChanged(); | 100 void orientTypeChanged(); |
| 101 | 101 |
| 102 // SVGPropertyBase: | 102 // SVGPropertyBase: |
| 103 | 103 |
| 104 PassRefPtrWillBeRawPtr<SVGAngle> clone() const; | 104 RawPtr<SVGAngle> clone() const; |
| 105 | 105 |
| 106 String valueAsString() const override; | 106 String valueAsString() const override; |
| 107 SVGParsingError setValueAsString(const String&); | 107 SVGParsingError setValueAsString(const String&); |
| 108 | 108 |
| 109 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 109 void add(RawPtr<SVGPropertyBase>, SVGElement*) override; |
| 110 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement* contextElement) override; | 110 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, RawPtr<SVGPropertyBase> from, RawPtr<SVGPropertyBase> to, RawPtr<S
VGPropertyBase> toAtEndOfDurationValue, SVGElement* contextElement) override; |
| 111 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt* contextElement) override; | 111 float calculateDistance(RawPtr<SVGPropertyBase> to, SVGElement* contextEleme
nt) override; |
| 112 | 112 |
| 113 static AnimatedPropertyType classType() { return AnimatedAngle; } | 113 static AnimatedPropertyType classType() { return AnimatedAngle; } |
| 114 | 114 |
| 115 DECLARE_VIRTUAL_TRACE(); | 115 DECLARE_VIRTUAL_TRACE(); |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 SVGAngle(); | 118 SVGAngle(); |
| 119 SVGAngle(SVGAngleType, float, SVGMarkerOrientType); | 119 SVGAngle(SVGAngleType, float, SVGMarkerOrientType); |
| 120 | 120 |
| 121 void assign(const SVGAngle&); | 121 void assign(const SVGAngle&); |
| 122 | 122 |
| 123 SVGAngleType m_unitType; | 123 SVGAngleType m_unitType; |
| 124 float m_valueInSpecifiedUnits; | 124 float m_valueInSpecifiedUnits; |
| 125 RefPtrWillBeMember<SVGMarkerOrientEnumeration> m_orientType; | 125 Member<SVGMarkerOrientEnumeration> m_orientType; |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGAngle); | 128 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGAngle); |
| 129 | 129 |
| 130 } // namespace blink | 130 } // namespace blink |
| 131 | 131 |
| 132 #endif // SVGAngle_h | 132 #endif // SVGAngle_h |
| OLD | NEW |