Home | History | Annotate | Download | only in svg
      1 /*
      2  * Copyright (C) 2009 Dirk Schulze <krit (at) webkit.org>
      3  *
      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.
      8  *
      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.
     13  *
     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.
     18  */
     19 
     20 #ifndef SVGFEMorphologyElement_h
     21 #define SVGFEMorphologyElement_h
     22 
     23 #include "core/svg/SVGAnimatedEnumeration.h"
     24 #include "core/svg/SVGAnimatedNumberOptionalNumber.h"
     25 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
     26 #include "platform/graphics/filters/FEMorphology.h"
     27 
     28 namespace WebCore {
     29 
     30 template<> const SVGEnumerationStringEntries& getStaticStringEntries<MorphologyOperatorType>();
     31 
     32 class SVGFEMorphologyElement FINAL : public SVGFilterPrimitiveStandardAttributes {
     33 public:
     34     DECLARE_NODE_FACTORY(SVGFEMorphologyElement);
     35 
     36     void setRadius(float radiusX, float radiusY);
     37 
     38     SVGAnimatedNumber* radiusX() { return m_radius->firstNumber(); }
     39     SVGAnimatedNumber* radiusY() { return m_radius->secondNumber(); }
     40     SVGAnimatedString* in1() { return m_in1.get(); }
     41     SVGAnimatedEnumeration<MorphologyOperatorType>* svgOperator() { return m_svgOperator.get(); }
     42 
     43 private:
     44     explicit SVGFEMorphologyElement(Document&);
     45 
     46     bool isSupportedAttribute(const QualifiedName&);
     47     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
     48     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) OVERRIDE;
     49     virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
     50     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*) OVERRIDE;
     51 
     52     RefPtr<SVGAnimatedNumberOptionalNumber> m_radius;
     53     RefPtr<SVGAnimatedString> m_in1;
     54     RefPtr<SVGAnimatedEnumeration<MorphologyOperatorType> > m_svgOperator;
     55 };
     56 
     57 } // namespace WebCore
     58 
     59 #endif
     60