tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

SMILNullType.h (1609B)


      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_SMIL_SMILNULLTYPE_H_
      8 #define DOM_SMIL_SMILNULLTYPE_H_
      9 
     10 #include "mozilla/SMILType.h"
     11 
     12 namespace mozilla {
     13 
     14 class SMILNullType : public SMILType {
     15 public:
     16  // Singleton for SMILValue objects to hold onto.
     17  static SMILNullType* Singleton();
     18 
     19 protected:
     20  // SMILType Methods
     21  // -------------------
     22  void InitValue(SMILValue& aValue) const override {}
     23  void DestroyValue(SMILValue& aValue) const override {}
     24  nsresult Assign(SMILValue& aDest, const SMILValue& aSrc) const override;
     25 
     26  // The remaining methods should never be called, so although they're very
     27  // simple they don't need to be inline.
     28  bool IsEqual(const SMILValue& aLeft, const SMILValue& aRight) const override;
     29  nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
     30               uint32_t aCount) const override;
     31  nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
     32                           double& aDistance) const override;
     33  nsresult Interpolate(const SMILValue& aStartVal, const SMILValue& aEndVal,
     34                       double aUnitDistance, SMILValue& aResult) const override;
     35 
     36 private:
     37  // Private constructor: prevent instances beyond my singleton.
     38  constexpr SMILNullType() = default;
     39 };
     40 
     41 }  // namespace mozilla
     42 
     43 #endif  // DOM_SMIL_SMILNULLTYPE_H_