2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
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
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef SVGFilterPrimitiveStandardAttributes_h
22 #define SVGFilterPrimitiveStandardAttributes_h
24 #if ENABLE(SVG) && ENABLE(FILTERS)
25 #include "FilterEffect.h"
26 #include "RenderSVGResource.h"
27 #include "SVGAnimatedLength.h"
28 #include "SVGAnimatedPropertyMacros.h"
29 #include "SVGFilterBuilder.h"
30 #include "SVGFilterElement.h"
32 #include "SVGStyledElement.h"
34 #include <wtf/PassRefPtr.h>
35 #include <wtf/RefPtr.h>
39 class SVGFilterPrimitiveStandardAttributes : public SVGStyledElement {
41 void setStandardAttributes(bool, FilterEffect*) const;
43 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*) = 0;
46 SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document*);
48 virtual void parseMappedAttribute(Attribute*);
49 virtual void svgAttributeChanged(const QualifiedName&);
50 virtual void synchronizeProperty(const QualifiedName&);
51 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
54 inline void invalidate()
56 if (RenderObject* primitiveRenderer = renderer())
57 RenderSVGResource::markForLayoutAndParentResourceInvalidation(primitiveRenderer);
61 virtual bool isFilterEffect() const { return true; }
63 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
65 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x)
66 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y)
67 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width)
68 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, SVGLength, Height, height)
69 DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, String, Result, result)
72 } // namespace WebCore