| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 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 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 4 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 void SVGZoomAndPan::resetZoomAndPan() | 34 void SVGZoomAndPan::resetZoomAndPan() |
| 35 { | 35 { |
| 36 m_zoomAndPan = SVGZoomAndPanMagnify; | 36 m_zoomAndPan = SVGZoomAndPanMagnify; |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool SVGZoomAndPan::isKnownAttribute(const QualifiedName& attrName) | 39 bool SVGZoomAndPan::isKnownAttribute(const QualifiedName& attrName) |
| 40 { | 40 { |
| 41 return attrName == SVGNames::zoomAndPanAttr; | 41 return attrName == SVGNames::zoomAndPanAttr; |
| 42 } | 42 } |
| 43 | 43 |
| 44 void SVGZoomAndPan::addSupportedAttributes(HashSet<QualifiedName>& supportedAttr
ibutes) | |
| 45 { | |
| 46 supportedAttributes.add(SVGNames::zoomAndPanAttr); | |
| 47 } | |
| 48 | |
| 49 static const LChar disable[] = {'d', 'i', 's', 'a', 'b', 'l', 'e'}; | 44 static const LChar disable[] = {'d', 'i', 's', 'a', 'b', 'l', 'e'}; |
| 50 static const LChar magnify[] = {'m', 'a', 'g', 'n', 'i', 'f', 'y'}; | 45 static const LChar magnify[] = {'m', 'a', 'g', 'n', 'i', 'f', 'y'}; |
| 51 | 46 |
| 52 template<typename CharType> | 47 template<typename CharType> |
| 53 static bool parseZoomAndPanInternal(const CharType*& start, const CharType* end,
SVGZoomAndPanType& zoomAndPan) | 48 static bool parseZoomAndPanInternal(const CharType*& start, const CharType* end,
SVGZoomAndPanType& zoomAndPan) |
| 54 { | 49 { |
| 55 if (skipString(start, end, disable, WTF_ARRAY_LENGTH(disable))) { | 50 if (skipString(start, end, disable, WTF_ARRAY_LENGTH(disable))) { |
| 56 zoomAndPan = SVGZoomAndPanDisable; | 51 zoomAndPan = SVGZoomAndPanDisable; |
| 57 return true; | 52 return true; |
| 58 } | 53 } |
| 59 if (skipString(start, end, magnify, WTF_ARRAY_LENGTH(magnify))) { | 54 if (skipString(start, end, magnify, WTF_ARRAY_LENGTH(magnify))) { |
| 60 zoomAndPan = SVGZoomAndPanMagnify; | 55 zoomAndPan = SVGZoomAndPanMagnify; |
| 61 return true; | 56 return true; |
| 62 } | 57 } |
| 63 return false; | 58 return false; |
| 64 } | 59 } |
| 65 | 60 |
| 66 bool SVGZoomAndPan::parseZoomAndPan(const LChar*& start, const LChar* end) | 61 bool SVGZoomAndPan::parseZoomAndPan(const LChar*& start, const LChar* end) |
| 67 { | 62 { |
| 68 return parseZoomAndPanInternal(start, end, m_zoomAndPan); | 63 return parseZoomAndPanInternal(start, end, m_zoomAndPan); |
| 69 } | 64 } |
| 70 | 65 |
| 71 bool SVGZoomAndPan::parseZoomAndPan(const UChar*& start, const UChar* end) | 66 bool SVGZoomAndPan::parseZoomAndPan(const UChar*& start, const UChar* end) |
| 72 { | 67 { |
| 73 return parseZoomAndPanInternal(start, end, m_zoomAndPan); | 68 return parseZoomAndPanInternal(start, end, m_zoomAndPan); |
| 74 } | 69 } |
| 75 | 70 |
| 76 } | 71 } |
| OLD | NEW |