diff options
Diffstat (limited to 'src/common/common/qflags.h')
-rw-r--r-- | src/common/common/qflags.h | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/common/common/qflags.h b/src/common/common/qflags.h index 4858ce4..c7abfc2 100644 --- a/src/common/common/qflags.h +++ b/src/common/common/qflags.h @@ -2,7 +2,7 @@ ** ** Copyright (C) 1992-2005 Trolltech AS. All rights reserved. ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the TQtCore module of the TQt Toolkit. ** ** This file may be used under the terms of the GNU General Public ** License version 2.0 as published by the Free Software Foundation @@ -20,62 +20,62 @@ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ****************************************************************************/ -#ifndef QFLAGS_H -#define QFLAGS_H +#ifndef TQFLAGS_H +#define TQFLAGS_H -#include <qglobal.h> +#include <tqglobal.h> -class QFlag +class TQFlag { int i; public: - inline QFlag(int i); + inline TQFlag(int i); inline operator int() const { return i; } }; -inline QFlag::QFlag(int ai) : i(ai) {} +inline TQFlag::TQFlag(int ai) : i(ai) {} template<typename Enum> -class QFlags +class TQFlags { typedef void **Zero; int i; public: typedef Enum enum_type; - inline QFlags(const QFlags &f) : i(f.i) {} - inline QFlags(Enum f) : i(f) {} - inline QFlags(Zero = 0) : i(0) {} - inline QFlags(QFlag f) : i(f) {} + inline TQFlags(const TQFlags &f) : i(f.i) {} + inline TQFlags(Enum f) : i(f) {} + inline TQFlags(Zero = 0) : i(0) {} + inline TQFlags(TQFlag f) : i(f) {} - inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; } - inline QFlags &operator&=(int mask) { i &= mask; return *this; } - inline QFlags &operator&=(uint mask) { i &= mask; return *this; } - inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; } - inline QFlags &operator|=(Enum f) { i |= f; return *this; } - inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; } - inline QFlags &operator^=(Enum f) { i ^= f; return *this; } + inline TQFlags &operator=(const TQFlags &f) { i = f.i; return *this; } + inline TQFlags &operator&=(int tqmask) { i &= tqmask; return *this; } + inline TQFlags &operator&=(uint tqmask) { i &= tqmask; return *this; } + inline TQFlags &operator|=(TQFlags f) { i |= f.i; return *this; } + inline TQFlags &operator|=(Enum f) { i |= f; return *this; } + inline TQFlags &operator^=(TQFlags f) { i ^= f.i; return *this; } + inline TQFlags &operator^=(Enum f) { i ^= f; return *this; } inline operator int() const { return i;} - inline QFlags operator|(QFlags f) const { QFlags g; g.i = i | f.i; return g; } - inline QFlags operator|(Enum f) const { QFlags g; g.i = i | f; return g; } - inline QFlags operator^(QFlags f) const { QFlags g; g.i = i ^ f.i; return g; } - inline QFlags operator^(Enum f) const { QFlags g; g.i = i ^ f; return g; } - inline QFlags operator&(int mask) const { QFlags g; g.i = i & mask; return g; } - inline QFlags operator&(uint mask) const { QFlags g; g.i = i & mask; return g; } - inline QFlags operator&(Enum f) const { QFlags g; g.i = i & f; return g; } - inline QFlags operator~() const { QFlags g; g.i = ~i; return g; } + inline TQFlags operator|(TQFlags f) const { TQFlags g; g.i = i | f.i; return g; } + inline TQFlags operator|(Enum f) const { TQFlags g; g.i = i | f; return g; } + inline TQFlags operator^(TQFlags f) const { TQFlags g; g.i = i ^ f.i; return g; } + inline TQFlags operator^(Enum f) const { TQFlags g; g.i = i ^ f; return g; } + inline TQFlags operator&(int tqmask) const { TQFlags g; g.i = i & tqmask; return g; } + inline TQFlags operator&(uint tqmask) const { TQFlags g; g.i = i & tqmask; return g; } + inline TQFlags operator&(Enum f) const { TQFlags g; g.i = i & f; return g; } + inline TQFlags operator~() const { TQFlags g; g.i = ~i; return g; } inline bool operator!() const { return !i; } }; -#define Q_DECLARE_FLAGS(Flags, Enum)\ -typedef QFlags<Enum> Flags; -#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \ -inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \ -{ return QFlags<Flags::enum_type>(f1) | f2; } \ -inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \ +#define TQ_DECLARE_FLAGS(Flags, Enum)\ +typedef TQFlags<Enum> Flags; +#define TQ_DECLARE_OPERATORS_FOR_FLAGS(Flags) \ +inline TQFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \ +{ return TQFlags<Flags::enum_type>(f1) | f2; } \ +inline TQFlags<Flags::enum_type> operator|(Flags::enum_type f1, TQFlags<Flags::enum_type> f2) \ { return f2 | f1; } #endif |