Line data Source code
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 : #include "nsSMILNullType.h"
8 : #include "nsSMILValue.h"
9 : #include "nsDebug.h"
10 :
11 : nsresult
12 0 : nsSMILNullType::Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const
13 : {
14 0 : NS_PRECONDITION(aDest.mType == aSrc.mType, "Incompatible SMIL types");
15 0 : NS_PRECONDITION(aSrc.mType == this, "Unexpected source type");
16 0 : aDest.mU = aSrc.mU;
17 0 : aDest.mType = Singleton();
18 0 : return NS_OK;
19 : }
20 :
21 : bool
22 0 : nsSMILNullType::IsEqual(const nsSMILValue& aLeft,
23 : const nsSMILValue& aRight) const
24 : {
25 0 : NS_PRECONDITION(aLeft.mType == aRight.mType, "Incompatible SMIL types");
26 0 : NS_PRECONDITION(aLeft.mType == this, "Unexpected type for SMIL value");
27 :
28 0 : return true; // All null-typed values are equivalent.
29 : }
30 :
31 : nsresult
32 0 : nsSMILNullType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
33 : uint32_t aCount) const
34 : {
35 0 : NS_NOTREACHED("Adding NULL type");
36 0 : return NS_ERROR_FAILURE;
37 : }
38 :
39 : nsresult
40 0 : nsSMILNullType::ComputeDistance(const nsSMILValue& aFrom,
41 : const nsSMILValue& aTo,
42 : double& aDistance) const
43 : {
44 0 : NS_NOTREACHED("Computing distance for NULL type");
45 0 : return NS_ERROR_FAILURE;
46 : }
47 :
48 : nsresult
49 0 : nsSMILNullType::Interpolate(const nsSMILValue& aStartVal,
50 : const nsSMILValue& aEndVal,
51 : double aUnitDistance,
52 : nsSMILValue& aResult) const
53 : {
54 0 : NS_NOTREACHED("Interpolating NULL type");
55 0 : return NS_ERROR_FAILURE;
56 : }
|