From 576eb4299a00bc053db35414406f46372a0f70f2 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:42:31 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kenolaba/Ball.cpp | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'kenolaba/Ball.cpp') diff --git a/kenolaba/Ball.cpp b/kenolaba/Ball.cpp index 565ef296..525f919b 100644 --- a/kenolaba/Ball.cpp +++ b/kenolaba/Ball.cpp @@ -1,18 +1,18 @@ /* Ball animation classes */ #include "Ball.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include Ball* Ball::first = 0; -//QImage Ball::back; +//TQImage Ball::back; int Ball::sizeX, Ball::sizeY; double Ball::lightX, Ball::lightY, Ball::lightZ; -QColor Ball::lightColor; +TQColor Ball::lightColor; double Ball::rippleCount, Ball::rippleDepth; /* set global Ball parameter */ @@ -33,7 +33,7 @@ void Ball::invalidate() b->pm.resize(0,0); } -void Ball::setLight(int x, int y, int z, const QColor& c) +void Ball::setLight(int x, int y, int z, const TQColor& c) { double len = sqrt(double(x*x + y*y + z*z)); @@ -57,7 +57,7 @@ void Ball::setTexture(double c, double d) -Ball::Ball(const QColor& c, double a, int t) +Ball::Ball(const TQColor& c, double a, int t) { if (first ==0) { sizeX = sizeY = -1; @@ -90,7 +90,7 @@ Ball::~Ball() } } -QPixmap* Ball::pixmap() +TQPixmap* Ball::pixmap() { if (pm.isNull() && sizeX>0 && sizeY>0) render(); @@ -105,7 +105,7 @@ void Ball::render() if (sizeX==0 || sizeY==0) return; - QImage image(sizeX,sizeY,32); + TQImage image(sizeX,sizeY,32); image.fill(0); double vv=2./(sizeX+sizeY); @@ -159,8 +159,8 @@ void Ball::render() } } } - const QImage iMask = image.createHeuristicMask(); - QBitmap bMask; + const TQImage iMask = image.createHeuristicMask(); + TQBitmap bMask; bMask = iMask; pm.convertFromImage( image, 0 ); pm.setMask(bMask); @@ -171,15 +171,15 @@ void Ball::render() BallAnimation::BallAnimation(int s, Ball* ball1, Ball* ball2) { - QColor c1 = ball1->ballColor(); + TQColor c1 = ball1->ballColor(); double a1 = ball1->angle(); int r1 = c1.red(), g1 = c1.green(), b1 = c1.blue(); - QColor c2 = ball2->ballColor(); + TQColor c2 = ball2->ballColor(); double a2 = ball2->angle(); int r2 = c2.red(), g2 = c2.green(), b2 = c2.blue(); - QColor c; + TQColor c; double a; int i; @@ -213,8 +213,8 @@ BallPosition::BallPosition(int xp,int yp, Ball* d) /* Class BallWidget */ -BallWidget::BallWidget( int _freq, int bFr, QWidget *parent, const char *name ) - : QWidget(parent,name), positions(MAX_POSITION), animations(MAX_ANIMATION) +BallWidget::BallWidget( int _freq, int bFr, TQWidget *parent, const char *name ) + : TQWidget(parent,name), positions(MAX_POSITION), animations(MAX_ANIMATION) { int i; @@ -228,8 +228,8 @@ BallWidget::BallWidget( int _freq, int bFr, QWidget *parent, const char *name ) isRunning = false; ballFraction = bFr; realSize = -1; - timer = new QTimer(this); - connect( timer, SIGNAL(timeout()), SLOT(animate()) ); + timer = new TQTimer(this); + connect( timer, TQT_SIGNAL(timeout()), TQT_SLOT(animate()) ); } BallWidget::~BallWidget() @@ -302,7 +302,7 @@ void BallWidget::stopAnimation(int pos) p->actStep = p->actAnimation->steps; } -void BallWidget::resizeEvent(QResizeEvent *) +void BallWidget::resizeEvent(TQResizeEvent *) { int w = width() *10/12, h = height(); @@ -312,13 +312,13 @@ void BallWidget::resizeEvent(QResizeEvent *) repaint(); } -void BallWidget::paintEvent(QPaintEvent *) +void BallWidget::paintEvent(TQPaintEvent *) { paint(this); } -void BallWidget::paint(QPaintDevice *pd) +void BallWidget::paint(TQPaintDevice *pd) { int i; BallPosition *p; @@ -421,7 +421,7 @@ void BallWidget::animate() /* Ball Test */ -BallTest::BallTest( QWidget *parent, const char *name ) +BallTest::BallTest( TQWidget *parent, const char *name ) : BallWidget(10,2,parent,name) { int w,h; @@ -449,13 +449,13 @@ BallTest::BallTest( QWidget *parent, const char *name ) } /* -void BallTest::paintEvent( QPaintEvent * ) +void BallTest::paintEvent( TQPaintEvent * ) { bitBlt(this,0,0, b.pixmap()); } */ -void BallTest::mousePressEvent( QMouseEvent * ) +void BallTest::mousePressEvent( TQMouseEvent * ) { startAnimation(0,0, ANIMATION_CYCLE); startAnimation(1,1); @@ -463,7 +463,7 @@ void BallTest::mousePressEvent( QMouseEvent * ) startAnimation(3,3, ANIMATION_LOOP); } -void BallTest::mouseReleaseEvent( QMouseEvent * ) +void BallTest::mouseReleaseEvent( TQMouseEvent * ) { stopAnimation(0); stopAnimation(1); -- cgit v1.2.1