OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 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, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #ifndef SVGFilterPrimitiveStandardAttributes_h | 21 #ifndef SVGFilterPrimitiveStandardAttributes_h |
22 #define SVGFilterPrimitiveStandardAttributes_h | 22 #define SVGFilterPrimitiveStandardAttributes_h |
23 | 23 |
24 #include "core/rendering/svg/RenderSVGResourceFilter.h" | 24 #include "core/rendering/svg/RenderSVGResource.h" |
25 #include "core/rendering/svg/RenderSVGResourceFilterPrimitive.h" | |
26 #include "core/svg/SVGAnimatedLength.h" | 25 #include "core/svg/SVGAnimatedLength.h" |
27 #include "core/svg/SVGAnimatedString.h" | 26 #include "core/svg/SVGAnimatedString.h" |
28 #include "core/svg/SVGStyledElement.h" | 27 #include "core/svg/SVGStyledElement.h" |
29 | 28 |
30 #include <wtf/PassRefPtr.h> | 29 #include <wtf/PassRefPtr.h> |
31 #include <wtf/RefPtr.h> | 30 #include <wtf/RefPtr.h> |
32 | 31 |
33 namespace WebCore { | 32 namespace WebCore { |
34 | 33 |
35 class Filter; | 34 class Filter; |
36 class FilterEffect; | 35 class FilterEffect; |
| 36 class RenderSVGResourceFilterPrimitive; |
37 class SVGFilterBuilder; | 37 class SVGFilterBuilder; |
38 | 38 |
39 class SVGFilterPrimitiveStandardAttributes : public SVGStyledElement { | 39 class SVGFilterPrimitiveStandardAttributes : public SVGStyledElement { |
40 public: | 40 public: |
41 void setStandardAttributes(FilterEffect*) const; | 41 void setStandardAttributes(FilterEffect*) const; |
42 | 42 |
43 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter* filter) =
0; | 43 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter* filter) =
0; |
44 // Returns true, if the new value is different from the old one. | 44 // Returns true, if the new value is different from the old one. |
45 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); | 45 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); |
46 | 46 |
47 protected: | 47 protected: |
48 SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document*); | 48 SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document*); |
49 | 49 |
50 bool isSupportedAttribute(const QualifiedName&); | 50 bool isSupportedAttribute(const QualifiedName&); |
51 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 51 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
52 virtual void svgAttributeChanged(const QualifiedName&); | 52 virtual void svgAttributeChanged(const QualifiedName&); |
53 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0); | 53 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0); |
54 | 54 |
55 inline void invalidate() | 55 inline void invalidate() |
56 { | 56 { |
57 if (RenderObject* primitiveRenderer = renderer()) | 57 if (RenderObject* primitiveRenderer = renderer()) |
58 RenderSVGResource::markForLayoutAndParentResourceInvalidation(primit
iveRenderer); | 58 RenderSVGResource::markForLayoutAndParentResourceInvalidation(primit
iveRenderer); |
59 } | 59 } |
60 | 60 |
61 inline void primitiveAttributeChanged(const QualifiedName& attribute) | 61 void primitiveAttributeChanged(const QualifiedName&); |
62 { | |
63 if (RenderObject* primitiveRenderer = renderer()) | |
64 static_cast<RenderSVGResourceFilterPrimitive*>(primitiveRenderer)->p
rimitiveAttributeChanged(attribute); | |
65 } | |
66 | 62 |
67 private: | 63 private: |
68 virtual bool isFilterEffect() const { return true; } | 64 virtual bool isFilterEffect() const { return true; } |
69 | 65 |
70 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 66 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
71 virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE; | 67 virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE; |
72 virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OV
ERRIDE { return false; } | 68 virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OV
ERRIDE { return false; } |
73 | 69 |
74 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes) | 70 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes) |
75 DECLARE_ANIMATED_LENGTH(X, x) | 71 DECLARE_ANIMATED_LENGTH(X, x) |
76 DECLARE_ANIMATED_LENGTH(Y, y) | 72 DECLARE_ANIMATED_LENGTH(Y, y) |
77 DECLARE_ANIMATED_LENGTH(Width, width) | 73 DECLARE_ANIMATED_LENGTH(Width, width) |
78 DECLARE_ANIMATED_LENGTH(Height, height) | 74 DECLARE_ANIMATED_LENGTH(Height, height) |
79 DECLARE_ANIMATED_STRING(Result, result) | 75 DECLARE_ANIMATED_STRING(Result, result) |
80 END_DECLARE_ANIMATED_PROPERTIES | 76 END_DECLARE_ANIMATED_PROPERTIES |
81 }; | 77 }; |
82 | 78 |
83 void invalidateFilterPrimitiveParent(SVGElement*); | 79 void invalidateFilterPrimitiveParent(SVGElement*); |
84 | 80 |
85 } // namespace WebCore | 81 } // namespace WebCore |
86 | 82 |
87 #endif | 83 #endif |
OLD | NEW |