summaryrefslogtreecommitdiffstats
path: root/ChangeLog.2001
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-10-24 14:56:38 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-10-24 14:56:38 (GMT)
commit3a72b68957dd3b1f2e48e34ead8b06b16b0c1b20 (patch)
tree19e788fb839b5504a8138f8b489058d436127c23 /ChangeLog.2001
parentff1b50a4021b13cb6e539e212ac3b704fb0de6c5 (diff)
downloadtcl-3a72b68957dd3b1f2e48e34ead8b06b16b0c1b20.zip
tcl-3a72b68957dd3b1f2e48e34ead8b06b16b0c1b20.tar.gz
tcl-3a72b68957dd3b1f2e48e34ead8b06b16b0c1b20.tar.bz2
Deal with a nasty special case.
Diffstat (limited to 'ChangeLog.2001')
0 files changed, 0 insertions, 0 deletions
class="hl opt">*=(qreal d) { val = (int) (val*d); return *this; } inline QFixed operator*(qreal d) const { QFixed f = *this; return (f *= d); } int val; }; Q_DECLARE_TYPEINFO(QFixed, Q_PRIMITIVE_TYPE); #define QFIXED_MAX (INT_MAX/256) inline int qRound(const QFixed &f) { return f.toInt(); } inline int qFloor(const QFixed &f) { return f.floor().truncate(); } inline QFixed operator*(int i, const QFixed &d) { return d*i; } inline QFixed operator+(int i, const QFixed &d) { return d+i; } inline QFixed operator-(int i, const QFixed &d) { return -(d-i); } inline QFixed operator*(uint i, const QFixed &d) { return d*i; } inline QFixed operator+(uint i, const QFixed &d) { return d+i; } inline QFixed operator-(uint i, const QFixed &d) { return -(d-i); } // inline QFixed operator*(qreal d, const QFixed &d2) { return d2*d; } inline bool operator==(const QFixed &f, int i) { return f.value() == (i<<6); } inline bool operator==(int i, const QFixed &f) { return f.value() == (i<<6); } inline bool operator!=(const QFixed &f, int i) { return f.value() != (i<<6); } inline bool operator!=(int i, const QFixed &f) { return f.value() != (i<<6); } inline bool operator<=(const QFixed &f, int i) { return f.value() <= (i<<6); } inline bool operator<=(int i, const QFixed &f) { return (i<<6) <= f.value(); } inline bool operator>=(const QFixed &f, int i) { return f.value() >= (i<<6); } inline bool operator>=(int i, const QFixed &f) { return (i<<6) >= f.value(); } inline bool operator<(const QFixed &f, int i) { return f.value() < (i<<6); } inline bool operator<(int i, const QFixed &f) { return (i<<6) < f.value(); } inline bool operator>(const QFixed &f, int i) { return f.value() > (i<<6); } inline bool operator>(int i, const QFixed &f) { return (i<<6) > f.value(); } inline QDebug &operator<<(QDebug &dbg, const QFixed &f) { return dbg << f.toReal(); } struct QFixedPoint { QFixed x; QFixed y; inline QFixedPoint() {} inline QFixedPoint(const QFixed &_x, const QFixed &_y) : x(_x), y(_y) {} QPointF toPointF() const { return QPointF(x.toReal(), y.toReal()); } static QFixedPoint fromPointF(const QPointF &p) { return QFixedPoint(QFixed::fromReal(p.x()), QFixed::fromReal(p.y())); } }; Q_DECLARE_TYPEINFO(QFixedPoint, Q_PRIMITIVE_TYPE); inline QFixedPoint operator-(const QFixedPoint &p1, const QFixedPoint &p2) { return QFixedPoint(p1.x - p2.x, p1.y - p2.y); } inline QFixedPoint operator+(const QFixedPoint &p1, const QFixedPoint &p2) { return QFixedPoint(p1.x + p2.x, p1.y + p2.y); } struct QFixedSize { QFixed width; QFixed height; QSizeF toSizeF() const { return QSizeF(width.toReal(), height.toReal()); } static QFixedSize fromSizeF(const QSizeF &s) { QFixedSize size; size.width = QFixed::fromReal(s.width()); size.height = QFixed::fromReal(s.height()); return size; } }; Q_DECLARE_TYPEINFO(QFixedSize, Q_PRIMITIVE_TYPE); QT_END_NAMESPACE #endif // QTEXTENGINE_P_H