Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | |
| 4 * | 3 * |
| 5 * This library is free software; you can redistribute it and/or | 4 * Redistribution and use in source and binary forms, with or without |
| 6 * modify it under the terms of the GNU Library General Public | 5 * modification, are permitted provided that the following conditions are |
| 7 * License as published by the Free Software Foundation; either | 6 * met: |
| 8 * version 2 of the License, or (at your option) any later version. | |
| 9 * | 7 * |
| 10 * This library is distributed in the hope that it will be useful, | 8 * * Redistributions of source code must retain the above copyright |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 * notice, this list of conditions and the following disclaimer. |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 10 * * Redistributions in binary form must reproduce the above |
| 13 * Library General Public License for more details. | 11 * copyright notice, this list of conditions and the following disclaimer |
| 12 * in the documentation and/or other materials provided with the | |
| 13 * distribution. | |
| 14 * * Neither the name of Google Inc. nor the names of its | |
| 15 * contributors may be used to endorse or promote products derived from | |
| 16 * this software without specific prior written permission. | |
| 14 * | 17 * |
| 15 * You should have received a copy of the GNU Library General Public License | 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 18 * Boston, MA 02110-1301, USA. | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 19 */ | 29 */ |
| 20 | 30 |
| 21 #ifndef SVGPointList_h | 31 #ifndef SVGPointList_h |
| 22 #define SVGPointList_h | 32 #define SVGPointList_h |
| 23 | 33 |
| 34 #include "bindings/v8/ScriptWrappable.h" | |
| 24 #include "core/svg/SVGPoint.h" | 35 #include "core/svg/SVGPoint.h" |
| 25 #include "core/svg/properties/SVGPropertyTraits.h" | 36 #include "core/svg/properties/NewSVGListPropertyHelper.h" |
| 26 #include "wtf/Vector.h" | |
| 27 | 37 |
| 28 namespace WebCore { | 38 namespace WebCore { |
| 29 | 39 |
| 30 class SVGPointList : public Vector<SVGPoint> { | 40 class SVGPointListTearOff; |
| 41 | |
| 42 class SVGPointList FINAL : public NewSVGListPropertyHelper<SVGPointList, SVGPoin t> { | |
| 31 public: | 43 public: |
| 32 SVGPointList() { } | 44 typedef SVGPointListTearOff TearOffType; |
| 33 | 45 |
| 34 String valueAsString() const; | 46 static PassRefPtr<SVGPointList> create() |
| 35 }; | 47 { |
| 48 return adoptRef(new SVGPointList()); | |
| 49 } | |
| 36 | 50 |
| 37 template<> | 51 virtual ~SVGPointList(); |
| 38 struct SVGPropertyTraits<SVGPointList> { | 52 |
| 39 static SVGPointList initialValue() { return SVGPointList(); } | 53 PassRefPtr<SVGPointList> clone(); |
| 40 typedef SVGPoint ListItemType; | 54 |
| 55 void setValueAsString(const String&, ExceptionState&); | |
| 56 | |
| 57 // NewSVGPropertyBase: | |
| 58 virtual PassRefPtr<NewSVGPropertyBase> cloneForAnimation(const String&) cons t OVERRIDE; | |
| 59 virtual String valueAsString() const OVERRIDE; | |
| 60 | |
| 61 virtual void add(PassRefPtr<NewSVGPropertyBase>, SVGElement*) OVERRIDE; | |
| 62 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtr<NewSVGPropertyBase> fromValue, PassRefPtr<NewSV GPropertyBase> toValue, PassRefPtr<NewSVGPropertyBase> toAtEndOfDurationValue, S VGElement*) OVERRIDE; | |
| 63 virtual float calculateDistance(PassRefPtr<NewSVGPropertyBase> to, SVGElemen t*) OVERRIDE; | |
| 64 | |
| 65 static AnimatedPropertyType classType() { return AnimatedPoints; } | |
| 66 | |
| 67 private: | |
| 68 explicit SVGPointList(); | |
|
haraken
2014/01/17 11:50:18
Drop explicit.
kouhei (in TOK)
2014/01/20 01:10:26
Done.
| |
| 69 | |
| 70 bool adjustFromToListValues(PassRefPtr<SVGPointList> fromList, PassRefPtr<SV GPointList> toList, float percentage, bool isToAnimation, bool resizeAnimatedLis tIfNeeded); | |
| 71 | |
| 72 template <typename CharType> | |
| 73 bool parse(const CharType*& ptr, const CharType* end); | |
| 41 }; | 74 }; |
| 42 | 75 |
| 43 } // namespace WebCore | 76 } // namespace WebCore |
| 44 | 77 |
| 45 #endif | 78 #endif // SVGPointList_h |
| OLD | NEW |