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 | |
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')
-rw-r--r-- | src/devices/base/device_group.cpp | 192 | ||||
-rw-r--r-- | src/devices/base/device_group.h | 26 | ||||
-rw-r--r-- | src/devices/base/generic_device.cpp | 32 | ||||
-rw-r--r-- | src/devices/base/generic_device.h | 74 | ||||
-rw-r--r-- | src/devices/base/generic_memory.cpp | 12 | ||||
-rw-r--r-- | src/devices/base/generic_memory.h | 14 | ||||
-rw-r--r-- | src/devices/base/hex_buffer.cpp | 34 | ||||
-rw-r--r-- | src/devices/base/hex_buffer.h | 18 | ||||
-rw-r--r-- | src/devices/base/register.cpp | 22 | ||||
-rw-r--r-- | src/devices/base/register.h | 43 |
10 files changed, 234 insertions, 233 deletions
diff --git a/src/devices/base/device_group.cpp b/src/devices/base/device_group.cpp index df230d1..4b9d75d 100644 --- a/src/devices/base/device_group.cpp +++ b/src/devices/base/device_group.cpp @@ -9,32 +9,32 @@ #include "device_group.h" #if !defined(NO_KDE) -# include <qpainter.h> +# include <tqpainter.h> # include <kglobal.h> -QColor Device::statusColor(Status status) +TQColor Device::statusColor(tqStatus status) { switch (status.type()) { - case Status::Future: return Qt::blue; - case Status::InProduction: return Qt::green; - case Status::Mature: - case Status::NotRecommended: return QColor("orange"); - case Status::EOL: return Qt::red; - case Status::Unknown: - case Status::Nb_Types: break; + case tqStatus::Future: return TQt::blue; + case tqStatus::InProduction: return TQt::green; + case tqStatus::Mature: + case tqStatus::NotRecommended: return TQColor("orange"); + case tqStatus::EOL: return TQt::red; + case tqStatus::Unknown: + case tqStatus::Nb_Types: break; } - return Qt::black; + return TQt::black; } -QString coloredString(const QString &text, QColor color) +TQString coloredString(const TQString &text, TQColor color) { - return QString("<font color=\"") + color.name() + "\">" + text + "</font>"; + return TQString("<font color=\"") + color.name() + "\">" + text + "</font>"; } -QString supportedString(bool supported) +TQString supportedString(bool supported) { return coloredString(supported ? i18n("Supported") : i18n("Unsupported"), - supported ? Qt::green : Qt::red); + supported ? TQt::green : TQt::red); } class Tick { @@ -44,27 +44,27 @@ public: s = KGlobal::locale()->formatNumber(value, 1); min = oValue; } - QString s; + TQString s; double min; }; -class TickMap : public QMap<double, Tick> +class TickMap : public TQMap<double, Tick> { public: TickMap() {} void add(double value, double oValue) { insert(value, Tick(value, oValue), false); - (*this)[value].min = QMIN((*this)[value].min, oValue); + (*this)[value].min = TQMIN((*this)[value].min, oValue); } }; -QPixmap drawGraph(const QValueVector<Device::RangeBox> &boxes) +TQPixmap drawGraph(const TQValueVector<Device::RangeBox> &boxes) { const uint w = 300, h = 200; - QPixmap pixmap(w, h); - pixmap.fill(Qt::white); - QPainter p(&pixmap); - QFontMetrics f(p.font()); + TQPixmap pixmap(w, h); + pixmap.fill(TQt::white); + TQPainter p(&pixmap); + TQFontMetrics f(p.font()); TickMap xTicks, yTicks; xTicks.add(0.0, 0.0); yTicks.add(0.0, 0.0); @@ -85,67 +85,67 @@ QPixmap drawGraph(const QValueVector<Device::RangeBox> &boxes) int yStart = h-1 - f.lineSpacing(); TickMap::const_iterator it = xTicks.begin(); for (; it!=xTicks.end(); ++it) { - xStart = QMAX(xStart, f.width(it.data().s)); - xMax = QMAX(xMax, it.key()); + xStart = TQMAX(xStart, f.width(it.data().s)); + xMax = TQMAX(xMax, it.key()); } for (it = yTicks.begin(); it!=yTicks.end(); ++it) - yMax = QMAX(yMax, it.key()); + yMax = TQMAX(yMax, it.key()); int xEnd = w-1 - f.width(xTicks[xMax].s)/2; - QRect rect = f.boundingRect(yTicks[yMax].s); + TQRect rect = f.boundingRect(yTicks[yMax].s); int yEnd = rect.height()/2; // draw boxes - p.setPen(Qt::lightGray); - p.setBrush(Qt::lightGray); + p.setPen(TQt::lightGray); + p.setBrush(TQt::lightGray); for (uint i=0; i<boxes.count(); i++) { double ax = double(xEnd - xStart)/xMax; double ay = double(yEnd - yStart)/yMax; - QPointArray pa(4); - pa.setPoint(0, qRound(ax*boxes[i].start.x), qRound(ay*boxes[i].start.yMin)); - pa.setPoint(1, qRound(ax*boxes[i].end.x), qRound(ay*boxes[i].end.yMin)); - pa.setPoint(2, qRound(ax*boxes[i].end.x), qRound(ay*boxes[i].end.yMax)); - pa.setPoint(3, qRound(ax*boxes[i].start.x), qRound(ay*boxes[i].start.yMax)); + TQPointArray pa(4); + pa.setPoint(0, tqRound(ax*boxes[i].start.x), tqRound(ay*boxes[i].start.yMin)); + pa.setPoint(1, tqRound(ax*boxes[i].end.x), tqRound(ay*boxes[i].end.yMin)); + pa.setPoint(2, tqRound(ax*boxes[i].end.x), tqRound(ay*boxes[i].end.yMax)); + pa.setPoint(3, tqRound(ax*boxes[i].start.x), tqRound(ay*boxes[i].start.yMax)); pa.translate(xStart, yStart); p.drawPolygon(pa); } // draw axis - p.setPen(Qt::black); + p.setPen(TQt::black); p.drawLine(xStart, yStart, w-1, yStart); p.drawLine(xStart, yStart, xStart, 0); // draw ticks and lines - p.setPen(Qt::DotLine); + p.setPen(TQt::DotLine); for (it = yTicks.begin(); it!=yTicks.end(); ++it) { - int y1 = yStart + qRound(it.key()*(yEnd-yStart)/yMax); - QRect rect = f.boundingRect(it.data().s); + int y1 = yStart + tqRound(it.key()*(yEnd-yStart)/yMax); + TQRect rect = f.boundingRect(it.data().s); p.drawText(xStart/2-rect.width()/2 , y1+rect.height()/2, it.data().s); - int xmin = xStart + qRound(it.data().min*(xEnd-xStart)/xMax); + int xmin = xStart + tqRound(it.data().min*(xEnd-xStart)/xMax); p.drawLine(xStart, y1, xmin, y1); } for (it = xTicks.begin(); it!=xTicks.end(); ++it) { - int x1 = xStart + qRound(it.key()*(xEnd-xStart)/xMax); - QRect rect = f.boundingRect(it.data().s); + int x1 = xStart + tqRound(it.key()*(xEnd-xStart)/xMax); + TQRect rect = f.boundingRect(it.data().s); p.drawText(x1-rect.width()/2, h-1, it.data().s); - int ymin = yStart + qRound(it.data().min*(yEnd-yStart)/yMax); + int ymin = yStart + tqRound(it.data().min*(yEnd-yStart)/yMax); p.drawLine(x1, yStart, x1, ymin); } return pixmap; } -QPixmap Device::vddGraph(const QString &xLabel, const QString &yLabel, - const QValueVector<Device::RangeBox> &boxes) +TQPixmap Device::vddGraph(const TQString &xLabel, const TQString &yLabel, + const TQValueVector<Device::RangeBox> &boxes) { uint sp = 10; - QPixmap graph = drawGraph(boxes); - QPainter p; - QFontMetrics f(p.font()); - QPixmap pixmap(graph.width() + sp + f.width(xLabel), graph.height() + sp + f.lineSpacing()); - pixmap.fill(Qt::white); + TQPixmap graph = drawGraph(boxes); + TQPainter p; + TQFontMetrics f(p.font()); + TQPixmap pixmap(graph.width() + sp + f.width(xLabel), graph.height() + sp + f.lineSpacing()); + pixmap.fill(TQt::white); copyBlt(&pixmap, 0, f.lineSpacing() + sp, &graph, 0, 0, graph.width(), graph.height()); p.begin(&pixmap); - p.setPen(Qt::black); + p.setPen(TQt::black); p.drawText(0, f.lineSpacing(), yLabel); p.drawText(pixmap.width()-1-f.width(xLabel), pixmap.height()-1, xLabel); return pixmap; @@ -159,31 +159,31 @@ const Device::Package *Device::barPackage(const char *name, const Device::Data & return 0; } -QPixmap Device::pinsGraph(const Device::Package &package) +TQPixmap Device::pinsGraph(const Device::Package &package) { - QPixmap pixmap; - QPainter p; - QFontMetrics fm(p.font()); + TQPixmap pixmap; + TQPainter p; + TQFontMetrics fm(p.font()); uint nb = package.pins.count(); const int hspacing = 3, wspacing = 3, wmark = 10, wpin = 4; int theight = fm.ascent() + (fm.ascent()%2==0 ? 1 : 0); int height = hspacing + (nb/2)*(hspacing + theight); int wnumber = fm.width("1"); - wnumber = QMAX(wnumber, fm.width(QString::number(nb/2))); - wnumber = QMAX(wnumber, fm.width(QString::number(nb/2+1))); - wnumber = QMAX(wnumber, fm.width(QString::number(nb))); + wnumber = TQMAX(wnumber, fm.width(TQString::number(nb/2))); + wnumber = TQMAX(wnumber, fm.width(TQString::number(nb/2+1))); + wnumber = TQMAX(wnumber, fm.width(TQString::number(nb))); int bwidth = 4*wspacing + 2*wnumber + wmark; int lwidth = 0, rwidth = 0; for (uint k=0; k<nb/2; k++) { - lwidth = QMAX(lwidth, fm.width(package.pins[k])); - rwidth = QMAX(rwidth, fm.width(package.pins[nb-k-1])); + lwidth = TQMAX(lwidth, fm.width(package.pins[k])); + rwidth = TQMAX(rwidth, fm.width(package.pins[nb-k-1])); } int bx = lwidth + wspacing + wpin; int width = bx + bwidth + wpin + wspacing + rwidth; pixmap.resize(width, height); - pixmap.fill(Qt::white); + pixmap.fill(TQt::white); p.begin(&pixmap); - p.setPen(QPen(Qt::black, 2)); + p.setPen(TQPen(TQt::black, 2)); p.drawRect(bx, 1, bwidth, height-1); p.drawArc(bx+wspacing+wnumber+wspacing, -wmark/2+2, wmark, wmark, 0, -180*16); for (uint k=0; k<nb/2; k++) { @@ -191,13 +191,13 @@ QPixmap Device::pinsGraph(const Device::Package &package) p.drawLine(bx-wpin-1, h, bx, h); p.drawLine(bx+bwidth, h, bx+bwidth+wpin, h); h += theight/2; - QString label = package.pins[k]; + TQString label = package.pins[k]; p.drawText(bx-wpin-wspacing-fm.width(label), h, label); p.drawText(bx+bwidth+wpin+wspacing, h, package.pins[nb-k-1]); uint pin = (k+1); if ( pin==1 || pin==(nb/2) ) { - p.drawText(bx+wspacing, h, QString::number(pin)); - label = QString::number(nb-k); + p.drawText(bx+wspacing, h, TQString::number(pin)); + label = TQString::number(nb-k); p.drawText(bx+bwidth-wspacing-fm.width(label), h, label); } } @@ -205,9 +205,9 @@ QPixmap Device::pinsGraph(const Device::Package &package) return pixmap; } -QString Device::htmlInfo(const Device::Data &data, const QString &deviceHref, const QString &documentHtml) +TQString Device::htmlInfo(const Device::Data &data, const TQString &deviceHref, const TQString &documentHtml) { - QString doc; + TQString doc; // title doc += "<h1>"; @@ -224,16 +224,16 @@ QString Device::htmlInfo(const Device::Data &data, const QString &deviceHref, co doc += "</h1>"; doc += "<table>"; - QString status = coloredString(data.status().label(), statusColor(data.status())); - doc += htmlTableRow(i18n("Status"), status); + TQString status = coloredString(data.status().label(), statusColor(data.status())); + doc += htmlTableRow(i18n("tqStatus"), status); if ( data.alternatives().count() ) { - QString s; + TQString s; for (uint i=0; i<data.alternatives().count(); i++) { if ( i!=0 ) s += ", "; if ( deviceHref.isEmpty() ) s += data.alternatives()[i].upper(); else { - QString href = deviceHref.arg(data.alternatives()[i].upper()); - s += QString("<a href=\"%1\">%2</a>").arg(href).arg(data.alternatives()[i].upper()); + TQString href = deviceHref.tqarg(data.alternatives()[i].upper()); + s += TQString("<a href=\"%1\">%2</a>").tqarg(href).tqarg(data.alternatives()[i].upper()); } } doc += htmlTableRow(i18n("Alternatives"), s); @@ -244,36 +244,36 @@ QString Device::htmlInfo(const Device::Data &data, const QString &deviceHref, co doc += "<hr />"; doc += "<table>"; doc += data.group().informationHtml(data); - QString s; + TQString s; for (uint i=0; i<data.packages().count(); i++) for (uint k=0; k<data.packages()[i].types.count(); k++) - s += i18n(Package::TYPE_DATA[data.packages()[i].types[k]].label) + QString("[%1] ").arg(data.packages()[i].pins.count()); + s += i18n(Package::TYPE_DATA[data.packages()[i].types[k]].label) + TQString("[%1] ").tqarg(data.packages()[i].pins.count()); doc += htmlTableRow(i18n("Packaging"), s); doc += "</table>"; return doc; } -QString Device::htmlPinDiagrams(const Device::Data &data, const QString &imagePrefix, QMimeSourceFactory *msf) +TQString Device::htmlPinDiagrams(const Device::Data &data, const TQString &imagePrefix, TQMimeSourceFactory *msf) { - QString doc; + TQString doc; // pins const Package *package = 0; for (uint i=0; Package::TYPE_DATA[i].name; i++) { - if ( Package::TYPE_DATA[i].shape!=Package::Bar ) continue; + if ( Package::TYPE_DATA[i].tqshape!=Package::Bar ) continue; package = barPackage(Package::TYPE_DATA[i].name, data); if (package) break; } if (package) { - QPixmap pix = pinsGraph(*package); + TQPixmap pix = pinsGraph(*package); doc += "<table cellpadding=\"3\"><tr bgcolor=\"gray\"><th align=\"center\">"; for (uint k=0; k<package->types.count(); k++) { if ( k!=0 ) doc += " "; doc += i18n(Package::TYPE_DATA[package->types[k]].label); - doc += "(" + QString::number(package->pins.count()) + ")"; + doc += "(" + TQString::number(package->pins.count()) + ")"; } doc += "</th></tr><tr><td align=\"center\">"; - QString label = data.name() + "_pins_graph.png"; + TQString label = data.name() + "_pins_graph.png"; doc += "<img src=\"" + imagePrefix + label + "\" />"; if (msf) msf->setPixmap(label, pix); doc += "</td></tr></table>"; @@ -281,15 +281,15 @@ QString Device::htmlPinDiagrams(const Device::Data &data, const QString &imagePr return doc; } -QString Device::htmlVoltageFrequencyGraphs(const Device::Data &data, const QString &imagePrefix, QMimeSourceFactory *msf) +TQString Device::htmlVoltageFrequencyGraphs(const Device::Data &data, const TQString &imagePrefix, TQMimeSourceFactory *msf) { - QString doc; + TQString doc; FOR_EACH(Special, special) { for (uint k=0; k<data.frequencyRanges().count(); k++) { const Device::FrequencyRange &fr = data.frequencyRanges()[k]; if ( fr.special!=special ) continue; doc += "<h3>" + data.fname(special) + " - " + i18n("Temperature range: ") + fr.operatingCondition.label() + "</h3>"; - QString label = data.name() + "_" + data.fname(special) + "_" + TQString label = data.name() + "_" + data.fname(special) + "_" + fr.operatingCondition.key() + ".png"; doc += "<img src=\"" + imagePrefix + label + "\" />"; if (msf) msf->setPixmap(label, Device::vddGraph(i18n("F (MHz)"), i18n("Vdd (V)"), fr.vdds)); @@ -298,18 +298,18 @@ QString Device::htmlVoltageFrequencyGraphs(const Device::Data &data, const QStri return doc; } -QPixmap Device::memoryGraph(const QValueList<MemoryGraphData> &r) +TQPixmap Device::memoryGraph(const TQValueList<MemoryGraphData> &r) { - QValueList<MemoryGraphData> ranges = r; - QPixmap pixmap; - QPainter p; - QFontMetrics fm(p.font()); + TQValueList<MemoryGraphData> ranges = r; + TQPixmap pixmap; + TQPainter p; + TQFontMetrics fm(p.font()); // order qHeapSort(ranges); // add empty ranges - QValueList<MemoryGraphData>::iterator it; + TQValueList<MemoryGraphData>::iterator it; for (it=ranges.begin(); it!=ranges.end(); ) { - QValueList<MemoryGraphData>::iterator prev = it; + TQValueList<MemoryGraphData>::iterator prev = it; ++it; if ( it==ranges.end() ) break; if ( (*prev).endAddress+1==(*it).startAddress ) continue; @@ -324,9 +324,9 @@ QPixmap Device::memoryGraph(const QValueList<MemoryGraphData> &r) int height = 1; int w1 = 0, w2 = 0; for (it=ranges.begin(); it!=ranges.end(); ++it) { - w1 = QMAX(w1, fm.width((*it).start)); - w1 = QMAX(w1, fm.width((*it).end)); - w2 = QMAX(w2, fm.width((*it).label)); + w1 = TQMAX(w1, fm.width((*it).start)); + w1 = TQMAX(w1, fm.width((*it).end)); + w2 = TQMAX(w2, fm.width((*it).label)); (*it).height = 2*hspacing + theight; if ( (*it).startAddress!=(*it).endAddress ) (*it).height += 2*theight; height += (*it).height; @@ -334,15 +334,15 @@ QPixmap Device::memoryGraph(const QValueList<MemoryGraphData> &r) int wspacing = 4; int width = wspacing + w1 + wspacing + wspacing + w2; pixmap.resize(width, height); - pixmap.fill(Qt::white); + pixmap.fill(TQt::white); p.begin(&pixmap); int h = 0; // draw ranges for (it=ranges.begin(); it!=ranges.end(); ++it) { - p.setPen(QPen(Qt::black, 1, Qt::DotLine)); + p.setPen(TQPen(TQt::black, 1, TQt::DotLine)); p.drawLine(0,h, width-1,h); - p.setPen(QPen(Qt::black, 1)); - p.setBrush((*it).label.isEmpty() ? Qt::gray : Qt::white); + p.setPen(TQPen(TQt::black, 1)); + p.setBrush((*it).label.isEmpty() ? TQt::gray : TQt::white); p.drawRect(0,h, wspacing+w1+wspacing,(*it).height+1); int hmid = h+(*it).height/2+theight/2; p.drawText(wspacing+w1+wspacing+wspacing,hmid, (*it).label); @@ -352,7 +352,7 @@ QPixmap Device::memoryGraph(const QValueList<MemoryGraphData> &r) p.drawText(wspacing,h+(*it).height-3, (*it).end); } h += (*it).height; - p.setPen(QPen(Qt::black, 1, Qt::DotLine)); + p.setPen(TQPen(TQt::black, 1, TQt::DotLine)); p.drawLine(0,h, width-1,h); } p.end(); diff --git a/src/devices/base/device_group.h b/src/devices/base/device_group.h index 087ca99..8414515 100644 --- a/src/devices/base/device_group.h +++ b/src/devices/base/device_group.h @@ -10,7 +10,7 @@ #define DEVICE_GROUP_H #if !defined(NO_KDE) -# include <qcolor.h> +# include <tqcolor.h> #endif #include "generic_device.h" @@ -35,13 +35,13 @@ class GroupBase : public ::Group::Base { public: virtual Memory *createMemory(const Device::Data &data) const = 0; - virtual QString informationHtml(const Device::Data &data) const = 0; + virtual TQString informationHtml(const Device::Data &data) const = 0; #if !defined(NO_KDE) - virtual QPixmap memoryGraph(const Device::Data &data) const = 0; + virtual TQPixmap memoryGraph(const Device::Data &data) const = 0; #endif protected: - virtual void addDevice(const QString &name, const Device::Data *data, ::Group::Support support) { + virtual void addDevice(const TQString &name, const Device::Data *data, ::Group::Support support) { const_cast<Device::Data *>(data)->_group = this; ::Group::Base::addDevice(name, data, support); } @@ -52,7 +52,7 @@ class Group : public GroupBase, public DataStreamer<DataType> { protected: virtual void initSupported() { - QValueList<DataType *> list = fromCppString(dataStream(), dataSize()); + TQValueList<DataType *> list = fromCppString(dataStream(), dataSize()); for (uint i=0; i<uint(list.count()); i++) addDevice(list[i]->name(), list[i], ::Group::Support::Tested); } virtual uint dataSize() const = 0; @@ -61,24 +61,24 @@ protected: //---------------------------------------------------------------------------- #if !defined(NO_KDE) -extern QColor statusColor(Status status); -extern QPixmap vddGraph(const QString &xLabel, const QString &yLabel, const QValueVector<RangeBox> &boxes); +extern TQColor statusColor(tqStatus status); +extern TQPixmap vddGraph(const TQString &xLabel, const TQString &yLabel, const TQValueVector<RangeBox> &boxes); extern const Package *barPackage(const char *name, const Data &data); -extern QPixmap pinsGraph(const Package &package); +extern TQPixmap pinsGraph(const Package &package); -extern QString htmlInfo(const Data &data, const QString &deviceHref, const QString &documentHtml); -extern QString htmlPinDiagrams(const Device::Data &data, const QString &imagePrefix, QMimeSourceFactory *msf); -extern QString htmlVoltageFrequencyGraphs(const Device::Data &data, const QString &imagePrefix, QMimeSourceFactory *msf); +extern TQString htmlInfo(const Data &data, const TQString &deviceHref, const TQString &documentHtml); +extern TQString htmlPinDiagrams(const Device::Data &data, const TQString &imagePrefix, TQMimeSourceFactory *msf); +extern TQString htmlVoltageFrequencyGraphs(const Device::Data &data, const TQString &imagePrefix, TQMimeSourceFactory *msf); class MemoryGraphData { public: Address startAddress, endAddress; - QString start, end, label; + TQString start, end, label; int height; bool operator <(const MemoryGraphData &data) const { return ( startAddress < data.startAddress ); } }; -extern QPixmap memoryGraph(const QValueList<MemoryGraphData> &ranges); +extern TQPixmap memoryGraph(const TQValueList<MemoryGraphData> &ranges); #endif diff --git a/src/devices/base/generic_device.cpp b/src/devices/base/generic_device.cpp index bf69dce..bfbd37d 100644 --- a/src/devices/base/generic_device.cpp +++ b/src/devices/base/generic_device.cpp @@ -13,7 +13,7 @@ #include "register.h" //----------------------------------------------------------------------------- -const Device::Status::Data Device::Status::DATA[Nb_Types] = { +const Device::tqStatus::Data Device::tqStatus::DATA[Nb_Types] = { { "IP", I18N_NOOP("In Production") }, { "Future", I18N_NOOP("Future Product") }, { "NR", I18N_NOOP("Not Recommended for New Design") }, @@ -52,10 +52,10 @@ const Device::Package::TypeData Device::Package::TYPE_DATA[] = { { "tssop", I18N_NOOP("TSSOP"), Bar, { 8, 14, 0, 0, 0, 0, 0, 0, 0 } }, { "soic", I18N_NOOP("SOIC"), Bar, { 8, 14, 18, 20, 28, 0, 0, 0, 0 } }, { "tqfp", I18N_NOOP("TQFP"), Square, { 0, 0, 0, 0, 0, 44, 64, 80, 100 } }, - { "mqfp", I18N_NOOP("MQFP"), Square, { 0, 0, 0, 0, 0, 44, 0, 0, 0 } }, + { "mqfp", I18N_NOOP("MTQFP"), Square, { 0, 0, 0, 0, 0, 44, 0, 0, 0 } }, { "dfns", I18N_NOOP("DFN-S"), Bar, { 8, 0, 0, 0, 0, 0, 0, 0, 0 } }, - { "qfn", I18N_NOOP("QFN"), Square, { 0, 16, 0, 20, 28, 44, 0, 0, 0 } }, - { "qfns", I18N_NOOP("QFN-S"), Bar, { 0, 0, 0, 0, 28, 0, 0, 0, 0 } }, + { "qfn", I18N_NOOP("TQFN"), Square, { 0, 16, 0, 20, 28, 44, 0, 0, 0 } }, + { "qfns", I18N_NOOP("TQFN-S"), Bar, { 0, 0, 0, 0, 28, 0, 0, 0, 0 } }, { "plcc", I18N_NOOP("PLCC"), Square, { 0, 0, 0, 0, 0, 44, 68, 84, 0 } }, { "mlf", I18N_NOOP("MLF"), Square, { 0, 0, 0, 0, 28, 0, 0, 0, 0 } }, { "dfn", I18N_NOOP("DFN"), Bar, { 8, 0, 0, 0, 0, 0, 0, 0, 0 } }, @@ -145,69 +145,69 @@ double Device::Data::vddMax() const } //----------------------------------------------------------------------------- -QDataStream &Device::operator <<(QDataStream &s, const RangeBox::Value &rbv) +TQDataStream &Device::operator <<(TQDataStream &s, const RangeBox::Value &rbv) { s << rbv.x << rbv.yMin << rbv.yMax; return s; } -QDataStream &Device::operator >>(QDataStream &s, RangeBox::Value &rbv) +TQDataStream &Device::operator >>(TQDataStream &s, RangeBox::Value &rbv) { s >> rbv.x >> rbv.yMin >> rbv.yMax; return s; } -QDataStream &Device::operator <<(QDataStream &s, const RangeBox &rb) +TQDataStream &Device::operator <<(TQDataStream &s, const RangeBox &rb) { s << rb.start << rb.end << rb.osc << rb.mode << rb.special; return s; } -QDataStream &Device::operator >>(QDataStream &s, RangeBox &rb) +TQDataStream &Device::operator >>(TQDataStream &s, RangeBox &rb) { s >> rb.start >> rb.end >> rb.osc >> rb.mode >> rb.special; return s; } -QDataStream &Device::operator <<(QDataStream &s, const FrequencyRange &frange) +TQDataStream &Device::operator <<(TQDataStream &s, const FrequencyRange &frange) { s << frange.operatingCondition << frange.special << frange.vdds; return s; } -QDataStream &Device::operator >>(QDataStream &s, FrequencyRange &frange) +TQDataStream &Device::operator >>(TQDataStream &s, FrequencyRange &frange) { s >> frange.operatingCondition >> frange.special >> frange.vdds; return s; } -QDataStream &Device::operator <<(QDataStream &s, const Package &package) +TQDataStream &Device::operator <<(TQDataStream &s, const Package &package) { s << package.types << package.pins; return s; } -QDataStream &Device::operator >>(QDataStream &s, Package &package) +TQDataStream &Device::operator >>(TQDataStream &s, Package &package) { s >> package.types >> package.pins; return s; } -QDataStream &Device::operator <<(QDataStream &s, const Documents &documents) +TQDataStream &Device::operator <<(TQDataStream &s, const Documents &documents) { s << documents.webpage << documents.datasheet << documents.progsheet << documents.erratas; return s; } -QDataStream &Device::operator >>(QDataStream &s, Documents &documents) +TQDataStream &Device::operator >>(TQDataStream &s, Documents &documents) { s >> documents.webpage >> documents.datasheet >> documents.progsheet >> documents.erratas; return s; } -QDataStream &Device::operator <<(QDataStream &s, const Data &data) +TQDataStream &Device::operator <<(TQDataStream &s, const Data &data) { s << data._name << data._documents << data._alternatives << data._status << data._frequencyRanges << data._memoryTechnology << data._packages; return s; } -QDataStream &Device::operator >>(QDataStream &s, Data &data) +TQDataStream &Device::operator >>(TQDataStream &s, Data &data) { s >> data._name >> data._documents >> data._alternatives >> data._status >> data._frequencyRanges >> data._memoryTechnology diff --git a/src/devices/base/generic_device.h b/src/devices/base/generic_device.h index e3cbec9..73f9b15 100644 --- a/src/devices/base/generic_device.h +++ b/src/devices/base/generic_device.h @@ -9,7 +9,7 @@ #ifndef GENERIC_DEVICE_H #define GENERIC_DEVICE_H -#include <qstringlist.h> +#include <tqstringlist.h> #include "common/common/misc.h" #include "common/common/bitvalue.h" @@ -19,9 +19,9 @@ namespace Device { //---------------------------------------------------------------------------- -BEGIN_DECLARE_ENUM(Status) +BEGIN_DECLARE_ENUM(tqStatus) InProduction = 0, Future, NotRecommended, EOL, Unknown, Mature -END_DECLARE_ENUM_STD(Status) +END_DECLARE_ENUM_STD(tqStatus) BEGIN_DECLARE_ENUM(MemoryTechnology) Flash = 0, Eprom, Rom, Romless @@ -31,7 +31,7 @@ class RangeBox { public: struct Value { double x, yMin, yMax; }; Value start, end; - QString osc, mode, special; + TQString osc, mode, special; double yMin() const { return qMin(start.yMin, end.yMin); } double yMax() const { return qMax(start.yMax, end.yMax); } }; @@ -48,7 +48,7 @@ class FrequencyRange { public: OperatingCondition operatingCondition; Special special; - QValueVector<RangeBox> vdds; + TQValueVector<RangeBox> vdds; double vddMin() const; double vddMax() const; }; @@ -62,15 +62,15 @@ public: class Package { public: - QValueVector<uint> types; - QValueVector<QString> pins; + TQValueVector<uint> types; + TQValueVector<TQString> pins; public: enum Shape { Bar, Square }; enum { MAX_NB = 9 }; struct TypeData { const char *name, *label; - Shape shape; + Shape tqshape; uint nbPins[MAX_NB]; }; static const TypeData TYPE_DATA[]; @@ -79,8 +79,8 @@ public: class Documents { public: - QString webpage, datasheet, progsheet; - QStringList erratas; + TQString webpage, datasheet, progsheet; + TQStringList erratas; }; //---------------------------------------------------------------------------- @@ -108,7 +108,7 @@ public: bool operator !=(const Array &array) const { return _data!=array._data; } private: - QMemArray<BitValue> _data; + TQMemArray<BitValue> _data; }; //---------------------------------------------------------------------------- @@ -118,15 +118,15 @@ public: Data(RegistersData *rdata) : _group(0), _registersData(rdata) {} virtual ~Data(); const GroupBase &group() const { return *_group; } - virtual QString name() const { return _name; } - virtual QString fname(Special) const { return _name; } - virtual QString listViewGroup() const = 0; - Status status() const { return _status; } + virtual TQString name() const { return _name; } + virtual TQString fname(Special) const { return _name; } + virtual TQString listViewGroup() const = 0; + tqStatus status() const { return _status; } const Documents &documents() const { return _documents; } - const QStringList &alternatives() const { return _alternatives; } + const TQStringList &alternatives() const { return _alternatives; } MemoryTechnology memoryTechnology() const { return _memoryTechnology; } virtual bool matchId(BitValue rawId, IdData &idata) const = 0; - const QValueVector<FrequencyRange> &frequencyRanges() const { return _frequencyRanges; } + const TQValueVector<FrequencyRange> &frequencyRanges() const { return _frequencyRanges; } double vddMin() const; double vddMax() const; virtual uint nbBitsAddress() const = 0; @@ -134,37 +134,37 @@ public: uint nbCharsAddress() const { return nbBitsAddress()/4 + (nbBitsAddress()%4 ? 1 : 0); } virtual bool canWriteCalibration() const = 0; // #### REMOVE ME const RegistersData *registersData() const { return _registersData; } - const QValueVector<Package> &packages() const { return _packages; } + const TQValueVector<Package> &packages() const { return _packages; } protected: const GroupBase *_group; - QString _name; + TQString _name; Documents _documents; - QStringList _alternatives; - Status _status; - QValueVector<FrequencyRange> _frequencyRanges; + TQStringList _alternatives; + tqStatus _status; + TQValueVector<FrequencyRange> _frequencyRanges; MemoryTechnology _memoryTechnology; RegistersData *_registersData; - QValueVector<Package> _packages; + TQValueVector<Package> _packages; friend class XmlToDataBase; friend class GroupBase; - friend QDataStream &operator <<(QDataStream &s, const Data &data); - friend QDataStream &operator >>(QDataStream &s, Data &data); + friend TQDataStream &operator <<(TQDataStream &s, const Data &data); + friend TQDataStream &operator >>(TQDataStream &s, Data &data); }; -QDataStream &operator <<(QDataStream &s, const RangeBox::Value &rbv); -QDataStream &operator >>(QDataStream &s, RangeBox::Value &rbv); -QDataStream &operator <<(QDataStream &s, const RangeBox &rb); -QDataStream &operator >>(QDataStream &s, RangeBox &rb); -QDataStream &operator <<(QDataStream &s, const FrequencyRange &frange); -QDataStream &operator >>(QDataStream &s, FrequencyRange &frange); -QDataStream &operator <<(QDataStream &s, const Package &package); -QDataStream &operator >>(QDataStream &s, Package &package); -QDataStream &operator <<(QDataStream &s, const Documents &documents); -QDataStream &operator >>(QDataStream &s, Documents &documents); -QDataStream &operator <<(QDataStream &s, const Data &data); -QDataStream &operator >>(QDataStream &s, Data &data); +TQDataStream &operator <<(TQDataStream &s, const RangeBox::Value &rbv); +TQDataStream &operator >>(TQDataStream &s, RangeBox::Value &rbv); +TQDataStream &operator <<(TQDataStream &s, const RangeBox &rb); +TQDataStream &operator >>(TQDataStream &s, RangeBox &rb); +TQDataStream &operator <<(TQDataStream &s, const FrequencyRange &frange); +TQDataStream &operator >>(TQDataStream &s, FrequencyRange &frange); +TQDataStream &operator <<(TQDataStream &s, const Package &package); +TQDataStream &operator >>(TQDataStream &s, Package &package); +TQDataStream &operator <<(TQDataStream &s, const Documents &documents); +TQDataStream &operator >>(TQDataStream &s, Documents &documents); +TQDataStream &operator <<(TQDataStream &s, const Data &data); +TQDataStream &operator >>(TQDataStream &s, Data &data); } // namespace diff --git a/src/devices/base/generic_memory.cpp b/src/devices/base/generic_memory.cpp index 78c4dd6..54190f5 100644 --- a/src/devices/base/generic_memory.cpp +++ b/src/devices/base/generic_memory.cpp @@ -8,8 +8,8 @@ ***************************************************************************/ #include "generic_memory.h" -bool Device::Memory::load(QTextStream &stream, QStringList &errors, - WarningTypes &warningTypes, QStringList &warnings) +bool Device::Memory::load(TQTextStream &stream, TQStringList &errors, + WarningTypes &warningTypes, TQStringList &warnings) { HexBuffer hb; if ( !hb.load(stream, errors) ) return false; @@ -17,12 +17,12 @@ bool Device::Memory::load(QTextStream &stream, QStringList &errors, return true; } -Device::Memory::WarningTypes Device::Memory::fromHexBuffer(const HexBuffer &hb, QStringList &warnings) +Device::Memory::WarningTypes Device::Memory::fromHexBuffer(const HexBuffer &hb, TQStringList &warnings) { clear(); WarningTypes result = NoWarning; warnings.clear(); - QMap<uint, bool> inRange; + TQMap<uint, bool> inRange; fromHexBuffer(hb, result, warnings, inRange); // check that all values in FragBuffer are within memory ranges @@ -31,7 +31,7 @@ Device::Memory::WarningTypes Device::Memory::fromHexBuffer(const HexBuffer &hb, if ( !it.data().isInitialized() || inRange[it.key()] ) continue; if ( !(result & ValueOutsideRange) ) { result |= ValueOutsideRange; - warnings += i18n("At least one value (at address %1) is defined outside memory ranges.").arg(toHexLabel(it.key(), 8)); + warnings += i18n("At least one value (at address %1) is defined outside memory ranges.").tqarg(toHexLabel(it.key(), 8)); } break; } @@ -39,7 +39,7 @@ Device::Memory::WarningTypes Device::Memory::fromHexBuffer(const HexBuffer &hb, return result; } -bool Device::Memory::save(QTextStream &stream, HexBuffer::Format format) const +bool Device::Memory::save(TQTextStream &stream, HexBuffer::Format format) const { savePartial(stream, format); HexBuffer hb; diff --git a/src/devices/base/generic_memory.h b/src/devices/base/generic_memory.h index 74bd938..f7127b5 100644 --- a/src/devices/base/generic_memory.h +++ b/src/devices/base/generic_memory.h @@ -26,21 +26,21 @@ public: virtual BitValue checksum() const = 0; virtual HexBuffer toHexBuffer() const = 0; - bool save(QTextStream &stream, HexBuffer::Format format) const; + bool save(TQTextStream &stream, HexBuffer::Format format) const; enum WarningType { NoWarning = 0, ValueTooLarge = 1, ValueOutsideRange = 2 }; - Q_DECLARE_FLAGS(WarningTypes, WarningType) - WarningTypes fromHexBuffer(const HexBuffer &hb, QStringList &warnings); - bool load(QTextStream &stream, QStringList &errors, WarningTypes &warningTypes, QStringList &warnings); + TQ_DECLARE_FLAGS(WarningTypes, WarningType) + WarningTypes fromHexBuffer(const HexBuffer &hb, TQStringList &warnings); + bool load(TQTextStream &stream, TQStringList &errors, WarningTypes &warningTypes, TQStringList &warnings); protected: const Data &_device; Memory(const Data &device) : _device(device) {} virtual void fromHexBuffer(const HexBuffer &hb, WarningTypes &warningTypes, - QStringList &warnings, QMap<uint, bool> &inRange) = 0; - virtual void savePartial(QTextStream &stream, HexBuffer::Format format) const = 0; + TQStringList &warnings, TQMap<uint, bool> &inRange) = 0; + virtual void savePartial(TQTextStream &stream, HexBuffer::Format format) const = 0; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(Memory::WarningTypes) +TQ_DECLARE_OPERATORS_FOR_FLAGS(Memory::WarningTypes) } // namespace diff --git a/src/devices/base/hex_buffer.cpp b/src/devices/base/hex_buffer.cpp index a63554d..09bf847 100644 --- a/src/devices/base/hex_buffer.cpp +++ b/src/devices/base/hex_buffer.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ #include "hex_buffer.h" -#include <qtextstream.h> +#include <tqtextstream.h> #include "devices/base/generic_device.h" @@ -18,7 +18,7 @@ const char * const HexBuffer::FORMATS[Nb_Formats] = { "inhx8m", /*"inhx8s", */"inhx16", "inhx32" }; -void HexBuffer::savePartial(QTextStream &stream, Format format) const +void HexBuffer::savePartial(TQTextStream &stream, Format format) const { BitValue oldseg; const_iterator block = begin(); @@ -37,7 +37,7 @@ void HexBuffer::savePartial(QTextStream &stream, Format format) const } } -void HexBuffer::saveEnd(QTextStream &stream) const +void HexBuffer::saveEnd(TQTextStream &stream) const { stream << ":00000001FF\n"; } @@ -46,7 +46,7 @@ void HexBuffer::saveEnd(QTextStream &stream) const * Original code source from Timo Rossi, * modified by Alain Gibaud to support large blocks write */ -void HexBuffer::writeHexBlock(QTextStream &stream, int reclen, // length (in words) +void HexBuffer::writeHexBlock(TQTextStream &stream, int reclen, // length (in words) const_iterator& data, // pointer to 1st data word (incremented by function) Format format) { @@ -133,33 +133,33 @@ bool HexBuffer::fetchNextBlock(const_iterator& it, const const_iterator &end, in return *len != 0 ; } -QString HexBuffer::ErrorData::message() const +TQString HexBuffer::ErrorData::message() const { switch (type) { - case UnrecognizedFormat: return i18n("Unrecognized format (line %1).").arg(line); + case UnrecognizedFormat: return i18n("Unrecognized format (line %1).").tqarg(line); case UnexpectedEOF: return i18n("Unexpected end-of-file."); - case UnexpectedEOL: return i18n("Unexpected end-of-line (line %1).").arg(line); - case WrongCRC: return i18n("CRC mismatch (line %1).").arg(line); + case UnexpectedEOL: return i18n("Unexpected end-of-line (line %1).").tqarg(line); + case WrongCRC: return i18n("CRC mismatch (line %1).").tqarg(line); } Q_ASSERT(false); - return QString::null; + return TQString(); } -bool HexBuffer::load(QTextStream &stream, QStringList &errors) +bool HexBuffer::load(TQTextStream &stream, TQStringList &errors) { Format format; - QValueList<ErrorData> list = load(stream, format); + TQValueList<ErrorData> list = load(stream, format); if ( list.isEmpty() ) return true; errors.clear(); for (uint i=0; i<uint(list.count()); i++) errors += list[i].message(); return false; } -QValueList<HexBuffer::ErrorData> HexBuffer::load(QTextStream &stream, Format &format) +TQValueList<HexBuffer::ErrorData> HexBuffer::load(TQTextStream &stream, Format &format) { clear(); format = Nb_Formats; - QValueList<HexBuffer::ErrorData> errors; + TQValueList<HexBuffer::ErrorData> errors; load(stream, format, errors); if ( format==Nb_Formats ) format = IHX8M; // default return errors; @@ -170,13 +170,13 @@ QValueList<HexBuffer::ErrorData> HexBuffer::load(QTextStream &stream, Format &fo the format automagicly by the wordcount and length of the line Tested in 8 and 16 bits modes ------------------------------------------------------------------------ */ -void HexBuffer::load(QTextStream &stream, Format &format, QValueList<ErrorData> &errors) +void HexBuffer::load(TQTextStream &stream, Format &format, TQValueList<ErrorData> &errors) { uint addrH = 0; // upper 16 bits of 32 bits address (inhx32 format) uint line = 1; for (; !stream.atEnd(); line++) { // read each line - QString s = stream.readLine(); + TQString s = stream.readLine(); if ( !s.startsWith(":") ) continue; // skip invalid intel hex line s = s.stripWhiteSpace(); // clean-up white spaces at end-of-line if ( s==":" ) continue; // skip empty line @@ -250,8 +250,8 @@ void HexBuffer::load(QTextStream &stream, Format &format, QValueList<ErrorData> // however, I don't know if such a situation can occurs uint a = addrbase+x >> 1; BitValue value = (*this)[a]; - if ( addrbase+x & 1 ) insert(a, value.maskWith(0x00FF) | data << 8); // Odd addr => Hi byte - else insert(a, value.maskWith(0xFF00) | data); // Low byte + if ( addrbase+x & 1 ) insert(a, value.tqmaskWith(0x00FF) | data << 8); // Odd addr => Hi byte + else insert(a, value.tqmaskWith(0xFF00) | data); // Low byte //if ( x==0 ) qDebug("fb@%s: %s", toHex(addrbase+x >> 1, 8).data(), toHex(fb[addrbase+x >> 1], 8).data()); cksum += data; } diff --git a/src/devices/base/hex_buffer.h b/src/devices/base/hex_buffer.h index 93b0640..fcbf1c5 100644 --- a/src/devices/base/hex_buffer.h +++ b/src/devices/base/hex_buffer.h @@ -12,9 +12,9 @@ #include "common/global/global.h" #include "common/common/bitvalue.h" -class QTextStream; +class TQTextStream; -class HexBuffer : public QMap<uint, BitValue> +class HexBuffer : public TQMap<uint, BitValue> { public: enum Format { /// Differents flavors of Intel HEX file formats @@ -26,26 +26,26 @@ public: }; static const char * const FORMATS[Nb_Formats]; - void savePartial(QTextStream &s, Format format) const; - void saveEnd(QTextStream &s) const; + void savePartial(TQTextStream &s, Format format) const; + void saveEnd(TQTextStream &s) const; enum ErrorType { UnrecognizedFormat, WrongCRC, UnexpectedEOF, UnexpectedEOL }; class ErrorData { public: ErrorData() {} ErrorData(uint _line, ErrorType _type) : line(_line), type(_type) {} - QString message() const; + TQString message() const; uint line; ErrorType type; }; - QValueList<ErrorData> load(QTextStream &stream, Format &format); - bool load(QTextStream &stream, QStringList &errors); + TQValueList<ErrorData> load(TQTextStream &stream, Format &format); + bool load(TQTextStream &stream, TQStringList &errors); private: enum { HEXBLKSIZE = 8 }; // line size in HEX files static bool fetchNextBlock(const_iterator& start, const const_iterator &end, int *len); - static void writeHexBlock(QTextStream &stream, int reclen, const_iterator& data, Format format); - void load(QTextStream &stream, Format &format, QValueList<ErrorData> &errors); + static void writeHexBlock(TQTextStream &stream, int reclen, const_iterator& data, Format format); + void load(TQTextStream &stream, Format &format, TQValueList<ErrorData> &errors); }; #endif diff --git a/src/devices/base/register.cpp b/src/devices/base/register.cpp index 85fc013..dcd4c18 100644 --- a/src/devices/base/register.cpp +++ b/src/devices/base/register.cpp @@ -25,12 +25,12 @@ Register::TypeData::TypeData(Address address, uint nbChars) { Q_ASSERT( address.isValid() && nbChars!=0 ); } -Register::TypeData::TypeData(const QString &name, uint nbChars) +Register::TypeData::TypeData(const TQString &name, uint nbChars) : _nbChars(nbChars), _name(name) { Q_ASSERT( !name.isEmpty() && nbChars!=0 ); } -Register::TypeData::TypeData(const QString &name, Address address, uint nbChars) +Register::TypeData::TypeData(const TQString &name, Address address, uint nbChars) : _nbChars(nbChars), _address(address), _name(name) { Q_ASSERT( address.isValid() && nbChars!=0 && !name.isEmpty() ); @@ -46,21 +46,21 @@ Register::Type Register::TypeData::type() const return Combined; } -QString Register::TypeData::toString() const +TQString Register::TypeData::toString() const { - return QString("%1 %2 %3").arg(toLabel(_address)).arg(_nbChars).arg(_name); + return TQString("%1 %2 %3").tqarg(toLabel(_address)).tqarg(_nbChars).tqarg(_name); } -Register::TypeData Register::TypeData::fromString(const QString &s) +Register::TypeData Register::TypeData::fromString(const TQString &s) { - QStringList list = QStringList::split(" ", s); + TQStringList list = TQStringList::split(" ", s); if ( list.count()<2 || list.count()>3 ) return TypeData(); bool ok; Address address = list[0].toUInt(&ok); if ( !ok ) return TypeData(); uint nbChars = list[1].toUInt(&ok); if ( !ok || nbChars==0 || (nbChars%2)!=0 ) return TypeData(); - QString name; + TQString name; if ( list.count()==3 ) name = list[2]; if ( !address.isValid() ) { if ( name.isEmpty() ) return TypeData(); @@ -83,7 +83,7 @@ void Register::List::init() void Register::List::setWatched(const TypeData &data, bool watched) { if (watched) { - if ( _watched.contains(data) ) return; + if ( _watched.tqcontains(data) ) return; _watched.append(data); } else _watched.remove(data); delayedChanged(); @@ -112,7 +112,7 @@ void Register::List::setValue(const TypeData &data, BitValue value) delayedChanged(); } -void Register::List::setPortData(uint index, const QMap<uint, Device::PortBitData> &data) +void Register::List::setPortData(uint index, const TQMap<uint, Device::PortBitData> &data) { _portDatas[index].old = _portDatas[index].current; _portDatas[index].current = data; @@ -122,7 +122,7 @@ void Register::List::setPortData(uint index, const QMap<uint, Device::PortBitDat BitValue Register::List::value(const TypeData &data) const { if ( !data.address().isValid() ) { - if ( !_specials.contains(data.name()) ) return BitValue(); + if ( !_specials.tqcontains(data.name()) ) return BitValue(); return _specials[data.name()].current; } Q_ASSERT( (data.nbChars()%2)==0 ); @@ -140,7 +140,7 @@ BitValue Register::List::value(const TypeData &data) const BitValue Register::List::oldValue(const TypeData &data) const { if ( !data.address().isValid() ) { - if ( !_specials.contains(data.name()) ) return BitValue(); + if ( !_specials.tqcontains(data.name()) ) return BitValue(); return _specials[data.name()].old; } Q_ASSERT( (data.nbChars()%2)==0 ); 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 |