KHTML
SVGCursorElement.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "config.h"
00024
00025 #if ENABLE(SVG)
00026 #include "SVGCursorElement.h"
00027
00028 #include "Attr.h"
00029 #include "SVGNames.h"
00030 #include "SVGLength.h"
00031
00032 namespace WebCore {
00033
00034 SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document* doc)
00035 : SVGElement(tagName, doc)
00036 , SVGTests()
00037 , SVGExternalResourcesRequired()
00038 , SVGURIReference()
00039 , m_x(0, LengthModeWidth)
00040 , m_y(0, LengthModeHeight)
00041 {
00042 }
00043
00044 SVGCursorElement::~SVGCursorElement()
00045 {
00046 }
00047
00048 ANIMATED_PROPERTY_DEFINITIONS(SVGCursorElement, SVGLength, Length, length, X, x, SVGNames::xAttr, m_x)
00049 ANIMATED_PROPERTY_DEFINITIONS(SVGCursorElement, SVGLength, Length, length, Y, y, SVGNames::yAttr, m_y)
00050
00051 void SVGCursorElement::parseMappedAttribute(MappedAttribute* attr)
00052 {
00053 if (attr->name() == SVGNames::xAttr)
00054 setXBaseValue(SVGLength(0, LengthModeWidth, attr->value()));
00055 else if (attr->name() == SVGNames::yAttr)
00056 setYBaseValue(SVGLength(0, LengthModeHeight, attr->value()));
00057 else {
00058 if (SVGTests::parseMappedAttribute(attr))
00059 return;
00060 if (SVGExternalResourcesRequired::parseMappedAttribute(attr))
00061 return;
00062 if (SVGURIReference::parseMappedAttribute(attr))
00063 return;
00064
00065 SVGElement::parseMappedAttribute(attr);
00066 }
00067 }
00068
00069 void SVGCursorElement::addClient(SVGElement* element)
00070 {
00071 m_clients.add(element);
00072 }
00073
00074 void SVGCursorElement::removeClient(SVGElement* element)
00075 {
00076 m_clients.remove(element);
00077 }
00078
00079 void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName)
00080 {
00081 SVGElement::svgAttributeChanged(attrName);
00082
00083 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr ||
00084 SVGTests::isKnownAttribute(attrName) ||
00085 SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
00086 SVGURIReference::isKnownAttribute(attrName)) {
00087 HashSet<SVGElement*>::const_iterator it = m_clients.begin();
00088 HashSet<SVGElement*>::const_iterator end = m_clients.end();
00089
00090 for (; it != end; ++it)
00091 (*it)->setChanged();
00092 }
00093 }
00094
00095 void SVGCursorElement::getSubresourceAttributeStrings(Vector<String>& urls) const
00096 {
00097 urls.append(href());
00098 }
00099
00100 }
00101
00102 #endif // ENABLE(SVG)