| 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, 2010 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Rob Buis <buis@kde.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #ifndef SVGSVGElement_h | 21 #ifndef SVGSVGElement_h |
| 22 #define SVGSVGElement_h | 22 #define SVGSVGElement_h |
| 23 | 23 |
| 24 #include "core/svg/SVGAnimatedBoolean.h" | 24 #include "core/svg/SVGAnimatedBoolean.h" |
| 25 #include "core/svg/SVGAnimatedLength.h" | 25 #include "core/svg/SVGAnimatedLength.h" |
| 26 #include "core/svg/SVGAnimatedPreserveAspectRatio.h" | 26 #include "core/svg/SVGAnimatedPreserveAspectRatio.h" |
| 27 #include "core/svg/SVGAnimatedRect.h" | 27 #include "core/svg/SVGAnimatedRect.h" |
| 28 #include "core/svg/SVGFitToViewBox.h" | 28 #include "core/svg/SVGFitToViewBox.h" |
| 29 #include "core/svg/SVGGraphicsElement.h" | 29 #include "core/svg/SVGGraphicsElement.h" |
| 30 #include "core/svg/SVGLengthTearOff.h" | 30 #include "core/svg/SVGLengthTearOff.h" |
| 31 #include "core/svg/SVGPointTearOff.h" |
| 31 #include "core/svg/SVGZoomAndPan.h" | 32 #include "core/svg/SVGZoomAndPan.h" |
| 32 #include "wtf/WeakPtr.h" | 33 #include "wtf/WeakPtr.h" |
| 33 | 34 |
| 34 namespace WebCore { | 35 namespace WebCore { |
| 35 | 36 |
| 36 class SVGAngle; | 37 class SVGAngle; |
| 37 class SVGMatrix; | 38 class SVGMatrix; |
| 38 class SVGTransform; | 39 class SVGTransform; |
| 39 class SVGViewSpec; | 40 class SVGViewSpec; |
| 40 class SVGViewElement; | 41 class SVGViewElement; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 76 |
| 76 // RenderSVGRoot wants to query the intrinsic size, by only examining the wi
dth/height attributes. | 77 // RenderSVGRoot wants to query the intrinsic size, by only examining the wi
dth/height attributes. |
| 77 Length intrinsicWidth(ConsiderCSSMode = RespectCSSProperties) const; | 78 Length intrinsicWidth(ConsiderCSSMode = RespectCSSProperties) const; |
| 78 Length intrinsicHeight(ConsiderCSSMode = RespectCSSProperties) const; | 79 Length intrinsicHeight(ConsiderCSSMode = RespectCSSProperties) const; |
| 79 FloatSize currentViewportSize() const; | 80 FloatSize currentViewportSize() const; |
| 80 FloatRect currentViewBoxRect() const; | 81 FloatRect currentViewBoxRect() const; |
| 81 | 82 |
| 82 float currentScale() const; | 83 float currentScale() const; |
| 83 void setCurrentScale(float scale); | 84 void setCurrentScale(float scale); |
| 84 | 85 |
| 85 SVGPoint& currentTranslate() { return m_translation; } | 86 FloatPoint currentTranslate() { return m_translation->value(); } |
| 86 void setCurrentTranslate(const FloatPoint&); | 87 void setCurrentTranslate(const FloatPoint&); |
| 87 | 88 PassRefPtr<SVGPointTearOff> currentTranslateFromJavascript(); |
| 88 // Only used from the bindings. | |
| 89 void updateCurrentTranslate(); | |
| 90 | 89 |
| 91 SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); } | 90 SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); } |
| 92 | 91 |
| 93 void pauseAnimations(); | 92 void pauseAnimations(); |
| 94 void unpauseAnimations(); | 93 void unpauseAnimations(); |
| 95 bool animationsPaused() const; | 94 bool animationsPaused() const; |
| 96 | 95 |
| 97 float getCurrentTime() const; | 96 float getCurrentTime() const; |
| 98 void setCurrentTime(float seconds); | 97 void setCurrentTime(float seconds); |
| 99 | 98 |
| 100 unsigned suspendRedraw(unsigned maxWaitMilliseconds); | 99 unsigned suspendRedraw(unsigned maxWaitMilliseconds); |
| 101 void unsuspendRedraw(unsigned suspendHandleId); | 100 void unsuspendRedraw(unsigned suspendHandleId); |
| 102 void unsuspendRedrawAll(); | 101 void unsuspendRedrawAll(); |
| 103 void forceRedraw(); | 102 void forceRedraw(); |
| 104 | 103 |
| 105 PassRefPtr<NodeList> getIntersectionList(PassRefPtr<SVGRectTearOff>, SVGElem
ent* referenceElement) const; | 104 PassRefPtr<NodeList> getIntersectionList(PassRefPtr<SVGRectTearOff>, SVGElem
ent* referenceElement) const; |
| 106 PassRefPtr<NodeList> getEnclosureList(PassRefPtr<SVGRectTearOff>, SVGElement
* referenceElement) const; | 105 PassRefPtr<NodeList> getEnclosureList(PassRefPtr<SVGRectTearOff>, SVGElement
* referenceElement) const; |
| 107 bool checkIntersection(SVGElement*, PassRefPtr<SVGRectTearOff>) const; | 106 bool checkIntersection(SVGElement*, PassRefPtr<SVGRectTearOff>) const; |
| 108 bool checkEnclosure(SVGElement*, PassRefPtr<SVGRectTearOff>) const; | 107 bool checkEnclosure(SVGElement*, PassRefPtr<SVGRectTearOff>) const; |
| 109 void deselectAll(); | 108 void deselectAll(); |
| 110 | 109 |
| 111 static float createSVGNumber(); | 110 static float createSVGNumber(); |
| 112 static PassRefPtr<SVGLengthTearOff> createSVGLength(); | 111 static PassRefPtr<SVGLengthTearOff> createSVGLength(); |
| 113 static SVGAngle createSVGAngle(); | 112 static SVGAngle createSVGAngle(); |
| 114 static SVGPoint createSVGPoint(); | 113 static PassRefPtr<SVGPointTearOff> createSVGPoint(); |
| 115 static SVGMatrix createSVGMatrix(); | 114 static SVGMatrix createSVGMatrix(); |
| 116 static PassRefPtr<SVGRectTearOff> createSVGRect(); | 115 static PassRefPtr<SVGRectTearOff> createSVGRect(); |
| 117 static SVGTransform createSVGTransform(); | 116 static SVGTransform createSVGTransform(); |
| 118 static SVGTransform createSVGTransformFromMatrix(const SVGMatrix&); | 117 static SVGTransform createSVGTransformFromMatrix(const SVGMatrix&); |
| 119 | 118 |
| 120 AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) co
nst; | 119 AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) co
nst; |
| 121 | 120 |
| 122 void setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
; | 121 void setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
; |
| 123 | 122 |
| 124 Element* getElementById(const AtomicString&) const; | 123 Element* getElementById(const AtomicString&) const; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 150 | 149 |
| 151 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 150 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; |
| 152 virtual void removedFrom(ContainerNode*) OVERRIDE; | 151 virtual void removedFrom(ContainerNode*) OVERRIDE; |
| 153 | 152 |
| 154 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; | 153 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; |
| 155 | 154 |
| 156 virtual bool selfHasRelativeLengths() const OVERRIDE; | 155 virtual bool selfHasRelativeLengths() const OVERRIDE; |
| 157 | 156 |
| 158 void inheritViewAttributes(SVGViewElement*); | 157 void inheritViewAttributes(SVGViewElement*); |
| 159 | 158 |
| 159 void updateCurrentTranslate(); |
| 160 |
| 160 enum CollectIntersectionOrEnclosure { | 161 enum CollectIntersectionOrEnclosure { |
| 161 CollectIntersectionList, | 162 CollectIntersectionList, |
| 162 CollectEnclosureList | 163 CollectEnclosureList |
| 163 }; | 164 }; |
| 164 | 165 |
| 165 PassRefPtr<NodeList> collectIntersectionOrEnclosureList(const FloatRect&, SV
GElement*, CollectIntersectionOrEnclosure) const; | 166 PassRefPtr<NodeList> collectIntersectionOrEnclosureList(const FloatRect&, SV
GElement*, CollectIntersectionOrEnclosure) const; |
| 166 | 167 |
| 167 RefPtr<SVGAnimatedLength> m_x; | 168 RefPtr<SVGAnimatedLength> m_x; |
| 168 RefPtr<SVGAnimatedLength> m_y; | 169 RefPtr<SVGAnimatedLength> m_y; |
| 169 RefPtr<SVGAnimatedLength> m_width; | 170 RefPtr<SVGAnimatedLength> m_width; |
| 170 RefPtr<SVGAnimatedLength> m_height; | 171 RefPtr<SVGAnimatedLength> m_height; |
| 171 RefPtr<SVGAnimatedRect> m_viewBox; | 172 RefPtr<SVGAnimatedRect> m_viewBox; |
| 172 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGSVGElement) | 173 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGSVGElement) |
| 173 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspect
Ratio) | 174 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspect
Ratio) |
| 174 END_DECLARE_ANIMATED_PROPERTIES | 175 END_DECLARE_ANIMATED_PROPERTIES |
| 175 | 176 |
| 176 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope)
const OVERRIDE; | 177 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope)
const OVERRIDE; |
| 177 | 178 |
| 178 bool m_useCurrentView; | 179 bool m_useCurrentView; |
| 179 SVGZoomAndPanType m_zoomAndPan; | 180 SVGZoomAndPanType m_zoomAndPan; |
| 180 RefPtr<SMILTimeContainer> m_timeContainer; | 181 RefPtr<SMILTimeContainer> m_timeContainer; |
| 181 SVGPoint m_translation; | 182 RefPtr<SVGPoint> m_translation; |
| 182 RefPtr<SVGViewSpec> m_viewSpec; | 183 RefPtr<SVGViewSpec> m_viewSpec; |
| 183 WeakPtrFactory<SVGSVGElement> m_weakFactory; | 184 WeakPtrFactory<SVGSVGElement> m_weakFactory; |
| 185 |
| 186 friend class SVGCurrentTranslateTearOff; |
| 184 }; | 187 }; |
| 185 | 188 |
| 186 inline bool isSVGSVGElement(const Node& node) | 189 inline bool isSVGSVGElement(const Node& node) |
| 187 { | 190 { |
| 188 return node.isSVGElement() && toSVGElement(node).isSVGSVGElement(); | 191 return node.isSVGElement() && toSVGElement(node).isSVGSVGElement(); |
| 189 } | 192 } |
| 190 | 193 |
| 191 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGSVGElement); | 194 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGSVGElement); |
| 192 | 195 |
| 193 } // namespace WebCore | 196 } // namespace WebCore |
| 194 | 197 |
| 195 #endif | 198 #endif |
| OLD | NEW |