OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2014 Google, Inc. | 4 * Copyright (C) 2014 Google, Inc. |
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 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 */ | 20 */ |
21 | 21 |
22 #ifndef SVGGraphicsElement_h | 22 #ifndef SVGGraphicsElement_h |
23 #define SVGGraphicsElement_h | 23 #define SVGGraphicsElement_h |
24 | 24 |
25 #include "core/svg/SVGAnimatedTransformList.h" | 25 #include "core/svg/SVGAnimatedTransformList.h" |
26 #include "core/svg/SVGElement.h" | 26 #include "core/svg/SVGElement.h" |
27 #include "core/svg/SVGRectTearOff.h" | 27 #include "core/svg/SVGRectTearOff.h" |
28 #include "core/svg/SVGTests.h" | 28 #include "core/svg/SVGTests.h" |
| 29 #include "platform/heap/Handle.h" |
29 | 30 |
30 namespace blink { | 31 namespace blink { |
31 | 32 |
32 class AffineTransform; | 33 class AffineTransform; |
33 class Path; | 34 class Path; |
34 class SVGMatrixTearOff; | 35 class SVGMatrixTearOff; |
35 | 36 |
36 class SVGGraphicsElement : public SVGElement, public SVGTests { | 37 class SVGGraphicsElement : public SVGElement, public SVGTests { |
37 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
| 39 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGGraphicsElement); |
38 public: | 40 public: |
39 virtual ~SVGGraphicsElement(); | 41 virtual ~SVGGraphicsElement(); |
40 | 42 |
41 enum StyleUpdateStrategy { AllowStyleUpdate, DisallowStyleUpdate }; | 43 enum StyleUpdateStrategy { AllowStyleUpdate, DisallowStyleUpdate }; |
42 | 44 |
43 AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate); | 45 AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate); |
44 AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate); | 46 AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate); |
45 PassRefPtr<SVGMatrixTearOff> getCTMFromJavascript(); | 47 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> getCTMFromJavascript(); |
46 PassRefPtr<SVGMatrixTearOff> getScreenCTMFromJavascript(); | 48 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> getScreenCTMFromJavascript(); |
47 | 49 |
48 PassRefPtr<SVGMatrixTearOff> getTransformToElement(SVGElement*, ExceptionSta
te&); | 50 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> getTransformToElement(SVGElement*,
ExceptionState&); |
49 | 51 |
50 SVGElement* nearestViewportElement() const; | 52 SVGElement* nearestViewportElement() const; |
51 SVGElement* farthestViewportElement() const; | 53 SVGElement* farthestViewportElement() const; |
52 | 54 |
53 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope)
const override { return calculateAnimatedLocalTransform(); } | 55 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope)
const override { return calculateAnimatedLocalTransform(); } |
54 bool hasAnimatedLocalTransform() const; | 56 bool hasAnimatedLocalTransform() const; |
55 AffineTransform calculateAnimatedLocalTransform() const; | 57 AffineTransform calculateAnimatedLocalTransform() const; |
56 virtual AffineTransform* animateMotionTransform() override; | 58 virtual AffineTransform* animateMotionTransform() override; |
57 | 59 |
58 virtual FloatRect getBBox(); | 60 virtual FloatRect getBBox(); |
59 PassRefPtr<SVGRectTearOff> getBBoxFromJavascript(); | 61 PassRefPtrWillBeRawPtr<SVGRectTearOff> getBBoxFromJavascript(); |
60 | 62 |
61 // "base class" methods for all the elements which render as paths | 63 // "base class" methods for all the elements which render as paths |
62 virtual void toClipPath(Path&); | 64 virtual void toClipPath(Path&); |
63 virtual RenderObject* createRenderer(RenderStyle*) override; | 65 virtual RenderObject* createRenderer(RenderStyle*) override; |
64 | 66 |
65 virtual bool isValid() const override final { return SVGTests::isValid(docum
ent()); } | 67 virtual bool isValid() const override final { return SVGTests::isValid(docum
ent()); } |
66 | 68 |
67 SVGAnimatedTransformList* transform() { return m_transform.get(); } | 69 SVGAnimatedTransformList* transform() { return m_transform.get(); } |
68 const SVGAnimatedTransformList* transform() const { return m_transform.get()
; } | 70 const SVGAnimatedTransformList* transform() const { return m_transform.get()
; } |
69 | 71 |
70 AffineTransform computeCTM(SVGElement::CTMScope mode, SVGGraphicsElement::St
yleUpdateStrategy, | 72 AffineTransform computeCTM(SVGElement::CTMScope mode, SVGGraphicsElement::St
yleUpdateStrategy, |
71 const SVGGraphicsElement* ancestor = 0) const; | 73 const SVGGraphicsElement* ancestor = 0) const; |
72 | 74 |
| 75 virtual void trace(Visitor*) override; |
| 76 |
73 protected: | 77 protected: |
74 SVGGraphicsElement(const QualifiedName&, Document&, ConstructionType = Creat
eSVGElement); | 78 SVGGraphicsElement(const QualifiedName&, Document&, ConstructionType = Creat
eSVGElement); |
75 | 79 |
76 virtual bool supportsFocus() const override { return Element::supportsFocus(
) || hasFocusEventListeners(); } | 80 virtual bool supportsFocus() const override { return Element::supportsFocus(
) || hasFocusEventListeners(); } |
77 | 81 |
78 bool isSupportedAttribute(const QualifiedName&); | 82 bool isSupportedAttribute(const QualifiedName&); |
79 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 83 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; |
80 virtual void svgAttributeChanged(const QualifiedName&) override; | 84 virtual void svgAttributeChanged(const QualifiedName&) override; |
81 | 85 |
82 RefPtr<SVGAnimatedTransformList> m_transform; | 86 RefPtrWillBeMember<SVGAnimatedTransformList> m_transform; |
83 | 87 |
84 private: | 88 private: |
85 virtual bool isSVGGraphicsElement() const override final { return true; } | 89 virtual bool isSVGGraphicsElement() const override final { return true; } |
86 }; | 90 }; |
87 | 91 |
88 inline bool isSVGGraphicsElement(const SVGElement& element) | 92 inline bool isSVGGraphicsElement(const SVGElement& element) |
89 { | 93 { |
90 return element.isSVGGraphicsElement(); | 94 return element.isSVGGraphicsElement(); |
91 } | 95 } |
92 | 96 |
93 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGGraphicsElement); | 97 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGGraphicsElement); |
94 | 98 |
95 } // namespace blink | 99 } // namespace blink |
96 | 100 |
97 #endif // SVGGraphicsElement_h | 101 #endif // SVGGraphicsElement_h |
OLD | NEW |