OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 PassRefPtr<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagNa
me, Document* document) | 40 PassRefPtr<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagNa
me, Document* document) |
41 { | 41 { |
42 return adoptRef(new SVGCursorElement(tagName, document)); | 42 return adoptRef(new SVGCursorElement(tagName, document)); |
43 } | 43 } |
44 | 44 |
45 SVGCursorElement::~SVGCursorElement() | 45 SVGCursorElement::~SVGCursorElement() |
46 { | 46 { |
47 HashSet<SVGElement*>::iterator end = m_clients.end(); | 47 HashSet<SVGElement*>::iterator end = m_clients.end(); |
48 for (HashSet<SVGElement*>::iterator it = m_clients.begin(); it != end; ++it) | 48 for (HashSet<SVGElement*>::iterator it = m_clients.begin(); it != end; ++it) |
49 (*it)->setCursorElement(0); | 49 (*it)->cursorElementRemoved(); |
50 } | 50 } |
51 | 51 |
52 void SVGCursorElement::parseMappedAttribute(Attribute* attr) | 52 void SVGCursorElement::parseMappedAttribute(Attribute* attr) |
53 { | 53 { |
54 if (attr->name() == SVGNames::xAttr) | 54 if (attr->name() == SVGNames::xAttr) |
55 setXBaseValue(SVGLength(LengthModeWidth, attr->value())); | 55 setXBaseValue(SVGLength(LengthModeWidth, attr->value())); |
56 else if (attr->name() == SVGNames::yAttr) | 56 else if (attr->name() == SVGNames::yAttr) |
57 setYBaseValue(SVGLength(LengthModeHeight, attr->value())); | 57 setYBaseValue(SVGLength(LengthModeHeight, attr->value())); |
58 else { | 58 else { |
59 if (SVGTests::parseMappedAttribute(attr)) | 59 if (SVGTests::parseMappedAttribute(attr)) |
60 return; | 60 return; |
61 if (SVGExternalResourcesRequired::parseMappedAttribute(attr)) | 61 if (SVGExternalResourcesRequired::parseMappedAttribute(attr)) |
62 return; | 62 return; |
63 if (SVGURIReference::parseMappedAttribute(attr)) | 63 if (SVGURIReference::parseMappedAttribute(attr)) |
64 return; | 64 return; |
65 | 65 |
66 SVGElement::parseMappedAttribute(attr); | 66 SVGElement::parseMappedAttribute(attr); |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 void SVGCursorElement::addClient(SVGElement* element) | 70 void SVGCursorElement::addClient(SVGElement* element) |
71 { | 71 { |
72 m_clients.add(element); | 72 m_clients.add(element); |
73 element->setCursorElement(this); | 73 element->setCursorElement(this); |
74 } | 74 } |
75 | 75 |
76 void SVGCursorElement::removeClient(SVGElement* element) | 76 void SVGCursorElement::removeClient(SVGElement* element) |
77 { | 77 { |
78 m_clients.remove(element); | 78 m_clients.remove(element); |
79 element->setCursorElement(0); | 79 element->cursorElementRemoved(); |
| 80 } |
| 81 |
| 82 void SVGCursorElement::removeReferencedElement(SVGElement* element) |
| 83 { |
| 84 m_clients.remove(element); |
80 } | 85 } |
81 | 86 |
82 void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName) | 87 void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName) |
83 { | 88 { |
84 SVGElement::svgAttributeChanged(attrName); | 89 SVGElement::svgAttributeChanged(attrName); |
85 | 90 |
86 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || | 91 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || |
87 SVGTests::isKnownAttribute(attrName) || | 92 SVGTests::isKnownAttribute(attrName) || |
88 SVGExternalResourcesRequired::isKnownAttribute(attrName) || | 93 SVGExternalResourcesRequired::isKnownAttribute(attrName) || |
89 SVGURIReference::isKnownAttribute(attrName)) { | 94 SVGURIReference::isKnownAttribute(attrName)) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons
t | 128 void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons
t |
124 { | 129 { |
125 SVGElement::addSubresourceAttributeURLs(urls); | 130 SVGElement::addSubresourceAttributeURLs(urls); |
126 | 131 |
127 addSubresourceURL(urls, document()->completeURL(href())); | 132 addSubresourceURL(urls, document()->completeURL(href())); |
128 } | 133 } |
129 | 134 |
130 } | 135 } |
131 | 136 |
132 #endif // ENABLE(SVG) | 137 #endif // ENABLE(SVG) |
OLD | NEW |