| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef SVGIntegerOptionalInteger_h | 31 #ifndef SVGIntegerOptionalInteger_h |
| 32 #define SVGIntegerOptionalInteger_h | 32 #define SVGIntegerOptionalInteger_h |
| 33 | 33 |
| 34 #include "core/svg/SVGAnimatedInteger.h" | 34 #include "core/svg/SVGAnimatedInteger.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 class SVGIntegerOptionalInteger : public NewSVGPropertyBase { | 38 class SVGIntegerOptionalInteger : public SVGPropertyBase { |
| 39 public: | 39 public: |
| 40 // Tearoff of SVGIntegerOptionalInteger is never created. | 40 // Tearoff of SVGIntegerOptionalInteger is never created. |
| 41 typedef void TearOffType; | 41 typedef void TearOffType; |
| 42 typedef void PrimitiveType; | 42 typedef void PrimitiveType; |
| 43 | 43 |
| 44 static PassRefPtr<SVGIntegerOptionalInteger> create(PassRefPtr<SVGInteger> f
irstInteger, PassRefPtr<SVGInteger> secondInteger) | 44 static PassRefPtr<SVGIntegerOptionalInteger> create(PassRefPtr<SVGInteger> f
irstInteger, PassRefPtr<SVGInteger> secondInteger) |
| 45 { | 45 { |
| 46 return adoptRef(new SVGIntegerOptionalInteger(firstInteger, secondIntege
r)); | 46 return adoptRef(new SVGIntegerOptionalInteger(firstInteger, secondIntege
r)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 PassRefPtr<SVGIntegerOptionalInteger> clone() const; | 49 PassRefPtr<SVGIntegerOptionalInteger> clone() const; |
| 50 virtual PassRefPtr<NewSVGPropertyBase> cloneForAnimation(const String&) cons
t OVERRIDE; | 50 virtual PassRefPtr<SVGPropertyBase> cloneForAnimation(const String&) const O
VERRIDE; |
| 51 | 51 |
| 52 virtual String valueAsString() const OVERRIDE; | 52 virtual String valueAsString() const OVERRIDE; |
| 53 void setValueAsString(const String&, ExceptionState&); | 53 void setValueAsString(const String&, ExceptionState&); |
| 54 | 54 |
| 55 virtual void add(PassRefPtr<NewSVGPropertyBase>, SVGElement*) OVERRIDE; | 55 virtual void add(PassRefPtr<SVGPropertyBase>, SVGElement*) OVERRIDE; |
| 56 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage,
unsigned repeatCount, PassRefPtr<NewSVGPropertyBase> from, PassRefPtr<NewSVGProp
ertyBase> to, PassRefPtr<NewSVGPropertyBase> toAtEndOfDurationValue, SVGElement*
contextElement) OVERRIDE; | 56 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage,
unsigned repeatCount, PassRefPtr<SVGPropertyBase> from, PassRefPtr<SVGPropertyBa
se> to, PassRefPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement* contextE
lement) OVERRIDE; |
| 57 virtual float calculateDistance(PassRefPtr<NewSVGPropertyBase> to, SVGElemen
t* contextElement) OVERRIDE; | 57 virtual float calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement*
contextElement) OVERRIDE; |
| 58 | 58 |
| 59 static AnimatedPropertyType classType() { return AnimatedIntegerOptionalInte
ger; } | 59 static AnimatedPropertyType classType() { return AnimatedIntegerOptionalInte
ger; } |
| 60 | 60 |
| 61 PassRefPtr<SVGInteger> firstInteger() { return m_firstInteger; } | 61 PassRefPtr<SVGInteger> firstInteger() { return m_firstInteger; } |
| 62 PassRefPtr<SVGInteger> secondInteger() { return m_secondInteger; } | 62 PassRefPtr<SVGInteger> secondInteger() { return m_secondInteger; } |
| 63 | 63 |
| 64 protected: | 64 protected: |
| 65 SVGIntegerOptionalInteger(PassRefPtr<SVGInteger> firstInteger, PassRefPtr<SV
GInteger> secondInteger); | 65 SVGIntegerOptionalInteger(PassRefPtr<SVGInteger> firstInteger, PassRefPtr<SV
GInteger> secondInteger); |
| 66 | 66 |
| 67 RefPtr<SVGInteger> m_firstInteger; | 67 RefPtr<SVGInteger> m_firstInteger; |
| 68 RefPtr<SVGInteger> m_secondInteger; | 68 RefPtr<SVGInteger> m_secondInteger; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 inline PassRefPtr<SVGIntegerOptionalInteger> toSVGIntegerOptionalInteger(PassRef
Ptr<NewSVGPropertyBase> passBase) | 71 inline PassRefPtr<SVGIntegerOptionalInteger> toSVGIntegerOptionalInteger(PassRef
Ptr<SVGPropertyBase> passBase) |
| 72 { | 72 { |
| 73 RefPtr<NewSVGPropertyBase> base = passBase; | 73 RefPtr<SVGPropertyBase> base = passBase; |
| 74 ASSERT(base->type() == SVGIntegerOptionalInteger::classType()); | 74 ASSERT(base->type() == SVGIntegerOptionalInteger::classType()); |
| 75 return static_pointer_cast<SVGIntegerOptionalInteger>(base.release()); | 75 return static_pointer_cast<SVGIntegerOptionalInteger>(base.release()); |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace WebCore | 78 } // namespace WebCore |
| 79 | 79 |
| 80 #endif // SVGIntegerOptionalInteger_h | 80 #endif // SVGIntegerOptionalInteger_h |
| OLD | NEW |