2 Copyright (C) 2005 Alexander Kellett <lypanov@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef SVGMaskElement_h
21 #define SVGMaskElement_h
24 #include "SVGResourceMasker.h"
25 #include "SVGExternalResourcesRequired.h"
26 #include "SVGLangSpace.h"
27 #include "SVGStyledLocatableElement.h"
29 #include "SVGURIReference.h"
30 #include <wtf/PassOwnPtr.h>
36 class SVGMaskElement
: public SVGStyledLocatableElement
,
37 public SVGURIReference
,
40 public SVGExternalResourcesRequired
{
42 SVGMaskElement(const QualifiedName
&, Document
*);
43 virtual ~SVGMaskElement();
44 virtual bool isValid() const { return SVGTests::isValid(); }
46 virtual void parseMappedAttribute(MappedAttribute
*);
47 virtual void svgAttributeChanged(const QualifiedName
&);
48 virtual void childrenChanged(bool changedByParser
= false, Node
* beforeChange
= 0, Node
* afterChange
= 0, int childCountDelta
= 0);
50 virtual RenderObject
* createRenderer(RenderArena
*, RenderStyle
*);
51 virtual SVGResource
* canvasResource();
53 PassOwnPtr
<ImageBuffer
> drawMaskerContent(const FloatRect
& targetRect
, FloatRect
& maskRect
) const;
56 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement
, SVGNames::maskTagString
, SVGNames::maskUnitsAttrString
, int, MaskUnits
, maskUnits
)
57 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement
, SVGNames::maskTagString
, SVGNames::maskContentUnitsAttrString
, int, MaskContentUnits
, maskContentUnits
)
58 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement
, SVGNames::maskTagString
, SVGNames::xAttrString
, SVGLength
, X
, x
)
59 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement
, SVGNames::maskTagString
, SVGNames::yAttrString
, SVGLength
, Y
, y
)
60 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement
, SVGNames::maskTagString
, SVGNames::widthAttrString
, SVGLength
, Width
, width
)
61 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement
, SVGNames::maskTagString
, SVGNames::heightAttrString
, SVGLength
, Height
, height
)
64 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement
, SVGURIReferenceIdentifier
, XLinkNames::hrefAttrString
, String
, Href
, href
)
66 // SVGExternalResourcesRequired
67 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement
, SVGExternalResourcesRequiredIdentifier
,
68 SVGNames::externalResourcesRequiredAttrString
, bool,
69 ExternalResourcesRequired
, externalResourcesRequired
)
71 RefPtr
<SVGResourceMasker
> m_masker
;
74 } // namespace WebCore