SVGPathSegListSMILType.h (1787B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef DOM_SVG_SVGPATHSEGLISTSMILTYPE_H_ 8 #define DOM_SVG_SVGPATHSEGLISTSMILTYPE_H_ 9 10 #include "mozilla/SMILType.h" 11 12 namespace mozilla { 13 14 class SMILValue; 15 16 //////////////////////////////////////////////////////////////////////// 17 // SVGPathSegListSMILType 18 // 19 // Operations for animating an SVGPathData. 20 // 21 class SVGPathSegListSMILType : public SMILType { 22 public: 23 // Singleton for SMILValue objects to hold onto. 24 static SVGPathSegListSMILType* Singleton() { 25 static SVGPathSegListSMILType sSingleton; 26 return &sSingleton; 27 } 28 29 protected: 30 // SMILType Methods 31 // ------------------- 32 33 void InitValue(SMILValue& aValue) const override; 34 35 void DestroyValue(SMILValue& aValue) const override; 36 nsresult Assign(SMILValue& aDest, const SMILValue& aSrc) const override; 37 bool IsEqual(const SMILValue& aLeft, const SMILValue& aRight) const override; 38 nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd, 39 uint32_t aCount) const override; 40 nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo, 41 double& aDistance) const override; 42 nsresult Interpolate(const SMILValue& aStartVal, const SMILValue& aEndVal, 43 double aUnitDistance, SMILValue& aResult) const override; 44 45 private: 46 // Private constructor: prevent instances beyond my singleton. 47 constexpr SVGPathSegListSMILType() = default; 48 }; 49 50 } // namespace mozilla 51 52 #endif // DOM_SVG_SVGPATHSEGLISTSMILTYPE_H_