SVGFilterPrimitiveStandardAttributes.h [plain text]
#ifndef SVGFilterPrimitiveStandardAttributes_h
#define SVGFilterPrimitiveStandardAttributes_h
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "RenderSVGResourceFilter.h"
#include "RenderSVGResourceFilterPrimitive.h"
#include "SVGAnimatedLength.h"
#include "SVGAnimatedString.h"
#include "SVGStyledElement.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
class Filter;
class FilterEffect;
class SVGFilterBuilder;
class SVGFilterPrimitiveStandardAttributes : public SVGStyledElement {
public:
void setStandardAttributes(bool, FilterEffect*) const;
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter* filter) = 0;
virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
protected:
SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document*);
virtual void parseMappedAttribute(Attribute*);
virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
inline void invalidate()
{
if (RenderObject* primitiveRenderer = renderer())
RenderSVGResource::markForLayoutAndParentResourceInvalidation(primitiveRenderer);
}
inline void primitiveAttributeChanged(const QualifiedName& attribute)
{
if (RenderObject* primitiveRenderer = renderer())
static_cast<RenderSVGResourceFilterPrimitive*>(primitiveRenderer)->primitiveAttributeChanged(attribute);
}
private:
virtual bool isFilterEffect() const { return true; }
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual bool rendererIsNeeded(RenderStyle*);
DECLARE_ANIMATED_LENGTH(X, x)
DECLARE_ANIMATED_LENGTH(Y, y)
DECLARE_ANIMATED_LENGTH(Width, width)
DECLARE_ANIMATED_LENGTH(Height, height)
DECLARE_ANIMATED_STRING(Result, result)
};
}
#endif // ENABLE(SVG)
#endif