2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef SVGPathSegWithContext_h
21 #define SVGPathSegWithContext_h
24 #include "SVGPathElement.h"
28 class SVGPathSegWithContext : public SVGPathSeg {
30 SVGPathSegWithContext(SVGPathElement* element, SVGPathSegRole role)
36 SVGAnimatedProperty* animatedProperty() const
39 case PathSegUndefinedRole:
41 case PathSegUnalteredRole:
42 return SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff, true>(m_element.get(), SVGPathElement::dPropertyInfo());
43 case PathSegNormalizedRole:
44 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists!
51 SVGPathElement* contextElement() const { return m_element.get(); }
52 SVGPathSegRole role() const { return m_role; }
54 void setContextAndRole(SVGPathElement* element, SVGPathSegRole role)
64 ASSERT(m_role == PathSegUndefinedRole);
68 ASSERT(m_role != PathSegUndefinedRole);
69 m_element->pathSegListChanged(m_role);
73 SVGPathSegRole m_role;
74 RefPtr<SVGPathElement> m_element;
77 class SVGPathSegSingleCoordinate : public SVGPathSegWithContext {
79 float x() const { return m_x; }
86 float y() const { return m_y; }
94 SVGPathSegSingleCoordinate(SVGPathElement* element, SVGPathSegRole role, float x, float y)
95 : SVGPathSegWithContext(element, role)
106 } // namespace WebCore
108 #endif // ENABLE(SVG)