| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 DEFINE_ANIMATED_NUMBER(SVGPathElement, SVGNames::pathLengthAttr, PathLength, pat
hLength) | 71 DEFINE_ANIMATED_NUMBER(SVGPathElement, SVGNames::pathLengthAttr, PathLength, pat
hLength) |
| 72 DEFINE_ANIMATED_BOOLEAN(SVGPathElement, SVGNames::externalResourcesRequiredAttr,
ExternalResourcesRequired, externalResourcesRequired) | 72 DEFINE_ANIMATED_BOOLEAN(SVGPathElement, SVGNames::externalResourcesRequiredAttr,
ExternalResourcesRequired, externalResourcesRequired) |
| 73 | 73 |
| 74 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPathElement) | 74 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPathElement) |
| 75 REGISTER_LOCAL_ANIMATED_PROPERTY(d) | 75 REGISTER_LOCAL_ANIMATED_PROPERTY(d) |
| 76 REGISTER_LOCAL_ANIMATED_PROPERTY(pathLength) | 76 REGISTER_LOCAL_ANIMATED_PROPERTY(pathLength) |
| 77 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | 77 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) |
| 78 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) | 78 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) |
| 79 END_REGISTER_ANIMATED_PROPERTIES | 79 END_REGISTER_ANIMATED_PROPERTIES |
| 80 | 80 |
| 81 inline SVGPathElement::SVGPathElement(const QualifiedName& tagName, Document& do
cument) | 81 inline SVGPathElement::SVGPathElement(Document& document) |
| 82 : SVGGeometryElement(tagName, document) | 82 : SVGGeometryElement(SVGNames::pathTag, document) |
| 83 , m_pathByteStream(SVGPathByteStream::create()) | 83 , m_pathByteStream(SVGPathByteStream::create()) |
| 84 , m_pathSegList(PathSegUnalteredRole) | 84 , m_pathSegList(PathSegUnalteredRole) |
| 85 , m_isAnimValObserved(false) | 85 , m_isAnimValObserved(false) |
| 86 { | 86 { |
| 87 ASSERT(hasTagName(SVGNames::pathTag)); | |
| 88 ScriptWrappable::init(this); | 87 ScriptWrappable::init(this); |
| 89 registerAnimatedPropertiesForSVGPathElement(); | 88 registerAnimatedPropertiesForSVGPathElement(); |
| 90 } | 89 } |
| 91 | 90 |
| 92 PassRefPtr<SVGPathElement> SVGPathElement::create(const QualifiedName& tagName,
Document& document) | 91 PassRefPtr<SVGPathElement> SVGPathElement::create(Document& document) |
| 93 { | 92 { |
| 94 return adoptRef(new SVGPathElement(tagName, document)); | 93 return adoptRef(new SVGPathElement(document)); |
| 95 } | 94 } |
| 96 | 95 |
| 97 float SVGPathElement::getTotalLength() | 96 float SVGPathElement::getTotalLength() |
| 98 { | 97 { |
| 99 float totalLength = 0; | 98 float totalLength = 0; |
| 100 getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength); | 99 getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength); |
| 101 return totalLength; | 100 return totalLength; |
| 102 } | 101 } |
| 103 | 102 |
| 104 SVGPoint SVGPathElement::getPointAtLength(float length) | 103 SVGPoint SVGPathElement::getPointAtLength(float length) |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 return renderer->path().boundingRect(); | 399 return renderer->path().boundingRect(); |
| 401 } | 400 } |
| 402 | 401 |
| 403 RenderObject* SVGPathElement::createRenderer(RenderStyle*) | 402 RenderObject* SVGPathElement::createRenderer(RenderStyle*) |
| 404 { | 403 { |
| 405 // By default, any subclass is expected to do path-based drawing | 404 // By default, any subclass is expected to do path-based drawing |
| 406 return new RenderSVGPath(this); | 405 return new RenderSVGPath(this); |
| 407 } | 406 } |
| 408 | 407 |
| 409 } | 408 } |
| OLD | NEW |