+2006-10-14 Rob Buis <buis@kde.org>
+
+ Reviewed by Mitz.
+
+ http://bugs.webkit.org/show_bug.cgi?id=11217
+ Cleanup svg coding style
+
+ Cleanup coding style in svg basic datastructure classes.
+
+ * ksvg2/svg/SVGAngle.cpp:
+ (WebCore::SVGAngle::valueAsString):
+ (WebCore::SVGAngle::context):
+ (WebCore::SVGAngle::setContext):
+ * ksvg2/svg/SVGAngle.h:
+ * ksvg2/svg/SVGColor.cpp:
+ * ksvg2/svg/SVGColor.h:
+ * ksvg2/svg/SVGElement.cpp:
+ (WebCore::SVGElement::ownerSVGElement):
+ (WebCore::SVGElement::viewportElement):
+ (WebCore::SVGElement::parseMappedAttribute):
+ (WebCore::SVGElement::childShouldCreateRenderer):
+ * ksvg2/svg/SVGElement.h:
+ (WebCore::svg_dynamic_cast):
+ * ksvg2/svg/SVGFitToViewBox.cpp:
+ (WebCore::SVGFitToViewBox::parseViewBox):
+ * ksvg2/svg/SVGFitToViewBox.h:
+ * ksvg2/svg/SVGLangSpace.cpp:
+ (WebCore::SVGLangSpace::parseMappedAttribute):
+ * ksvg2/svg/SVGLangSpace.h:
+ * ksvg2/svg/SVGLength.cpp:
+ (WebCore::SVGLength::SVGLength):
+ (WebCore::SVGLength::setValueAsString):
+ (WebCore::SVGLength::dpi):
+ (WebCore::SVGLength::updateValue):
+ (WebCore::SVGLength::updateValueInSpecifiedUnits):
+ (WebCore::SVGLength::context):
+ (WebCore::SVGLength::setContext):
+ * ksvg2/svg/SVGLength.h:
+ * ksvg2/svg/SVGLengthList.cpp:
+ * ksvg2/svg/SVGLengthList.h:
+ * ksvg2/svg/SVGLocatable.cpp:
+ (WebCore::SVGLocatable::nearestViewportElement):
+ (WebCore::SVGLocatable::farthestViewportElement):
+ (WebCore::SVGLocatable::getBBox):
+ (WebCore::SVGLocatable::getCTM):
+ (WebCore::SVGLocatable::getScreenCTM):
+ * ksvg2/svg/SVGNumberList.cpp:
+ * ksvg2/svg/SVGNumberList.h:
+ * ksvg2/svg/SVGPreserveAspectRatio.cpp:
+ (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio):
+ (WebCore::SVGPreserveAspectRatio::getCTM):
+ * ksvg2/svg/SVGPreserveAspectRatio.h:
+ * ksvg2/svg/SVGStringList.cpp:
+ (WebCore::SVGStringList::reset):
+ * ksvg2/svg/SVGStringList.h:
+ * ksvg2/svg/SVGStylable.cpp:
+ * ksvg2/svg/SVGStylable.h:
+ * ksvg2/svg/SVGTests.cpp:
+ (WebCore::SVGTests::requiredFeatures):
+ (WebCore::SVGTests::requiredExtensions):
+ (WebCore::SVGTests::systemLanguage):
+ (WebCore::SVGTests::isValid):
+ (WebCore::SVGTests::parseMappedAttribute):
+ * ksvg2/svg/SVGTests.h:
+ * ksvg2/svg/SVGTransformable.cpp:
+ (WebCore::SVGTransformable::parseTransformAttribute):
+ * ksvg2/svg/SVGTransformable.h:
+ * ksvg2/svg/SVGURIReference.cpp:
+ (WebCore::SVGURIReference::parseMappedAttribute):
+ * ksvg2/svg/SVGZoomAndPan.cpp:
+ (WebCore::SVGZoomAndPan::parseMappedAttribute):
+ * ksvg2/svg/SVGZoomAndPan.h:
+
2006-10-15 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Oliver.
/*
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 <math.h>
-
-#include <ksvg2/ksvg.h>
-
-#include "DeprecatedString.h"
#include "SVGAngle.h"
-#include "SVGHelper.h"
-using namespace WebCore;
+#include <math.h>
+
+namespace WebCore {
const double deg2rad = 0.017453292519943295769; // pi/180
const double deg2grad = 400.0 / 360.0;
{
m_valueAsString = String::number(m_valueInSpecifiedUnits);
- switch(m_unitType) {
+ switch (m_unitType) {
case SVG_ANGLETYPE_UNSPECIFIED:
case SVG_ANGLETYPE_DEG:
m_valueAsString += "deg";
return bisector;
}
-const SVGStyledElement *SVGAngle::context() const
+const SVGStyledElement* SVGAngle::context() const
{
return m_context;
}
-void SVGAngle::setContext(const SVGStyledElement *context)
+void SVGAngle::setContext(const SVGStyledElement* context)
{
m_context = context;
}
+}
// 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
float m_value;
float m_valueInSpecifiedUnits;
mutable String m_valueAsString;
- const SVGStyledElement *m_context;
+ const SVGStyledElement* m_context;
void calculate();
};
/*
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 "SVGColor.h"
-#include "ksvg.h"
+#include "SVGException.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
#include "PlatformString.h"
namespace WebCore {
- class RGBColor;
+
typedef int ExceptionCode;
-
+
class SVGColor : public CSSValue {
public:
SVGColor();
/*
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 "SVGElement.h"
-#include "Attr.h"
-#include "Document.h"
#include "DOMImplementation.h"
+#include "Document.h"
#include "Event.h"
#include "EventListener.h"
#include "EventNames.h"
#include "SVGNames.h"
#include "SVGSVGElement.h"
#include "XMLNames.h"
-#include "ksvg.h"
namespace WebCore {
SVGSVGElement* SVGElement::ownerSVGElement() const
{
- Node *n = parentNode();
- while(n) {
+ Node* n = parentNode();
+ while (n) {
if (n->nodeType() == ELEMENT_NODE && n->hasTagName(SVGNames::svgTag))
return static_cast<SVGSVGElement*>(n);
SVGElement* SVGElement::viewportElement() const
{
- Node *n = parentNode();
+ Node* n = parentNode();
while (n) {
if (n->isElementNode() &&
(n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::imageTag) || n->hasTagName(SVGNames::symbolTag)))
createSVGEventListener(attr->localName().domString(), attr->value(), this));
}
-void SVGElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGElement::parseMappedAttribute(MappedAttribute* attr)
{
// standard events
if (attr->name() == onloadAttr)
sendSVGLoadEventIfPossible();
}
-bool SVGElement::childShouldCreateRenderer(Node *child) const
+bool SVGElement::childShouldCreateRenderer(Node* child) const
{
if (child->isSVGElement())
return static_cast<SVGElement*>(child)->isValid();
/*
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 "Document.h"
#include "FloatRect.h"
#include "StyledElement.h"
-
-#include "SVGNames.h"
#include "SVGAnimatedTemplate.h"
#include "SVGDocumentExtensions.h"
+#include "SVGNames.h"
#define ANIMATED_PROPERTY_EMPTY_DECLARATIONS(BareType, NullType, UpperProperty, LowerProperty) \
public: \
static inline SVGElement* svg_dynamic_cast(Node* node)
{
- SVGElement* svgElement = NULL;
+ SVGElement* svgElement = 0;
if (node && node->isSVGElement())
svgElement = static_cast<SVGElement*>(node);
return svgElement;
/*
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 "SVGFitToViewBox.h"
-#include "Attr.h"
#include "FloatRect.h"
-#include "SVGPreserveAspectRatio.h"
-#include "SVGFitToViewBox.h"
#include "SVGNames.h"
#include "SVGPreserveAspectRatio.h"
#include "SVGSVGElement.h"
{
double x = 0, y = 0, w = 0, h = 0;
DeprecatedString viewbox = str.deprecatedString();
- const char *p = viewbox.latin1();
- const char *end = p + viewbox.length();
- const char *c = p;
+ const char* p = viewbox.latin1();
+ const char* end = p + viewbox.length();
+ const char* c = p;
p = parseCoord(c, x);
if (p == c)
goto bail_out;
c = p;
p = parseCoord(c, w);
- if(w < 0.0 || p == c) // check that width is positive
+ if (w < 0.0 || p == c) // check that width is positive
goto bail_out;
c = p;
/*
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
namespace WebCore {
class Attribute;
- class StringImpl;
- class SVGPreserveAspectRatio;
class SVGMatrix;
+ class SVGPreserveAspectRatio;
+ class StringImpl;
class SVGFitToViewBox {
public:
// 'SVGFitToViewBox' functions
void parseViewBox(const String&);
- SVGMatrix *viewBoxToViewTransform(float viewWidth, float viewHeight) const;
+ SVGMatrix* viewBoxToViewTransform(float viewWidth, float viewHeight) const;
- bool parseMappedAttribute(MappedAttribute *attr);
+ bool parseMappedAttribute(MappedAttribute*);
protected:
virtual const SVGElement* contextElement() const = 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
#ifdef SVG_SUPPORT
#include "SVGLangSpace.h"
-#include "Attr.h"
#include "SVGElement.h"
#include "SVGNames.h"
-#include "StringImpl.h"
-#include "ksvg.h"
-using namespace WebCore;
+namespace WebCore {
SVGLangSpace::SVGLangSpace()
{
m_space = xmlSpace;
}
-bool SVGLangSpace::parseMappedAttribute(MappedAttribute *attr)
+bool SVGLangSpace::parseMappedAttribute(MappedAttribute* attr)
{
- if (attr->name() == SVGNames::langAttr)
- {
+ if (attr->name() == SVGNames::langAttr) {
setXmllang(attr->value());
return true;
- }
- else if (attr->name() == SVGNames::spaceAttr)
- {
+ } else if (attr->name() == SVGNames::spaceAttr) {
setXmlspace(attr->value());
return true;
}
return false;
}
+}
+
// 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
namespace WebCore {
class MappedAttribute;
- class StringImpl;
- class SVGLength;
class SVGLangSpace {
public:
const AtomicString& xmlspace() const;
void setXmlspace(const AtomicString& xmlSpace);
- bool parseMappedAttribute(MappedAttribute *attr);
+ bool parseMappedAttribute(MappedAttribute*);
private:
AtomicString m_lang;
/*
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 "SVGElement.h"
#include "SVGLength.h"
#include "SVGSVGElement.h"
-#include "ksvg.h"
#include "svgpathparser.h"
-
#include <math.h>
using namespace std;
namespace WebCore {
-SVGLength::SVGLength(const SVGStyledElement *context, LengthMode mode, const SVGElement *viewport)
+SVGLength::SVGLength(const SVGStyledElement* context, LengthMode mode, const SVGElement* viewport)
: Shared<SVGLength>()
, m_value(0)
, m_valueInSpecifiedUnits(0)
void SVGLength::setValueAsString(const String& s)
{
- if(s.isEmpty())
+ if (s.isEmpty())
return;
DeprecatedString valueAsQString = s.deprecatedString();
double convertedNumber = 0;
- const char *start = valueAsQString.latin1();
- const char *end = parseCoord(start, convertedNumber);
+ const char* start = valueAsQString.latin1();
+ const char* end = parseCoord(start, convertedNumber);
m_valueInSpecifiedUnits = convertedNumber;
unsigned int diff = end - start;
double SVGLength::dpi() const
{
/* FIXME: DPI detection
- if(context && context->ownerDoc())
- {
- if(mode == LM_WIDTH)
+ if (context && context->ownerDoc()) {
+ if (mode == LM_WIDTH)
return 25.4 * context->ownerDoc()->screenPixelsPerMillimeterX();
- else if(mode == LM_HEIGHT)
+ else if (mode == LM_HEIGHT)
return 25.4 * context->ownerDoc()->screenPixelsPerMillimeterY();
- else if(mode == LM_OTHER)
+ else if (mode == LM_OTHER)
return 25.4 * context->ownerDoc()->screenPixelsPerMillimeterX();
}
*/
void SVGLength::updateValue(bool notify)
{
- switch(m_unitType)
- {
+ switch (m_unitType) {
case SVG_LENGTHTYPE_PX:
m_value = m_valueInSpecifiedUnits;
break;
m_value = (m_valueInSpecifiedUnits / 6.0) * dpi();
break;
case SVG_LENGTHTYPE_EMS:
- case SVG_LENGTHTYPE_EXS:
- {
- RenderStyle *style = 0;
+ case SVG_LENGTHTYPE_EXS: {
+ RenderStyle* style = 0;
if (m_context && m_context->renderer())
style = m_context->renderer()->style();
else if (m_viewportElement && m_viewportElement->renderer())
bool SVGLength::updateValueInSpecifiedUnits(bool notify)
{
- if(m_unitType == SVG_LENGTHTYPE_UNKNOWN)
+ if (m_unitType == SVG_LENGTHTYPE_UNKNOWN)
return false;
- switch(m_unitType)
- {
+ switch (m_unitType) {
case SVG_LENGTHTYPE_PERCENTAGE:
//kdError() << "updateValueInSpecifiedUnits() SVG_LENGTHTYPE_PERCENTAGE - UNSUPPORTED! Please report!" << endl;
return false;
m_bboxRelative = relative;
}
-const SVGStyledElement *SVGLength::context() const
+const SVGStyledElement* SVGLength::context() const
{
return m_context;
}
-void SVGLength::setContext(const SVGStyledElement *context)
+void SVGLength::setContext(const SVGStyledElement* context)
{
m_context = context;
}
/*
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 "PlatformString.h"
-#include <ksvg2/svg/SVGHelper.h>
+#include "SVGHelper.h"
namespace WebCore {
void setBboxRelative(bool);
const SVGStyledElement* context() const;
- void setContext(const SVGStyledElement *context);
+ void setContext(const SVGStyledElement* context);
private:
bool updateValueInSpecifiedUnits(bool notify = true);
SVGLengthType m_unitType : 4;
bool m_requiresLayout : 1;
- const SVGStyledElement *m_context;
- const SVGElement *m_viewportElement;
+ const SVGStyledElement* m_context;
+ const SVGElement* m_viewportElement;
};
} // 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 "SVGLengthList.h"
#include "SVGMatrix.h"
#include "SVGSVGElement.h"
-#include "SVGLengthList.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 "SVGList.h"
#include "SVGLength.h"
+#include "SVGList.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 "SVGLocatable.h"
-#include "SVGElement.h"
+#include "RenderPath.h"
#include "SVGMatrix.h"
#include "SVGSVGElement.h"
-#include <kcanvas/RenderPath.h>
-using namespace WebCore;
+namespace WebCore {
SVGLocatable::SVGLocatable()
{
{
}
-SVGElement *SVGLocatable::nearestViewportElement(const SVGStyledElement *e)
+SVGElement* SVGLocatable::nearestViewportElement(const SVGStyledElement* e)
{
- Node *n = e->parentNode();
+ Node* n = e->parentNode();
while (n && !n->isDocumentNode()) {
if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::symbolTag) ||
n->hasTagName(SVGNames::imageTag) || n->hasTagName(SVGNames::foreignObjectTag))
- return static_cast<SVGElement *>(n);
+ return static_cast<SVGElement*>(n);
n = n->parentNode();
}
return 0;
}
-SVGElement *SVGLocatable::farthestViewportElement(const SVGStyledElement *e)
+SVGElement* SVGLocatable::farthestViewportElement(const SVGStyledElement* e)
{
// FIXME : likely this will be always the <svg> farthest away.
// If we have a different implementation of documentElement(), one
// that give the documentElement() of the svg fragment, it could be
// used instead. This depends on cdf demands though(Rob.)
- SVGElement *farthest = 0;
- Node *n = e->parentNode();
+ SVGElement* farthest = 0;
+ Node* n = e->parentNode();
while (n && !n->isDocumentNode()) {
if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::symbolTag) ||
n->hasTagName(SVGNames::imageTag) || n->hasTagName(SVGNames::foreignObjectTag))
- farthest = static_cast<SVGElement *>(n);
+ farthest = static_cast<SVGElement*>(n);
n = n->parentNode();
}
// Spec:
// http://www.w3.org/TR/2005/WD-SVGMobile12-20050413/svgudom.html#svg::SVGLocatable
-FloatRect SVGLocatable::getBBox(const SVGStyledElement *e)
+FloatRect SVGLocatable::getBBox(const SVGStyledElement* e)
{
FloatRect bboxRect;
return bboxRect;
}
-SVGMatrix *SVGLocatable::getCTM(const SVGElement *element)
+SVGMatrix* SVGLocatable::getCTM(const SVGElement* element)
{
- if(!element)
+ if (!element)
return 0;
- SVGMatrix *ctm = SVGSVGElement::createSVGMatrix();
+ SVGMatrix* ctm = SVGSVGElement::createSVGMatrix();
- Node *parent = element->parentNode();
+ Node* parent = element->parentNode();
if (parent && parent->isElementNode()) {
- SVGElement *parentElement = svg_dynamic_cast(parent);
- if(parentElement && parentElement->isStyledLocatable())
- {
- RefPtr<SVGMatrix> parentCTM = static_cast<SVGStyledLocatableElement *>(parentElement)->getCTM();
+ SVGElement* parentElement = svg_dynamic_cast(parent);
+ if (parentElement && parentElement->isStyledLocatable()) {
+ RefPtr<SVGMatrix> parentCTM = static_cast<SVGStyledLocatableElement*>(parentElement)->getCTM();
ctm->multiply(parentCTM.get());
}
}
return ctm;
}
-SVGMatrix *SVGLocatable::getScreenCTM(const SVGElement *element)
+SVGMatrix* SVGLocatable::getScreenCTM(const SVGElement* element)
{
- if(!element)
+ if (!element)
return 0;
- SVGMatrix *ctm = SVGSVGElement::createSVGMatrix();
+ SVGMatrix* ctm = SVGSVGElement::createSVGMatrix();
- Node *parent = element->parentNode();
- if(parent && parent->isElementNode())
- {
- SVGElement *parentElement = static_cast<SVGElement *>(parent);
- if(parentElement->isStyledLocatable())
- {
- RefPtr<SVGMatrix> parentCTM = static_cast<SVGStyledLocatableElement *>(parentElement)->getScreenCTM();
+ Node* parent = element->parentNode();
+ if (parent && parent->isElementNode()) {
+ SVGElement* parentElement = static_cast<SVGElement*>(parent);
+ if (parentElement->isStyledLocatable()) {
+ RefPtr<SVGMatrix> parentCTM = static_cast<SVGStyledLocatableElement*>(parentElement)->getScreenCTM();
ctm->multiply(parentCTM.get());
}
}
return ctm;
}
+}
+
#endif // SVG_SUPPORT
// vim:ts=4:noet
/*
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 "SVGNumberList.h"
+
#include "SVGMatrix.h"
#include "SVGSVGElement.h"
-#include "SVGNumberList.h"
-using namespace WebCore;
+namespace WebCore {
SVGNumberList::SVGNumberList()
: SVGList<double>()
appendItem(numbers[i].toDouble(), ec);
}
+}
+
// 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
namespace WebCore
{
- class DeprecatedString;
+ class String;
class SVGNumberList : public SVGList<double>
{
/*
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 "ksvg.h"
+#include "SVGPreserveAspectRatio.h"
+
#include "SVGMatrix.h"
#include "SVGSVGElement.h"
-#include "SVGPreserveAspectRatio.h"
namespace WebCore {
-SVGPreserveAspectRatio::SVGPreserveAspectRatio(const SVGStyledElement *context)
+SVGPreserveAspectRatio::SVGPreserveAspectRatio(const SVGStyledElement* context)
: Shared<SVGPreserveAspectRatio>()
, m_align(SVG_PRESERVEASPECTRATIO_XMIDYMID)
, m_meetOrSlice(SVG_MEETORSLICE_MEET)
m_context->notifyAttributeChange();
}
-SVGMatrix *SVGPreserveAspectRatio::getCTM(float logicX, float logicY, float logicWidth, float logicHeight,
- float /*physX*/, float /*physY*/, float physWidth, float physHeight)
+SVGMatrix* SVGPreserveAspectRatio::getCTM(float logicX, float logicY,
+ float logicWidth, float logicHeight,
+ float /*physX*/, float /*physY*/,
+ float physWidth, float physHeight)
{
- SVGMatrix *temp = SVGSVGElement::createSVGMatrix();
+ SVGMatrix* temp = SVGSVGElement::createSVGMatrix();
if (align() == SVG_PRESERVEASPECTRATIO_UNKNOWN)
return temp;
/*
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
namespace WebCore {
+ class String;
class SVGMatrix;
class SVGStyledElement;
SVG_MEETORSLICE_SLICE = 2
};
- SVGPreserveAspectRatio(const SVGStyledElement *context);
+ SVGPreserveAspectRatio(const SVGStyledElement* context);
virtual ~SVGPreserveAspectRatio();
void setAlign(unsigned short);
void setMeetOrSlice(unsigned short);
unsigned short meetOrSlice() const;
- SVGMatrix *getCTM(float logicX, float logicY,
- float logicWidth, float logicHeight,
- float physX, float physY, float physWidth,
- float physHeight);
+ SVGMatrix* getCTM(float logicX, float logicY,
+ float logicWidth, float logicHeight,
+ float physX, float physY,
+ float physWidth, float physHeight);
// Helper
void parsePreserveAspectRatio(const String&);
unsigned short m_align;
unsigned short m_meetOrSlice;
- const SVGStyledElement *m_context;
+ const SVGStyledElement* m_context;
};
} // 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 "SVGStringList.h"
appendItem(String(""), ec); // Create empty string...
} else {
Vector<String>::const_iterator end = vector.end();
- for(Vector<String>::const_iterator it = vector.begin(); it != end; ++it)
+ for (Vector<String>::const_iterator it = vector.begin(); it != end; ++it)
appendItem(*it, ec);
}
}
/*
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 "SVGList.h"
#include "PlatformString.h"
+#include "SVGList.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 "SVGStylable.h"
-using namespace WebCore;
+namespace WebCore {
SVGStylable::SVGStylable()
{
{
}
+}
+
// 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_SVGStylableImpl_H
#ifdef SVG_SUPPORT
-#include "PlatformString.h"
-
namespace WebCore {
- class String;
class CSSValue;
class CSSStyleDeclaration;
+ class String;
+ class StringImpl;
class SVGStylable {
public:
/*
Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
+ 2004, 2005 Rob, 2006 Buis <buis@kde.org>
This file is part of the KDE project
#ifdef SVG_SUPPORT
#include "SVGTests.h"
+#include "DOMImplementation.h"
#include "Language.h"
#include "SVGElement.h"
#include "SVGHelper.h"
#include "SVGNames.h"
#include "SVGStringList.h"
-#include "Attr.h"
-#include "DOMImplementation.h"
namespace WebCore {
{
}
-SVGStringList *SVGTests::requiredFeatures() const
+SVGStringList* SVGTests::requiredFeatures() const
{
return lazy_create<SVGStringList>(m_features);
}
-SVGStringList *SVGTests::requiredExtensions() const
+SVGStringList* SVGTests::requiredExtensions() const
{
return lazy_create<SVGStringList>(m_extensions);
}
-SVGStringList *SVGTests::systemLanguage() const
+SVGStringList* SVGTests::systemLanguage() const
{
return lazy_create<SVGStringList>(m_systemLanguage);
}
{
ExceptionCode ec = 0;
- SVGStringList *list = requiredFeatures();
- for (unsigned long i = 0;i < list->numberOfItems();i++) {
- String value = String(list->getItem(i, ec));
- if(value.isEmpty() || !DOMImplementation::instance()->hasFeature(value, String()))
+ SVGStringList* list = requiredFeatures();
+ for (unsigned long i = 0; i < list->numberOfItems(); i++) {
+ String value = list->getItem(i, ec);
+ if (value.isEmpty() || !DOMImplementation::instance()->hasFeature(value, String()))
return false;
}
return false;
list = requiredExtensions();
- if(list->numberOfItems() > 0)
+ if (list->numberOfItems() > 0)
return false;
return true;
}
-bool SVGTests::parseMappedAttribute(MappedAttribute *attr)
+bool SVGTests::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::requiredFeaturesAttr) {
/*
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 ~SVGTests();
// 'SVGTests' functions
- SVGStringList *requiredFeatures() const;
- SVGStringList *requiredExtensions() const;
- SVGStringList *systemLanguage() const;
+ SVGStringList* requiredFeatures() const;
+ SVGStringList* requiredExtensions() const;
+ SVGStringList* systemLanguage() const;
bool hasExtension(const String&) const;
bool isValid() const;
- bool parseMappedAttribute(MappedAttribute *attr);
+ bool parseMappedAttribute(MappedAttribute*);
private:
mutable RefPtr<SVGStringList> m_features;
/*
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 "RegularExpression.h"
-#include <wtf/RefPtr.h>
-
-#include "Attr.h"
-
-#include <kcanvas/RenderPath.h>
+#include "SVGTransformable.h"
-#include "SVGNames.h"
+#include "RegularExpression.h"
#include "SVGHelper.h"
#include "SVGMatrix.h"
-#include "SVGTransformable.h"
+#include "SVGNames.h"
#include "SVGStyledElement.h"
#include "SVGTransformList.h"
-#include "ksvg.h"
-using namespace WebCore;
+namespace WebCore {
SVGTransformable::SVGTransformable() : SVGLocatable()
{
{
}
-void SVGTransformable::parseTransformAttribute(SVGTransformList *list, const AtomicString& transform)
+void SVGTransformable::parseTransformAttribute(SVGTransformList* list, const AtomicString& transform)
{
// Split string for handling 1 transform statement at a time
Vector<String> subtransforms = transform.domString().simplifyWhiteSpace().split(')');
else if (subtransform[0] == "skewy" && (params.size() == 1))
t->setSkewY(params[0].toDouble());
else if (subtransform[0] == "matrix" && (params.size() == 6)) {
- SVGMatrix *ret = new SVGMatrix(params[0].toDouble(),
- params[1].toDouble(),
- params[2].toDouble(),
- params[3].toDouble(),
- params[4].toDouble(),
- params[5].toDouble());
+ SVGMatrix* ret = new SVGMatrix(params[0].toDouble(),
+ params[1].toDouble(),
+ params[2].toDouble(),
+ params[3].toDouble(),
+ params[4].toDouble(),
+ params[5].toDouble());
t->setMatrix(ret);
}
}
}
+}
+
// 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
namespace WebCore {
- class AffineTransform;
class AtomicString;
- class Attribute;
- class Node;
- class SVGTransformList;
class SVGMatrix;
class SVGTransformList;
/*
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 "Node.h"
-#include "Attr.h"
+#include "SVGURIReference.h"
-#include "SVGNames.h"
-#include "XLinkNames.h"
#include "SVGHelper.h"
-#include "SVGURIReference.h"
+#include "SVGNames.h"
#include "SVGStyledElement.h"
+#include "XLinkNames.h"
namespace WebCore {
ANIMATED_PROPERTY_DEFINITIONS_WITH_CONTEXT(SVGURIReference, String, String, string, Href, href, XLinkNames::hrefAttr.localName(), m_href)
-bool SVGURIReference::parseMappedAttribute(MappedAttribute *attr)
+bool SVGURIReference::parseMappedAttribute(MappedAttribute* attr)
{
if (attr->name().matches(XLinkNames::hrefAttr)) {
setHrefBaseValue(attr->value());
/*
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 "MappedAttribute.h"
+#include "SVGZoomAndPan.h"
-#include "ksvg.h"
-#include "SVGNames.h"
#include "SVGHelper.h"
+#include "SVGNames.h"
#include "SVGSVGElement.h"
-#include "SVGZoomAndPan.h"
namespace WebCore {
m_zoomAndPan = zoomAndPan;
}
-bool SVGZoomAndPan::parseMappedAttribute(MappedAttribute *attr)
+bool SVGZoomAndPan::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::zoomAndPanAttr) {
- if(value == "disable")
+ if (value == "disable")
setZoomAndPan(SVGSVGElement::SVG_ZOOMANDPAN_DISABLE);
- else if(value == "magnify")
+ else if (value == "magnify")
setZoomAndPan(SVGSVGElement::SVG_ZOOMANDPAN_MAGNIFY);
return true;
}
/*
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
unsigned short zoomAndPan() const;
virtual void setZoomAndPan(unsigned short zoomAndPan);
- bool parseMappedAttribute(MappedAttribute *attr);
+ bool parseMappedAttribute(MappedAttribute*);
private:
unsigned short m_zoomAndPan;