diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
commit | 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch) | |
tree | b95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/devices/base/register.h | |
parent | b79a2c28534cf09987eeeba3077fff9236df182a (diff) | |
download | piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip |
TQt4 port piklab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/devices/base/register.h')
-rw-r--r-- | src/devices/base/register.h | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/src/devices/base/register.h b/src/devices/base/register.h index 1c587e2..5e89f91 100644 --- a/src/devices/base/register.h +++ b/src/devices/base/register.h @@ -16,8 +16,8 @@ namespace Register { class TypeData; } namespace Device { enum RegisterProperty { NotAccessible = 0x0, Readable = 0x1, Writable = 0x2 }; -Q_DECLARE_FLAGS(RegisterProperties, RegisterProperty) -Q_DECLARE_OPERATORS_FOR_FLAGS(RegisterProperties) +TQ_DECLARE_FLAGS(RegisterProperties, RegisterProperty) +TQ_DECLARE_OPERATORS_FOR_FLAGS(RegisterProperties) enum { MAX_NB_PORTS = 8 }; enum { MAX_NB_PORT_BITS = 16 }; @@ -44,20 +44,20 @@ class TypeData { public: TypeData() : _nbChars(0) {} TypeData(Address address, uint nbChars); - TypeData(const QString &name, uint nbChars); - TypeData(const QString &name, Address address, uint nbChars); + TypeData(const TQString &name, uint nbChars); + TypeData(const TQString &name, Address address, uint nbChars); bool operator ==(const TypeData &data) const { return _name==data._name && _address==data._address && _nbChars==data._nbChars; } Type type() const; - QString name() const { return _name; } + TQString name() const { return _name; } Address address() const { return _address; } uint nbChars() const { return _nbChars; } - QString toString() const; - static TypeData fromString(const QString &s); + TQString toString() const; + static TypeData fromString(const TQString &s); private: uint _nbChars; Address _address; - QString _name; + TQString _name; }; } // namespace @@ -77,12 +77,12 @@ public: virtual uint addressFromIndex(uint i) const = 0; virtual uint indexFromAddress(Address address) const = 0; virtual RegisterProperties properties(Address address) const = 0; - virtual QValueList<Register::TypeData> relatedRegisters(const Register::TypeData &data) const = 0; + virtual TQValueList<Register::TypeData> relatedRegisters(const Register::TypeData &data) const = 0; virtual bool hasPort(uint index) const = 0; virtual int portIndex(Address address) const = 0; - virtual QString portName(uint index) const = 0; + virtual TQString portName(uint index) const = 0; virtual bool hasPortBit(uint index, uint bit) const = 0; - virtual QString portBitName(uint index, uint bit) const = 0; + virtual TQString portBitName(uint index, uint bit) const = 0; }; } // namespace @@ -96,33 +96,34 @@ extern List &list(); class List : public GenericStorage { Q_OBJECT + TQ_OBJECT public: List() : GenericStorage(0, "register_list") {} void init(); void setWatched(const TypeData &data, bool watched); void clearWatched(); - const QValueList<TypeData> &watched() const { return _watched; } - bool isWatched(const TypeData &data) const { return _watched.contains(data); } + const TQValueList<TypeData> &watched() const { return _watched; } + bool isWatched(const TypeData &data) const { return _watched.tqcontains(data); } void setValue(const TypeData &data, BitValue value); BitValue value(const TypeData &data) const; BitValue oldValue(const TypeData &data) const; - void setPortData(uint index, const QMap<uint, Device::PortBitData> &data); - QMap<uint, Device::PortBitData> portData(uint index) const { return _portDatas[index].current; } - QMap<uint, Device::PortBitData> oldPortData(uint index) const { return _portDatas[index].old; } + void setPortData(uint index, const TQMap<uint, Device::PortBitData> &data); + TQMap<uint, Device::PortBitData> portData(uint index) const { return _portDatas[index].current; } + TQMap<uint, Device::PortBitData> oldPortData(uint index) const { return _portDatas[index].old; } private: class StateData { public: BitValue current, old; }; - QMap<Address, StateData> _regulars; // registers with address - QMap<QString, StateData> _specials; // registers with no address + TQMap<Address, StateData> _regulars; // registers with address + TQMap<TQString, StateData> _specials; // registers with no address class PortData { public: - QMap<uint, Device::PortBitData> current, old; + TQMap<uint, Device::PortBitData> current, old; }; - QMap<uint, PortData> _portDatas; // port index - QValueList<TypeData> _watched; + TQMap<uint, PortData> _portDatas; // port index + TQValueList<TypeData> _watched; }; } // namespace |