• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2     Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3     Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4     Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
5 
6     This file is part of the KDE project
7 
8     This library is free software; you can redistribute it and/or
9     modify it under the terms of the GNU Library General Public
10     License as published by the Free Software Foundation; either
11     version 2 of the License, or (at your option) any later version.
12 
13     This library is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16     Library General Public License for more details.
17 
18     You should have received a copy of the GNU Library General Public License
19     along with this library; see the file COPYING.LIB.  If not, write to
20     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21     Boston, MA 02110-1301, USA.
22 */
23 
24 #ifndef SVGFilterElement_h
25 #define SVGFilterElement_h
26 
27 #if ENABLE(SVG) && ENABLE(FILTERS)
28 #include "SVGResourceFilter.h"
29 #include "SVGExternalResourcesRequired.h"
30 #include "SVGLangSpace.h"
31 #include "SVGStyledElement.h"
32 #include "SVGURIReference.h"
33 
34 namespace WebCore {
35 
36     extern char SVGFilterResXIdentifier[];
37     extern char SVGFilterResYIdentifier[];
38 
39     class SVGFilterElement : public SVGStyledElement,
40                              public SVGURIReference,
41                              public SVGLangSpace,
42                              public SVGExternalResourcesRequired {
43     public:
44         SVGFilterElement(const QualifiedName&, Document*);
45         virtual ~SVGFilterElement();
46 
47         virtual SVGResource* canvasResource();
48 
49         void setFilterRes(unsigned long filterResX, unsigned long filterResY) const;
50 
51         virtual void parseMappedAttribute(MappedAttribute*);
rendererIsNeeded(RenderStyle *)52         virtual bool rendererIsNeeded(RenderStyle*) { return false; }
53 
54     protected:
contextElement()55         virtual const SVGElement* contextElement() const { return this; }
56 
57     private:
58         ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGNames::filterTagString, SVGNames::filterUnitsAttrString, int, FilterUnits, filterUnits)
59         ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGNames::filterTagString, SVGNames::primitiveUnitsAttrString, int, PrimitiveUnits, primitiveUnits)
60         ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGNames::filterTagString, SVGNames::xAttrString, SVGLength, X, x)
61         ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGNames::filterTagString, SVGNames::yAttrString, SVGLength, Y, y)
62         ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGNames::filterTagString, SVGNames::widthAttrString, SVGLength, Width, width)
63         ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGNames::filterTagString, SVGNames::heightAttrString, SVGLength, Height, height)
64         ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGNames::filterTagString, SVGFilterResXIdentifier, long, FilterResX, filterResX)
65         ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGNames::filterTagString, SVGFilterResYIdentifier, long, FilterResY, filterResY)
66 
67         RefPtr<SVGResourceFilter> m_filter;
68     };
69 
70 } // namespace WebCore
71 
72 #endif // ENABLE(SVG)
73 #endif
74