diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:49:52 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:49:52 +0000 |
commit | cfc42a28c327b96c6a2afee92af3bac1a479eb8a (patch) | |
tree | e3219edf5f827eaa4db3feb509a17846a1a5a752 /ktux | |
parent | a73fc4d7e66fe0824313aa4e9a650c4cddef6e9f (diff) | |
download | tdetoys-cfc42a28c327b96c6a2afee92af3bac1a479eb8a.tar.gz tdetoys-cfc42a28c327b96c6a2afee92af3bac1a479eb8a.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1157650 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ktux')
-rw-r--r-- | ktux/sprite.cpp | 62 | ||||
-rw-r--r-- | ktux/sprite.h | 22 | ||||
-rw-r--r-- | ktux/spriteanim.cpp | 16 | ||||
-rw-r--r-- | ktux/spriteanim.h | 20 | ||||
-rw-r--r-- | ktux/spritemisc.cpp | 10 | ||||
-rw-r--r-- | ktux/spritemisc.h | 16 | ||||
-rw-r--r-- | ktux/spritepm.cpp | 30 | ||||
-rw-r--r-- | ktux/spritepm.h | 24 |
8 files changed, 100 insertions, 100 deletions
diff --git a/ktux/sprite.cpp b/ktux/sprite.cpp index 205c754..85be229 100644 --- a/ktux/sprite.cpp +++ b/ktux/sprite.cpp @@ -1,16 +1,16 @@ //----------------------------------------------------------------------------- // -// KTux - QCanvas based screensaver +// KTux - TQCanvas based screensaver // // Copyright (c) Martin R. Jones 1999 // #include <stdlib.h> #include <time.h> -#include <qlabel.h> -#include <qmessagebox.h> -#include <qlayout.h> -#include <qslider.h> +#include <tqlabel.h> +#include <tqmessagebox.h> +#include <tqlayout.h> +#include <tqslider.h> #include <kstandarddirs.h> #include <klocale.h> #include <kdebug.h> @@ -35,7 +35,7 @@ extern "C" return new KSpriteSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new KSpriteSetup(); } @@ -43,8 +43,8 @@ extern "C" //----------------------------------------------------------------------------- -KSpriteSetup::KSpriteSetup( QWidget *parent, const char *name ) - : QDialog( parent, name, TRUE ) +KSpriteSetup::KSpriteSetup( TQWidget *parent, const char *name ) + : TQDialog( parent, name, TRUE ) { KGlobal::locale()->insertCatalogue("ktux"); saver = 0; @@ -53,22 +53,22 @@ KSpriteSetup::KSpriteSetup( QWidget *parent, const char *name ) setCaption(i18n("Setup KTux") ); - QVBoxLayout *tl = new QVBoxLayout(this, 10, 10); - QHBoxLayout *tl1 = new QHBoxLayout; + TQVBoxLayout *tl = new TQVBoxLayout(this, 10, 10); + TQHBoxLayout *tl1 = new QHBoxLayout; tl->addLayout(tl1); - QVBoxLayout *tl11 = new QVBoxLayout(5); + TQVBoxLayout *tl11 = new TQVBoxLayout(5); tl1->addLayout(tl11); - QLabel *label = new QLabel( i18n("Speed:"), this ); + TQLabel *label = new TQLabel( i18n("Speed:"), this ); label->setMinimumSize(label->sizeHint()); tl11->addStretch(1); tl11->addWidget(label); - QSlider *sb = new QSlider(0, 100, 10, speed, QSlider::Horizontal, this ); + TQSlider *sb = new TQSlider(0, 100, 10, speed, TQSlider::Horizontal, this ); tl11->addWidget(sb); - connect( sb, SIGNAL( valueChanged( int ) ), SLOT( slotSpeed( int ) ) ); + connect( sb, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotSpeed( int ) ) ); - preview = new QWidget( this ); + preview = new TQWidget( this ); preview->setFixedSize( 220, 170 ); preview->setBackgroundColor( black ); preview->show(); // otherwise saver does not get correct size @@ -76,15 +76,15 @@ KSpriteSetup::KSpriteSetup( QWidget *parent, const char *name ) tl1->addWidget(preview); KButtonBox *bbox = new KButtonBox(this); - QButton *button = bbox->addButton( i18n("About")); - connect( button, SIGNAL( clicked() ), SLOT(slotAbout() ) ); + TQButton *button = bbox->addButton( i18n("About")); + connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT(slotAbout() ) ); bbox->addStretch(1); button = bbox->addButton( KStdGuiItem::ok()); - connect( button, SIGNAL( clicked() ), SLOT( slotOkPressed() ) ); + connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( slotOkPressed() ) ); button = bbox->addButton(KStdGuiItem::cancel()); - connect( button, SIGNAL( clicked() ), SLOT( reject() ) ); + connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) ); bbox->layout(); tl->addWidget(bbox); @@ -128,7 +128,7 @@ void KSpriteSetup::slotOkPressed() void KSpriteSetup::slotAbout() { - QMessageBox::message(i18n("About KTux"), + TQMessageBox::message(i18n("About KTux"), i18n("KTux Version 1.0\n\nWritten by Martin R. Jones 1999\nmjones@kde.org"), i18n("OK")); } @@ -144,7 +144,7 @@ KSpriteSaver::KSpriteSaver( WId id ) : KScreenSaver( id ) readSettings(); blank(); - connect(&mTimer, SIGNAL(timeout()), SLOT(slotTimeout())); + connect(&mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout())); mTimer.start(120-mSpeed, true); } @@ -169,14 +169,14 @@ void KSpriteSaver::setSpeed(int speed) // void KSpriteSaver::readSettings() { - QString str; + TQString str; KConfig *config = KGlobal::config(); config->setGroup("Settings"); mSpeed = config->readNumEntry("Speed", 50); - QString path = KGlobal::dirs()->findResourceDir( "sprite", "bg.png" ); + TQString path = KGlobal::dirs()->findResourceDir( "sprite", "bg.png" ); SpritePixmapManager::manager()->setPixmapDir(path); @@ -184,7 +184,7 @@ void KSpriteSaver::readSettings() KSimpleConfig *mConfig = new KSimpleConfig(path, true); mConfig->setGroup("Config"); - QStrList list; + TQStrList list; int groups = mConfig->readListEntry("Groups", list); mTimerIds.resize(groups); for (int i = 0; i < groups; i++) @@ -201,16 +201,16 @@ void KSpriteSaver::readSettings() //----------------------------------------------------------------------------- void KSpriteSaver::initialise() { - mCanvas = new QCanvas(); - QPixmap pm( locate("sprite", "bg.png") ); + mCanvas = new TQCanvas(); + TQPixmap pm( locate("sprite", "bg.png") ); mCanvas->setBackgroundPixmap( pm ); mCanvas->resize( width(), height() ); - mView = new QCanvasView(mCanvas); + mView = new TQCanvasView(mCanvas); mView->viewport()->setBackgroundColor( black ); mView->resize( size()); - mView->setFrameStyle( QFrame::NoFrame ); - mView->setVScrollBarMode( QScrollView::AlwaysOff ); - mView->setHScrollBarMode( QScrollView::AlwaysOff ); + mView->setFrameStyle( TQFrame::NoFrame ); + mView->setVScrollBarMode( TQScrollView::AlwaysOff ); + mView->setHScrollBarMode( TQScrollView::AlwaysOff ); embed( mView ); mView->show(); SpriteRange::setFieldSize(mView->size()); @@ -231,7 +231,7 @@ void KSpriteSaver::slotTimeout() } //----------------------------------------------------------------------------- -void KSpriteSaver::timerEvent(QTimerEvent *ev) +void KSpriteSaver::timerEvent(TQTimerEvent *ev) { for (unsigned i = 0; i < mTimerIds.size(); i++) { diff --git a/ktux/sprite.h b/ktux/sprite.h index d93e285..2414d68 100644 --- a/ktux/sprite.h +++ b/ktux/sprite.h @@ -1,6 +1,6 @@ //----------------------------------------------------------------------------- // -// ksprite - QCanvas based screensaver +// ksprite - TQCanvas based screensaver // // Copyright (c) Martin R. Jones 1996 // @@ -8,11 +8,11 @@ #ifndef __SPRITE_H__ #define __SPRITE_H__ -#include <qtimer.h> -#include <qpushbutton.h> -#include <qptrlist.h> -#include <qstrlist.h> -#include <qcanvas.h> +#include <tqtimer.h> +#include <tqpushbutton.h> +#include <tqptrlist.h> +#include <tqstrlist.h> +#include <tqcanvas.h> #include <kscreensaver.h> #include "spriteanim.h" @@ -35,22 +35,22 @@ protected slots: void slotTimeout(); protected: - virtual void timerEvent(QTimerEvent *); + virtual void timerEvent(TQTimerEvent *); protected: QCanvas *mCanvas; QCanvasView *mView; QTimer mTimer; int mSpeed; - QPtrList<SpriteGroup> mGroups; - QMemArray<int> mTimerIds; + TQPtrList<SpriteGroup> mGroups; + TQMemArray<int> mTimerIds; }; class KSpriteSetup : public QDialog { Q_OBJECT public: - KSpriteSetup( QWidget *parent = NULL, const char *name = NULL ); + KSpriteSetup( TQWidget *parent = NULL, const char *name = NULL ); ~KSpriteSetup(); protected: @@ -63,7 +63,7 @@ private slots: private: int speed; - QWidget *preview; + TQWidget *preview; KSpriteSaver *saver; }; diff --git a/ktux/spriteanim.cpp b/ktux/spriteanim.cpp index 2c21838..fdbcd00 100644 --- a/ktux/spriteanim.cpp +++ b/ktux/spriteanim.cpp @@ -14,8 +14,8 @@ // // SpriteObject stores the animations that create an object // -SpriteObject::SpriteObject(SpritePixmapSequence *seq, QCanvas *c ) - : QCanvasSprite(seq, c), +SpriteObject::SpriteObject(SpritePixmapSequence *seq, TQCanvas *c ) + : TQCanvasSprite(seq, c), mCycle(0), mLifeSpan(-1), mSeq(seq) @@ -39,7 +39,7 @@ void SpriteObject::age() void SpriteObject::setBounds( int x1, int y1, int x2, int y2 ) { - mBound = QRect( x1, y1, x2-x1, y2-y1 ); + mBound = TQRect( x1, y1, x2-x1, y2-y1 ); } bool SpriteObject::outOfBounds() const @@ -58,7 +58,7 @@ SpriteDef::SpriteDef(KConfigBase &config) } //--------------------------------------------------------------------------- -SpriteObject *SpriteDef::create( QCanvas *c ) +SpriteObject *SpriteDef::create( TQCanvas *c ) { SpriteObject *sprite = 0; if (mSeq) @@ -92,7 +92,7 @@ void SpriteDef::read(KConfigBase &config) mEndY.set(config.readEntry("EndY", "10000")); mLifeSpan = config.readNumEntry("LifeSpan", -1); mZ = config.readNumEntry("Z", 1); - QString animation = config.readEntry("Animation", ""); + TQString animation = config.readEntry("Animation", ""); mSeq = SpriteSequenceManager::manager()->load(config, animation); kdDebug() << "Set Z = " << mZ << endl; } @@ -101,7 +101,7 @@ void SpriteDef::read(KConfigBase &config) // // SpriteGroup // -SpriteGroup::SpriteGroup(QCanvas *c, KConfigBase &config) +SpriteGroup::SpriteGroup(TQCanvas *c, KConfigBase &config) : mCanvas(c) { mAvailable.setAutoDelete(true); @@ -112,7 +112,7 @@ SpriteGroup::SpriteGroup(QCanvas *c, KConfigBase &config) //--------------------------------------------------------------------------- void SpriteGroup::next() { - QPtrListIterator<SpriteObject> it(mActive); + TQPtrListIterator<SpriteObject> it(mActive); for (; it.current(); ++it) { @@ -148,7 +148,7 @@ void SpriteGroup::read(KConfigBase &config) mRefresh.set(config.readEntry("Refresh", "1000")); - QStrList anims; + TQStrList anims; config.readListEntry("Animations", anims); for (anims.first(); anims.current(); anims.next()) diff --git a/ktux/spriteanim.h b/ktux/spriteanim.h index 9d5417b..8be8a0e 100644 --- a/ktux/spriteanim.h +++ b/ktux/spriteanim.h @@ -12,11 +12,11 @@ #include <config.h> #endif -#include <qpixmap.h> -#include <qdict.h> -#include <qptrlist.h> -#include <qstrlist.h> -#include <qcanvas.h> +#include <tqpixmap.h> +#include <tqdict.h> +#include <tqptrlist.h> +#include <tqstrlist.h> +#include <tqcanvas.h> #include <kconfigbase.h> #include <ksimpleconfig.h> @@ -27,7 +27,7 @@ class SpriteObject : public QCanvasSprite { public: - SpriteObject(SpritePixmapSequence *seq, QCanvas *c); + SpriteObject(SpritePixmapSequence *seq, TQCanvas *c); void setLifeSpan(int l) { mLifeSpan = l; } void age(); @@ -51,7 +51,7 @@ class SpriteDef public: SpriteDef(KConfigBase &config); - SpriteObject *create( QCanvas *c ); + SpriteObject *create( TQCanvas *c ); protected: void read(KConfigBase &config); @@ -75,7 +75,7 @@ protected: class SpriteGroup { public: - SpriteGroup(QCanvas *c, KConfigBase &config); + SpriteGroup(TQCanvas *c, KConfigBase &config); void next(); void refresh(); @@ -85,8 +85,8 @@ protected: void read(KConfigBase &config); protected: - QPtrList<SpriteDef> mAvailable; - QPtrList<SpriteObject> mActive; + TQPtrList<SpriteDef> mAvailable; + TQPtrList<SpriteObject> mActive; int mCount; SpriteRange mRefresh; QCanvas *mCanvas; diff --git a/ktux/spritemisc.cpp b/ktux/spritemisc.cpp index f3a9a73..4b239a6 100644 --- a/ktux/spritemisc.cpp +++ b/ktux/spritemisc.cpp @@ -8,9 +8,9 @@ #include <kapplication.h> #include "spritemisc.h" -QSize SpriteRange::mFieldSize; +TQSize SpriteRange::mFieldSize; -SpriteRange::SpriteRange(const QString &str) +SpriteRange::SpriteRange(const TQString &str) { set(str); } @@ -27,7 +27,7 @@ int SpriteRange::random() const return val; } -void SpriteRange::set(const QString &str) +void SpriteRange::set(const TQString &str) { int r = str.find(".."); @@ -42,12 +42,12 @@ void SpriteRange::set(const QString &str) } } -void SpriteRange::setFieldSize(const QSize &size) +void SpriteRange::setFieldSize(const TQSize &size) { mFieldSize = size; } -int SpriteRange::parse(const QString &str) +int SpriteRange::parse(const TQString &str) { int val = 0; diff --git a/ktux/spritemisc.h b/ktux/spritemisc.h index 0a0d058..2034907 100644 --- a/ktux/spritemisc.h +++ b/ktux/spritemisc.h @@ -8,13 +8,13 @@ #ifndef __SPRITEMISC_H__ #define __SPRITEMISC_H__ -#include <qstring.h> -#include <qsize.h> +#include <tqstring.h> +#include <tqsize.h> class SpriteRange { public: - SpriteRange(const QString &str); + SpriteRange(const TQString &str); SpriteRange(int l=0, int h=0) : mMin(l), mMax(h) {} int min() const { return mMin; } @@ -23,18 +23,18 @@ public: int random() const; void set(int l, int h) { mMin=l; mMax=h; } - void set(const QString &str); + void set(const TQString &str); - static void setFieldSize(const QSize &size); - static QSize fieldSize() { return mFieldSize; } + static void setFieldSize(const TQSize &size); + static TQSize fieldSize() { return mFieldSize; } protected: - int parse(const QString &str); + int parse(const TQString &str); protected: int mMin; int mMax; - static QSize mFieldSize; + static TQSize mFieldSize; }; #endif diff --git a/ktux/spritepm.cpp b/ktux/spritepm.cpp index ec9ba47..d933144 100644 --- a/ktux/spritepm.cpp +++ b/ktux/spritepm.cpp @@ -37,16 +37,16 @@ SpritePixmapManager::~SpritePixmapManager() // Returns: // pointer to pixmap if loaded successfully, 0 otherwise. // -const QPixmap *SpritePixmapManager::load(const QString & img) +const TQPixmap *SpritePixmapManager::load(const TQString & img) { - QPixmap *pixmap = mPixmaps.find(img); + TQPixmap *pixmap = mPixmaps.find(img); if (!pixmap) { // pixmap has not yet been loaded. kdDebug() << "Reading pixmap: " << img << endl; - QString path = mPixmapDir + QString("/") + img; - pixmap = new QPixmap(path); + TQString path = mPixmapDir + TQString("/") + img; + pixmap = new TQPixmap(path); if (!pixmap->isNull()) { @@ -79,9 +79,9 @@ SpritePixmapManager *SpritePixmapManager::manager() //=========================================================================== // -SpritePixmapSequence::SpritePixmapSequence(QPtrList<QPixmap> pm, QPtrList<QPoint> hs, - QMemArray<int> d) - : QCanvasPixmapArray(pm, hs), mDelays(d) +SpritePixmapSequence::SpritePixmapSequence(TQPtrList<TQPixmap> pm, TQPtrList<TQPoint> hs, + TQMemArray<int> d) + : TQCanvasPixmapArray(pm, hs), mDelays(d) { } @@ -113,7 +113,7 @@ SpriteSequenceManager::~SpriteSequenceManager() // pointer to sprite if loaded successfully, 0 otherwise. // SpritePixmapSequence *SpriteSequenceManager::load(KConfigBase &config, - const QString & name) + const TQString & name) { SpritePixmapSequence *sprite = mSprites.find(name); @@ -135,24 +135,24 @@ SpritePixmapSequence *SpriteSequenceManager::load(KConfigBase &config, // SpritePixmapSequence *SpriteSequenceManager::read(KConfigBase &config) { - QStrList strImages; - QStrList strDelays; - QPtrList<QPixmap> pixmaps; - QPtrList<QPoint> hotspots; + TQStrList strImages; + TQStrList strDelays; + TQPtrList<TQPixmap> pixmaps; + TQPtrList<TQPoint> hotspots; int frames = config.readListEntry("Images", strImages); config.readListEntry("Delays", strDelays); - QMemArray<int> delays(frames); + TQMemArray<int> delays(frames); for (int i = 0; i < frames; i++) { - const QPixmap *pixmap = + const TQPixmap *pixmap = SpritePixmapManager::manager()->load(strImages.at(i)); if (pixmap) { pixmaps.append(pixmap); - hotspots.append(new QPoint(0,0)); + hotspots.append(new TQPoint(0,0)); delays[i] = atoi(strDelays.at(i)); } } diff --git a/ktux/spritepm.h b/ktux/spritepm.h index e9f24be..da3be7e 100644 --- a/ktux/spritepm.h +++ b/ktux/spritepm.h @@ -12,9 +12,9 @@ #include <config.h> #endif -#include <qdict.h> -#include <qpixmap.h> -#include <qcanvas.h> +#include <tqdict.h> +#include <tqpixmap.h> +#include <tqcanvas.h> #include <kconfigbase.h> #include <ksimpleconfig.h> @@ -28,19 +28,19 @@ public: SpritePixmapManager(); virtual ~SpritePixmapManager(); - void setPixmapDir(const QString &dir) + void setPixmapDir(const TQString &dir) { mPixmapDir = dir; } void reset() { mPixmapDir = "."; mPixmaps.clear(); } - const QPixmap *load(const QString & img); - const QPixmap *pixmap(const char *img) const + const TQPixmap *load(const TQString & img); + const TQPixmap *pixmap(const char *img) const { return mPixmaps.find(img); } static SpritePixmapManager *manager(); public: - QString mPixmapDir; // get pixmaps from here - QDict<QPixmap> mPixmaps; // list of pixmaps + TQString mPixmapDir; // get pixmaps from here + TQDict<TQPixmap> mPixmaps; // list of pixmaps static SpritePixmapManager *mManager; // static pointer to instance }; @@ -49,12 +49,12 @@ public: class SpritePixmapSequence : public QCanvasPixmapArray { public: - SpritePixmapSequence(QPtrList<QPixmap> pm, QPtrList<QPoint> hs, QMemArray<int> d); + SpritePixmapSequence(TQPtrList<TQPixmap> pm, TQPtrList<TQPoint> hs, TQMemArray<int> d); int delay(int i) const { return mDelays[i]; } protected: - QMemArray<int> mDelays; + TQMemArray<int> mDelays; }; //--------------------------------------------------------------------------- @@ -67,7 +67,7 @@ public: SpriteSequenceManager(); ~SpriteSequenceManager(); - SpritePixmapSequence *load(KConfigBase &config, const QString & name); + SpritePixmapSequence *load(KConfigBase &config, const TQString & name); SpritePixmapSequence *sprite(const char *name) { return mSprites.find(name); } @@ -77,7 +77,7 @@ protected: SpritePixmapSequence *read(KConfigBase &config); protected: - QDict<SpritePixmapSequence> mSprites; + TQDict<SpritePixmapSequence> mSprites; static SpriteSequenceManager *mManager; }; |