KHTML
SMILTime.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "config.h"
00027 #if ENABLE(SVG)
00028 #include "SMILTime.h"
00029
00030 #include <float.h>
00031
00032 using namespace WebCore;
00033
00034 const double SMILTime::unresolvedValue = DBL_MAX;
00035
00036 const double SMILTime::indefiniteValue = FLT_MAX;
00037
00038 SMILTime WebCore::operator+(const SMILTime& a, const SMILTime& b) {
00039 if (a.isUnresolved() || b.isUnresolved())
00040 return SMILTime::unresolved();
00041 if (a.isIndefinite() || b.isIndefinite())
00042 return SMILTime::indefinite();
00043 return a.value() + b.value();
00044 }
00045
00046 SMILTime WebCore::operator-(const SMILTime& a, const SMILTime& b) {
00047 if (a.isUnresolved() || b.isUnresolved())
00048 return SMILTime::unresolved();
00049 if (a.isIndefinite() || b.isIndefinite())
00050 return SMILTime::indefinite();
00051 return a.value() - b.value();
00052 }
00053
00054 SMILTime WebCore::operator*(const SMILTime& a, const SMILTime& b) {
00055 if (a.isUnresolved() || b.isUnresolved())
00056 return SMILTime::unresolved();
00057 if (a.value() == 0 || b.value() == 0)
00058 return SMILTime(0);
00059 if (a.isIndefinite() || b.isIndefinite())
00060 return SMILTime::indefinite();
00061 return a.value() * b.value();
00062 }
00063 #endif
00064