OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "core/svg/SVGAnimatedPreserveAspectRatio.h" | 24 #include "core/svg/SVGAnimatedPreserveAspectRatio.h" |
25 #include "core/svg/SVGAnimatedRect.h" | 25 #include "core/svg/SVGAnimatedRect.h" |
26 #include "core/svg/SVGFitToViewBox.h" | 26 #include "core/svg/SVGFitToViewBox.h" |
27 #include "core/svg/SVGSVGElement.h" | 27 #include "core/svg/SVGSVGElement.h" |
28 #include "core/svg/SVGTransformList.h" | 28 #include "core/svg/SVGTransformList.h" |
29 #include "core/svg/SVGZoomAndPan.h" | 29 #include "core/svg/SVGZoomAndPan.h" |
30 #include "wtf/WeakPtr.h" | 30 #include "wtf/WeakPtr.h" |
31 | 31 |
32 namespace WebCore { | 32 namespace WebCore { |
33 | 33 |
34 class ExceptionState; | |
35 class SVGTransformListPropertyTearOff; | 34 class SVGTransformListPropertyTearOff; |
36 | 35 |
37 class SVGViewSpec FINAL : public RefCounted<SVGViewSpec>, public ScriptWrappable
, public SVGZoomAndPan, public SVGFitToViewBox { | 36 class SVGViewSpec FINAL : public RefCounted<SVGViewSpec>, public ScriptWrappable
, public SVGZoomAndPan, public SVGFitToViewBox { |
38 public: | 37 public: |
39 using RefCounted<SVGViewSpec>::ref; | 38 using RefCounted<SVGViewSpec>::ref; |
40 using RefCounted<SVGViewSpec>::deref; | 39 using RefCounted<SVGViewSpec>::deref; |
41 | 40 |
42 static PassRefPtr<SVGViewSpec> create(SVGSVGElement* contextElement) | 41 static PassRefPtr<SVGViewSpec> create(SVGSVGElement* contextElement) |
43 { | 42 { |
44 return adoptRef(new SVGViewSpec(contextElement)); | 43 return adoptRef(new SVGViewSpec(contextElement)); |
45 } | 44 } |
46 | 45 |
47 bool parseViewSpec(const String&); | 46 bool parseViewSpec(const String&); |
48 void reset(); | 47 void reset(); |
49 | 48 |
50 SVGElement* viewTarget() const; | 49 SVGElement* viewTarget() const; |
51 String viewBoxString() const; | 50 String viewBoxString() const; |
52 | 51 |
53 String preserveAspectRatioString() const; | 52 String preserveAspectRatioString() const; |
54 | 53 |
55 void setTransformString(const String&); | 54 void setTransformString(const String&); |
56 String transformString() const; | 55 String transformString() const; |
57 | 56 |
58 void setViewTargetString(const String& string) { m_viewTargetString = string
; } | 57 void setViewTargetString(const String& string) { m_viewTargetString = string
; } |
59 String viewTargetString() const { return m_viewTargetString; } | 58 String viewTargetString() const { return m_viewTargetString; } |
60 | 59 |
61 SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; } | |
62 void setZoomAndPan(unsigned short zoomAndPan) { setZoomAndPanBaseValue(zoomA
ndPan); } | |
63 void setZoomAndPan(unsigned short, ExceptionState&); | |
64 void setZoomAndPanBaseValue(unsigned short zoomAndPan) { m_zoomAndPan = SVGZ
oomAndPan::parseFromNumber(zoomAndPan); } | |
65 | |
66 SVGElement* contextElement() const { return m_contextElement; } | 60 SVGElement* contextElement() const { return m_contextElement; } |
67 void detachContextElement(); | 61 void detachContextElement(); |
68 | 62 |
69 // Custom non-animated 'transform' property. | 63 // Custom non-animated 'transform' property. |
70 SVGTransformListPropertyTearOff* transform(); | 64 SVGTransformListPropertyTearOff* transform(); |
71 SVGTransformList transformBaseValue() const { return m_transform; } | 65 SVGTransformList transformBaseValue() const { return m_transform; } |
72 | 66 |
73 SVGAnimatedRect* viewBox() { return m_viewBox.get(); } | 67 SVGAnimatedRect* viewBox() { return m_viewBox.get(); } |
74 SVGAnimatedPreserveAspectRatio* preserveAspectRatio() { return m_preserveAsp
ectRatio.get(); } | 68 SVGAnimatedPreserveAspectRatio* preserveAspectRatio() { return m_preserveAsp
ectRatio.get(); } |
75 | 69 |
76 private: | 70 private: |
77 explicit SVGViewSpec(SVGSVGElement*); | 71 explicit SVGViewSpec(SVGSVGElement*); |
78 | 72 |
79 static const SVGPropertyInfo* transformPropertyInfo(); | 73 static const SVGPropertyInfo* transformPropertyInfo(); |
80 | 74 |
81 static const AtomicString& transformIdentifier(); | 75 static const AtomicString& transformIdentifier(); |
82 | 76 |
83 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateTransformWrapper(SVGVie
wSpec* contextElement); | 77 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateTransformWrapper(SVGVie
wSpec* contextElement); |
84 | 78 |
85 template<typename CharType> | 79 template<typename CharType> |
86 bool parseViewSpecInternal(const CharType* ptr, const CharType* end); | 80 bool parseViewSpecInternal(const CharType* ptr, const CharType* end); |
87 | 81 |
88 // FIXME(oilpan): This is back-ptr to be cleared from contextElement. | 82 // FIXME(oilpan): This is back-ptr to be cleared from contextElement. |
89 SVGSVGElement* m_contextElement; | 83 SVGSVGElement* m_contextElement; |
90 | |
91 SVGZoomAndPanType m_zoomAndPan; | |
92 SVGTransformList m_transform; | 84 SVGTransformList m_transform; |
93 RefPtr<SVGAnimatedRect> m_viewBox; | 85 RefPtr<SVGAnimatedRect> m_viewBox; |
94 RefPtr<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio; | 86 RefPtr<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio; |
95 String m_viewTargetString; | 87 String m_viewTargetString; |
96 }; | 88 }; |
97 | 89 |
98 } // namespace WebCore | 90 } // namespace WebCore |
99 | 91 |
100 #endif | 92 #endif |
OLD | NEW |