diff options
Diffstat (limited to 'ksim/library')
-rw-r--r-- | ksim/library/chart.cpp | 120 | ||||
-rw-r--r-- | ksim/library/chart.h | 38 | ||||
-rw-r--r-- | ksim/library/common.cpp | 6 | ||||
-rw-r--r-- | ksim/library/common.h | 12 | ||||
-rw-r--r-- | ksim/library/ksimconfig.cpp | 50 | ||||
-rw-r--r-- | ksim/library/ksimconfig.h | 54 | ||||
-rw-r--r-- | ksim/library/label.cpp | 114 | ||||
-rw-r--r-- | ksim/library/label.h | 58 | ||||
-rw-r--r-- | ksim/library/led.cpp | 68 | ||||
-rw-r--r-- | ksim/library/led.h | 22 | ||||
-rw-r--r-- | ksim/library/pluginglobal.cpp | 26 | ||||
-rw-r--r-- | ksim/library/pluginglobal.h | 24 | ||||
-rw-r--r-- | ksim/library/pluginloader.cpp | 48 | ||||
-rw-r--r-- | ksim/library/pluginloader.h | 24 | ||||
-rw-r--r-- | ksim/library/pluginmodule.cpp | 32 | ||||
-rw-r--r-- | ksim/library/pluginmodule.h | 16 | ||||
-rw-r--r-- | ksim/library/progress.cpp | 38 | ||||
-rw-r--r-- | ksim/library/progress.h | 26 | ||||
-rw-r--r-- | ksim/library/themeloader.cpp | 474 | ||||
-rw-r--r-- | ksim/library/themeloader.h | 154 | ||||
-rw-r--r-- | ksim/library/themetypes.h | 8 |
21 files changed, 706 insertions, 706 deletions
diff --git a/ksim/library/chart.cpp b/ksim/library/chart.cpp index 38f0f17..5128cdb 100644 --- a/ksim/library/chart.cpp +++ b/ksim/library/chart.cpp @@ -20,13 +20,13 @@ #include "chart.h" #include "chart.moc" -#include <qrect.h> -#include <qpainter.h> -#include <qimage.h> -#include <qcolor.h> -#include <qtimer.h> -#include <qvaluelist.h> -#include <qbitmap.h> +#include <tqrect.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqcolor.h> +#include <tqtimer.h> +#include <tqvaluelist.h> +#include <tqbitmap.h> #include <kdebug.h> #include <klocale.h> @@ -49,8 +49,8 @@ class KSim::Chart::Timer qAddPostRoutine(cleanup); } - QObject::connect(m_timer, SIGNAL(timeout()), - chart, SLOT(updateDisplay())); + TQObject::connect(m_timer, TQT_SIGNAL(timeout()), + chart, TQT_SLOT(updateDisplay())); } static void disconnect(KSim::Chart *chart) @@ -58,8 +58,8 @@ class KSim::Chart::Timer if (!m_timer) return; - QObject::disconnect(m_timer, SIGNAL(timeout()), - chart, SLOT(updateDisplay())); + TQObject::disconnect(m_timer, TQT_SIGNAL(timeout()), + chart, TQT_SLOT(updateDisplay())); } private: @@ -72,50 +72,50 @@ class KSim::Chart::Timer m_timer = 0; } - static QTimer *m_timer; + static TQTimer *m_timer; }; -QTimer *KSim::Chart::Timer::m_timer = 0; +TQTimer *KSim::Chart::Timer::m_timer = 0; class KSim::Chart::Private { public: typedef QPair<int, int> ValuePair; - QSize size; + TQSize size; int type; bool showShadow; bool showKrell; - QString inText; - QString outText; - QString title; - QPixmap chartPixmap; - QPixmap gridPixmap; - QPixmap graphData; - QColor mColour; - QColor sColour; - QColor dataInColour; - QColor dataOutColour; + TQString inText; + TQString outText; + TQString title; + TQPixmap chartPixmap; + TQPixmap gridPixmap; + TQPixmap graphData; + TQColor mColour; + TQColor sColour; + TQColor dataInColour; + TQColor dataOutColour; Chart::LabelType labelType; KSim::Label *krell; // first will be data In and second will be data out - QValueList<ValuePair> values; - QValueList<int> maxValues; + TQValueList<ValuePair> values; + TQValueList<int> maxValues; int minValue; int maxValue; bool variableGraphs; }; KSim::Chart::Chart(bool showKrell, int maxValue, - const QString &title, QWidget *parent, const char *name, - WFlags fl) : QWidget(parent, name, fl) + const TQString &title, TQWidget *parent, const char *name, + WFlags fl) : TQWidget(parent, name, fl) { init(showKrell, maxValue, title); } KSim::Chart::Chart(bool showKrell, int maxValue, - QWidget *parent, const char *name, WFlags fl) - : QWidget(parent, name, fl) + TQWidget *parent, const char *name, WFlags fl) + : TQWidget(parent, name, fl) { init(showKrell, maxValue, i18n("None")); } @@ -126,7 +126,7 @@ KSim::Chart::~Chart() delete d; } -const QString &KSim::Chart::text(DataType type) const +const TQString &KSim::Chart::text(DataType type) const { if (type == DataIn) return d->inText; @@ -134,7 +134,7 @@ const QString &KSim::Chart::text(DataType type) const return d->outText; } -const QString &KSim::Chart::title() const +const TQString &KSim::Chart::title() const { return d->title; } @@ -206,7 +206,7 @@ KSim::Chart::LabelType KSim::Chart::labelType() const void KSim::Chart::buildPixmaps() { - QImage image(themeLoader().current().chartPixmap()); + TQImage image(themeLoader().current().chartPixmap()); KSim::ThemeLoader::self().reColourImage(image); d->chartPixmap.convertFromImage(image.smoothScale(chartSize())); @@ -251,7 +251,7 @@ void KSim::Chart::buildPixmaps() void KSim::Chart::configureObject(bool repaintWidget) { - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); KSim::Config::config()->setGroup("Misc"); d->size = KSim::Config::config()->readSizeEntry("GraphSize"); @@ -279,21 +279,21 @@ void KSim::Chart::configureObject(bool repaintWidget) update(); } -QSize KSim::Chart::sizeHint() const +TQSize KSim::Chart::sizeHint() const { return d->size; } -QSize KSim::Chart::minimumSizeHint() const +TQSize KSim::Chart::minimumSizeHint() const { return sizeHint(); } -void KSim::Chart::resizeEvent(QResizeEvent *re) +void KSim::Chart::resizeEvent(TQResizeEvent *re) { if (d->chartPixmap.size() != chartSize()) buildPixmaps(); - QWidget::resizeEvent(re); + TQWidget::resizeEvent(re); } void KSim::Chart::disableAutomaticUpdates() @@ -308,7 +308,7 @@ void KSim::Chart::clear() updateDisplay(); } -void KSim::Chart::setTitle(const QString &name) +void KSim::Chart::setTitle(const TQString &name) { if (d->krell) { d->title = name; @@ -331,7 +331,7 @@ void KSim::Chart::setDisplayMeter(bool value) } } -void KSim::Chart::setText(const QString &in, const QString &out) +void KSim::Chart::setText(const TQString &in, const TQString &out) { bool repaint = false; @@ -406,7 +406,7 @@ void KSim::Chart::setValue(int valueIn, int valueOut) void KSim::Chart::setConfigValues() { - QFont newFont = font(); + TQFont newFont = font(); bool repaint = themeLoader().current().fontColours(this, newFont, d->mColour, d->sColour, d->showShadow); @@ -422,7 +422,7 @@ void KSim::Chart::extraTypeCall() setConfigValues(); } -QColor KSim::Chart::chartColour(const DataType &dataType, int, int) const +TQColor KSim::Chart::chartColour(const DataType &dataType, int, int) const { switch (dataType) { case DataIn: @@ -433,19 +433,19 @@ QColor KSim::Chart::chartColour(const DataType &dataType, int, int) const break; } - return QColor(); // avoid a g++ warning + return TQColor(); // avoid a g++ warning } -void KSim::Chart::paintEvent(QPaintEvent *) +void KSim::Chart::paintEvent(TQPaintEvent *) { if (d->krell && labelType() == Led) { static_cast<KSim::LedLabel *>(d->krell)->setOff(KSim::Led::First); static_cast<KSim::LedLabel *>(d->krell)->setOff(KSim::Led::Second); } - const QSize &size = chartSize(); - QPixmap pixmap(size); - QPainter painter; + const TQSize &size = chartSize(); + TQPixmap pixmap(size); + TQPainter painter; painter.begin(&pixmap, this); int location = size.height() / 5; @@ -476,7 +476,7 @@ void KSim::Chart::paintEvent(QPaintEvent *) bitBlt(this, 0, 0, &pixmap); } -void KSim::Chart::fontChange(const QFont &) +void KSim::Chart::fontChange(const TQFont &) { if (d->krell) d->krell->setFont(font()); @@ -510,7 +510,7 @@ void KSim::Chart::drawChart() if (d->variableGraphs) { int maxValue = 0; - QValueList<int>::ConstIterator max; + TQValueList<int>::ConstIterator max; for (max = d->maxValues.begin(); max != d->maxValues.end(); ++max) { if ((*max) > maxValue) maxValue = (*max); @@ -519,12 +519,12 @@ void KSim::Chart::drawChart() setMaxValue(maxValue); } - QPainter painter; + TQPainter painter; d->graphData.setMask(drawMask(&painter)); painter.begin(&d->graphData, this); int position = width() - 1; - QValueList<Private::ValuePair>::ConstIterator it; + TQValueList<Private::ValuePair>::ConstIterator it; for (it = d->values.begin(); it != d->values.end(); ++it) { // Draw the data In lines first if its higher than the data out lines if ((*it).first >= (*it).second) { @@ -541,23 +541,23 @@ void KSim::Chart::drawChart() painter.end(); } -QSize KSim::Chart::chartSize() const +TQSize KSim::Chart::chartSize() const { - QSize sz(size()); + TQSize sz(size()); if (d->krell && d->showKrell) sz.setHeight(sz.height() - d->krell->height()); return sz; } -QBitmap KSim::Chart::drawMask(QPainter *painter) +TQBitmap KSim::Chart::drawMask(TQPainter *painter) { - QBitmap bitmap(chartSize(), true); + TQBitmap bitmap(chartSize(), true); painter->begin(&bitmap, this); painter->setPen(color1); int position = width() - 1; - QValueList<Private::ValuePair>::ConstIterator it; + TQValueList<Private::ValuePair>::ConstIterator it; for (it = d->values.begin(); it != d->values.end(); ++it) { drawIn(painter, (*it).first, position, true); drawOut(painter, (*it).second, position, true); @@ -569,7 +569,7 @@ QBitmap KSim::Chart::drawMask(QPainter *painter) return bitmap; } -void KSim::Chart::drawIn(QPainter *painter, int value, int pos, bool dontSet) +void KSim::Chart::drawIn(TQPainter *painter, int value, int pos, bool dontSet) { if (!dontSet) { painter->setPen(chartColour(DataIn)); @@ -581,7 +581,7 @@ void KSim::Chart::drawIn(QPainter *painter, int value, int pos, bool dontSet) pos, d->graphData.size().height() - location); } -void KSim::Chart::drawOut(QPainter *painter, int value, int pos, bool dontSet) +void KSim::Chart::drawOut(TQPainter *painter, int value, int pos, bool dontSet) { if (!dontSet) { painter->setPen(chartColour(DataOut)); @@ -604,11 +604,11 @@ int KSim::Chart::range(int value) const return value; } -void KSim::Chart::init(bool krell, int maxValue, const QString &title) +void KSim::Chart::init(bool krell, int maxValue, const TQString &title) { setConfigString("StyleChart"); setThemeConfigOnly(false); - setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); + setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed)); d = new Private; KSim::Config::config()->setGroup("Misc"); diff --git a/ksim/library/chart.h b/ksim/library/chart.h index 55f4426..0053ae3 100644 --- a/ksim/library/chart.h +++ b/ksim/library/chart.h @@ -20,7 +20,7 @@ #ifndef KSIM__CHART_H #define KSIM__CHART_H -#include <qwidget.h> +#include <tqwidget.h> #include "common.h" #include <kdemacros.h> @@ -33,7 +33,7 @@ namespace KSim * provides a graph displaying data onscreen using gkrellm themes * @author Robbie Ward <linuxphreak@gmx.co.uk> */ - class KDE_EXPORT Chart : public QWidget, public KSim::Base + class KDE_EXPORT Chart : public TQWidget, public KSim::Base { Q_OBJECT public: @@ -49,7 +49,7 @@ namespace KSim * @param parent is the parent widget */ Chart(bool displayMeter, int maxValue, - const QString &title, QWidget *parent, + const TQString &title, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * Constructs a KSim::Chart. @@ -60,7 +60,7 @@ namespace KSim * @param parent is the parent widget */ Chart(bool displayMeter, int maxValue, - QWidget *parent, const char *name = 0, + TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * destructs KSim::Chart @@ -70,11 +70,11 @@ namespace KSim /** * returns the current text of the chart */ - const QString &text(DataType type) const; + const TQString &text(DataType type) const; /** * @return the title of the chart */ - const QString &title() const; + const TQString &title() const; /** * @return true if the meter is enabled */ @@ -108,11 +108,11 @@ namespace KSim /** * reimplemented for internal reasons */ - QSize sizeHint() const; + TQSize sizeHint() const; /** * reimplemented for internal reasons */ - QSize minimumSizeHint() const; + TQSize minimumSizeHint() const; void disableAutomaticUpdates(); @@ -125,7 +125,7 @@ namespace KSim * sets the title of the chart, this function returns if * the optional krell widget is disabled */ - void setTitle(const QString &); + void setTitle(const TQString &); /** * turns the meter on and off */ @@ -133,7 +133,7 @@ namespace KSim /** * sets the current text that apears in the top left hand corner */ - void setText(const QString &in, const QString &out = QString::null); + void setText(const TQString &in, const TQString &out = TQString::null); /** * Sets the minimum value the graph will display */ @@ -157,10 +157,10 @@ namespace KSim */ virtual void extraTypeCall(); - QColor chartColour(const DataType &dataType, int x = 1, int y = 1) const; - virtual void paintEvent(QPaintEvent *); - virtual void fontChange(const QFont &); - virtual void resizeEvent(QResizeEvent *re); + TQColor chartColour(const DataType &dataType, int x = 1, int y = 1) const; + virtual void paintEvent(TQPaintEvent *); + virtual void fontChange(const TQFont &); + virtual void resizeEvent(TQResizeEvent *re); protected slots: void updateDisplay(); @@ -169,12 +169,12 @@ namespace KSim void buildPixmaps(); int yLocation(int) const; void drawChart(); - QSize chartSize() const; - QBitmap drawMask(QPainter *); - void drawIn(QPainter *, int, int, bool = false); - void drawOut(QPainter *, int, int, bool = false); + TQSize chartSize() const; + TQBitmap drawMask(TQPainter *); + void drawIn(TQPainter *, int, int, bool = false); + void drawOut(TQPainter *, int, int, bool = false); int range(int) const; - void init(bool, int, const QString &); + void init(bool, int, const TQString &); class Timer; class Private; diff --git a/ksim/library/common.cpp b/ksim/library/common.cpp index 3e714c6..d2cf572 100644 --- a/ksim/library/common.cpp +++ b/ksim/library/common.cpp @@ -29,7 +29,7 @@ class KSim::Base::Private public: int type; bool theme; - QString string; + TQString string; }; KSim::Base::Base() @@ -76,12 +76,12 @@ int KSim::Base::type() const return d->type; } -void KSim::Base::setConfigString(const QString &string) +void KSim::Base::setConfigString(const TQString &string) { d->string = string; } -const QString &KSim::Base::configString() const +const TQString &KSim::Base::configString() const { return d->string; } diff --git a/ksim/library/common.h b/ksim/library/common.h index 3f53f7a..9fc01c0 100644 --- a/ksim/library/common.h +++ b/ksim/library/common.h @@ -23,7 +23,7 @@ #define KSIM_VERSION 110 #define KSIM_VERSION_STRING "1.1.0" -#include <qstring.h> +#include <tqstring.h> #include <kdemacros.h> /** @@ -52,13 +52,13 @@ namespace KSim * * example: * <pre> - * #include <qwidget.h> + * #include <tqwidget.h> * #include <ksim/common.h> * - * class Test : public QWidget, virtual public KSim::Base + * class Test : public TQWidget, virtual public KSim::Base * { * public: - * Test(QWidget *parent, const char *name) : QWidget(parent, name) + * Test(TQWidget *parent, const char *name) : TQWidget(parent, name) * { * } * ~Test() {} @@ -100,11 +100,11 @@ namespace KSim /** * Set the config entry key to look for when reading gkrellmrc */ - void setConfigString(const QString &string); + void setConfigString(const TQString &string); /** * @return the config entry to look for when reading theme files */ - const QString &configString() const; + const TQString &configString() const; protected: /** diff --git a/ksim/library/ksimconfig.cpp b/ksim/library/ksimconfig.cpp index 9f70890..2fd136e 100644 --- a/ksim/library/ksimconfig.cpp +++ b/ksim/library/ksimconfig.cpp @@ -57,40 +57,40 @@ void KSim::Config::setWidth(int width) mainConfig->sync(); } -bool KSim::Config::enabledMonitor(const QString &entry) const +bool KSim::Config::enabledMonitor(const TQString &entry) const { mainConfig->setGroup("Monitors"); return mainConfig->readBoolEntry(entry, false); } -void KSim::Config::setEnabledMonitor(const QString &entry, bool enabled) +void KSim::Config::setEnabledMonitor(const TQString &entry, bool enabled) { mainConfig->setGroup("Monitors"); mainConfig->writeEntry(entry, enabled); mainConfig->sync(); } -QString KSim::Config::monitorCommand(const QString &entry) const +TQString KSim::Config::monitorCommand(const TQString &entry) const { mainConfig->setGroup("Monitors"); return mainConfig->readPathEntry(entry + "_command"); } -void KSim::Config::setMonitorCommand(const QString &entry, - const QString &command) +void KSim::Config::setMonitorCommand(const TQString &entry, + const TQString &command) { mainConfig->setGroup("Monitors"); mainConfig->writePathEntry(entry + "_command", command); mainConfig->sync(); } -int KSim::Config::monitorLocation(const QString &entry) +int KSim::Config::monitorLocation(const TQString &entry) { mainConfig->setGroup("Monitors"); return mainConfig->readNumEntry(entry + "_location", -1); } -void KSim::Config::setMonitorLocation(const QString &entry, int location) +void KSim::Config::setMonitorLocation(const TQString &entry, int location) { mainConfig->setGroup("Monitors"); mainConfig->writeEntry(entry + "_location", location); @@ -149,33 +149,33 @@ void KSim::Config::setStayOnTop(bool stayOnTop) mainConfig->sync(); } -QPoint KSim::Config::position(const QPoint &defaultPos) const +TQPoint KSim::Config::position(const TQPoint &defaultPos) const { mainConfig->setGroup("Misc"); return mainConfig->readPointEntry("ksimPosition", &defaultPos); } -void KSim::Config::setPosition(const QPoint &pos) +void KSim::Config::setPosition(const TQPoint &pos) { mainConfig->setGroup("Misc"); mainConfig->writeEntry("ksimPosition", pos); mainConfig->sync(); } -QSize KSim::Config::graphSize() const +TQSize KSim::Config::graphSize() const { mainConfig->setGroup("Misc"); return mainConfig->readSizeEntry("GraphSize"); } -void KSim::Config::setGraphSize(const QSize &size) +void KSim::Config::setGraphSize(const TQSize &size) { mainConfig->setGroup("Misc"); mainConfig->writeEntry("GraphSize", size); mainConfig->sync(); } -QString KSim::Config::uptimeFormat() const +TQString KSim::Config::uptimeFormat() const { return uptimeFormatList()[uptimeItem()]; } @@ -186,13 +186,13 @@ int KSim::Config::uptimeItem() const return mainConfig->readNumEntry("UptimeItem", 0); } -QStringList KSim::Config::uptimeFormatList() const +TQStringList KSim::Config::uptimeFormatList() const { mainConfig->setGroup("Misc"); return mainConfig->readListEntry("UptimeFormat"); } -void KSim::Config::setUptimeFormat(const QStringList &uptimeFormat) +void KSim::Config::setUptimeFormat(const TQStringList &uptimeFormat) { mainConfig->setGroup("Misc"); mainConfig->writeEntry("UptimeFormat", uptimeFormat); @@ -206,7 +206,7 @@ void KSim::Config::setUptimeItem(int item) mainConfig->sync(); } -QString KSim::Config::memoryFormat() const +TQString KSim::Config::memoryFormat() const { return memoryFormatList()[memoryItem()]; } @@ -217,13 +217,13 @@ int KSim::Config::memoryItem() const return mainConfig->readNumEntry("MemoryItem", 0); } -QStringList KSim::Config::memoryFormatList() const +TQStringList KSim::Config::memoryFormatList() const { mainConfig->setGroup("Misc"); return mainConfig->readListEntry("MemoryFormat"); } -void KSim::Config::setMemoryFormat(const QStringList &memoryFormat) +void KSim::Config::setMemoryFormat(const TQStringList &memoryFormat) { mainConfig->setGroup("Misc"); mainConfig->writeEntry("MemoryFormat", memoryFormat); @@ -237,7 +237,7 @@ void KSim::Config::setMemoryItem(int item) mainConfig->sync(); } -QString KSim::Config::swapFormat() const +TQString KSim::Config::swapFormat() const { mainConfig->setGroup("Misc"); return swapFormatList()[swapItem()]; @@ -249,13 +249,13 @@ int KSim::Config::swapItem() const return mainConfig->readNumEntry("SwapItem", 0); } -QStringList KSim::Config::swapFormatList() const +TQStringList KSim::Config::swapFormatList() const { mainConfig->setGroup("Misc"); return mainConfig->readListEntry("SwapFormat"); } -void KSim::Config::setSwapFormat(const QStringList &swapFormat) +void KSim::Config::setSwapFormat(const TQStringList &swapFormat) { mainConfig->setGroup("Misc"); mainConfig->writeEntry("SwapFormat", swapFormat); @@ -360,17 +360,17 @@ void KSim::Config::setShowProcs(bool procs) mainConfig->sync(); } -QString KSim::Config::themeUrl() const +TQString KSim::Config::themeUrl() const { return KSim::ThemeLoader::currentUrl(); } -QString KSim::Config::themeName() const +TQString KSim::Config::themeName() const { return KSim::ThemeLoader::currentName(); } -void KSim::Config::setThemeName(const QString &name) +void KSim::Config::setThemeName(const TQString &name) { mainConfig->setGroup("Theme"); mainConfig->writeEntry("Name", name); @@ -389,12 +389,12 @@ void KSim::Config::setThemeAlt(int alt) mainConfig->sync(); } -QFont KSim::Config::themeFont() const +TQFont KSim::Config::themeFont() const { return KSim::ThemeLoader::currentFont(); } -void KSim::Config::setThemeFont(const QFont &font) +void KSim::Config::setThemeFont(const TQFont &font) { mainConfig->setGroup("Theme"); mainConfig->writeEntry("Font", font); diff --git a/ksim/library/ksimconfig.h b/ksim/library/ksimconfig.h index 0208b18..c831f35 100644 --- a/ksim/library/ksimconfig.h +++ b/ksim/library/ksimconfig.h @@ -20,9 +20,9 @@ #ifndef KSIMCONFIG_H #define KSIMCONFIG_H -#include <qstringlist.h> -#include <qpoint.h> -#include <qfont.h> +#include <tqstringlist.h> +#include <tqpoint.h> +#include <tqfont.h> #include <kdemacros.h> @@ -43,12 +43,12 @@ namespace KSim int width(int defaultWidth) const; void setWidth(int width); - bool enabledMonitor(const QString &) const; - void setEnabledMonitor(const QString &, bool); - QString monitorCommand(const QString &) const; - void setMonitorCommand(const QString &, const QString &); - int monitorLocation(const QString &); - void setMonitorLocation(const QString &, int); + bool enabledMonitor(const TQString &) const; + void setEnabledMonitor(const TQString &, bool); + TQString monitorCommand(const TQString &) const; + void setMonitorCommand(const TQString &, const TQString &); + int monitorLocation(const TQString &); + void setMonitorLocation(const TQString &, int); bool displayFqdn() const; void setDisplayFqdn(bool); bool showDock() const; @@ -57,25 +57,25 @@ namespace KSim void setSavePos(bool); bool stayOnTop() const; void setStayOnTop(bool); - QPoint position(const QPoint &) const; - void setPosition(const QPoint &); - QSize graphSize() const; - void setGraphSize(const QSize &); - QString uptimeFormat() const; - void setUptimeFormat(const QStringList &); + TQPoint position(const TQPoint &) const; + void setPosition(const TQPoint &); + TQSize graphSize() const; + void setGraphSize(const TQSize &); + TQString uptimeFormat() const; + void setUptimeFormat(const TQStringList &); int uptimeItem() const; void setUptimeItem(int); - QStringList uptimeFormatList() const; - QString memoryFormat() const; - void setMemoryFormat(const QStringList &); + TQStringList uptimeFormatList() const; + TQString memoryFormat() const; + void setMemoryFormat(const TQStringList &); int memoryItem() const; void setMemoryItem(int); - QStringList memoryFormatList() const; - QString swapFormat() const; - void setSwapFormat(const QStringList &); + TQStringList memoryFormatList() const; + TQString swapFormat() const; + void setSwapFormat(const TQStringList &); int swapItem() const; void setSwapItem(int); - QStringList swapFormatList() const; + TQStringList swapFormatList() const; bool showTime() const; void setShowTime(bool); bool show24hour() const; @@ -90,13 +90,13 @@ namespace KSim void setShowSwap(bool); bool showProcs() const; void setShowProcs(bool); - QString themeUrl() const; - QString themeName() const; - void setThemeName(const QString &); + TQString themeUrl() const; + TQString themeName() const; + void setThemeName(const TQString &); int themeAlt() const; void setThemeAlt(int); - QFont themeFont() const; - void setThemeFont(const QFont &); + TQFont themeFont() const; + void setThemeFont(const TQFont &); int themeFontItem() const; void setThemeFontItem(int); bool reColourThemes() const; diff --git a/ksim/library/label.cpp b/ksim/library/label.cpp index 91e7621..400b1c5 100644 --- a/ksim/library/label.cpp +++ b/ksim/library/label.cpp @@ -22,13 +22,13 @@ #include <ksimconfig.h> #include "themetypes.h" -#include <qpainter.h> -#include <qstyle.h> -#include <qstylesheet.h> -#include <qsimplerichtext.h> -#include <qcursor.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqpainter.h> +#include <tqstyle.h> +#include <tqstylesheet.h> +#include <tqsimplerichtext.h> +#include <tqcursor.h> +#include <tqpixmap.h> +#include <tqimage.h> #include <themeloader.h> #include <kdebug.h> @@ -39,31 +39,31 @@ class KSim::Label::Private { public: - QColor mColour; - QColor sColour; - QRect loc; - QRect shad; - QString text; - QImage meterImage; - QPixmap background; - QPixmap sidePixmap; + TQColor mColour; + TQColor sColour; + TQRect loc; + TQRect shad; + TQString text; + TQImage meterImage; + TQPixmap background; + TQPixmap sidePixmap; bool showShadow; }; -KSim::Label::Label(QWidget *parent, const char *name, WFlags fl) - : QWidget(parent, name, fl) +KSim::Label::Label(TQWidget *parent, const char *name, WFlags fl) + : TQWidget(parent, name, fl) { initWidget(KSim::Types::None); } -KSim::Label::Label(int type, QWidget *parent, const char *name, - WFlags fl) : QWidget(parent, name, fl) +KSim::Label::Label(int type, TQWidget *parent, const char *name, + WFlags fl) : TQWidget(parent, name, fl) { initWidget(type); } -KSim::Label::Label(int type, const QString &text, QWidget *parent, - const char *name, WFlags fl) : QWidget(parent, name, fl) +KSim::Label::Label(int type, const TQString &text, TQWidget *parent, + const char *name, WFlags fl) : TQWidget(parent, name, fl) { initWidget(type); setText(text); @@ -74,43 +74,43 @@ KSim::Label::~Label() delete d; } -const QString &KSim::Label::text() const +const TQString &KSim::Label::text() const { return d->text; } void KSim::Label::configureObject(bool repaintWidget) { - QString image = themeLoader().current().meterPixmap(type(), false); + TQString image = themeLoader().current().meterPixmap(type(), false); if (image.isEmpty()) image = themeLoader().current().panelPixmap(type()); d->meterImage.load(image); KSim::ThemeLoader::self().reColourImage(d->meterImage); d->background = d->meterImage.smoothScale(size()); - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); setConfigValues(); relayoutLabel(oldSize, repaintWidget); } -void KSim::Label::setPixmap(const QPixmap &pixmap) +void KSim::Label::setPixmap(const TQPixmap &pixmap) { if (pixmap.serialNumber() == d->sidePixmap.serialNumber()) return; - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); d->sidePixmap = pixmap; relayoutLabel(oldSize); } -const QPixmap &KSim::Label::pixmap() const +const TQPixmap &KSim::Label::pixmap() const { return d->sidePixmap; } -QSize KSim::Label::sizeHint() const +TQSize KSim::Label::sizeHint() const { int width = fontMetrics().size(SingleLine, text()).width(); if (!pixmap().isNull()) @@ -120,25 +120,25 @@ QSize KSim::Label::sizeHint() const if (!pixmap().isNull() && pixmap().height() > height) height = pixmap().height(); - return QSize(width, height); + return TQSize(width, height); } -QSize KSim::Label::minimumSizeHint() const +TQSize KSim::Label::minimumSizeHint() const { return sizeHint(); } void KSim::Label::clear() { - setText(QString::null); + setText(TQString::null); } -void KSim::Label::setText(const QString &text) +void KSim::Label::setText(const TQString &text) { if (text == d->text) return; // If the text is the same, no need to repaint etc - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); // set the text of our widget and repaint d->text = text; relayoutLabel(oldSize); @@ -160,29 +160,29 @@ bool KSim::Label::showShadow() const return d->showShadow; } -void KSim::Label::setTextColour(const QColor &color) +void KSim::Label::setTextColour(const TQColor &color) { d->mColour = color; } -const QColor &KSim::Label::textColour() const +const TQColor &KSim::Label::textColour() const { return d->mColour; } -void KSim::Label::setShadowColour(const QColor &color) +void KSim::Label::setShadowColour(const TQColor &color) { d->sColour = color; } -const QColor &KSim::Label::shadowColour() const +const TQColor &KSim::Label::shadowColour() const { return d->sColour; } void KSim::Label::setConfigValues() { - QFont newFont = font(); + TQFont newFont = font(); bool repaint = themeLoader().current().fontColours(this, newFont, d->mColour, d->sColour, d->showShadow); @@ -193,9 +193,9 @@ void KSim::Label::setConfigValues() update(); } -void KSim::Label::paintEvent(QPaintEvent *) +void KSim::Label::paintEvent(TQPaintEvent *) { - QPainter painter; + TQPainter painter; painter.begin(this); // paint our background pixmap onto the widget @@ -212,7 +212,7 @@ void KSim::Label::paintEvent(QPaintEvent *) painter.end(); } -void KSim::Label::resizeEvent(QResizeEvent *ev) +void KSim::Label::resizeEvent(TQResizeEvent *ev) { // set the location of where the shadow'ed text will be drawn d->shad.setWidth(ev->size().width() + 3); @@ -225,10 +225,10 @@ void KSim::Label::resizeEvent(QResizeEvent *ev) d->background = d->meterImage.smoothScale(ev->size()); } -void KSim::Label::drawText(QPainter *painter, const QRect &rect, - const QColor &color, const QString &text) +void KSim::Label::drawText(TQPainter *painter, const TQRect &rect, + const TQColor &color, const TQString &text) { - QRect location(rect); + TQRect location(rect); if (!pixmap().isNull()) location.setX(pixmap().width() + 5); @@ -236,39 +236,39 @@ void KSim::Label::drawText(QPainter *painter, const QRect &rect, 0, text, -1, &color); } -void KSim::Label::drawPixmap(QPainter *painter, const QRect &rect, - const QPixmap &pixmap) +void KSim::Label::drawPixmap(TQPainter *painter, const TQRect &rect, + const TQPixmap &pixmap) { - QRect location(rect); + TQRect location(rect); location.setWidth(pixmap.width()); style().drawItem(painter, location, AlignCenter, colorGroup(), true, - pixmap.isNull() ? 0 : &pixmap, QString::null); + pixmap.isNull() ? 0 : &pixmap, TQString::null); } -void KSim::Label::setTextLocation(const QRect &rect) +void KSim::Label::setTextLocation(const TQRect &rect) { d->loc = rect; } -const QRect &KSim::Label::textLocation() const +const TQRect &KSim::Label::textLocation() const { return d->loc; } -void KSim::Label::setShadowLocation(const QRect &rect) +void KSim::Label::setShadowLocation(const TQRect &rect) { d->shad = rect; } -const QRect &KSim::Label::shadowLocation() const +const TQRect &KSim::Label::shadowLocation() const { return d->shad; } -void KSim::Label::setThemePixmap(const QString &image) +void KSim::Label::setThemePixmap(const TQString &image) { - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); d->meterImage.reset(); d->meterImage.load(image); KSim::ThemeLoader::self().reColourImage(d->meterImage); @@ -276,7 +276,7 @@ void KSim::Label::setThemePixmap(const QString &image) relayoutLabel(oldSize); } -void KSim::Label::relayoutLabel(const QSize &old, bool repaint) +void KSim::Label::relayoutLabel(const TQSize &old, bool repaint) { if (sizeHint() != old) { updateGeometry(); @@ -294,8 +294,8 @@ void KSim::Label::initWidget(int type) // try to reduce flicker as much as possible setBackgroundMode(NoBackground); - setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, - QSizePolicy::Fixed)); + setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, + TQSizePolicy::Fixed)); configureObject(); } diff --git a/ksim/library/label.h b/ksim/library/label.h index 1c750f2..7d77aa6 100644 --- a/ksim/library/label.h +++ b/ksim/library/label.h @@ -20,7 +20,7 @@ #ifndef KSIM__LABEL_H #define KSIM__LABEL_H -#include <qwidget.h> +#include <tqwidget.h> #include "common.h" #include <kdemacros.h> @@ -34,7 +34,7 @@ namespace KSim * @short Label widget * @author Robbie Ward <linuxphreak@gmx.co.uk> */ - class KDE_EXPORT Label : public QWidget, public KSim::Base + class KDE_EXPORT Label : public TQWidget, public KSim::Base { Q_OBJECT public: @@ -50,7 +50,7 @@ namespace KSim * To create a KSim::Label with the normal theme look * @see KSim::ThemeLoader */ - Label(QWidget *parent, const char *name = 0, WFlags fl = 0); + Label(TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * Constructs a KSimLabel. * @@ -62,10 +62,10 @@ namespace KSim * KSim::Label *label = new KSim::Label(KSim::Types::None, this); * </pre> * To create a KSim::Label with the normal theme look, - * NOTE: this is the same as the KSim::Label(QWidget *, const char *, WFlags) ctor + * NOTE: this is the same as the KSim::Label(TQWidget *, const char *, WFlags) ctor * @see KSim::ThemeLoader */ - Label(int type, QWidget *parent, const char *name = 0, WFlags fl = 0); + Label(int type, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * Constructs a KSim::Label. * @@ -80,8 +80,8 @@ namespace KSim * To create a KSim::Label with the theme look of host * @see KSim::ThemeLoader */ - Label(int type, const QString &text, - QWidget *parent, const char *name = 0, WFlags fl = 0); + Label(int type, const TQString &text, + TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * destructs KSim::Label. */ @@ -91,7 +91,7 @@ namespace KSim * returns the current text of the label * @see #setText */ - const QString &text() const; + const TQString &text() const; /** * recreates the labels look & feel */ @@ -99,19 +99,19 @@ namespace KSim /** * sets a pixmap for the label */ - void setPixmap(const QPixmap &pixmap); + void setPixmap(const TQPixmap &pixmap); /** * @return the side pixmap */ - const QPixmap &pixmap() const; + const TQPixmap &pixmap() const; /** * reimplemented for internal reasons */ - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; /** * reimplemented for internal reasons */ - virtual QSize minimumSizeHint() const; + virtual TQSize minimumSizeHint() const; public slots: /** @@ -122,7 +122,7 @@ namespace KSim * sets the current label of the widget to @ref text * @see text() */ - void setText(const QString &text); + void setText(const TQString &text); protected: /** @@ -140,19 +140,19 @@ namespace KSim /** * Set the text color */ - void setTextColour(const QColor &color); + void setTextColour(const TQColor &color); /** * @return the text color */ - const QColor &textColour() const; + const TQColor &textColour() const; /** * Set the shadow color */ - void setShadowColour(const QColor &color); + void setShadowColour(const TQColor &color); /** * @return the shadow color */ - const QColor &shadowColour() const; + const TQColor &shadowColour() const; /** * Set the config values depending on the chart type */ @@ -160,42 +160,42 @@ namespace KSim /** * reimplemented for internal reasons */ - virtual void paintEvent(QPaintEvent *); + virtual void paintEvent(TQPaintEvent *); /** * reimplemented for internal reasons */ - virtual void resizeEvent(QResizeEvent *); + virtual void resizeEvent(TQResizeEvent *); /** * draw the text onto the label */ - void drawText(QPainter *painter, const QRect &rect, - const QColor &color, const QString &text); + void drawText(TQPainter *painter, const TQRect &rect, + const TQColor &color, const TQString &text); /** * draw the pixmap onto the label */ - void drawPixmap(QPainter *painter, - const QRect &rect, const QPixmap &pixmap); + void drawPixmap(TQPainter *painter, + const TQRect &rect, const TQPixmap &pixmap); /** * sets the location of the text */ - void setTextLocation(const QRect &rect); + void setTextLocation(const TQRect &rect); /** * @return the location of the text */ - const QRect &textLocation() const; + const TQRect &textLocation() const; /** * sets the location of the shadow text */ - void setShadowLocation(const QRect &rect); + void setShadowLocation(const TQRect &rect); /** * @return the location of the shadow text */ - const QRect &shadowLocation() const; + const TQRect &shadowLocation() const; /** * sets the background image to be painted */ - void setThemePixmap(const QString &image); - void relayoutLabel(const QSize &old, bool repaint = true); + void setThemePixmap(const TQString &image); + void relayoutLabel(const TQSize &old, bool repaint = true); private: /** diff --git a/ksim/library/led.cpp b/ksim/library/led.cpp index 8d0c88d..a3d9e1c 100644 --- a/ksim/library/led.cpp +++ b/ksim/library/led.cpp @@ -20,10 +20,10 @@ #include "led.h" #include "led.moc" -#include <qimage.h> -#include <qpainter.h> -#include <qfile.h> -#include <qbitmap.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqfile.h> +#include <tqbitmap.h> #include <kdebug.h> #include <kpixmapsplitter.h> @@ -35,13 +35,13 @@ class KSim::Led::Private { public: KPixmapSplitter splitter; - QPixmap pixmap; - QString imageName; + TQPixmap pixmap; + TQString imageName; KSim::Led::Type type; bool toggled; }; -KSim::Led::Led() : QPixmap() +KSim::Led::Led() : TQPixmap() { d = new Private; @@ -52,7 +52,7 @@ KSim::Led::Led() : QPixmap() setOff(); } -KSim::Led::Led(Type type, const QString &imageName) : QPixmap() +KSim::Led::Led(Type type, const TQString &imageName) : TQPixmap() { d = new Private; @@ -74,7 +74,7 @@ void KSim::Led::setOn(bool force) return; // Return if our pixmap is null - QRect rect = d->splitter.coordinates(d->type == First ? 1 : 3); + TQRect rect = d->splitter.coordinates(d->type == First ? 1 : 3); if (d->pixmap.isNull() || rect.isEmpty()) { resize(12, 8); fill(Qt::white); @@ -82,12 +82,12 @@ void KSim::Led::setOn(bool force) } if (d->pixmap.mask() && !d->pixmap.mask()->isNull()) { - QBitmap mask(rect.size()); - bitBlt(&mask, QPoint(0, 0), d->pixmap.mask(), rect, CopyROP); + TQBitmap mask(rect.size()); + bitBlt(&mask, TQPoint(0, 0), d->pixmap.mask(), rect, CopyROP); setMask(mask); } - bitBlt(this, QPoint(0, 0), &d->pixmap, rect, CopyROP); + bitBlt(this, TQPoint(0, 0), &d->pixmap, rect, CopyROP); d->toggled = true; } @@ -97,7 +97,7 @@ void KSim::Led::setOff(bool force) return; // Return if our pixmap is null - QRect rect = d->splitter.coordinates(d->type == First ? 0 : 2); + TQRect rect = d->splitter.coordinates(d->type == First ? 0 : 2); if (d->pixmap.isNull() || rect.isEmpty()) { resize(12, 8); fill(Qt::white); @@ -105,12 +105,12 @@ void KSim::Led::setOff(bool force) } if (d->pixmap.mask() && !d->pixmap.mask()->isNull()) { - QBitmap mask(rect.size()); - bitBlt(&mask, QPoint(0, 0), d->pixmap.mask(), rect, CopyROP); + TQBitmap mask(rect.size()); + bitBlt(&mask, TQPoint(0, 0), d->pixmap.mask(), rect, CopyROP); setMask(mask); } - bitBlt(this, QPoint(0, 0), &d->pixmap, rect, CopyROP); + bitBlt(this, TQPoint(0, 0), &d->pixmap, rect, CopyROP); d->toggled = false; } @@ -122,28 +122,28 @@ void KSim::Led::toggle() setOn(); } -void KSim::Led::setPixmap(const QString &imageName) +void KSim::Led::setPixmap(const TQString &imageName) { if (imageName == d->imageName) return; - QImage image(imageName); + TQImage image(imageName); if (image.width() >= 19) image = image.smoothScale(19, image.height()); KSim::ThemeLoader::self().reColourImage(image); d->pixmap.convertFromImage(image); - QSize size(image.width(), image.height() / 4); + TQSize size(image.width(), image.height() / 4); d->splitter.setPixmap(d->pixmap); d->splitter.setItemSize(size); resize(size); - setMask(QBitmap()); + setMask(TQBitmap()); } -const QString &KSim::Led::fileName() const +const TQString &KSim::Led::fileName() const { return d->imageName; } @@ -179,12 +179,12 @@ class KSim::LedLabel::Private public: KSim::Led receiveLed; KSim::Led sendLed; - QPoint sendPoint; - QPoint receivePoint; + TQPoint sendPoint; + TQPoint receivePoint; }; -KSim::LedLabel::LedLabel(int max, int type, const QString &label, - QWidget *parent, const char *name, WFlags fl) +KSim::LedLabel::LedLabel(int max, int type, const TQString &label, + TQWidget *parent, const char *name, WFlags fl) : KSim::Progress(max, type, Panel, parent, name, fl) { init(); @@ -192,14 +192,14 @@ KSim::LedLabel::LedLabel(int max, int type, const QString &label, } KSim::LedLabel::LedLabel(int max, int type, - QWidget *parent, const char *name, WFlags fl) + TQWidget *parent, const char *name, WFlags fl) : KSim::Progress(max, type, Panel, parent, name, fl) { init(); } KSim::LedLabel::LedLabel(int max, - QWidget *parent, const char *name, WFlags fl) + TQWidget *parent, const char *name, WFlags fl) : KSim::Progress(max, KSim::Types::None, Panel, parent, name, fl) { @@ -215,7 +215,7 @@ void KSim::LedLabel::configureObject(bool reapaintWidget) { KSim::Progress::configureObject(false); - QPixmap pixmap = themeLoader().current().splitPixmap(KSim::Theme::KrellPanel, 0, false); + TQPixmap pixmap = themeLoader().current().splitPixmap(KSim::Theme::KrellPanel, 0, false); if (pixmap.isNull()) pixmap = themeLoader().current().splitPixmap(KSim::Theme::KrellSlider); @@ -234,9 +234,9 @@ void KSim::LedLabel::configureObject(bool reapaintWidget) update(); } -QSize KSim::LedLabel::sizeHint() const +TQSize KSim::LedLabel::sizeHint() const { - QSize hint(Progress::sizeHint()); + TQSize hint(Progress::sizeHint()); if (d->sendLed.height() > hint.height()) hint.setHeight(d->sendLed.height()); @@ -303,14 +303,14 @@ void KSim::LedLabel::drawLeds() bitBlt(this, d->receivePoint, &d->receiveLed); } -void KSim::LedLabel::paintEvent(QPaintEvent *ev) +void KSim::LedLabel::paintEvent(TQPaintEvent *ev) { KSim::Label::paintEvent(ev); drawLeds(); KSim::Progress::drawMeter(); } -void KSim::LedLabel::resizeEvent(QResizeEvent *ev) +void KSim::LedLabel::resizeEvent(TQResizeEvent *ev) { KSim::Progress::resizeEvent(ev); layoutLeds(); @@ -328,11 +328,11 @@ void KSim::LedLabel::layoutLeds() d->receivePoint.setX((d->sendPoint.x() - d->receiveLed.width()) - 3); d->receivePoint.setY(ledHeight - (d->receiveLed.height() / 2)); - QRect location = textLocation(); + TQRect location = textLocation(); location.setWidth(d->receivePoint.x()); setTextLocation(location); - QRect shadow = shadowLocation(); + TQRect shadow = shadowLocation(); shadow.setWidth(d->receivePoint.x() + 3); setShadowLocation(shadow); diff --git a/ksim/library/led.h b/ksim/library/led.h index 2e5d084..a3ef85e 100644 --- a/ksim/library/led.h +++ b/ksim/library/led.h @@ -22,7 +22,7 @@ #include "progress.h" #include <kdemacros.h> -#include <qpixmap.h> +#include <tqpixmap.h> namespace KSim { @@ -49,7 +49,7 @@ namespace KSim * @param parent is the parent widget * @param name is the object instance name */ - Led(Type type, const QString &imageName); + Led(Type type, const TQString &imageName); /** * destructor for KSim::Led. */ @@ -70,11 +70,11 @@ namespace KSim /** * sets the image of the led */ - void setPixmap(const QString &); + void setPixmap(const TQString &); /** * @return the location of the filename */ - const QString &fileName() const; + const TQString &fileName() const; /** * @return true if the led is on */ @@ -116,8 +116,8 @@ namespace KSim * @param parent is the parent widget * @see KSim::ThemeLoader */ - LedLabel(int max, int type, const QString &label, - QWidget *parent, const char *name = 0, WFlags fl = 0); + LedLabel(int max, int type, const TQString &label, + TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * Constructs a KSim::LedLabel. * @@ -126,7 +126,7 @@ namespace KSim * @param parent is the parent widget * @see KSim::ThemeLoader */ - LedLabel(int max, int type, QWidget *parent, + LedLabel(int max, int type, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * Constructs a KSim::LedLabel. @@ -135,7 +135,7 @@ namespace KSim * @param parent is the parent widget * @see KSim::ThemeLoader */ - LedLabel(int max, QWidget *parent, + LedLabel(int max, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * destructor for KSim::LedLabel. @@ -149,7 +149,7 @@ namespace KSim /** * reimplemented for internal reasons */ - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; public slots: /** @@ -176,11 +176,11 @@ namespace KSim /** * reimplemented for internal reasons */ - virtual void paintEvent(QPaintEvent *); + virtual void paintEvent(TQPaintEvent *); /** * reimplemented for internal reasons */ - virtual void resizeEvent(QResizeEvent *); + virtual void resizeEvent(TQResizeEvent *); private: void layoutLeds(); diff --git a/ksim/library/pluginglobal.cpp b/ksim/library/pluginglobal.cpp index 02b32ad..3cbae68 100644 --- a/ksim/library/pluginglobal.cpp +++ b/ksim/library/pluginglobal.cpp @@ -40,7 +40,7 @@ class KSim::Plugin::Private ~Private() { kdDebug(2003) << "Deleting " << (plugin ? - plugin->name() : QString("Null")) + plugin->name() : TQString("Null")) << " objects." << endl; // Remember to delete the objects we own @@ -57,10 +57,10 @@ class KSim::Plugin::Private bool deref() { return !--count; } uint count; - QString name; - QPixmap icon; - QCString libName; - QString filename; + TQString name; + TQPixmap icon; + TQCString libName; + TQString filename; KSim::PluginObject *plugin; KSim::PluginView *view; KSim::PluginPage *page; @@ -155,24 +155,24 @@ bool KSim::Plugin::isNull() const return !d; } -const QString &KSim::Plugin::name() const +const TQString &KSim::Plugin::name() const { - return d ? d->name : QString::null; + return d ? d->name : TQString::null; } -QPixmap KSim::Plugin::icon() const +TQPixmap KSim::Plugin::icon() const { - return d ? d->icon : QPixmap(); + return d ? d->icon : TQPixmap(); } -QCString KSim::Plugin::libName() const +TQCString KSim::Plugin::libName() const { - return d ? d->libName : QCString(); + return d ? d->libName : TQCString(); } -const QString &KSim::Plugin::fileName() const +const TQString &KSim::Plugin::fileName() const { - return d ? d->filename : QString::null; + return d ? d->filename : TQString::null; } KSim::PluginObject *KSim::Plugin::plugin() const diff --git a/ksim/library/pluginglobal.h b/ksim/library/pluginglobal.h index 85df9ce..5dbeef8 100644 --- a/ksim/library/pluginglobal.h +++ b/ksim/library/pluginglobal.h @@ -20,9 +20,9 @@ #ifndef PLUGINGLOBAL_H #define PLUGINGLOBAL_H -#include <qstring.h> -#include <qpixmap.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqpixmap.h> +#include <tqvaluelist.h> #include <kdemacros.h> @@ -93,19 +93,19 @@ namespace KSim * @return the name of the plugin, NOT the library name * @see #libName */ - const QString &name() const; + const TQString &name() const; /** * @return the icon of the plugin */ - QPixmap icon() const; + TQPixmap icon() const; /** * @return library name of the plugin */ - QCString libName() const; + TQCString libName() const; /** * @return path to the .desktop file */ - const QString &fileName() const; + const TQString &fileName() const; /** * @return the plugin object */ @@ -135,22 +135,22 @@ namespace KSim * use pluginList() from KSim::PluginLoader instead * @author Robbie Ward <linuxphreak@gmx.co.uk> */ - class KDE_EXPORT PluginList : public QValueList<Plugin> + class KDE_EXPORT PluginList : public TQValueList<Plugin> { public: /** * constructs a null list */ - PluginList() : QValueList<Plugin>() {} + PluginList() : TQValueList<Plugin>() {} /** * constructs a copy of @p list */ - PluginList(const PluginList &list) : QValueList<Plugin>(list) {} + PluginList(const PluginList &list) : TQValueList<Plugin>(list) {} /** * constructs a copy of @p list */ - PluginList(const QValueList<Plugin> &list) - : QValueList<Plugin>(list) {} + PluginList(const TQValueList<Plugin> &list) + : TQValueList<Plugin>(list) {} /** * constructs a list with just one item */ diff --git a/ksim/library/pluginloader.cpp b/ksim/library/pluginloader.cpp index be2d2bf..1a8bbd8 100644 --- a/ksim/library/pluginloader.cpp +++ b/ksim/library/pluginloader.cpp @@ -28,7 +28,7 @@ #include <kstandarddirs.h> #include <kmessagebox.h> -#include <qstringlist.h> +#include <tqstringlist.h> class KSim::PluginInfo::Private { @@ -39,17 +39,17 @@ KSim::PluginInfo::~PluginInfo() { } -const QString &KSim::PluginInfo::name() const +const TQString &KSim::PluginInfo::name() const { return m_name; } -QCString KSim::PluginInfo::libName(bool includePrefix) const +TQCString KSim::PluginInfo::libName(bool includePrefix) const { return (includePrefix ? "ksim_" + m_libName : m_libName); } -const QString &KSim::PluginInfo::location() const +const TQString &KSim::PluginInfo::location() const { return m_location; } @@ -63,8 +63,8 @@ class KSim::PluginLoader::Private public: typedef KSim::PluginObject *(PluginPtr)(const char *); KSim::PluginList pluginList; - QString error; - QString lib; + TQString error; + TQString lib; bool lastLoaded; static const char *const ksimString; }; @@ -119,7 +119,7 @@ bool KSim::PluginLoader::loadPlugin(const KDesktopFile &file) return true; } -bool KSim::PluginLoader::unloadPlugin(const QCString &name) +bool KSim::PluginLoader::unloadPlugin(const TQCString &name) { if (name.isEmpty()) return false; @@ -156,7 +156,7 @@ bool KSim::PluginLoader::isLoaded(const KSim::Plugin &info) const return isLoaded(info.libName()); } -bool KSim::PluginLoader::isLoaded(const QCString &library) const +bool KSim::PluginLoader::isLoaded(const TQCString &library) const { if (library.isEmpty()) return false; @@ -164,15 +164,15 @@ bool KSim::PluginLoader::isLoaded(const QCString &library) const return !find(library).isNull(); } -KSim::PluginInfo KSim::PluginLoader::findPluginInfo(const QString &name, +KSim::PluginInfo KSim::PluginLoader::findPluginInfo(const TQString &name, SearchType type) const { - QString location; + TQString location; switch (type) { case Name: { - QStringList files = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); - QStringList::ConstIterator it; + TQStringList files = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); + TQStringList::ConstIterator it; for (it = files.begin(); it != files.end(); ++it) { KDesktopFile file((*it)); if (file.readName() == name) { @@ -183,8 +183,8 @@ KSim::PluginInfo KSim::PluginLoader::findPluginInfo(const QString &name, break; } case LibName: { - QStringList files = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); - QStringList::ConstIterator it; + TQStringList files = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); + TQStringList::ConstIterator it; for (it = files.begin(); it != files.end(); ++it) { KDesktopFile file((*it)); if (file.readEntry("X-KSIM-LIBRARY") == name) { @@ -211,12 +211,12 @@ KSim::PluginInfo KSim::PluginLoader::findPluginInfo(const QString &name, return info; } -KSim::Plugin &KSim::PluginLoader::find(const QCString &libName) +KSim::Plugin &KSim::PluginLoader::find(const TQCString &libName) { if (libName.isEmpty()) return KSim::Plugin::null; - QCString library(libName); + TQCString library(libName); if (libName.find(Private::ksimString) == -1) library.prepend(Private::ksimString); @@ -229,12 +229,12 @@ KSim::Plugin &KSim::PluginLoader::find(const QCString &libName) return KSim::Plugin::null; } -const KSim::Plugin &KSim::PluginLoader::find(const QCString &libName) const +const KSim::Plugin &KSim::PluginLoader::find(const TQCString &libName) const { if (libName.isEmpty()) return KSim::Plugin::null; - QCString library(libName); + TQCString library(libName); if (libName.find(Private::ksimString) == -1) library.prepend(Private::ksimString); @@ -277,7 +277,7 @@ KSim::Plugin &KSim::PluginLoader::plugin() return (d->lastLoaded ? d->pluginList.last() : KSim::Plugin::null); } -KSim::PluginLoader::PluginLoader() : QObject(0, "PluginLoader") +KSim::PluginLoader::PluginLoader() : TQObject(0, "PluginLoader") { d = new KSim::PluginLoader::Private; d->lastLoaded = false; @@ -294,20 +294,20 @@ void KSim::PluginLoader::cleanup() KSim::PluginLoader::ErrorCode KSim::PluginLoader::createPlugin(const KDesktopFile &file) { - d->error = QString::null; - QCString pluginName(file.readEntry("X-KSIM-LIBRARY").local8Bit()); + d->error = TQString::null; + TQCString pluginName(file.readEntry("X-KSIM-LIBRARY").local8Bit()); if (pluginName.isEmpty()) return EmptyLibName; - QCString libName(Private::ksimString + pluginName); + TQCString libName(Private::ksimString + pluginName); KLibrary *library = KLibLoader::self()->library(libName); if (!library) return LibNotFound; - QCString symbol("init_plugin"); + TQCString symbol("init_plugin"); if (Private::PluginPtr *create = (Private::PluginPtr *)(library->symbol(symbol))) { d->pluginList.append(KSim::Plugin(create(pluginName), file)); - d->lib = QString::null; + d->lib = TQString::null; d->lastLoaded = true; } else { diff --git a/ksim/library/pluginloader.h b/ksim/library/pluginloader.h index f101973..385df44 100644 --- a/ksim/library/pluginloader.h +++ b/ksim/library/pluginloader.h @@ -21,7 +21,7 @@ #define PLUGINLOADER_H #include "pluginglobal.h" -#include <qobject.h> +#include <tqobject.h> #include <kdemacros.h> @@ -36,22 +36,22 @@ namespace KSim /** * @return the name of the plugin */ - const QString &name() const; + const TQString &name() const; /** * @return the library name of the plugin */ - QCString libName(bool includePrefix = false) const; + TQCString libName(bool includePrefix = false) const; /** * @return the location of the desktop file */ - const QString &location() const; + const TQString &location() const; private: PluginInfo(); - QString m_name; - QString m_location; - QCString m_libName; + TQString m_name; + TQString m_location; + TQCString m_libName; class Private; Private *d; @@ -89,7 +89,7 @@ namespace KSim /** * unloads a loaded plugin and removes plugin entries from pluginList() */ - bool unloadPlugin(const QCString &name); + bool unloadPlugin(const TQCString &name); /** * unloads all loaded plugins */ @@ -103,14 +103,14 @@ namespace KSim /** * returns true if library is loaded */ - bool isLoaded(const QCString &library) const; + bool isLoaded(const TQCString &library) const; /** * finds the plugins desktopfile and returns information * on the plugin * @return a KSim::PluginInfo object * @see KSim::PluginInfo */ - KSim::PluginInfo findPluginInfo(const QString &name, + KSim::PluginInfo findPluginInfo(const TQString &name, SearchType type = DesktopFile) const; /** * looks through the list of loaded plugins and returns @@ -122,11 +122,11 @@ namespace KSim * @return a KSim::Plugin object * @see KSim::Plugin */ - KSim::Plugin &find(const QCString &libName); + KSim::Plugin &find(const TQCString &libName); /** * convenience function, see the above function for details. */ - const KSim::Plugin &find(const QCString &libName) const; + const KSim::Plugin &find(const TQCString &libName) const; /** * equivalent to find(info.libName()); */ diff --git a/ksim/library/pluginmodule.cpp b/ksim/library/pluginmodule.cpp index f267197..b5cbd37 100644 --- a/ksim/library/pluginmodule.cpp +++ b/ksim/library/pluginmodule.cpp @@ -24,19 +24,19 @@ #include <kapplication.h> #include <kaboutdata.h> #include <kdebug.h> -#include <qregexp.h> -#include <qpopupmenu.h> +#include <tqregexp.h> +#include <tqpopupmenu.h> #include <kconfig.h> class KSim::PluginObject::Private { public: - QCString name; - QString configName; + TQCString name; + TQString configName; }; -KSim::PluginObject::PluginObject(const QCString &name) +KSim::PluginObject::PluginObject(const TQCString &name) { d = new PluginObject::Private; d->name = name; @@ -53,12 +53,12 @@ const char *KSim::PluginObject::instanceName() const return kapp->aboutData()->appName(); } -const QCString &KSim::PluginObject::name() const +const TQCString &KSim::PluginObject::name() const { return d->name; } -void KSim::PluginObject::setConfigFileName(const QString &name) +void KSim::PluginObject::setConfigFileName(const TQString &name) { if (d->configName == name) return; @@ -68,7 +68,7 @@ void KSim::PluginObject::setConfigFileName(const QString &name) d->configName.prepend("ksim_"); } -const QString &KSim::PluginObject::configFileName() const +const TQString &KSim::PluginObject::configFileName() const { return d->configName; } @@ -81,7 +81,7 @@ class KSim::PluginPage::Private }; KSim::PluginPage::PluginPage(KSim::PluginObject *parent, const char *name) - : QWidget(0, name) + : TQWidget(0, name) { d = new PluginPage::Private; d->parent = parent; @@ -112,18 +112,18 @@ class KSim::PluginView::Private { public: PluginObject *parent; - QPopupMenu *popupMenu; + TQPopupMenu *popupMenu; KConfig *config; }; KSim::PluginView::PluginView(KSim::PluginObject *parent, const char *name) - : QWidget(0, name) + : TQWidget(0, name) { d = new PluginView::Private; d->parent = parent; - d->popupMenu = new QPopupMenu(this); + d->popupMenu = new TQPopupMenu(this); d->popupMenu->insertItem(i18n("About"), this, - SLOT(showAbout()), 0, -1, 0); + TQT_SLOT(showAbout()), 0, -1, 0); if (parent && !parent->configFileName().isEmpty()) d->config = new KConfig(parent->configFileName() + "rc"); @@ -147,7 +147,7 @@ KConfig *KSim::PluginView::config() const return d->config; } -QPopupMenu *KSim::PluginView::menu() const +TQPopupMenu *KSim::PluginView::menu() const { return d->popupMenu; } @@ -157,9 +157,9 @@ void KSim::PluginView::doCommand() emit runCommand(name()); } -void KSim::PluginView::mousePressEvent(QMouseEvent *ev) +void KSim::PluginView::mousePressEvent(TQMouseEvent *ev) { - if (ev->button() == QMouseEvent::LeftButton) + if (ev->button() == TQMouseEvent::LeftButton) doCommand(); } diff --git a/ksim/library/pluginmodule.h b/ksim/library/pluginmodule.h index 1cc6a1c..753030f 100644 --- a/ksim/library/pluginmodule.h +++ b/ksim/library/pluginmodule.h @@ -20,7 +20,7 @@ #ifndef PLUGINMODULE_H #define PLUGINMODULE_H -#include <qwidget.h> +#include <tqwidget.h> #include <kdemacros.h> @@ -56,7 +56,7 @@ namespace KSim /** * constructor for PluginObject */ - PluginObject(const QCString &name); + PluginObject(const TQCString &name); /** * destructor for PluginObject */ @@ -83,16 +83,16 @@ namespace KSim /** * @return the name of the plugin */ - const QCString &name() const; + const TQCString &name() const; /** * sets the configuration file name to @p name */ - void setConfigFileName(const QString &name); + void setConfigFileName(const TQString &name); /** * @return the config filename the plugin should use * or name() if the filename hasn't been set */ - const QString &configFileName() const; + const TQString &configFileName() const; private: PluginObject(); @@ -180,7 +180,7 @@ namespace KSim /** * the plugins popup menu */ - QPopupMenu *menu() const; + TQPopupMenu *menu() const; /** * reimplement to recreate your view when KSim requests this */ @@ -188,10 +188,10 @@ namespace KSim void doCommand(); signals: - void runCommand(const QCString &); + void runCommand(const TQCString &); protected: - virtual void mousePressEvent(QMouseEvent *); + virtual void mousePressEvent(TQMouseEvent *); PluginObject *parentPlugin() const; private slots: diff --git a/ksim/library/progress.cpp b/ksim/library/progress.cpp index fd923d2..82ae16e 100644 --- a/ksim/library/progress.cpp +++ b/ksim/library/progress.cpp @@ -21,17 +21,17 @@ #include "progress.moc" #include <kdebug.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqimage.h> #include <themeloader.h> class KSim::Progress::Private { public: - QPixmap meterPixmap; - QRect rectOrigin; + TQPixmap meterPixmap; + TQRect rectOrigin; ProgressType type; int krellDepth; int value; @@ -40,7 +40,7 @@ class KSim::Progress::Private }; KSim::Progress::Progress(int maxValue, - QWidget *parent, const char *name, + TQWidget *parent, const char *name, WFlags fl) : KSim::Label(parent, name, fl) { init(maxValue); @@ -48,7 +48,7 @@ KSim::Progress::Progress(int maxValue, } KSim::Progress::Progress(int maxValue, - int type, const QString &label, QWidget *parent, + int type, const TQString &label, TQWidget *parent, const char *name, WFlags fl) : KSim::Label(type, label, parent, name, fl) { @@ -57,8 +57,8 @@ KSim::Progress::Progress(int maxValue, } KSim::Progress::Progress(int maxValue, - int type, const QString &label, int value, - QWidget *parent, const char *name, WFlags fl) + int type, const TQString &label, int value, + TQWidget *parent, const char *name, WFlags fl) : KSim::Label(type, label, parent, name, fl) { init(maxValue, value); @@ -66,7 +66,7 @@ KSim::Progress::Progress(int maxValue, } KSim::Progress::Progress(int maxValue, - int type, QWidget *parent, + int type, TQWidget *parent, const char *name, WFlags fl) : KSim::Label(type, parent, name, fl) { @@ -76,7 +76,7 @@ KSim::Progress::Progress(int maxValue, KSim::Progress::Progress(int maxValue, int type, ProgressType progressType, - QWidget *parent, const char *name, WFlags fl) + TQWidget *parent, const char *name, WFlags fl) : KSim::Label(type, parent, name, fl) { init(maxValue, 0, progressType); @@ -103,7 +103,7 @@ int KSim::Progress::maxValue() const return d->maxValue; } -const QRect &KSim::Progress::rectOrigin() const +const TQRect &KSim::Progress::rectOrigin() const { return d->rectOrigin; } @@ -124,9 +124,9 @@ void KSim::Progress::configureObject(bool repaintWidget) update(); } -QSize KSim::Progress::sizeHint() const +TQSize KSim::Progress::sizeHint() const { - QSize hint(Label::sizeHint()); + TQSize hint(Label::sizeHint()); if (d->meterPixmap.height() > hint.height()) hint.setHeight(d->meterPixmap.height()); @@ -179,14 +179,14 @@ void KSim::Progress::setMaxValue(int maxValue) } } -void KSim::Progress::setOrigin(const QRect &origin) +void KSim::Progress::setOrigin(const TQRect &origin) { d->rectOrigin = origin; } -void KSim::Progress::setMeterPixmap(const QPixmap &pixmap) +void KSim::Progress::setMeterPixmap(const TQPixmap &pixmap) { - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); d->meterPixmap = pixmap; relayoutLabel(oldSize); } @@ -204,13 +204,13 @@ int KSim::Progress::xLocation() const return returnValue; } -void KSim::Progress::paintEvent(QPaintEvent *ev) +void KSim::Progress::paintEvent(TQPaintEvent *ev) { KSim::Label::paintEvent(ev); drawMeter(); } -void KSim::Progress::resizeEvent(QResizeEvent *ev) +void KSim::Progress::resizeEvent(TQResizeEvent *ev) { KSim::Label::resizeEvent(ev); setOrigin(rect()); diff --git a/ksim/library/progress.h b/ksim/library/progress.h index 570894a..7f0f68a 100644 --- a/ksim/library/progress.h +++ b/ksim/library/progress.h @@ -43,7 +43,7 @@ namespace KSim * @param label is the text that will be displayed * @param parent is the parent widget */ - Progress(int maxValue, QWidget *parent, + Progress(int maxValue, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * constructs a KSim::Progress @@ -54,8 +54,8 @@ namespace KSim * @param label is the text that will be displayed * @param parent is the parent widget */ - Progress(int maxValue, int type, const QString &label, - QWidget *parent, const char *name = 0, WFlags fl = 0); + Progress(int maxValue, int type, const TQString &label, + TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * constructs a KSim::Progress * @@ -66,8 +66,8 @@ namespace KSim * @param value is the initial value to be displayed * @param parent is the parent widget */ - Progress(int maxValue, int type, const QString &label, - int value, QWidget *parent, const char *name = 0, + Progress(int maxValue, int type, const TQString &label, + int value, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * constructs a KSim::Progress @@ -77,7 +77,7 @@ namespace KSim * @param type is the theme type * @param parent is the parent widget */ - Progress(int maxValue, int type, QWidget *parent, + Progress(int maxValue, int type, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * constructs a KSim::Progress @@ -90,7 +90,7 @@ namespace KSim */ Progress(int maxValue, int type, ProgressType progressType, - QWidget *parent, const char *name = 0, + TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * destructs KSim::Chart @@ -113,7 +113,7 @@ namespace KSim /** * @return the area that the progress meter will be drawn */ - const QRect &rectOrigin() const; + const TQRect &rectOrigin() const; /** * reimplemented for internal reasons */ @@ -121,7 +121,7 @@ namespace KSim /** * reimplemented for internal reasons */ - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; public slots: /** @@ -146,11 +146,11 @@ namespace KSim /** * sets the area that the progess bar will be drawn */ - void setOrigin(const QRect &); + void setOrigin(const TQRect &); /** * sets the progress bar pixmap */ - void setMeterPixmap(const QPixmap &); + void setMeterPixmap(const TQPixmap &); /** * @return the pixel position where the meter should be drawn */ @@ -158,11 +158,11 @@ namespace KSim /** * reimplemented for internal reasons */ - virtual void paintEvent(QPaintEvent *); + virtual void paintEvent(TQPaintEvent *); /** * reimplemented for internal reasons */ - virtual void resizeEvent(QResizeEvent *); + virtual void resizeEvent(TQResizeEvent *); /** * paints the meter image onto the widget */ diff --git a/ksim/library/themeloader.cpp b/ksim/library/themeloader.cpp index 7c42dcd..f960ef7 100644 --- a/ksim/library/themeloader.cpp +++ b/ksim/library/themeloader.cpp @@ -22,15 +22,15 @@ #include "themetypes.h" #include "common.h" -#include <qfile.h> -#include <qstringlist.h> -#include <qvaluevector.h> -#include <qregexp.h> -#include <qapplication.h> -#include <qfileinfo.h> -#include <qdir.h> -#include <qimage.h> -#include <qbitmap.h> +#include <tqfile.h> +#include <tqstringlist.h> +#include <tqvaluevector.h> +#include <tqregexp.h> +#include <tqapplication.h> +#include <tqfileinfo.h> +#include <tqdir.h> +#include <tqimage.h> +#include <tqbitmap.h> #include <kdebug.h> #include <ksimpleconfig.h> @@ -41,40 +41,40 @@ class KSim::Theme::Private { public: - Private(const QValueVector<QString> &names, - const QStringList &list) : fileNames(names), + Private(const TQValueVector<TQString> &names, + const TQStringList &list) : fileNames(names), imageTypes(list) {} - QStringList file; - QStringList dFile; + TQStringList file; + TQStringList dFile; KConfig *globalReader; - QString altTheme; - QString location; - const QValueVector<QString> &fileNames; - const QStringList &imageTypes; + TQString altTheme; + TQString location; + const TQValueVector<TQString> &fileNames; + const TQStringList &imageTypes; int alternative; int font; bool recolour; - QString readOption(const QString &entry, + TQString readOption(const TQString &entry, bool useGlobal = true, - const QString &defValue = QString::null) + const TQString &defValue = TQString::null) { - QString text; - QStringList::ConstIterator it; + TQString text; + TQStringList::ConstIterator it; for (it = file.begin(); it != file.end(); ++it) { if ((*it).find(entry) != -1) { - text = QStringList::split("=", (*it))[1].stripWhiteSpace(); + text = TQStringList::split("=", (*it))[1].stripWhiteSpace(); } } if (!text.isEmpty() || dFile.isEmpty()) return text; - QStringList::ConstIterator it2; + TQStringList::ConstIterator it2; for (it2 = dFile.begin(); it2 != dFile.end(); ++it) { if ((*it2).find(entry) != -1) { - text = QStringList::split("=", (*it2))[1].stripWhiteSpace(); + text = TQStringList::split("=", (*it2))[1].stripWhiteSpace(); } } @@ -92,11 +92,11 @@ class KSim::Theme::Private class KSim::ThemeLoader::Private { public: - QValueVector<QString> fileNames; - QStringList imageTypes; + TQValueVector<TQString> fileNames; + TQStringList imageTypes; KConfig *globalReader; bool recolour; - QColor pixelColour; + TQColor pixelColour; }; bool KSim::Theme::operator==(const KSim::Theme &rhs) const @@ -124,24 +124,24 @@ KSim::Theme::~Theme() delete d; } -const QString &KSim::Theme::path() const +const TQString &KSim::Theme::path() const { return d->location; } -QString KSim::Theme::name() const +TQString KSim::Theme::name() const { - QString name = d->location; + TQString name = d->location; if (name.endsWith("/")) name.remove(name.length() - 1, 1); return name.remove(0, name.findRev("/") + 1); } -QString KSim::Theme::author() const +TQString KSim::Theme::author() const { - QString author(d->readOption("author", false)); - return author.replace(QRegExp("\""), QString::null); + TQString author(d->readOption("author", false)); + return author.replace(TQRegExp("\""), TQString::null); } int KSim::Theme::fontItem() const @@ -194,48 +194,48 @@ int KSim::Theme::frameRightWidth(int defValue) const return KMIN(2, internalNumEntry("frame_right_width", defValue)); } -QRect KSim::Theme::frameTopBorder(const QRect &defValue) const +TQRect KSim::Theme::frameTopBorder(const TQRect &defValue) const { return internalRectEntry("frame_top_border", defValue); } -QRect KSim::Theme::frameBottomBorder(const QRect &defValue) const +TQRect KSim::Theme::frameBottomBorder(const TQRect &defValue) const { return internalRectEntry("frame_bottom_border", defValue); } -QRect KSim::Theme::frameLeftBorder(const QRect &defValue) const +TQRect KSim::Theme::frameLeftBorder(const TQRect &defValue) const { return internalRectEntry("frame_left_border", defValue); } -QRect KSim::Theme::frameRightBorder(const QRect &defValue) const +TQRect KSim::Theme::frameRightBorder(const TQRect &defValue) const { return internalRectEntry("frame_right_border", defValue); } -QColor KSim::Theme::chartInColour(const QColor &defValue) const +TQColor KSim::Theme::chartInColour(const TQColor &defValue) const { if (d->recolour) - return QApplication::palette().active().background(); + return TQApplication::palette().active().background(); return internalColourEntry("chart_in_color", defValue); } -QColor KSim::Theme::chartInColourGrid(const QColor &defValue) const +TQColor KSim::Theme::chartInColourGrid(const TQColor &defValue) const { return internalColourEntry("chart_in_color_grid", defValue); } -QColor KSim::Theme::chartOutColour(const QColor &defValue) const +TQColor KSim::Theme::chartOutColour(const TQColor &defValue) const { if (d->recolour) - return QApplication::palette().active().background(); + return TQApplication::palette().active().background(); return internalColourEntry("chart_out_color", defValue); } -QColor KSim::Theme::chartOutColourGrid(const QColor &defValue) const +TQColor KSim::Theme::chartOutColourGrid(const TQColor &defValue) const { return internalColourEntry("chart_out_color_grid", defValue); } @@ -285,68 +285,68 @@ int KSim::Theme::krellSliderXHot(int defValue) const return internalNumEntry("krell_slider_x_hot", defValue); } -QRect KSim::Theme::sliderPanel(const QRect &defValue) const +TQRect KSim::Theme::sliderPanel(const TQRect &defValue) const { return internalRectEntry("bg_slider_panel_border", defValue); } -QRect KSim::Theme::sliderMeter(const QRect &defValue) const +TQRect KSim::Theme::sliderMeter(const TQRect &defValue) const { return internalRectEntry("bg_slider_meter_border", defValue); } -QRect KSim::Theme::timerBorder(const QRect &defValue) const +TQRect KSim::Theme::timerBorder(const TQRect &defValue) const { return internalRectEntry("bg_timer_border", defValue); } -QRect KSim::Theme::buttonPanelBorder(const QRect &defValue) const +TQRect KSim::Theme::buttonPanelBorder(const TQRect &defValue) const { return internalRectEntry("button_panel_border", defValue); } -QRect KSim::Theme::buttonMeterBorder(const QRect &defValue) const +TQRect KSim::Theme::buttonMeterBorder(const TQRect &defValue) const { return internalRectEntry("button_meter_border", defValue); } -QFont KSim::Theme::largeFont() const +TQFont KSim::Theme::largeFont() const { - QString font(internalStringEntry("large_font", QString::null)); + TQString font(internalStringEntry("large_font", TQString::null)); if (font.isEmpty()) - return QApplication::font(); + return TQApplication::font(); - QFont themeFont; - themeFont.setRawName(font.replace(QRegExp("\""), QString::null)); + TQFont themeFont; + themeFont.setRawName(font.replace(TQRegExp("\""), TQString::null)); return themeFont; } -QFont KSim::Theme::normalFont() const +TQFont KSim::Theme::normalFont() const { - QString font(internalStringEntry("normal_font", QString::null)); + TQString font(internalStringEntry("normal_font", TQString::null)); if (font.isEmpty()) - return QApplication::font(); + return TQApplication::font(); - QFont themeFont; - themeFont.setRawName(font.replace(QRegExp("\""), QString::null)); + TQFont themeFont; + themeFont.setRawName(font.replace(TQRegExp("\""), TQString::null)); return themeFont; } -QFont KSim::Theme::smallFont() const +TQFont KSim::Theme::smallFont() const { - QString font(internalStringEntry("small_font", QString::null)); + TQString font(internalStringEntry("small_font", TQString::null)); if (font.isEmpty()) - return QApplication::font(); + return TQApplication::font(); - QFont themeFont; - themeFont.setRawName(font.replace(QRegExp("\""), QString::null)); + TQFont themeFont; + themeFont.setRawName(font.replace(TQRegExp("\""), TQString::null)); return themeFont; } -QFont KSim::Theme::currentFont() const +TQFont KSim::Theme::currentFont() const { switch (fontItem()) { case 0: @@ -366,23 +366,23 @@ QFont KSim::Theme::currentFont() const break; } - return QFont(); + return TQFont(); } -QString KSim::Theme::meterPixmap(int type, bool useDefault) const +TQString KSim::Theme::meterPixmap(int type, bool useDefault) const { - QString imageFile = createType(type, d->location); - QString text; - QString file = d->fileNames[7]; + TQString imageFile = createType(type, d->location); + TQString text; + TQString file = d->fileNames[7]; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(imageFile + file + d->altTheme + "." + *it)) { + if (TQFile::exists(imageFile + file + d->altTheme + "." + *it)) { text = imageFile + file + d->altTheme + "." + *it; break; } else - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -394,20 +394,20 @@ QString KSim::Theme::meterPixmap(int type, bool useDefault) const return text; } -QString KSim::Theme::panelPixmap(int type, bool useDefault) const +TQString KSim::Theme::panelPixmap(int type, bool useDefault) const { - QString imageFile = createType(type, d->location); - QString text; - QString file = d->fileNames[6]; + TQString imageFile = createType(type, d->location); + TQString text; + TQString file = d->fileNames[6]; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(imageFile + file + d->altTheme + "." + *it)) { + if (TQFile::exists(imageFile + file + d->altTheme + "." + *it)) { text = imageFile + file + d->altTheme + "." + *it; break; } else - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -419,20 +419,20 @@ QString KSim::Theme::panelPixmap(int type, bool useDefault) const return text; } -QString KSim::Theme::ledPixmap(int type, bool useDefault) const +TQString KSim::Theme::ledPixmap(int type, bool useDefault) const { - QString imageFile = createType(type, d->location); - QString text; - QString file = d->fileNames[30]; + TQString imageFile = createType(type, d->location); + TQString text; + TQString file = d->fileNames[30]; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(imageFile + file + d->altTheme + "." + *it)) { + if (TQFile::exists(imageFile + file + d->altTheme + "." + *it)) { text = imageFile + file + d->altTheme + "." + *it; break; } else - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -444,10 +444,10 @@ QString KSim::Theme::ledPixmap(int type, bool useDefault) const return text; } -QString KSim::Theme::framePixmap(int type, bool useDefault) const +TQString KSim::Theme::framePixmap(int type, bool useDefault) const { - QString text; - QString file; + TQString text; + TQString file; switch (type) { case Types::TopFrame: @@ -464,9 +464,9 @@ QString KSim::Theme::framePixmap(int type, bool useDefault) const break; } - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -492,55 +492,55 @@ QString KSim::Theme::framePixmap(int type, bool useDefault) const return text; } -QString KSim::Theme::chartPixmap(bool useDefault) const +TQString KSim::Theme::chartPixmap(bool useDefault) const { return loader(4, useDefault); } -QString KSim::Theme::gridPixmap(bool useDefault) const +TQString KSim::Theme::gridPixmap(bool useDefault) const { return loader(5, useDefault); } -QString KSim::Theme::krellPanelPixmap(bool useDefault) const +TQString KSim::Theme::krellPanelPixmap(bool useDefault) const { return loader(14, useDefault); } -QString KSim::Theme::krellMeterPixmap(bool useDefault) const +TQString KSim::Theme::krellMeterPixmap(bool useDefault) const { return loader(15, useDefault); } -QString KSim::Theme::krellSliderPixmap(bool useDefault) const +TQString KSim::Theme::krellSliderPixmap(bool useDefault) const { return loader(16, useDefault); } -QString KSim::Theme::dataInPixmap(bool useDefault) const +TQString KSim::Theme::dataInPixmap(bool useDefault) const { return loader(18, useDefault); } -QString KSim::Theme::dataOutPixmap(bool useDefault) const +TQString KSim::Theme::dataOutPixmap(bool useDefault) const { return loader(20, useDefault); } -QString KSim::Theme::mailPixmap(bool useDefault) const +TQString KSim::Theme::mailPixmap(bool useDefault) const { - QString imageFile = createType(KSim::Types::Mail, d->location); - QString text; - QString file = d->fileNames[25]; + TQString imageFile = createType(KSim::Types::Mail, d->location); + TQString text; + TQString file = d->fileNames[25]; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(imageFile + file + d->altTheme + "." + *it)) { + if (TQFile::exists(imageFile + file + d->altTheme + "." + *it)) { text = imageFile + file + d->altTheme + "." + *it; break; } else - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -548,21 +548,21 @@ QString KSim::Theme::mailPixmap(bool useDefault) const if (text.isNull() && useDefault) return KSim::ThemeLoader::defaultUrl() - + createType(KSim::Types::Mail, QString::null) + file + ".png"; + + createType(KSim::Types::Mail, TQString::null) + file + ".png"; return text; } -QPixmap KSim::Theme::splitPixmap(PixmapType type, uint itemNo, +TQPixmap KSim::Theme::splitPixmap(PixmapType type, uint itemNo, bool useDefault) const { return pixmapToList(type, itemNo, useDefault)[itemNo]; } -QValueList<QPixmap> KSim::Theme::pixmapToList(PixmapType type, +TQValueList<TQPixmap> KSim::Theme::pixmapToList(PixmapType type, int limitAmount, bool useDefault) const { - QImage image; + TQImage image; int xOffset = 0; int yOffset = 0; int depth = 0; @@ -588,27 +588,27 @@ QValueList<QPixmap> KSim::Theme::pixmapToList(PixmapType type, kdDebug(2003) << "KSim::Theme: type = KrellSlider" << endl; break; default: - return QValueList<QPixmap>(); + return TQValueList<TQPixmap>(); break; } if (image.isNull()) - return QValueList<QPixmap>(); + return TQValueList<TQPixmap>(); - QValueList<QPixmap> list; + TQValueList<TQPixmap> list; int size = image.height(); if (depth) size = image.height() / depth; KSim::ThemeLoader::self().reColourImage(image); - QPixmap pixmap = image; - QPixmap newPixmap(image.width() - xOffset, size); + TQPixmap pixmap = image; + TQPixmap newPixmap(image.width() - xOffset, size); for (int i = 0; i < (depth + 1); ++i) { newPixmap.fill(); if (pixmap.mask()) { - QBitmap mask(newPixmap.size()); + TQBitmap mask(newPixmap.size()); bitBlt(&mask, 0, 0, pixmap.mask(), xOffset, yOffset, image.width() - xOffset, size); newPixmap.setMask(mask); @@ -631,33 +631,33 @@ QValueList<QPixmap> KSim::Theme::pixmapToList(PixmapType type, return list; } -int KSim::Theme::transparency(const QString &itemType, - const QString &entry) const +int KSim::Theme::transparency(const TQString &itemType, + const TQString &entry) const { return readIntEntry(itemType, entry); } -bool KSim::Theme::textShadow(const QString &itemType, - const QString &entry) const +bool KSim::Theme::textShadow(const TQString &itemType, + const TQString &entry) const { if (d->recolour) return false; - QString shadow = readEntry(itemType, entry); + TQString shadow = readEntry(itemType, entry); if (shadow.isEmpty() || shadow.findRev("none") != -1) return false; return true; } -QColor KSim::Theme::shadowColour(const QString &itemType, - const QString &entry) const +TQColor KSim::Theme::shadowColour(const TQString &itemType, + const TQString &entry) const { return readColourEntry(itemType, entry, 1); } -QColor KSim::Theme::textColour(const QString &itemType, - const QString &entry) const +TQColor KSim::Theme::textColour(const TQString &itemType, + const TQString &entry) const { if (d->recolour) return KGlobalSettings::textColor(); @@ -665,41 +665,41 @@ QColor KSim::Theme::textColour(const QString &itemType, return readColourEntry(itemType, entry, 0); } -int KSim::Theme::readIntEntry(const QString &itemType, - const QString &entry) const +int KSim::Theme::readIntEntry(const TQString &itemType, + const TQString &entry) const { - QString entryName = itemType + " " + entry; + TQString entryName = itemType + " " + entry; return internalNumEntry(entryName, 0); } -QRect KSim::Theme::readRectEntry(const QString &itemType, - const QString &entry) const +TQRect KSim::Theme::readRectEntry(const TQString &itemType, + const TQString &entry) const { - QString entryName = itemType + " " + entry; - return internalRectEntry(entryName, QRect()); + TQString entryName = itemType + " " + entry; + return internalRectEntry(entryName, TQRect()); } -QString KSim::Theme::readEntry(const QString &itemType, - const QString &entry) const +TQString KSim::Theme::readEntry(const TQString &itemType, + const TQString &entry) const { - QString entryName = itemType + " " + entry; - return internalStringEntry(entryName, QString::null); + TQString entryName = itemType + " " + entry; + return internalStringEntry(entryName, TQString::null); } -QString KSim::Theme::readColourEntry(const QString &itemType, - const QString &entry, int row) const +TQString KSim::Theme::readColourEntry(const TQString &itemType, + const TQString &entry, int row) const { - QString color = readEntry(itemType, entry); + TQString color = readEntry(itemType, entry); if (color.isEmpty()) - color = QString::fromLatin1("#ffffff #ffffff"); + color = TQString::fromLatin1("#ffffff #ffffff"); - return QStringList::split(' ', color)[row]; + return TQStringList::split(' ', color)[row]; } -QFont KSim::Theme::readFontEntry(const QString &itemType, - const QString &entry) const +TQFont KSim::Theme::readFontEntry(const TQString &itemType, + const TQString &entry) const { - const QString &font = readEntry(itemType, entry); + const TQString &font = readEntry(itemType, entry); // If only there was a better way of doing this if (font == "small_font") @@ -711,13 +711,13 @@ QFont KSim::Theme::readFontEntry(const QString &itemType, if (font == "large_font") return largeFont(); - return QFont(); + return TQFont(); } -bool KSim::Theme::fontColours(int type, const QString &string, QFont &font, - QColor &text, QColor &shadow, bool &showShadow) const +bool KSim::Theme::fontColours(int type, const TQString &string, TQFont &font, + TQColor &text, TQColor &shadow, bool &showShadow) const { - QString key = KSim::Types::typeToString(type, false); + TQString key = KSim::Types::typeToString(type, false); bool repaint = false; // set colours from the string 'key' @@ -747,8 +747,8 @@ bool KSim::Theme::fontColours(int type, const QString &string, QFont &font, return repaint; } -bool KSim::Theme::fontColours(const KSim::Base *const base, QFont &font, - QColor &text, QColor &shadow, bool &showShadow) const +bool KSim::Theme::fontColours(const KSim::Base *const base, TQFont &font, + TQColor &text, TQColor &shadow, bool &showShadow) const { if (!base) return false; @@ -762,8 +762,8 @@ KSim::Theme::Theme() d = 0; } -KSim::Theme::Theme(const QString &url, const QString &fileName, int alt, - const QValueVector<QString> &vector, const QStringList &list, +KSim::Theme::Theme(const TQString &url, const TQString &fileName, int alt, + const TQValueVector<TQString> &vector, const TQStringList &list, KConfig *globalReader) { create(vector, list, globalReader); @@ -773,45 +773,45 @@ KSim::Theme::Theme(const QString &url, const QString &fileName, int alt, d->recolour = KSim::Config::config()->readBoolEntry("ReColourTheme", false); } -void KSim::Theme::create(const QValueVector<QString> &vector, - const QStringList &list, KConfig *globalReader) +void KSim::Theme::create(const TQValueVector<TQString> &vector, + const TQStringList &list, KConfig *globalReader) { d = new Private(vector, list); d->globalReader = globalReader; } -void KSim::Theme::init(const QString &url, const QString &fileName, int alt) +void KSim::Theme::init(const TQString &url, const TQString &fileName, int alt) { d->altTheme = KSim::ThemeLoader::alternativeAsString(alt); d->location = url; d->alternative = alt; d->font = KSim::ThemeLoader::currentFontItem(); - d->file = QStringList::split("\n", parseConfig(url, fileName)); + d->file = TQStringList::split("\n", parseConfig(url, fileName)); if (alt != 0) - d->dFile = QStringList::split("\n", parseConfig(url, "gkrellmrc")); + d->dFile = TQStringList::split("\n", parseConfig(url, "gkrellmrc")); } -void KSim::Theme::reparse(const QString &url, const QString &fileName, int alt) +void KSim::Theme::reparse(const TQString &url, const TQString &fileName, int alt) { init(url, fileName, alt); } -QString KSim::Theme::parseConfig(const QString &url, - const QString &fileName) +TQString KSim::Theme::parseConfig(const TQString &url, + const TQString &fileName) { return KSim::ThemeLoader::self().parseConfig(url, fileName); } -QString KSim::Theme::loader(int value, bool useDefault) const +TQString KSim::Theme::loader(int value, bool useDefault) const { - QString text; - QString file = d->fileNames[value]; + TQString text; + TQString file = d->fileNames[value]; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -823,7 +823,7 @@ QString KSim::Theme::loader(int value, bool useDefault) const return text; } -QString KSim::Theme::createType(int type, const QString &text) const +TQString KSim::Theme::createType(int type, const TQString &text) const { if (type == Types::None) return text; @@ -841,37 +841,37 @@ void KSim::Theme::setRecolour(bool value) // Keep the ugliness here to make the rest // of the class readable -int KSim::Theme::internalNumEntry(const QString &entry, int defValue) const +int KSim::Theme::internalNumEntry(const TQString &entry, int defValue) const { - return d->readOption(entry, true, QString::number(defValue)).toInt(); + return d->readOption(entry, true, TQString::number(defValue)).toInt(); } -QRect KSim::Theme::internalRectEntry(const QString &entry, - const QRect &defValue) const +TQRect KSim::Theme::internalRectEntry(const TQString &entry, + const TQRect &defValue) const { - QString rect; - rect += QString::number(defValue.left()); + TQString rect; + rect += TQString::number(defValue.left()); rect += ","; - rect += QString::number(defValue.top()); + rect += TQString::number(defValue.top()); rect += ","; - rect += QString::number(defValue.width()); + rect += TQString::number(defValue.width()); rect += ","; - rect += QString::number(defValue.height()); + rect += TQString::number(defValue.height()); - QStringList list = QStringList::split(",", d->readOption(entry, true, rect)); - QRect rect2(list[0].toInt(), list[1].toInt(), list[2].toInt(), list[3].toInt()); + TQStringList list = TQStringList::split(",", d->readOption(entry, true, rect)); + TQRect rect2(list[0].toInt(), list[1].toInt(), list[2].toInt(), list[3].toInt()); return rect2; } -QColor KSim::Theme::internalColourEntry(const QString &entry, - const QColor &defValue) const +TQColor KSim::Theme::internalColourEntry(const TQString &entry, + const TQColor &defValue) const { return d->readOption(entry, true, defValue.name()); } -QString KSim::Theme::internalStringEntry(const QString &entry, - const QString &defValue) const +TQString KSim::Theme::internalStringEntry(const TQString &entry, + const TQString &defValue) const { return d->readOption(entry, true, defValue); } @@ -927,7 +927,7 @@ void KSim::ThemeLoader::reload() if (m_theme.d) m_theme.d->globalReader = d->globalReader; - QString fileName = QString::fromLatin1("gkrellmrc") + alternativeAsString(); + TQString fileName = TQString::fromLatin1("gkrellmrc") + alternativeAsString(); m_theme.reparse(currentUrl(), fileName, currentAlternative()); } @@ -936,20 +936,20 @@ const KSim::Theme &KSim::ThemeLoader::current() const return m_theme; } -KSim::Theme KSim::ThemeLoader::theme(const QString &url, - const QString &rcFile, int alt) const +KSim::Theme KSim::ThemeLoader::theme(const TQString &url, + const TQString &rcFile, int alt) const { return KSim::Theme(url, rcFile, alt, d->fileNames, d->imageTypes, d->globalReader); } -void KSim::ThemeLoader::reColourImage(QImage &image) +void KSim::ThemeLoader::reColourImage(TQImage &image) { if (!d->recolour || image.isNull()) return; - QColor color = QApplication::palette().active().background(); - QImage output(image.width(), image.height(), 32); + TQColor color = TQApplication::palette().active().background(); + TQImage output(image.width(), image.height(), 32); output.setAlphaBuffer(image.hasAlphaBuffer()); Q_UINT32 r = color.red(); @@ -980,22 +980,22 @@ void KSim::ThemeLoader::reColourImage(QImage &image) image = output; } -QString KSim::ThemeLoader::parseConfig(const QString &url, - const QString &fileName) +TQString KSim::ThemeLoader::parseConfig(const TQString &url, + const TQString &fileName) { - QFile origFile(url + fileName); + TQFile origFile(url + fileName); if (!origFile.open(IO_ReadOnly)) - return QString::null; - - QTextStream origStream(&origFile); - QString text; - QRegExp reg("\\*"); // regexp for '*' chars - QRegExp number("[0-9]+"); // regexp for all numbers - QRegExp numbers("[0-9]+,[0-9]+,[0-9]+,[0-9]+"); // regexp for int,int,int,int - QRegExp minus("[a-zA-Z]+ \\- [a-zA-Z]+"); // regexp for 'someText - someText' + return TQString::null; + + TQTextStream origStream(&origFile); + TQString text; + TQRegExp reg("\\*"); // regexp for '*' chars + TQRegExp number("[0-9]+"); // regexp for all numbers + TQRegExp numbers("[0-9]+,[0-9]+,[0-9]+,[0-9]+"); // regexp for int,int,int,int + TQRegExp minus("[a-zA-Z]+ \\- [a-zA-Z]+"); // regexp for 'someText - someText' while (!origStream.atEnd()) { - QString line(origStream.readLine().simplifyWhiteSpace()); + TQString line(origStream.readLine().simplifyWhiteSpace()); if (line.find(reg) == 0) // find the location of the * comments // replace all * comments with # comments so KConfig doesn't complain @@ -1016,7 +1016,7 @@ QString KSim::ThemeLoader::parseConfig(const QString &url, numLoc = line.findRev(minus); if (numLoc != -1) // replace the '-' with an '=' so KConfig doesn't get confused - line.replace(QRegExp("-"), "="); + line.replace(TQRegExp("-"), "="); } } @@ -1030,50 +1030,50 @@ QString KSim::ThemeLoader::parseConfig(const QString &url, // so the following code changes the dir structure // of a theme to be more consistant, but the dir structure // is still compliant with GKrellM. -void KSim::ThemeLoader::parseDir(const QString &url, int alt) +void KSim::ThemeLoader::parseDir(const TQString &url, int alt) { - if ( !QFileInfo( url ).isWritable() && currentName() != "ksim" ) + if ( !TQFileInfo( url ).isWritable() && currentName() != "ksim" ) { - QString homePath = QDir::current().path(); + TQString homePath = TQDir::current().path(); homePath = locateLocal( "data", "ksim" ) - + QString::fromLatin1( "/themes" ) + + TQString::fromLatin1( "/themes" ) + homePath.right( homePath.length() - - homePath.findRev( QRegExp( "\\/" ), + - homePath.findRev( TQRegExp( "\\/" ), homePath.length() ) ); - if ( !QFile::exists( homePath ) ) + if ( !TQFile::exists( homePath ) ) KStandardDirs::makeDir( homePath ); kdWarning() << "Cant write to current dir, setting dir to " << homePath << endl; - QDir::setCurrent( homePath ); + TQDir::setCurrent( homePath ); } int alternatives = ++alt; - QStringList formats; - QStringList panels; - QStringList meters; + TQStringList formats; + TQStringList panels; + TQStringList meters; formats << "png" << "jpg" << "jpeg" << "gif" << "xpm"; panels << "inet" << "net" << "proc" << "cpu" << "disk"; meters << "mem" << "fs" << "mail" << "apm" << "uptime" << "clock" << "cal" << "timer" << "host" << "swap"; - QDir directory; + TQDir directory; for (int i = 0; i < alternatives; ++i) { - QString altString = KSim::ThemeLoader::alternativeAsString(i); + TQString altString = KSim::ThemeLoader::alternativeAsString(i); if (alternatives == 1 || i == 0) - altString = QString::null; + altString = TQString::null; - QStringList::ConstIterator format; + TQStringList::ConstIterator format; for (format = formats.begin(); format != formats.end(); ++format) { // go through the meters array and move the files to the correct dir/filename - QStringList::Iterator meter; + TQStringList::Iterator meter; for (meter = meters.begin(); meter != meters.end(); ++meter) { - QString bgMeter = QString::fromLatin1("bg_meter_"); - if (QFile::exists(bgMeter + (*meter) + altString + "." + (*format))) { + TQString bgMeter = TQString::fromLatin1("bg_meter_"); + if (TQFile::exists(bgMeter + (*meter) + altString + "." + (*format))) { if (KStandardDirs::makeDir(url + (*meter))) directory.rename(bgMeter + (*meter) + altString + "." + (*format), (*meter) + "/bg_meter" + altString + "." + (*format)); @@ -1081,10 +1081,10 @@ void KSim::ThemeLoader::parseDir(const QString &url, int alt) } // go through the panels array and move the files to the correct dir/filename - QStringList::ConstIterator panel; + TQStringList::ConstIterator panel; for (panel = panels.begin(); panel != panels.end(); ++panel) { - QString bgPanel = QString::fromLatin1("bg_panel_"); - if (QFile::exists(bgPanel + (*panel) + altString + "." + (*format))) { + TQString bgPanel = TQString::fromLatin1("bg_panel_"); + if (TQFile::exists(bgPanel + (*panel) + altString + "." + (*format))) { if (KStandardDirs::makeDir(url + (*panel))) directory.rename(bgPanel + (*panel) + altString + "." + (*format), (*panel) + "/bg_panel" + altString + "." + (*format)); @@ -1092,14 +1092,14 @@ void KSim::ThemeLoader::parseDir(const QString &url, int alt) } // fix stupid themes that have a bg_panel image in the host dir - QString tempFile = QString::fromLatin1("host/bg_panel"); - if (QFile::exists(tempFile + altString + "." + (*format))) + TQString tempFile = TQString::fromLatin1("host/bg_panel"); + if (TQFile::exists(tempFile + altString + "." + (*format))) directory.rename(tempFile + altString + "." + (*format), "host/bg_meter" + altString + "." + (*format)); // move decal_net_leds* to the net folder to be more consistant - tempFile = QString::fromLatin1("decal_net_leds"); - if (QFile::exists(tempFile + altString + "." + (*format))) { + tempFile = TQString::fromLatin1("decal_net_leds"); + if (TQFile::exists(tempFile + altString + "." + (*format))) { if (KStandardDirs::makeDir(url + "net")) directory.rename(tempFile + altString + "." + (*format), "net/decal_net_leds" + altString + "." + (*format)); @@ -1110,7 +1110,7 @@ void KSim::ThemeLoader::parseDir(const QString &url, int alt) void KSim::ThemeLoader::validate() { - if (!QFile::exists(currentUrl())) { + if (!TQFile::exists(currentUrl())) { KSim::Config::config()->setGroup("Theme"); KSim::Config::config()->writeEntry("Name", "ksim"); KSim::Config::config()->writeEntry("Alternative", 0); @@ -1118,29 +1118,29 @@ void KSim::ThemeLoader::validate() } } -void KSim::ThemeLoader::themeColours(QWidget *widget) +void KSim::ThemeLoader::themeColours(TQWidget *widget) { widget->setEraseColor(d->pixelColour); } -QString KSim::ThemeLoader::currentName() +TQString KSim::ThemeLoader::currentName() { KSim::Config::config()->setGroup("Theme"); return KSim::Config::config()->readEntry("Name", "ksim"); } -QString KSim::ThemeLoader::currentUrl() +TQString KSim::ThemeLoader::currentUrl() { KSim::Config::config()->setGroup("Theme"); - QString folder(KSim::Config::config()->readEntry("Name")); + TQString folder(KSim::Config::config()->readEntry("Name")); folder.prepend("ksim/themes/").append("/"); - QString dirName(KGlobal::dirs()->findResourceDir("data", folder)); + TQString dirName(KGlobal::dirs()->findResourceDir("data", folder)); dirName += folder; return dirName; } -QString KSim::ThemeLoader::defaultUrl() +TQString KSim::ThemeLoader::defaultUrl() { return KGlobal::dirs()->findDirs("data", "ksim/themes/ksim").first(); } @@ -1156,14 +1156,14 @@ int KSim::ThemeLoader::currentAlternative() return alternative; } -QString KSim::ThemeLoader::alternativeAsString(int alt) +TQString KSim::ThemeLoader::alternativeAsString(int alt) { int alternative = (alt == -1 ? currentAlternative() : alt); - return (alternative == 0 ? QString::null : QString::fromLatin1("_") - + QString::number(alternative)); + return (alternative == 0 ? TQString::null : TQString::fromLatin1("_") + + TQString::number(alternative)); } -QFont KSim::ThemeLoader::currentFont() +TQFont KSim::ThemeLoader::currentFont() { if (currentFontItem() != 3) return self().current().currentFont(); @@ -1225,7 +1225,7 @@ KSim::ThemeLoader::ThemeLoader() m_theme.create(d->fileNames, d->imageTypes, d->globalReader); - QString fileName = QString::fromLatin1("gkrellmrc") + alternativeAsString(); + TQString fileName = TQString::fromLatin1("gkrellmrc") + alternativeAsString(); m_theme.init(currentUrl(), fileName, currentAlternative()); reColourItems(); @@ -1257,10 +1257,10 @@ void KSim::ThemeLoader::reColourItems() void KSim::ThemeLoader::grabColour() { KSim::Config::config()->setGroup("Theme"); - QPoint pos(2, 2); + TQPoint pos(2, 2); pos = KSim::Config::config()->readPointEntry("PixelLocation", &pos); - QImage image(current().meterPixmap(Types::None)); + TQImage image(current().meterPixmap(Types::None)); reColourImage(image); d->pixelColour = image.pixel(pos.x(), pos.y()); } diff --git a/ksim/library/themeloader.h b/ksim/library/themeloader.h index c20afe0..28a38e6 100644 --- a/ksim/library/themeloader.h +++ b/ksim/library/themeloader.h @@ -20,11 +20,11 @@ #ifndef THEMELOADER_H #define THEMELOADER_H -#include <qstring.h> -#include <qrect.h> -#include <qcolor.h> -#include <qfont.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqrect.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqvaluelist.h> #include <kdemacros.h> @@ -56,15 +56,15 @@ namespace KSim /** * @return the theme path */ - const QString &path() const; + const TQString &path() const; /** * @return the name of the theme */ - QString name() const; + TQString name() const; /** * @return the author of the theme */ - QString author() const; + TQString author() const; /** * @return the set font item for the theme */ @@ -105,35 +105,35 @@ namespace KSim /** * @return a rect of the top frame border */ - QRect frameTopBorder(const QRect &defValue = QRect()) const; + TQRect frameTopBorder(const TQRect &defValue = TQRect()) const; /** * @return a rect of the bottom frame border */ - QRect frameBottomBorder(const QRect &defValue = QRect()) const; + TQRect frameBottomBorder(const TQRect &defValue = TQRect()) const; /** * @return a rect of the left frame border */ - QRect frameLeftBorder(const QRect &defValue = QRect()) const; + TQRect frameLeftBorder(const TQRect &defValue = TQRect()) const; /** * @return a rect of the right frame border */ - QRect frameRightBorder(const QRect &defValue = QRect()) const; + TQRect frameRightBorder(const TQRect &defValue = TQRect()) const; /** * @return the color of the chart in */ - QColor chartInColour(const QColor &defValue = QColor()) const; + TQColor chartInColour(const TQColor &defValue = TQColor()) const; /** * @return the color of the chart in grid */ - QColor chartInColourGrid(const QColor &defValue = QColor()) const; + TQColor chartInColourGrid(const TQColor &defValue = TQColor()) const; /** * @return the color of the chart out */ - QColor chartOutColour(const QColor &defValue = QColor()) const; + TQColor chartOutColour(const TQColor &defValue = TQColor()) const; /** * @return the color of the chart out grid */ - QColor chartOutColourGrid(const QColor &defValue = QColor()) const; + TQColor chartOutColourGrid(const TQColor &defValue = TQColor()) const; /** * if false then the grid lines should be drawn at the * top and bottom of the graphs @@ -174,40 +174,40 @@ namespace KSim /** * @return the area for the slider panel */ - QRect sliderPanel(const QRect &defValue = QRect()) const; + TQRect sliderPanel(const TQRect &defValue = TQRect()) const; /** * @return the area for the slider meter */ - QRect sliderMeter(const QRect &defValue = QRect()) const; + TQRect sliderMeter(const TQRect &defValue = TQRect()) const; /** * @return the border for the timer label/button */ - QRect timerBorder(const QRect &defValue = QRect()) const; + TQRect timerBorder(const TQRect &defValue = TQRect()) const; /** * @return the border for the panel button */ - QRect buttonPanelBorder(const QRect &defValue = QRect()) const; + TQRect buttonPanelBorder(const TQRect &defValue = TQRect()) const; /** * @return the border for the meter button */ - QRect buttonMeterBorder(const QRect &defValue = QRect()) const; + TQRect buttonMeterBorder(const TQRect &defValue = TQRect()) const; /** * @return the large font that the theme specifies */ - QFont largeFont() const; + TQFont largeFont() const; /** * @return the normal font that the theme specifies */ - QFont normalFont() const; + TQFont normalFont() const; /** * @return the small font that the theme specifies */ - QFont smallFont() const; + TQFont smallFont() const; /** * @return the current font to be used * according to fontItem() */ - QFont currentFont() const; + TQFont currentFont() const; /** * @return the meter image (bg_meter.[png|jpg|gif]) * of the current theme, if type is specified then it will @@ -218,14 +218,14 @@ namespace KSim * @param type is one of: none, apm, cal, clock, fs, * host, mail, mem, swap, timer, uptime */ - QString meterPixmap(int type, bool useDefault = true) const; + TQString meterPixmap(int type, bool useDefault = true) const; /** * @return the meter image (bg_panel.[png|jpg|gif]) * of the current theme, it will first look in the dir 'type' * if no image is found it will drop back a dir * @param type is one of: net, inet */ - QString panelPixmap(int type, bool useDefault = true) const; + TQString panelPixmap(int type, bool useDefault = true) const; /** * @return the decal net leds image * (usually decal_net_leds.[png|jpg|gif]) of the @@ -233,57 +233,57 @@ namespace KSim * if no image is found it will drop back a dir * @param type is one of: net, inet */ - QString ledPixmap(int type, bool useDefault = true) const; + TQString ledPixmap(int type, bool useDefault = true) const; /** * @return the frame image of the current theme, * @param type is one of: top, bottom, left, right */ - QString framePixmap(int type, bool useDefault = true) const; + TQString framePixmap(int type, bool useDefault = true) const; /** * @return the krell chart image (bg_chart.[png|jpg|gif]) * of the current theme */ - QString chartPixmap(bool useDefault = true) const; + TQString chartPixmap(bool useDefault = true) const; /** * @return the krell grid image (bg_grid.[png|jpg|gif]) * of the current theme */ - QString gridPixmap(bool useDefault = true) const; + TQString gridPixmap(bool useDefault = true) const; /** * @return the krell panel image (krell_panel.[png|jpg|gif]) * of the current theme */ - QString krellPanelPixmap(bool useDefault = true) const; + TQString krellPanelPixmap(bool useDefault = true) const; /** * @return the krell meter image (krell_meter.[png|jpg|gif]) * of the current theme */ - QString krellMeterPixmap(bool useDefault = true) const; + TQString krellMeterPixmap(bool useDefault = true) const; /** * @return the krell slider image (krell_slider.[png|jpg|gif]) * of the current theme */ - QString krellSliderPixmap(bool useDefault = true) const; + TQString krellSliderPixmap(bool useDefault = true) const; /** * @return the data in image (data_in.[png|jpg|gif]) * of the current theme */ - QString dataInPixmap(bool useDefault = true) const; + TQString dataInPixmap(bool useDefault = true) const; /** * @return the data out image (data_out.[png|jpg|gif]) * of the current theme */ - QString dataOutPixmap(bool useDefault = true) const; + TQString dataOutPixmap(bool useDefault = true) const; /** * @return the mail image (mail/decal_mail.[png|jpg|gif]) * of the current theme */ - QString mailPixmap(bool useDefault = true) const; + TQString mailPixmap(bool useDefault = true) const; /** * @return a segmant of an image, using @p itemNo to * get the segmant and from the ImageType @p type */ - QPixmap splitPixmap(PixmapType type, uint itemNo = 0, + TQPixmap splitPixmap(PixmapType type, uint itemNo = 0, bool useDefault = true) const; /** * Same as the above function but returns an array of pixmaps @@ -291,44 +291,44 @@ namespace KSim * limitAmount is -1 (default) * @return an array of pixmaps */ - QValueList<QPixmap> pixmapToList(PixmapType type, + TQValueList<TQPixmap> pixmapToList(PixmapType type, int limitAmount = -1, bool useDefault = true) const; /** * returns the transparency level from the specified keys */ - int transparency(const QString &, const QString &) const; + int transparency(const TQString &, const TQString &) const; /** * @return true if shadow text is enabled */ - bool textShadow(const QString &, const QString &) const; + bool textShadow(const TQString &, const TQString &) const; /** * @return the shadow color (if any) for the specified keys */ - QColor shadowColour(const QString &, const QString &) const; + TQColor shadowColour(const TQString &, const TQString &) const; /** * @return the text color for the specified keys */ - QColor textColour(const QString &, const QString &) const; + TQColor textColour(const TQString &, const TQString &) const; /** * reads an entry and returns it as an int */ - int readIntEntry(const QString &, const QString &) const; + int readIntEntry(const TQString &, const TQString &) const; /** * @return a rect from the specified keys */ - QRect readRectEntry(const QString &, const QString &) const; + TQRect readRectEntry(const TQString &, const TQString &) const; /** * reads an entry from the specified keys */ - QString readEntry(const QString &, const QString &) const; + TQString readEntry(const TQString &, const TQString &) const; /** * reads a color entry from the specified keys */ - QString readColourEntry(const QString &, const QString &, int) const; + TQString readColourEntry(const TQString &, const TQString &, int) const; /** * reads a font entry from the specified keys */ - QFont readFontEntry(const QString &, const QString &) const; + TQFont readFontEntry(const TQString &, const TQString &) const; /** * sets the font, textColour, shadowColour and showShadow to * the fonts and colours KSim should use depending on type and @@ -340,8 +340,8 @@ namespace KSim * * example usage: * <pre> - * QFont font; - * QColor textColour, shadowColour; + * TQFont font; + * TQColor textColour, shadowColour; * bool showShadow; * if (KSim::ThemeLoader::self().current().fontColours(type(), configString(), font, * textColour, shadowColour, showShadow) @@ -356,35 +356,35 @@ namespace KSim * from, generally if you're calling this from a KSim::Base (or derived from) * object then use configString() */ - bool fontColours(int type, const QString &string, QFont &font, - QColor &textColour, QColor &shadowColour, bool &showShadow) const; + bool fontColours(int type, const TQString &string, TQFont &font, + TQColor &textColour, TQColor &shadowColour, bool &showShadow) const; /** * convenience function. * * collects the theme type and config key from the base pointer */ - bool fontColours(const KSim::Base *const base, QFont &font, - QColor &textColour, QColor &shadowColour, bool &showShadow) const; + bool fontColours(const KSim::Base *const base, TQFont &font, + TQColor &textColour, TQColor &shadowColour, bool &showShadow) const; Theme(const KSim::Theme &); private: Theme(); - Theme(const QString &url, const QString &fileName, int alt, - const QValueVector<QString> &vector, const QStringList &list, + Theme(const TQString &url, const TQString &fileName, int alt, + const TQValueVector<TQString> &vector, const TQStringList &list, KConfig *globalReader); - void create(const QValueVector<QString> &, const QStringList &, KConfig *); - void init(const QString &url, const QString &fileName, int alt); - void reparse(const QString &url, const QString &fileName, int alt); - QString parseConfig(const QString &, const QString &); - QString loader(int, bool useDefault = true) const; - QString createType(int, const QString &) const; + void create(const TQValueVector<TQString> &, const TQStringList &, KConfig *); + void init(const TQString &url, const TQString &fileName, int alt); + void reparse(const TQString &url, const TQString &fileName, int alt); + TQString parseConfig(const TQString &, const TQString &); + TQString loader(int, bool useDefault = true) const; + TQString createType(int, const TQString &) const; void setRecolour(bool); - int internalNumEntry(const QString &, int) const; - QRect internalRectEntry(const QString &, const QRect &) const; - QColor internalColourEntry(const QString &, const QColor &) const; - QString internalStringEntry(const QString &, const QString &) const; + int internalNumEntry(const TQString &, int) const; + TQRect internalRectEntry(const TQString &, const TQRect &) const; + TQColor internalColourEntry(const TQString &, const TQColor &) const; + TQString internalStringEntry(const TQString &, const TQString &) const; class Private; Private *d; @@ -422,24 +422,24 @@ namespace KSim * @param rcFile is the filename of the config file (optional) * @param alt is the theme alternative number (optional) */ - KSim::Theme theme(const QString &url, - const QString &rcFile = "gkrellmrc", int alt = 0) const; + KSim::Theme theme(const TQString &url, + const TQString &rcFile = "gkrellmrc", int alt = 0) const; /** * re-colours an image to the current KDE * color scheme */ - void reColourImage(QImage &image); + void reColourImage(TQImage &image); /** * changes some of the entries in the config file so kconfig * can handle the file better. * @return the location of the config file */ - QString parseConfig(const QString &url, const QString &file); + TQString parseConfig(const TQString &url, const TQString &file); /** * change the dir structure of a theme directory * so KSim can understand them better */ - void parseDir(const QString &url, int alt); + void parseDir(const TQString &url, int alt); /** * checks if the themeUrl entry is valid, * if not it then reverts the current theme @@ -449,20 +449,20 @@ namespace KSim /** * sets the pallete of the current theme */ - void themeColours(QWidget *); + void themeColours(TQWidget *); /** * @return current theme name */ - static QString currentName(); + static TQString currentName(); /** * @return current theme url, if there is no current theme * then it will return the default theme */ - static QString currentUrl(); + static TQString currentUrl(); /** * @return the default theme url */ - static QString defaultUrl(); + static TQString defaultUrl(); /** * @return the current theme alternative */ @@ -475,11 +475,11 @@ namespace KSim * if this is set to -1 (the default) then the current alternative * will be used */ - static QString alternativeAsString(int alt = -1); + static TQString alternativeAsString(int alt = -1); /** * @return the font of the theme if the theme font is set to custom */ - static QFont currentFont(); + static TQFont currentFont(); /** * @return the font item of the theme, eg: 0 would be the small font */ diff --git a/ksim/library/themetypes.h b/ksim/library/themetypes.h index 805302c..0f34fbf 100644 --- a/ksim/library/themetypes.h +++ b/ksim/library/themetypes.h @@ -58,10 +58,10 @@ namespace KSim /** * @return the ThemeType enum as a QString */ - inline QString typeToString(int type, bool incSlash = true) + inline TQString typeToString(int type, bool incSlash = true) { if (type == Types::None) - return QString::null; + return TQString::null; // This array MUST be in the same order // as the ThemeType enum @@ -72,9 +72,9 @@ namespace KSim "uptime", "net", "inet", 0 }; - QString returnString; + TQString returnString; returnString.setLatin1(typeNames[type]); - return incSlash ? returnString + QString::fromLatin1("/") : returnString; + return incSlash ? returnString + TQString::fromLatin1("/") : returnString; } } } |