+2006-10-09 Rob Buis <buis@kde.org>
+
+ Reviewed by Darin.
+
+ http://bugs.webkit.org/show_bug.cgi?id=11217
+ Cleanup svg coding style
+
+ Cleanup coding style in filter classes.
+
+ * ksvg2/svg/SVGComponentTransferFunctionElement.cpp:
+ (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
+ (WebCore::SVGComponentTransferFunctionElement::parseMappedAttribute):
+ * ksvg2/svg/SVGComponentTransferFunctionElement.h:
+ * ksvg2/svg/SVGFEBlendElement.cpp:
+ (WebCore::SVGFEBlendElement::SVGFEBlendElement):
+ (WebCore::SVGFEBlendElement::parseMappedAttribute):
+ (WebCore::SVGFEBlendElement::filterEffect):
+ * ksvg2/svg/SVGFEBlendElement.h:
+ * ksvg2/svg/SVGFEColorMatrixElement.cpp:
+ (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
+ (WebCore::SVGFEColorMatrixElement::parseMappedAttribute):
+ (WebCore::SVGFEColorMatrixElement::filterEffect):
+ * ksvg2/svg/SVGFEColorMatrixElement.h:
+ * ksvg2/svg/SVGFECompositeElement.cpp:
+ (WebCore::SVGFECompositeElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFECompositeElement.h:
+ * ksvg2/svg/SVGFEDisplacementMapElement.cpp:
+ (WebCore::SVGFEDisplacementMapElement::stringToChannel):
+ * ksvg2/svg/SVGFEDisplacementMapElement.h:
+ * ksvg2/svg/SVGFEFloodElement.cpp:
+ (WebCore::SVGFEFloodElement::filterEffect):
+ * ksvg2/svg/SVGFEFuncAElement.cpp:
+ (WebCore::SVGFEFuncAElement::SVGFEFuncAElement):
+ * ksvg2/svg/SVGFEFuncBElement.cpp:
+ (WebCore::SVGFEFuncBElement::SVGFEFuncBElement):
+ * ksvg2/svg/SVGFEFuncGElement.cpp:
+ (WebCore::SVGFEFuncGElement::SVGFEFuncGElement):
+ * ksvg2/svg/SVGFEFuncRElement.cpp:
+ (WebCore::SVGFEFuncRElement::SVGFEFuncRElement):
+ * ksvg2/svg/SVGFEGaussianBlurElement.cpp:
+ (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
+ (WebCore::SVGFEGaussianBlurElement::parseMappedAttribute):
+ (WebCore::SVGFEGaussianBlurElement::filterEffect):
+ * ksvg2/svg/SVGFEGaussianBlurElement.h:
+ * ksvg2/svg/SVGFELightElement.cpp:
+ (WebCore::SVGFELightElement::SVGFELightElement):
+ (WebCore::SVGFELightElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFELightElement.h:
+ * ksvg2/svg/SVGFEMergeElement.cpp:
+ (WebCore::SVGFEMergeElement::SVGFEMergeElement):
+
2006-10-09 Rob Buis <buis@kde.org>
Reviewed by olliej.
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
+#include "SVGComponentTransferFunctionElement.h"
-#include "SVGNames.h"
-#include "SVGHelper.h"
-#include "SVGRenderStyle.h"
#include "SVGFEComponentTransferElement.h"
-#include "SVGComponentTransferFunctionElement.h"
+#include "SVGHelper.h"
+#include "SVGNames.h"
#include "SVGNumberList.h"
-using namespace WebCore;
+namespace WebCore {
-SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const QualifiedName& tagName, Document *doc)
+SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const QualifiedName& tagName, Document* doc)
: SVGElement(tagName, doc)
, m_type(0)
, m_tableValues(new SVGNumberList)
ANIMATED_PROPERTY_DEFINITIONS(SVGComponentTransferFunctionElement, double, Number, number, Exponent, exponent, SVGNames::exponentAttr.localName(), m_exponent)
ANIMATED_PROPERTY_DEFINITIONS(SVGComponentTransferFunctionElement, double, Number, number, Offset, offset, SVGNames::offsetAttr.localName(), m_offset)
-void SVGComponentTransferFunctionElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGComponentTransferFunctionElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::typeAttr)
{
- if(value == "identity")
+ if (value == "identity")
setTypeBaseValue(SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY);
- else if(value == "table")
+ else if (value == "table")
setTypeBaseValue(SVG_FECOMPONENTTRANSFER_TYPE_TABLE);
- else if(value == "discrete")
+ else if (value == "discrete")
setTypeBaseValue(SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE);
- else if(value == "linear")
+ else if (value == "linear")
setTypeBaseValue(SVG_FECOMPONENTTRANSFER_TYPE_LINEAR);
- else if(value == "gamma")
+ else if (value == "gamma")
setTypeBaseValue(SVG_FECOMPONENTTRANSFER_TYPE_GAMMA);
}
else if (attr->name() == SVGNames::tableValuesAttr)
func.amplitude = amplitude();
func.exponent = exponent();
func.offset = offset();
- SVGNumberList *numbers = tableValues();
+ SVGNumberList* numbers = tableValues();
ExceptionCode ec = 0;
unsigned int nr = numbers->numberOfItems();
return func;
}
+}
+
// vim:ts=4:noet
#endif // SVG_SUPPORT
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#define KSVG_SVGComponentTransferFunctionElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGElement.h"
#include "KCanvasFilters.h"
+#include "SVGElement.h"
namespace WebCore
{
// 'SVGComponentTransferFunctionElement' functions
// Derived from: 'Element'
- virtual void parseMappedAttribute(MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute* attr);
KCComponentTransferFunction transferFunction() const;
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
-
-#include <kcanvas/KCanvasFilters.h>
-#include <kcanvas/device/KRenderingDevice.h>
+#include "SVGFEBlendElement.h"
-#include "ksvg.h"
+#include "KRenderingDevice.h"
#include "SVGHelper.h"
-#include "SVGRenderStyle.h"
-#include "SVGFEBlendElement.h"
namespace WebCore {
-SVGFEBlendElement::SVGFEBlendElement(const QualifiedName& tagName, Document *doc)
+SVGFEBlendElement::SVGFEBlendElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_mode(0)
, m_filterEffect(0)
ANIMATED_PROPERTY_DEFINITIONS(SVGFEBlendElement, String, String, string, In2, in2, SVGNames::in2Attr.localName(), m_in2)
ANIMATED_PROPERTY_DEFINITIONS(SVGFEBlendElement, int, Enumeration, enumeration, Mode, mode, SVGNames::modeAttr.localName(), m_mode)
-void SVGFEBlendElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEBlendElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
- if (attr->name() == SVGNames::modeAttr)
- {
- if(value == "normal")
+ if (attr->name() == SVGNames::modeAttr) {
+ if (value == "normal")
setModeBaseValue(SVG_FEBLEND_MODE_NORMAL);
- else if(value == "multiply")
+ else if (value == "multiply")
setModeBaseValue(SVG_FEBLEND_MODE_MULTIPLY);
- else if(value == "screen")
+ else if (value == "screen")
setModeBaseValue(SVG_FEBLEND_MODE_SCREEN);
- else if(value == "darken")
+ else if (value == "darken")
setModeBaseValue(SVG_FEBLEND_MODE_DARKEN);
- else if(value == "lighten")
+ else if (value == "lighten")
setModeBaseValue(SVG_FEBLEND_MODE_LIGHTEN);
- }
- else if (attr->name() == SVGNames::inAttr)
+ } else if (attr->name() == SVGNames::inAttr)
setIn1BaseValue(value);
else if (attr->name() == SVGNames::in2Attr)
setIn2BaseValue(value);
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-KCanvasFEBlend *SVGFEBlendElement::filterEffect() const
+KCanvasFEBlend* SVGFEBlendElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<KCanvasFEBlend *>(renderingDevice()->createFilterEffect(FE_BLEND));
+ m_filterEffect = static_cast<KCanvasFEBlend*>(renderingDevice()->createFilterEffect(FE_BLEND));
if (!m_filterEffect)
return 0;
m_filterEffect->setBlendMode((KCBlendModeType)(mode()-1));
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#define KSVG_SVGFEBlendElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGFilterPrimitiveStandardAttributes.h"
#include "KCanvasFilters.h"
+#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore
{
// 'SVGFEBlendElement' functions
// Derived from: 'Element'
- virtual void parseMappedAttribute(MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute* attr);
- virtual KCanvasFEBlend *filterEffect() const;
+ virtual KCanvasFEBlend* filterEffect() const;
protected:
virtual const SVGElement* contextElement() const { return this; }
ANIMATED_PROPERTY_DECLARATIONS(SVGFEBlendElement, String, String, In1, in1)
ANIMATED_PROPERTY_DECLARATIONS(SVGFEBlendElement, String, String, In2, in2)
ANIMATED_PROPERTY_DECLARATIONS(SVGFEBlendElement, int, int, Mode, mode)
- mutable KCanvasFEBlend *m_filterEffect;
+ mutable KCanvasFEBlend* m_filterEffect;
};
} // namespace WebCore
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
+#include "SVGFEColorMatrixElement.h"
-#include "KCanvasFilters.h"
#include "KRenderingDevice.h"
-#include "KRenderingPaintServerGradient.h"
-
-#include "ksvg.h"
-#include "SVGNames.h"
#include "SVGHelper.h"
-#include "SVGRenderStyle.h"
-#include "SVGFEColorMatrixElement.h"
+#include "SVGNames.h"
#include "SVGNumberList.h"
namespace WebCore {
-SVGFEColorMatrixElement::SVGFEColorMatrixElement(const QualifiedName& tagName, Document *doc)
+SVGFEColorMatrixElement::SVGFEColorMatrixElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_type(0)
, m_values(new SVGNumberList)
ANIMATED_PROPERTY_DEFINITIONS(SVGFEColorMatrixElement, int, Enumeration, enumeration, Type, type, SVGNames::typeAttr.localName(), m_type)
ANIMATED_PROPERTY_DEFINITIONS(SVGFEColorMatrixElement, SVGNumberList*, NumberList, numberList, Values, values, SVGNames::valuesAttr.localName(), m_values.get())
-void SVGFEColorMatrixElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEColorMatrixElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::typeAttr) {
- if(value == "matrix")
+ if (value == "matrix")
setTypeBaseValue(SVG_FECOLORMATRIX_TYPE_MATRIX);
- else if(value == "saturate")
+ else if (value == "saturate")
setTypeBaseValue(SVG_FECOLORMATRIX_TYPE_SATURATE);
- else if(value == "hueRotate")
+ else if (value == "hueRotate")
setTypeBaseValue(SVG_FECOLORMATRIX_TYPE_HUEROTATE);
- else if(value == "luminanceToAlpha")
+ else if (value == "luminanceToAlpha")
setTypeBaseValue(SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA);
}
else if (attr->name() == SVGNames::inAttr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-KCanvasFEColorMatrix *SVGFEColorMatrixElement::filterEffect() const
+KCanvasFEColorMatrix* SVGFEColorMatrixElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<KCanvasFEColorMatrix *>(renderingDevice()->createFilterEffect(FE_COLOR_MATRIX));
+ m_filterEffect = static_cast<KCanvasFEColorMatrix*>(renderingDevice()->createFilterEffect(FE_COLOR_MATRIX));
if (!m_filterEffect)
return 0;
m_filterEffect->setIn(in1());
setStandardAttributes(m_filterEffect);
DeprecatedValueList<float> _values;
- SVGNumberList *numbers = values();
+ SVGNumberList* numbers = values();
ExceptionCode ec = 0;
unsigned int nr = numbers->numberOfItems();
- for(unsigned int i = 0;i < nr;i++)
+ for (unsigned int i = 0;i < nr;i++)
_values.append(numbers->getItem(i, ec));
m_filterEffect->setValues(_values);
m_filterEffect->setType((KCColorMatrixType)(type() - 1));
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#define KSVG_SVGFEColorMatrixElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGFilterPrimitiveStandardAttributes.h"
#include "KCanvasFilters.h"
+#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore
{
// 'SVGFEColorMatrixElement' functions
// Derived from: 'Element'
- virtual void parseMappedAttribute(MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute* attr);
- virtual KCanvasFEColorMatrix *filterEffect() const;
+ virtual KCanvasFEColorMatrix* filterEffect() const;
protected:
virtual const SVGElement* contextElement() const { return this; }
ANIMATED_PROPERTY_DECLARATIONS(SVGFEColorMatrixElement, String, String, In1, in1)
ANIMATED_PROPERTY_DECLARATIONS(SVGFEColorMatrixElement, int, int, Type, type)
ANIMATED_PROPERTY_DECLARATIONS(SVGFEColorMatrixElement, SVGNumberList*, RefPtr<SVGNumberList>, Values, values)
- mutable KCanvasFEColorMatrix *m_filterEffect;
+ mutable KCanvasFEColorMatrix* m_filterEffect;
};
} // namespace WebCore
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
+#include "SVGFECompositeElement.h"
-#include "KCanvasFilters.h"
#include "KRenderingDevice.h"
-#include "KRenderingPaintServerGradient.h"
-
-#include "ksvg.h"
-#include "SVGNames.h"
#include "SVGHelper.h"
-#include "SVGRenderStyle.h"
-#include "SVGFECompositeElement.h"
+#include "SVGNames.h"
namespace WebCore {
const String& value = attr->value();
if (attr->name() == SVGNames::operatorAttr)
{
- if(value == "over")
+ if (value == "over")
set_operatorBaseValue(SVG_FECOMPOSITE_OPERATOR_OVER);
- else if(value == "in")
+ else if (value == "in")
set_operatorBaseValue(SVG_FECOMPOSITE_OPERATOR_IN);
- else if(value == "out")
+ else if (value == "out")
set_operatorBaseValue(SVG_FECOMPOSITE_OPERATOR_OUT);
- else if(value == "atop")
+ else if (value == "atop")
set_operatorBaseValue(SVG_FECOMPOSITE_OPERATOR_ATOP);
- else if(value == "xor")
+ else if (value == "xor")
set_operatorBaseValue(SVG_FECOMPOSITE_OPERATOR_XOR);
- else if(value == "arithmetic")
+ else if (value == "arithmetic")
set_operatorBaseValue(SVG_FECOMPOSITE_OPERATOR_ARITHMETIC);
}
else if (attr->name() == SVGNames::inAttr)
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#define KSVG_SVGFECompositeElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGFilterPrimitiveStandardAttributes.h"
#include "KCanvasFilters.h"
+#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore
{
// 'SVGFECompositeElement' functions
// Derived from: 'Element'
- virtual void parseMappedAttribute(MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute* attr);
- virtual KCanvasFEComposite *filterEffect() const;
+ virtual KCanvasFEComposite* filterEffect() const;
protected:
virtual const SVGElement* contextElement() const { return this; }
ANIMATED_PROPERTY_DECLARATIONS(SVGFECompositeElement, double, double, K2, k2)
ANIMATED_PROPERTY_DECLARATIONS(SVGFECompositeElement, double, double, K3, k3)
ANIMATED_PROPERTY_DECLARATIONS(SVGFECompositeElement, double, double, K4, k4)
- mutable KCanvasFEComposite *m_filterEffect;
+ mutable KCanvasFEComposite* m_filterEffect;
};
} // namespace WebCore
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
-
-#include <kcanvas/KCanvasFilters.h>
-#include <kcanvas/device/KRenderingDevice.h>
+#include "SVGFEDisplacementMapElement.h"
-#include "ksvg.h"
+#include "KRenderingDevice.h"
#include "SVGHelper.h"
-#include "SVGRenderStyle.h"
-#include "SVGFEDisplacementMapElement.h"
-using namespace WebCore;
+namespace WebCore {
SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
KCChannelSelectorType SVGFEDisplacementMapElement::stringToChannel(const String& key)
{
- if(key == "R")
+ if (key == "R")
return CS_RED;
- else if(key == "G")
+ else if (key == "G")
return CS_GREEN;
- else if(key == "B")
+ else if (key == "B")
return CS_BLUE;
- else if(key == "A")
+ else if (key == "A")
return CS_ALPHA;
//error
return (KCChannelSelectorType)-1;
setStandardAttributes(m_filterEffect);
return m_filterEffect;
}
+
+}
#endif // SVG_SUPPORT
#define KSVG_SVGFEDisplacementMapElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGFilterPrimitiveStandardAttributes.h"
#include "KCanvasFilters.h"
+#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#ifdef SVG_SUPPORT
#include "SVGFEFuncAElement.h"
-using namespace WebCore;
+namespace WebCore {
-SVGFEFuncAElement::SVGFEFuncAElement(const QualifiedName& tagName, Document *doc) :
-SVGComponentTransferFunctionElement(tagName, doc)
+SVGFEFuncAElement::SVGFEFuncAElement(const QualifiedName& tagName, Document* doc)
+ : SVGComponentTransferFunctionElement(tagName, doc)
{
}
{
}
+}
+
// vim:ts=4:noet
#endif // SVG_SUPPORT
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#ifdef SVG_SUPPORT
#include "SVGFEFuncBElement.h"
-using namespace WebCore;
+namespace WebCore {
-SVGFEFuncBElement::SVGFEFuncBElement(const QualifiedName& tagName, Document *doc) :
-SVGComponentTransferFunctionElement(tagName, doc)
+SVGFEFuncBElement::SVGFEFuncBElement(const QualifiedName& tagName, Document *doc)
+ : SVGComponentTransferFunctionElement(tagName, doc)
{
}
{
}
+}
+
// vim:ts=4:noet
#endif // SVG_SUPPORT
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#ifdef SVG_SUPPORT
#include "SVGFEFuncGElement.h"
-using namespace WebCore;
+namespace WebCore {
-SVGFEFuncGElement::SVGFEFuncGElement(const QualifiedName& tagName, Document *doc) :
+SVGFEFuncGElement::SVGFEFuncGElement(const QualifiedName& tagName, Document* doc) :
SVGComponentTransferFunctionElement(tagName, doc)
{
}
{
}
+}
+
// vim:ts=4:noet
#endif // SVG_SUPPORT
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#ifdef SVG_SUPPORT
#include "SVGFEFuncRElement.h"
-using namespace WebCore;
+namespace WebCore {
-SVGFEFuncRElement::SVGFEFuncRElement(const QualifiedName& tagName, Document *doc) :
-SVGComponentTransferFunctionElement(tagName, doc)
+SVGFEFuncRElement::SVGFEFuncRElement(const QualifiedName& tagName, Document* doc)
+ : SVGComponentTransferFunctionElement(tagName, doc)
{
}
{
}
+}
+
// vim:ts=4:noet
#endif // SVG_SUPPORT
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
+#include "SVGFEGaussianBlurElement.h"
-#include "KCanvasFilters.h"
#include "KRenderingDevice.h"
#include "KRenderingPaintServerGradient.h"
-
-#include "SVGNames.h"
#include "SVGHelper.h"
-#include "SVGRenderStyle.h"
-#include "SVGFEGaussianBlurElement.h"
+#include "SVGNames.h"
namespace WebCore {
-SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& tagName, Document *doc)
+SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_stdDeviationX(0.0)
, m_stdDeviationY(0.0)
{
}
-void SVGFEGaussianBlurElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEGaussianBlurElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::stdDeviationAttr) {
Vector<String> numbers = value.split(' ');
setStdDeviationXBaseValue(numbers[0].toDouble());
- if(numbers.size() == 1)
+ if (numbers.size() == 1)
setStdDeviationYBaseValue(numbers[0].toDouble());
else
setStdDeviationYBaseValue(numbers[1].toDouble());
- }
- else if (attr->name() == SVGNames::inAttr)
+ } else if (attr->name() == SVGNames::inAttr)
setIn1BaseValue(value);
else
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-KCanvasFEGaussianBlur *SVGFEGaussianBlurElement::filterEffect() const
+KCanvasFEGaussianBlur* SVGFEGaussianBlurElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<KCanvasFEGaussianBlur *>(renderingDevice()->createFilterEffect(FE_GAUSSIAN_BLUR));
+ m_filterEffect = static_cast<KCanvasFEGaussianBlur*>(renderingDevice()->createFilterEffect(FE_GAUSSIAN_BLUR));
if (!m_filterEffect)
return 0;
m_filterEffect->setIn(in1());
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#define KSVG_SVGFEGaussianBlurElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGFilterPrimitiveStandardAttributes.h"
#include "KCanvasFilters.h"
+#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore
{
void setStdDeviation(float stdDeviationX, float stdDeviationY);
// Derived from: 'Element'
- virtual void parseMappedAttribute(MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute* attr);
- virtual KCanvasFEGaussianBlur *filterEffect() const;
+ virtual KCanvasFEGaussianBlur* filterEffect() const;
protected:
virtual const SVGElement* contextElement() const { return this; }
ANIMATED_PROPERTY_DECLARATIONS(SVGFEGaussianBlurElement, String, String, In1, in1)
ANIMATED_PROPERTY_DECLARATIONS(SVGFEGaussianBlurElement, double, double, StdDeviationX, stdDeviationX)
ANIMATED_PROPERTY_DECLARATIONS(SVGFEGaussianBlurElement, double, double, StdDeviationY, stdDeviationY)
- mutable KCanvasFEGaussianBlur *m_filterEffect;
+ mutable KCanvasFEGaussianBlur* m_filterEffect;
};
} // namespace WebCore
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>
This library is free software; you can redistribute it and/or
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
- */
+*/
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
-
-#include "KCanvasFilters.h"
-#include "KRenderingDevice.h"
+#include "SVGFELightElement.h"
-#include "SVGNames.h"
#include "SVGHelper.h"
-#include "SVGRenderStyle.h"
-#include "SVGFELightElement.h"
+#include "SVGNames.h"
-using namespace WebCore;
+namespace WebCore {
-SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document *doc)
+SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document* doc)
: SVGElement(tagName, doc)
, m_azimuth(0.0)
, m_elevation(0.0)
ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, double, Number, number, SpecularExponent, specularExponent, SVGNames::specularExponentAttr.localName(), m_specularExponent)
ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, double, Number, number, LimitingConeAngle, limitingConeAngle, SVGNames::limitingConeAngleAttr.localName(), m_limitingConeAngle)
-void SVGFELightElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFELightElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::azimuthAttr)
else
SVGElement::parseMappedAttribute(attr);
}
+
+}
+
#endif // SVG_SUPPORT
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>
This library is free software; you can redistribute it and/or
#define KSVG_SVGFELightElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGElement.h"
#include "KCanvasFilters.h"
+#include "SVGElement.h"
namespace WebCore
{
virtual ~SVGFELightElement();
// 'SVGComponentTransferFunctionElement' functions
- virtual KCLightSource *lightSource() const = 0;
+ virtual KCLightSource* lightSource() const = 0;
// Derived from: 'Element'
- virtual void parseMappedAttribute(MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute* attr);
private:
ANIMATED_PROPERTY_DECLARATIONS(SVGFELightElement, double, double, Azimuth, azimuth)
ANIMATED_PROPERTY_DECLARATIONS(SVGFELightElement, double, double, Elevation, elevation)
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
-
-#include <kcanvas/KCanvasFilters.h>
-#include <kcanvas/device/KRenderingDevice.h>
-
-#include "ksvg.h"
-#include "SVGHelper.h"
-#include "SVGRenderStyle.h"
#include "SVGFEMergeElement.h"
+
+#include "KRenderingDevice.h"
#include "SVGFEMergeNodeElement.h"
+#include "SVGHelper.h"
-using namespace WebCore;
+namespace WebCore {
-SVGFEMergeElement::SVGFEMergeElement(const QualifiedName& tagName, Document *doc)
+SVGFEMergeElement::SVGFEMergeElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_filterEffect(0)
{
delete m_filterEffect;
}
-KCanvasFEMerge *SVGFEMergeElement::filterEffect() const
+KCanvasFEMerge* SVGFEMergeElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<KCanvasFEMerge *>(renderingDevice()->createFilterEffect(FE_MERGE));
+ m_filterEffect = static_cast<KCanvasFEMerge*>(renderingDevice()->createFilterEffect(FE_MERGE));
if (!m_filterEffect)
return 0;
setStandardAttributes(m_filterEffect);
Vector<String> mergeInputs;
for (Node* n = firstChild(); n != 0; n = n->nextSibling()) {
if (n->hasTagName(SVGNames::feMergeNodeTag))
- mergeInputs.append(static_cast<SVGFEMergeNodeElement *>(n)->in1());
+ mergeInputs.append(static_cast<SVGFEMergeNodeElement*>(n)->in1());
}
m_filterEffect->setMergeInputs(mergeInputs);
return m_filterEffect;
}
+}
+
// vim:ts=4:noet
#endif // SVG_SUPPORT
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#define KSVG_SVGFEMergeElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGFilterPrimitiveStandardAttributes.h"
#include "KCanvasFilters.h"
+#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore
{
SVGFEMergeElement(const QualifiedName&, Document*);
virtual ~SVGFEMergeElement();
- virtual KCanvasFEMerge *filterEffect() const;
+ virtual KCanvasFEMerge* filterEffect() const;
protected:
virtual const SVGElement* contextElement() const { return this; }
private:
- mutable KCanvasFEMerge *m_filterEffect;
+ mutable KCanvasFEMerge* m_filterEffect;
};
} // namespace WebCore
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
+#include "SVGFEMergeNodeElement.h"
#include "SVGHelper.h"
-#include "SVGFEMergeNodeElement.h"
-using namespace WebCore;
+namespace WebCore {
-SVGFEMergeNodeElement::SVGFEMergeNodeElement(const QualifiedName& tagName, Document *doc) : SVGElement(tagName, doc)
+SVGFEMergeNodeElement::SVGFEMergeNodeElement(const QualifiedName& tagName, Document* doc)
+ : SVGElement(tagName, doc)
{
}
ANIMATED_PROPERTY_DEFINITIONS(SVGFEMergeNodeElement, String, String, string, In1, in1, SVGNames::inAttr.localName(), m_in1)
-void SVGFEMergeNodeElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEMergeNodeElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
SVGElement::parseMappedAttribute(attr);
}
+}
// vim:ts=4:noet
#endif // SVG_SUPPORT
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
virtual ~SVGFEMergeNodeElement();
// Derived from: 'Element'
- virtual void parseMappedAttribute(MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute* attr);
// 'SVGFEMergeNodeElement' functions
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>
This library is free software; you can redistribute it and/or
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
- */
+*/
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
-
-#include <kcanvas/KCanvasFilters.h>
-#include <kcanvas/device/KRenderingDevice.h>
+#include "SVGFESpecularLightingElement.h"
-#include "SVGNames.h"
-#include "SVGHelper.h"
-#include "SVGRenderStyle.h"
+#include "KRenderingDevice.h"
#include "SVGColor.h"
+#include "SVGHelper.h"
+#include "SVGNames.h"
#include "SVGFELightElement.h"
-#include "SVGFESpecularLightingElement.h"
-
-using namespace WebCore;
+namespace WebCore {
-SVGFESpecularLightingElement::SVGFESpecularLightingElement(const QualifiedName& tagName, Document *doc)
+SVGFESpecularLightingElement::SVGFESpecularLightingElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_specularConstant(0.0)
, m_specularExponent(0.0)
ANIMATED_PROPERTY_DEFINITIONS(SVGFESpecularLightingElement, double, Number, number, KernelUnitLengthY, kernelUnitLengthY, "kernelUnitLengthY", m_kernelUnitLengthY)
ANIMATED_PROPERTY_DEFINITIONS(SVGFESpecularLightingElement, SVGColor*, Color, color, LightingColor, lightingColor, SVGNames::lighting_colorAttr.localName(), m_lightingColor.get())
-void SVGFESpecularLightingElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFESpecularLightingElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-KCanvasFESpecularLighting *SVGFESpecularLightingElement::filterEffect() const
+KCanvasFESpecularLighting* SVGFESpecularLightingElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<KCanvasFESpecularLighting *>(renderingDevice()->createFilterEffect(FE_SPECULAR_LIGHTING));
+ m_filterEffect = static_cast<KCanvasFESpecularLighting*>(renderingDevice()->createFilterEffect(FE_SPECULAR_LIGHTING));
m_filterEffect->setIn(in1());
setStandardAttributes(m_filterEffect);
m_filterEffect->setSpecularConstant((specularConstant()));
if (!m_filterEffect)
return;
- KCLightSource *light = 0;
- for (Node *n = firstChild(); n; n = n->nextSibling()) {
+ KCLightSource* light = 0;
+ for (Node* n = firstChild(); n; n = n->nextSibling()) {
if (n->hasTagName(SVGNames::feDistantLightTag)||n->hasTagName(SVGNames::fePointLightTag)||n->hasTagName(SVGNames::feSpotLightTag)) {
- SVGFELightElement *lightNode = static_cast<SVGFELightElement *>(n);
+ SVGFELightElement* lightNode = static_cast<SVGFELightElement*>(n);
light = lightNode->lightSource();
break;
}
}
m_filterEffect->setLightSource(light);
}
+
+}
+
#endif // SVG_SUPPORT
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>
This library is free software; you can redistribute it and/or
#define KSVG_SVGFESpecularLightingElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGFilterPrimitiveStandardAttributes.h"
#include "KCanvasFilters.h"
+#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore
{
// 'SVGFEDiffuseLightingElement' functions
// Derived from: 'Element'
- virtual void parseMappedAttribute(MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute* attr);
- virtual KCanvasFESpecularLighting *filterEffect() const;
+ virtual KCanvasFESpecularLighting* filterEffect() const;
protected:
virtual const SVGElement* contextElement() const { return this; }
ANIMATED_PROPERTY_DECLARATIONS(SVGFESpecularLightingElement, double, double, KernelUnitLengthX, kernelUnitLengthX)
ANIMATED_PROPERTY_DECLARATIONS(SVGFESpecularLightingElement, double, double, KernelUnitLengthY, kernelUnitLengthY)
//need other properties here...
- mutable KCanvasFESpecularLighting *m_filterEffect;
+ mutable KCanvasFESpecularLighting* m_filterEffect;
//light management
void updateLights() const;
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
+#include "SVGFETurbulenceElement.h"
-#include "KCanvasFilters.h"
#include "KRenderingDevice.h"
-#include "KRenderingPaintServerGradient.h"
-
-#include "ksvg.h"
-#include "SVGHelper.h"
-#include "SVGRenderStyle.h"
-#include "SVGFETurbulenceElement.h"
namespace WebCore {
-SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Document *doc)
+SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_baseFrequencyX(0.0)
, m_baseFrequencyY(0.0)
ANIMATED_PROPERTY_DEFINITIONS(SVGFETurbulenceElement, int, Enumeration, enumeration, StitchTiles, stitchTiles, SVGNames::stitchTilesAttr.localName(), m_stitchTiles)
ANIMATED_PROPERTY_DEFINITIONS(SVGFETurbulenceElement, int, Enumeration, enumeration, Type, type, SVGNames::typeAttr.localName(), m_type)
-void SVGFETurbulenceElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFETurbulenceElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
- if (attr->name() == SVGNames::typeAttr)
- {
- if(value == "fractalNoise")
+ if (attr->name() == SVGNames::typeAttr) {
+ if (value == "fractalNoise")
setTypeBaseValue(SVG_TURBULENCE_TYPE_FRACTALNOISE);
- else if(value == "turbulence")
+ else if (value == "turbulence")
setTypeBaseValue(SVG_TURBULENCE_TYPE_TURBULENCE);
- }
- else if (attr->name() == SVGNames::stitchTilesAttr)
- {
- if(value == "stitch")
+ } else if (attr->name() == SVGNames::stitchTilesAttr) {
+ if (value == "stitch")
setStitchTilesBaseValue(SVG_STITCHTYPE_STITCH);
- else if(value == "nostitch")
+ else if (value == "nostitch")
setStitchTilesBaseValue(SVG_STITCHTYPE_NOSTITCH);
- }
- else if (attr->name() == SVGNames::baseFrequencyAttr)
- {
+ } else if (attr->name() == SVGNames::baseFrequencyAttr) {
Vector<String> numbers = value.split(' ');
setBaseFrequencyXBaseValue(numbers[0].toDouble());
- if(numbers.size() == 1)
+ if (numbers.size() == 1)
setBaseFrequencyYBaseValue(numbers[0].toDouble());
else
setBaseFrequencyYBaseValue(numbers[1].toDouble());
- }
- else if (attr->name() == SVGNames::seedAttr)
+ } else if (attr->name() == SVGNames::seedAttr)
setSeedBaseValue(value.toDouble());
else if (attr->name() == SVGNames::numOctavesAttr)
setNumOctavesBaseValue(value.deprecatedString().toUInt());
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-KCanvasFETurbulence *SVGFETurbulenceElement::filterEffect() const
+KCanvasFETurbulence* SVGFETurbulenceElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<KCanvasFETurbulence *>(renderingDevice()->createFilterEffect(FE_TURBULENCE));
+ m_filterEffect = static_cast<KCanvasFETurbulence*>(renderingDevice()->createFilterEffect(FE_TURBULENCE));
if (!m_filterEffect)
return 0;
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#define KSVG_SVGFETurbulenceElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGFilterPrimitiveStandardAttributes.h"
#include "KCanvasFilters.h"
+#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore
{
// 'SVGFETurbulenceElement' functions
// Derived from: 'Element'
- virtual void parseMappedAttribute(MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute* attr);
- virtual KCanvasFETurbulence *filterEffect() const;
+ virtual KCanvasFETurbulence* filterEffect() const;
protected:
virtual const SVGElement* contextElement() const { return this; }
ANIMATED_PROPERTY_DECLARATIONS(SVGFETurbulenceElement, double, double, Seed, seed)
ANIMATED_PROPERTY_DECLARATIONS(SVGFETurbulenceElement, int, int, StitchTiles, stitchTiles)
ANIMATED_PROPERTY_DECLARATIONS(SVGFETurbulenceElement, int, int, Type, type)
- mutable KCanvasFETurbulence *m_filterEffect;
+ mutable KCanvasFETurbulence* m_filterEffect;
};
} // namespace WebCore
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
This file is part of the KDE project
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
+#include "SVGFilterElement.h"
+#include "Attr.h"
#include "KRenderingDevice.h"
#include "KCanvasFilters.h"
-#include "SVGUnitTypes.h"
-#include "SVGNames.h"
-#include "SVGHelper.h"
-#include "SVGFilterElement.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
+#include "SVGHelper.h"
#include "SVGLength.h"
+#include "SVGNames.h"
+#include "SVGUnitTypes.h"
namespace WebCore {
-SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document *doc)
+SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document* doc)
: SVGStyledElement(tagName, doc)
, SVGURIReference()
, SVGLangSpace()
{
}
-void SVGFilterElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFilterElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
- if (attr->name() == SVGNames::filterUnitsAttr)
- {
- if(value == "userSpaceOnUse")
+ if (attr->name() == SVGNames::filterUnitsAttr) {
+ if (value == "userSpaceOnUse")
setFilterUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE);
- else if(value == "objectBoundingBox")
+ else if (value == "objectBoundingBox")
setFilterUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
- }
- else if (attr->name() == SVGNames::primitiveUnitsAttr)
- {
- if(value == "userSpaceOnUse")
+ } else if (attr->name() == SVGNames::primitiveUnitsAttr) {
+ if (value == "userSpaceOnUse")
setPrimitiveUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE);
- else if(value == "objectBoundingBox")
+ else if (value == "objectBoundingBox")
setPrimitiveUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
- }
- else if (attr->name() == SVGNames::xAttr)
+ } else if (attr->name() == SVGNames::xAttr)
xBaseValue()->setValueAsString(value);
else if (attr->name() == SVGNames::yAttr)
yBaseValue()->setValueAsString(value);
widthBaseValue()->setValueAsString(value);
else if (attr->name() == SVGNames::heightAttr)
heightBaseValue()->setValueAsString(value);
- else
- {
- if(SVGURIReference::parseMappedAttribute(attr)) return;
- if(SVGLangSpace::parseMappedAttribute(attr)) return;
- if(SVGExternalResourcesRequired::parseMappedAttribute(attr)) return;
+ else {
+ if (SVGURIReference::parseMappedAttribute(attr)) return;
+ if (SVGLangSpace::parseMappedAttribute(attr)) return;
+ if (SVGExternalResourcesRequired::parseMappedAttribute(attr)) return;
SVGStyledElement::parseMappedAttribute(attr);
}
}
-KCanvasFilter *SVGFilterElement::canvasResource()
+KCanvasFilter* SVGFilterElement::canvasResource()
{
if (!attached())
return 0;
if (!m_filter)
- m_filter = static_cast<KCanvasFilter *>(renderingDevice()->createResource(RS_FILTER));
+ m_filter = static_cast<KCanvasFilter*>(renderingDevice()->createResource(RS_FILTER));
bool filterBBoxMode = filterUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
m_filter->setFilterBoundingBoxMode(filterBBoxMode);
// TODO : use switch/case instead?
m_filter->clearEffects();
- for (Node *n = firstChild(); n != 0; n = n->nextSibling()) {
- SVGElement *element = svg_dynamic_cast(n);
- if(element && element->isFilterEffect()) {
- SVGFilterPrimitiveStandardAttributes *fe = static_cast<SVGFilterPrimitiveStandardAttributes *>(element);
+ for (Node* n = firstChild(); n != 0; n = n->nextSibling()) {
+ SVGElement* element = svg_dynamic_cast(n);
+ if (element && element->isFilterEffect()) {
+ SVGFilterPrimitiveStandardAttributes* fe = static_cast<SVGFilterPrimitiveStandardAttributes*>(element);
if (fe->filterEffect())
m_filter->addFilterEffect(fe->filterEffect());
}
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
This file is part of the KDE project
#define KSVG_SVGFilterElementImpl_H
#ifdef SVG_SUPPORT
+#include "KCanvasFilters.h"
+#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
-#include "SVGURIReference.h"
#include "SVGStyledElement.h"
-#include "SVGExternalResourcesRequired.h"
-
-#include "KCanvasFilters.h"
+#include "SVGURIReference.h"
namespace WebCore {
class SVGLength;
class SVGFilterElement : public SVGStyledElement,
- public SVGURIReference,
- public SVGLangSpace,
- public SVGExternalResourcesRequired
+ public SVGURIReference,
+ public SVGLangSpace,
+ public SVGExternalResourcesRequired
{
public:
SVGFilterElement(const QualifiedName&, Document*);
virtual ~SVGFilterElement();
- virtual KCanvasFilter *canvasResource();
+ virtual KCanvasFilter* canvasResource();
// 'SVGFilterElement' functions
void setFilterRes(unsigned long filterResX, unsigned long filterResY) const;
- virtual void parseMappedAttribute(MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute* attr);
protected:
virtual const SVGElement* contextElement() const { return this; }
ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, long, long, FilterResX, filterResX)
ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, long, long, FilterResY, filterResY)
- KCanvasFilter *m_filter;
+ KCanvasFilter* m_filter;
};
} // namespace WebCore
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
#include "config.h"
#ifdef SVG_SUPPORT
-#include "Attr.h"
-#include <wtf/Assertions.h>
-
-#include "SVGUnitTypes.h"
-#include "SVGNames.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
+
+#include "SVGFilterElement.h"
#include "SVGLength.h"
+#include "SVGNames.h"
#include "SVGStyledElement.h"
-#include "SVGFilterElement.h"
-
-#include <kcanvas/KCanvasFilters.h>
+#include "SVGUnitTypes.h"
-using namespace WebCore;
+namespace WebCore {
-SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document *doc)
+SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document* doc)
: SVGStyledElement(tagName, doc)
, m_x(new SVGLength(this, LM_WIDTH, viewportElement()))
, m_y(new SVGLength(this, LM_HEIGHT, viewportElement()))
ANIMATED_PROPERTY_DEFINITIONS(SVGFilterPrimitiveStandardAttributes, SVGLength*, Length, length, Height, height, SVGNames::heightAttr.localName(), m_height.get())
ANIMATED_PROPERTY_DEFINITIONS(SVGFilterPrimitiveStandardAttributes, String, String, string, Result, result, SVGNames::resultAttr.localName(), m_result)
-void SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(MappedAttribute *attr)
+void SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(MappedAttribute* attr)
{
const AtomicString& value = attr->value();
if (attr->name() == SVGNames::xAttr)
return SVGStyledElement::parseMappedAttribute(attr);
}
-void SVGFilterPrimitiveStandardAttributes::setStandardAttributes(KCanvasFilterEffect *filterEffect) const
+void SVGFilterPrimitiveStandardAttributes::setStandardAttributes(KCanvasFilterEffect* filterEffect) const
{
ASSERT(filterEffect);
if (!filterEffect)
return;
bool bbox = false;
if (parentNode() && parentNode()->hasTagName(SVGNames::filterTag))
- bbox = static_cast<SVGFilterElement *>(parentNode())->primitiveUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
+ bbox = static_cast<SVGFilterElement*>(parentNode())->primitiveUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
x()->setBboxRelative(bbox);
y()->setBboxRelative(bbox);
filterEffect->setResult(result());
}
+}
+
// vim:ts=4:noet
#endif // SVG_SUPPORT
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
// 'SVGFilterPrimitiveStandardAttributes' functions
virtual void parseMappedAttribute(MappedAttribute *attr);
- virtual KCanvasFilterEffect *filterEffect() const = 0;
+ virtual KCanvasFilterEffect* filterEffect() const = 0;
protected:
- void setStandardAttributes(KCanvasFilterEffect *filterEffect) const;
+ void setStandardAttributes(KCanvasFilterEffect* filterEffect) const;
protected:
virtual const SVGElement* contextElement() const { return this; }