| 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 | 33 |
| 33 namespace WebCore { | 34 namespace WebCore { |
| 34 | 35 |
| 35 class SVGAngle; | 36 class SVGAngle; |
| 36 class SVGMatrix; | 37 class SVGMatrix; |
| 37 class SVGTransform; | 38 class SVGTransform; |
| 38 class SVGViewSpec; | 39 class SVGViewSpec; |
| 39 class SVGViewElement; | 40 class SVGViewElement; |
| 40 class SMILTimeContainer; | 41 class SMILTimeContainer; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 75 |
| 75 // RenderSVGRoot wants to query the intrinsic size, by only examining the wi
dth/height attributes. | 76 // RenderSVGRoot wants to query the intrinsic size, by only examining the wi
dth/height attributes. |
| 76 Length intrinsicWidth(ConsiderCSSMode = RespectCSSProperties) const; | 77 Length intrinsicWidth(ConsiderCSSMode = RespectCSSProperties) const; |
| 77 Length intrinsicHeight(ConsiderCSSMode = RespectCSSProperties) const; | 78 Length intrinsicHeight(ConsiderCSSMode = RespectCSSProperties) const; |
| 78 FloatSize currentViewportSize() const; | 79 FloatSize currentViewportSize() const; |
| 79 FloatRect currentViewBoxRect() const; | 80 FloatRect currentViewBoxRect() const; |
| 80 | 81 |
| 81 float currentScale() const; | 82 float currentScale() const; |
| 82 void setCurrentScale(float scale); | 83 void setCurrentScale(float scale); |
| 83 | 84 |
| 84 SVGPoint& currentTranslate() { return m_translation; } | 85 FloatPoint currentTranslate() { return m_translation->value(); } |
| 85 void setCurrentTranslate(const FloatPoint&); | 86 void setCurrentTranslate(const FloatPoint&); |
| 86 | 87 PassRefPtr<SVGPointTearOff> currentTranslateFromJavascript(); |
| 87 // Only used from the bindings. | |
| 88 void updateCurrentTranslate(); | |
| 89 | 88 |
| 90 SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); } | 89 SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); } |
| 91 | 90 |
| 92 void pauseAnimations(); | 91 void pauseAnimations(); |
| 93 void unpauseAnimations(); | 92 void unpauseAnimations(); |
| 94 bool animationsPaused() const; | 93 bool animationsPaused() const; |
| 95 | 94 |
| 96 float getCurrentTime() const; | 95 float getCurrentTime() const; |
| 97 void setCurrentTime(float seconds); | 96 void setCurrentTime(float seconds); |
| 98 | 97 |
| 99 unsigned suspendRedraw(unsigned maxWaitMilliseconds); | 98 unsigned suspendRedraw(unsigned maxWaitMilliseconds); |
| 100 void unsuspendRedraw(unsigned suspendHandleId); | 99 void unsuspendRedraw(unsigned suspendHandleId); |
| 101 void unsuspendRedrawAll(); | 100 void unsuspendRedrawAll(); |
| 102 void forceRedraw(); | 101 void forceRedraw(); |
| 103 | 102 |
| 104 PassRefPtr<NodeList> getIntersectionList(PassRefPtr<SVGRectTearOff>, SVGElem
ent* referenceElement) const; | 103 PassRefPtr<NodeList> getIntersectionList(PassRefPtr<SVGRectTearOff>, SVGElem
ent* referenceElement) const; |
| 105 PassRefPtr<NodeList> getEnclosureList(PassRefPtr<SVGRectTearOff>, SVGElement
* referenceElement) const; | 104 PassRefPtr<NodeList> getEnclosureList(PassRefPtr<SVGRectTearOff>, SVGElement
* referenceElement) const; |
| 106 bool checkIntersection(SVGElement*, PassRefPtr<SVGRectTearOff>) const; | 105 bool checkIntersection(SVGElement*, PassRefPtr<SVGRectTearOff>) const; |
| 107 bool checkEnclosure(SVGElement*, PassRefPtr<SVGRectTearOff>) const; | 106 bool checkEnclosure(SVGElement*, PassRefPtr<SVGRectTearOff>) const; |
| 108 void deselectAll(); | 107 void deselectAll(); |
| 109 | 108 |
| 110 static float createSVGNumber(); | 109 static float createSVGNumber(); |
| 111 static PassRefPtr<SVGLengthTearOff> createSVGLength(); | 110 static PassRefPtr<SVGLengthTearOff> createSVGLength(); |
| 112 static SVGAngle createSVGAngle(); | 111 static SVGAngle createSVGAngle(); |
| 113 static SVGPoint createSVGPoint(); | 112 static PassRefPtr<SVGPointTearOff> createSVGPoint(); |
| 114 static SVGMatrix createSVGMatrix(); | 113 static SVGMatrix createSVGMatrix(); |
| 115 static PassRefPtr<SVGRectTearOff> createSVGRect(); | 114 static PassRefPtr<SVGRectTearOff> createSVGRect(); |
| 116 static SVGTransform createSVGTransform(); | 115 static SVGTransform createSVGTransform(); |
| 117 static SVGTransform createSVGTransformFromMatrix(const SVGMatrix&); | 116 static SVGTransform createSVGTransformFromMatrix(const SVGMatrix&); |
| 118 | 117 |
| 119 AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) co
nst; | 118 AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) co
nst; |
| 120 | 119 |
| 121 void setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
; | 120 void setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
; |
| 122 | 121 |
| 123 Element* getElementById(const AtomicString&) const; | 122 Element* getElementById(const AtomicString&) const; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 149 | 148 |
| 150 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 149 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; |
| 151 virtual void removedFrom(ContainerNode*) OVERRIDE; | 150 virtual void removedFrom(ContainerNode*) OVERRIDE; |
| 152 | 151 |
| 153 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; | 152 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; |
| 154 | 153 |
| 155 virtual bool selfHasRelativeLengths() const OVERRIDE; | 154 virtual bool selfHasRelativeLengths() const OVERRIDE; |
| 156 | 155 |
| 157 void inheritViewAttributes(SVGViewElement*); | 156 void inheritViewAttributes(SVGViewElement*); |
| 158 | 157 |
| 158 void updateCurrentTranslate(); |
| 159 |
| 159 enum CollectIntersectionOrEnclosure { | 160 enum CollectIntersectionOrEnclosure { |
| 160 CollectIntersectionList, | 161 CollectIntersectionList, |
| 161 CollectEnclosureList | 162 CollectEnclosureList |
| 162 }; | 163 }; |
| 163 | 164 |
| 164 PassRefPtr<NodeList> collectIntersectionOrEnclosureList(const FloatRect&, SV
GElement*, CollectIntersectionOrEnclosure) const; | 165 PassRefPtr<NodeList> collectIntersectionOrEnclosureList(const FloatRect&, SV
GElement*, CollectIntersectionOrEnclosure) const; |
| 165 | 166 |
| 166 RefPtr<SVGAnimatedLength> m_x; | 167 RefPtr<SVGAnimatedLength> m_x; |
| 167 RefPtr<SVGAnimatedLength> m_y; | 168 RefPtr<SVGAnimatedLength> m_y; |
| 168 RefPtr<SVGAnimatedLength> m_width; | 169 RefPtr<SVGAnimatedLength> m_width; |
| 169 RefPtr<SVGAnimatedLength> m_height; | 170 RefPtr<SVGAnimatedLength> m_height; |
| 170 RefPtr<SVGAnimatedRect> m_viewBox; | 171 RefPtr<SVGAnimatedRect> m_viewBox; |
| 171 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGSVGElement) | 172 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGSVGElement) |
| 172 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspect
Ratio) | 173 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspect
Ratio) |
| 173 END_DECLARE_ANIMATED_PROPERTIES | 174 END_DECLARE_ANIMATED_PROPERTIES |
| 174 | 175 |
| 175 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope)
const OVERRIDE; | 176 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope)
const OVERRIDE; |
| 176 | 177 |
| 177 bool m_useCurrentView; | 178 bool m_useCurrentView; |
| 178 SVGZoomAndPanType m_zoomAndPan; | 179 SVGZoomAndPanType m_zoomAndPan; |
| 179 RefPtr<SMILTimeContainer> m_timeContainer; | 180 RefPtr<SMILTimeContainer> m_timeContainer; |
| 180 SVGPoint m_translation; | 181 RefPtr<SVGPoint> m_translation; |
| 181 RefPtr<SVGViewSpec> m_viewSpec; | 182 RefPtr<SVGViewSpec> m_viewSpec; |
| 183 |
| 184 friend class SVGCurrentTranslateTearOff; |
| 182 }; | 185 }; |
| 183 | 186 |
| 184 inline bool isSVGSVGElement(const Node& node) | 187 inline bool isSVGSVGElement(const Node& node) |
| 185 { | 188 { |
| 186 return node.isSVGElement() && toSVGElement(node).isSVGSVGElement(); | 189 return node.isSVGElement() && toSVGElement(node).isSVGSVGElement(); |
| 187 } | 190 } |
| 188 | 191 |
| 189 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGSVGElement); | 192 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGSVGElement); |
| 190 | 193 |
| 191 } // namespace WebCore | 194 } // namespace WebCore |
| 192 | 195 |
| 193 #endif | 196 #endif |
| OLD | NEW |