summaryrefslogtreecommitdiffstats
path: root/lskat/lskat/lskatview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lskat/lskat/lskatview.cpp')
-rw-r--r--lskat/lskat/lskatview.cpp316
1 files changed, 158 insertions, 158 deletions
diff --git a/lskat/lskat/lskatview.cpp b/lskat/lskat/lskatview.cpp
index c14d5cee..a338bc00 100644
--- a/lskat/lskat/lskatview.cpp
+++ b/lskat/lskat/lskatview.cpp
@@ -16,14 +16,14 @@
***************************************************************************/
// include files for Qt
-#include <qpixmap.h>
-#include <qcolor.h>
-#include <qrect.h>
-#include <qfontmetrics.h>
-#include <qpoint.h>
-#include <qstring.h>
-#include <qpainter.h>
-#include <qdatetime.h>
+#include <tqpixmap.h>
+#include <tqcolor.h>
+#include <tqrect.h>
+#include <tqfontmetrics.h>
+#include <tqpoint.h>
+#include <tqstring.h>
+#include <tqpainter.h>
+#include <tqdatetime.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <klocale.h>
@@ -92,39 +92,39 @@
//#define COL_STATUSLIGHT white
#define COL_STATUSBORDER black
-//#define COL_STATUSFIELD QColor(192,192,192)
-//#define COL_STATUSDARK QColor(65,65,65)
-#define COL_STATUSFIELD QColor(130,130,255)
-#define COL_STATUSDARK QColor(0,0,65)
-#define COL_STATUSLIGHT QColor(210,210,255)
-#define COL_PLAYER QColor(255,255,0)
+//#define COL_STATUSFIELD TQColor(192,192,192)
+//#define COL_STATUSDARK TQColor(65,65,65)
+#define COL_STATUSFIELD TQColor(130,130,255)
+#define COL_STATUSDARK TQColor(0,0,65)
+#define COL_STATUSLIGHT TQColor(210,210,255)
+#define COL_PLAYER TQColor(255,255,0)
#define DLGBOXTITLE TITLE
#define MOVECOUNTER 20 // so many moves when playing card
#define MOVE_TIMER_DELAY 7 // timer in milllisec default 7
-LSkatView::LSkatView(QWidget *parent, const char *name) : QWidget(parent, name)
+LSkatView::LSkatView(TQWidget *parent, const char *name) : TQWidget(parent, name)
{
setBackgroundMode(PaletteBase);
// setBackgroundMode(NoBackground);
- status_rect1=QRect(412,CARD_Y_OFFSET+5,180,95+25);
- status_rect2=QRect(412,310,180,95+25);
- status_rect3=QRect(CARD_X_OFFSET+60,CARD_Y_OFFSET+5+100+15+20,
+ status_rect1=TQRect(412,CARD_Y_OFFSET+5,180,95+25);
+ status_rect2=TQRect(412,310,180,95+25);
+ status_rect3=TQRect(CARD_X_OFFSET+60,CARD_Y_OFFSET+5+100+15+20,
400,320-100-CARD_Y_OFFSET-30);
- setBackgroundColor(QColor(0,0,128));
+ setBackgroundColor(TQColor(0,0,128));
setBackgroundPixmap( getDocument()->mPixBackground );
- moveTimer=new QTimer(this);
+ moveTimer=new TQTimer(this);
moveTimer->stop();
- connect(moveTimer,SIGNAL(timeout()),this,SLOT(moveTimerReady()));
+ connect(moveTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(moveTimerReady()));
introcnt=0;
- introTimer=new QTimer(this);
+ introTimer=new TQTimer(this);
introTimer->stop();
- connect(introTimer,SIGNAL(timeout()),this,SLOT(introTimerReady()));
+ connect(introTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(introTimerReady()));
introTimer->start(75,FALSE);
for (int i=0;i<NO_OF_CARDS;i++)
@@ -146,11 +146,11 @@ LSkatDoc *LSkatView::getDocument() const
// offset: An offset to the rect to make it smaller
// width: The width of the border
// mode: 0: Light border, 1: dark border
-void LSkatView::drawBorder(QPainter *p,QRect rect,int offset,int width,int mode)
+void LSkatView::drawBorder(TQPainter *p,TQRect rect,int offset,int width,int mode)
{
-QPen graypen;
+TQPen graypen;
int i;
-QPoint p1,p2;
+TQPoint p1,p2;
if (mode!=0 && mode!=1) return;
@@ -179,16 +179,16 @@ QPoint p1,p2;
// draw a move by animating the movment and turning of the
// card. This is called until the card reaches its final
// position
-void LSkatView::drawMove(QPainter *p)
+void LSkatView::drawMove(TQPainter *p)
{
int m1,m2;
int below;
- QPoint point1,point2;
+ TQPoint point1,point2;
m1=getDocument()->GetMove(0);
m2=getDocument()->GetMove(1);
- point1=QPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
- point2=QPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
+ point1=TQPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
+ point2=TQPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
below=getDocument()->GetLastStartPlayer();
if (below<0) below=getDocument()->GetStartPlayer();
@@ -205,7 +205,7 @@ void LSkatView::drawMove(QPainter *p)
}
int card;
- QPoint point;
+ TQPoint point;
card=getDocument()->GetMoveStatus();
if (card>=0)
{
@@ -215,23 +215,23 @@ void LSkatView::drawMove(QPainter *p)
// turn new card
if ((double)cardmovecnt/(double)MOVECOUNTER>0.5)
{
- QPixmap pix1(getDocument()->mPixCard[cardmoveunder]);
+ TQPixmap pix1(getDocument()->mPixCard[cardmoveunder]);
int wid=pix1.width();
- QWMatrix m;
+ TQWMatrix m;
m.scale(2.0*((double)cardmovecnt/(double)MOVECOUNTER-0.5),1.0);
pix1=pix1.xForm(m);
- point=QPoint((wid-pix1.width())/2,0);
+ point=TQPoint((wid-pix1.width())/2,0);
p->drawPixmap(cardorigin+point,pix1);
}
// turn deck
else
{
- QPixmap pix1(getDocument()->mPixDeck);
+ TQPixmap pix1(getDocument()->mPixDeck);
int wid=pix1.width();
- QWMatrix m;
+ TQWMatrix m;
m.scale(1.0-2.0*((double)cardmovecnt/(double)MOVECOUNTER),1.0);
pix1=pix1.xForm(m);
- point=QPoint((wid-pix1.width())/2,0);
+ point=TQPoint((wid-pix1.width())/2,0);
p->drawPixmap(cardorigin+point,pix1);
}
} /* end turn card */
@@ -244,18 +244,18 @@ void LSkatView::drawMove(QPainter *p)
// Show the intro (Cards+Text)
// This is called repeatetly
-void LSkatView::drawIntro(QPainter *p)
+void LSkatView::drawIntro(TQPainter *p)
{
int i,c1,c2,x,cnt,y,col,col2,col3,col4;
// The window width;
// int win_width = p->window().width();
- QPoint point,point1,p2;
- QString s;
+ TQPoint point,point1,p2;
+ TQString s;
// Get a nice font
- QFont font = KGlobalSettings::generalFont();
+ TQFont font = KGlobalSettings::generalFont();
font.setPointSize(48);
// Get the font info to determine text sizes
- QFontMetrics fontMetrics(font);
+ TQFontMetrics fontMetrics(font);
p->setFont(font);
@@ -264,17 +264,17 @@ void LSkatView::drawIntro(QPainter *p)
i=0;
- point=QPoint(20,20);
- point1=QPoint(550,20);
+ point=TQPoint(20,20);
+ point1=TQPoint(550,20);
for (i=0;i<cnt;i++)
{
x=(int)((i+10)*5*sin(1.5*i*M_PI/(float)NO_OF_CARDS));
c1=introCards[i];
c2=introCards[(i+17)%NO_OF_CARDS];
- p2=QPoint(i*10+x, i*10);
+ p2=TQPoint(i*10+x, i*10);
p->drawPixmap(point+p2,getDocument()->mPixCard[c1]);
- p2=QPoint(-i*10-x, i*10);
+ p2=TQPoint(-i*10-x, i*10);
p->drawPixmap(point1+p2,getDocument()->mPixCard[c2]);
}
@@ -288,38 +288,38 @@ void LSkatView::drawIntro(QPainter *p)
s=i18n("Lieutenant Skat");
x=310-fontMetrics.width(s)/2;
y=-20+(int)(200.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt));
- p->setPen(QColor(col4,col2,0));
+ p->setPen(TQColor(col4,col2,0));
p->drawText(x-2,y+2,s);
- p->setPen(QColor(col3,col,0));
+ p->setPen(TQColor(col3,col,0));
p->drawText(x,y,s);
s=i18n("for");
y=270+(NO_OF_CARDS-cnt)*3;
x=-fontMetrics.width(s)/2+(int)(310.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt));
- p->setPen(QColor(col4,col2,0));
+ p->setPen(TQColor(col4,col2,0));
p->drawText(x-2,y+2,s);
- p->setPen(QColor(col3,col,0));
+ p->setPen(TQColor(col3,col,0));
p->drawText(x,y,s);
s=i18n("K D E");
y=350+(NO_OF_CARDS-cnt)*3;
// x=640-(int)(380.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt));
x=570-fontMetrics.width(s)/2-(int)(260.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt));
- p->setPen(QColor(col4,col2,0));
+ p->setPen(TQColor(col4,col2,0));
p->drawText(x-2,y+2,s);
- p->setPen(QColor(col3,col,0));
+ p->setPen(TQColor(col3,col,0));
p->drawText(x,y,s);
}
// Draw all cards to create the game board
-void LSkatView::drawDeck(QPainter *p)
+void LSkatView::drawDeck(TQPainter *p)
{
int x,y,card;
int player,pos,height;
- QPoint point;
+ TQPoint point;
for (y=0;y<4;y++)
{
@@ -338,7 +338,7 @@ void LSkatView::drawDeck(QPainter *p)
if (height==2)
- p->drawPixmap(point-QPoint(CARD_X_DECK,CARD_Y_DECK),getDocument()->mPixDeck);
+ p->drawPixmap(point-TQPoint(CARD_X_DECK,CARD_Y_DECK),getDocument()->mPixDeck);
if (cardmovecnt<1 || x!=cardmovex || y!=cardmovey)
{
@@ -358,18 +358,18 @@ void LSkatView::drawDeck(QPainter *p)
}
}
// Draw the winner field
-void LSkatView::drawFinal(QPainter *p)
+void LSkatView::drawFinal(TQPainter *p)
{
int sc1,sc0,pt0,pt1;
- //QPoint p1,p2;
+ //TQPoint p1,p2;
int trump;
- //QRect r;
- QString ld;
+ //TQRect r;
+ TQString ld;
int ts[10];
- QFont font24 = KGlobalSettings::generalFont();
+ TQFont font24 = KGlobalSettings::generalFont();
font24.setPointSize(24);
- QFont font14 = KGlobalSettings::generalFont();
+ TQFont font14 = KGlobalSettings::generalFont();
font14.setPointSize(13);
//p1=status_rect3.topLeft();
@@ -394,14 +394,14 @@ void LSkatView::drawFinal(QPainter *p)
- QString line1,line2,line3,line4,line5;
- QString col1_3,col2_3,col3_3,col4_3;
- QString col1_4,col2_4,col3_4,col4_4;
- QRect sumrect;
- QRect rect;
- QRect brect1,brect2,brect3,brect4,brect5;
- QRect brect1_3,brect2_3,brect3_3,brect4_3;
- QRect brect1_4,brect2_4,brect3_4,brect4_4;
+ TQString line1,line2,line3,line4,line5;
+ TQString col1_3,col2_3,col3_3,col4_3;
+ TQString col1_4,col2_4,col3_4,col4_4;
+ TQRect sumrect;
+ TQRect rect;
+ TQRect brect1,brect2,brect3,brect4,brect5;
+ TQRect brect1_3,brect2_3,brect3_3,brect4_3;
+ TQRect brect1_4,brect2_4,brect3_4,brect4_4;
// Calculate geometry
line1=i18n("Game over");
@@ -409,14 +409,14 @@ void LSkatView::drawFinal(QPainter *p)
//rect1.moveBy(0,FINAL_Y0-24);
p->setFont(font24);
brect1=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line1);
- //QRect wrect=p->window();
+ //TQRect wrect=p->window();
sumrect=brect1;
if (sc0+sc1!=120) // aborted
{
line2=i18n("Game was aborted - no winner");
int hp=getDocument()->mPixTrump[trump].height()+5;
- rect=QRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height());
+ rect=TQRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height());
p->setFont(font14);
brect2=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2);
sumrect|=brect2;
@@ -436,55 +436,55 @@ void LSkatView::drawFinal(QPainter *p)
line2=i18n("Player 2 - %1 won ").arg(getDocument()->GetName(1));
}
int hp=getDocument()->mPixTrump[trump].height()+5;
- rect=QRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height());
+ rect=TQRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height());
p->setFont(font14);
brect2=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2);
sumrect|=brect2;
p->setFont(font14);
col1_3=i18n("Score:");
- col1_4=QString(" ");
- rect=QRect(0,0,p->window().width(),p->window().height());
+ col1_4=TQString(" ");
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect1_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col1_3);
ts[0]=brect1_3.width()+10;
col2_3=getDocument()->GetName(0);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect2_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col2_3);
col2_4=getDocument()->GetName(1);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect2_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col2_4);
rect=brect2_3|brect2_4;
ts[1]=ts[0]+rect.width()+10;
col3_3.sprintf("%d",sc0);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect3_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col3_3);
col3_4.sprintf("%d",sc1);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect3_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col3_4);
rect=brect3_3|brect3_4;
ts[2]=ts[1]+rect.width()+30;
col4_3=i18n("%1 points").arg(pt0);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect4_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col4_3);
col4_4=i18n("%1 points").arg(pt1);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect4_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col4_4);
rect=brect4_3|brect4_4;
ts[3]=ts[2]+rect.width()+10;
ts[4]=0;
- line3=col1_3+QString("\t")+col2_3+QString("\t")+col3_3+QString("\t")+col4_3;
- line4=col1_4+QString("\t")+col2_4+QString("\t")+col3_4+QString("\t")+col4_4;
- brect3=QRect(sumrect.left(),sumrect.bottom()+10,ts[3],brect4_3.height());
- brect4=QRect(sumrect.left(),sumrect.bottom()+10+brect4_3.height()+6,ts[3],brect4_4.height());
+ line3=col1_3+TQString("\t")+col2_3+TQString("\t")+col3_3+TQString("\t")+col4_3;
+ line4=col1_4+TQString("\t")+col2_4+TQString("\t")+col3_4+TQString("\t")+col4_4;
+ brect3=TQRect(sumrect.left(),sumrect.bottom()+10,ts[3],brect4_3.height());
+ brect4=TQRect(sumrect.left(),sumrect.bottom()+10+brect4_3.height()+6,ts[3],brect4_4.height());
sumrect|=brect3;
sumrect|=brect4;
@@ -493,7 +493,7 @@ void LSkatView::drawFinal(QPainter *p)
if (sc0>=120)
{
line5=i18n("%1 won to nil. Congratulations!").arg(getDocument()->GetName(0));
- rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height());
+ rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height());
brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5);
sumrect|=brect5;
}
@@ -503,14 +503,14 @@ void LSkatView::drawFinal(QPainter *p)
line5=i18n("%1 won with 90 points. Super!").arg(getDocument()->GetName(0));
else
line5=i18n("%1 won over 90 points. Super!").arg(getDocument()->GetName(0));
- rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height());
+ rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height());
brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5);
sumrect|=brect5;
}
if (sc1>=120)
{
line5=i18n("%1 won to nil. Congratulations!").arg(getDocument()->GetName(1));
- rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height());
+ rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height());
brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5);
sumrect|=brect5;
}
@@ -520,18 +520,18 @@ void LSkatView::drawFinal(QPainter *p)
line5=i18n("%1 won with 90 points. Super!").arg(getDocument()->GetName(1));
else
line5=i18n("%1 won over 90 points. Super!").arg(getDocument()->GetName(1));
- rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height());
+ rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height());
brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5);
sumrect|=brect5;
}
}
- QPoint offset=QPoint(status_rect3.left()-sumrect.left(),status_rect3.top());
+ TQPoint offset=TQPoint(status_rect3.left()-sumrect.left(),status_rect3.top());
sumrect.moveBy(offset.x(),offset.y());
// draw actual strings and symbols
- QRect borderrect=QRect(sumrect.left()-20,sumrect.top()-20,sumrect.width()+40,sumrect.height()+40);
+ TQRect borderrect=TQRect(sumrect.left()-20,sumrect.top()-20,sumrect.width()+40,sumrect.height()+40);
p->drawRect(borderrect);
drawBorder(p,borderrect,0,4,0);
drawBorder(p,borderrect,10,1,1);
@@ -551,8 +551,8 @@ void LSkatView::drawFinal(QPainter *p)
//brect2.moveBy(offset.x(),offset.y());
p->drawText(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2);
- p->drawPixmap(sumrect.topLeft()+QPoint(-5,-5), getDocument()->mPixTrump[trump]);
- p->drawPixmap(sumrect.topLeft()+QPoint(5,-5)+QPoint(sumrect.width()-getDocument()->mPixTrump[trump].width(),0),
+ p->drawPixmap(sumrect.topLeft()+TQPoint(-5,-5), getDocument()->mPixTrump[trump]);
+ p->drawPixmap(sumrect.topLeft()+TQPoint(5,-5)+TQPoint(sumrect.width()-getDocument()->mPixTrump[trump].width(),0),
getDocument()->mPixTrump[trump]);
@@ -585,7 +585,7 @@ void LSkatView::drawFinal(QPainter *p)
// This function is just a workaround for the QT function drawText
// with Qt::EXpandTAbs eanbled. For some strange reasons this crashes...
-void LSkatView::drawTabText(QPainter *p,QRect rect,QString s,int *ts)
+void LSkatView::drawTabText(TQPainter *p,TQRect rect,TQString s,int *ts)
{
int lcnt=0;
@@ -600,9 +600,9 @@ void LSkatView::drawTabText(QPainter *p,QRect rect,QString s,int *ts)
lpos=s.length();
rpos=0;
}
- QString tmp=s.left(lpos);
+ TQString tmp=s.left(lpos);
s=s.right(rpos);
- QRect rect2=rect;
+ TQRect rect2=rect;
if (lcnt>0)
rect2.setLeft(rect.left()+ts[lcnt-1]);
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,tmp);
@@ -611,17 +611,17 @@ void LSkatView::drawTabText(QPainter *p,QRect rect,QString s,int *ts)
}
// Draw the status field at the right side
-void LSkatView::drawStatus(QPainter *p)
+void LSkatView::drawStatus(TQPainter *p)
{
- QPoint p1,p2;
+ TQPoint p1,p2;
int trump;
- QRect drawrect;
+ TQRect drawrect;
// For loop
- QRect srect[2];
+ TQRect srect[2];
srect[0]=status_rect1;
srect[1]=status_rect2;
- QFont font10 = KGlobalSettings::generalFont();
+ TQFont font10 = KGlobalSettings::generalFont();
font10.setPointSize(13);
p->setFont(font10);
@@ -629,14 +629,14 @@ void LSkatView::drawStatus(QPainter *p)
// draw text
- QString ld;
- QString line1,line2,line3,line4,line2a,line2b,line2c;
- QRect sumrect,rect,rect2,brect1,brect2,brect3,brect4;
- QPoint pa;
+ TQString ld;
+ TQString line1,line2,line3,line4,line2a,line2b,line2c;
+ TQRect sumrect,rect,rect2,brect1,brect2,brect3,brect4;
+ TQPoint pa;
for (int pl=0;pl<2;pl++)
{
- drawrect=QRect(srect[pl].left()+14,srect[pl].top()+14,srect[pl].width()-28,srect[pl].height()-28);
+ drawrect=TQRect(srect[pl].left()+14,srect[pl].top()+14,srect[pl].width()-28,srect[pl].height()-28);
p1=drawrect.topLeft();
p2=drawrect.bottomRight();
@@ -649,7 +649,7 @@ void LSkatView::drawStatus(QPainter *p)
// Player pl -------------------
- // line1=QString(i18n("Player 1"))+QString(QCString(" - "))+getDocument()->GetName(0);
+ // line1=TQString(i18n("Player 1"))+TQString(TQCString(" - "))+getDocument()->GetName(0);
line1=getDocument()->GetName(pl);
brect1=p->boundingRect(drawrect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line1);
sumrect=brect1;
@@ -658,11 +658,11 @@ void LSkatView::drawStatus(QPainter *p)
{
// Geometry and strings
line2=i18n("Score:");
- rect=QRect(drawrect.left(),sumrect.bottom()+16,drawrect.width(),drawrect.height()-sumrect.height());
+ rect=TQRect(drawrect.left(),sumrect.bottom()+16,drawrect.width(),drawrect.height()-sumrect.height());
brect2=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2);
sumrect|=brect2;
line3=i18n("Move:");
- rect=QRect(drawrect.left(),sumrect.bottom()+10,drawrect.width(),drawrect.height()-sumrect.height());
+ rect=TQRect(drawrect.left(),sumrect.bottom()+10,drawrect.width(),drawrect.height()-sumrect.height());
brect3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3);
sumrect|=brect3;
@@ -678,33 +678,33 @@ void LSkatView::drawStatus(QPainter *p)
p->setPen(black);
p->drawText(brect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2);
p->drawText(brect3,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3);
- rect2=QRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width(),brect2.height());
+ rect2=TQRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width(),brect2.height());
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2a);
- rect2=QRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width(),brect3.height());
+ rect2=TQRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width(),brect3.height());
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2b);
- pa=QPoint(drawrect.width()-getDocument()->mPixTrump[trump].width(),drawrect.height()-getDocument()->mPixTrump[trump].height());
+ pa=TQPoint(drawrect.width()-getDocument()->mPixTrump[trump].width(),drawrect.height()-getDocument()->mPixTrump[trump].height());
if (getDocument()->GetStartPlayer()==pl)
- p->drawPixmap(p1+pa+QPoint(3,3),getDocument()->mPixTrump[trump]);
+ p->drawPixmap(p1+pa+TQPoint(3,3),getDocument()->mPixTrump[trump]);
- pa=QPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0);
- p->drawPixmap(p1+pa+QPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]);
+ pa=TQPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0);
+ p->drawPixmap(p1+pa+TQPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]);
}
else // draw all time score
{
// Geometry and strings
line2=i18n("Points:");
- rect=QRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
+ rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
brect2=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2);
sumrect|=brect2;
line3=i18n("Won:");
- rect=QRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
+ rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
brect3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3);
sumrect|=brect3;
line4=i18n("Games:");
- rect=QRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
+ rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
brect4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line4);
sumrect|=brect4;
@@ -721,15 +721,15 @@ void LSkatView::drawStatus(QPainter *p)
p->drawText(brect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2);
p->drawText(brect3,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3);
p->drawText(brect4,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line4);
- rect2=QRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width()+5,brect2.height());
+ rect2=TQRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width()+5,brect2.height());
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2a);
- rect2=QRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width()+5,brect3.height());
+ rect2=TQRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width()+5,brect3.height());
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2b);
- rect2=QRect(brect4.left()+rect.width(),brect4.top(),drawrect.width()-brect4.width()-rect.width()+5,brect4.height());
+ rect2=TQRect(brect4.left()+rect.width(),brect4.top(),drawrect.width()-brect4.width()-rect.width()+5,brect4.height());
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2c);
- pa=QPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0);
- p->drawPixmap(p1+pa+QPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]);
+ pa=TQPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0);
+ p->drawPixmap(p1+pa+TQPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]);
}
@@ -737,7 +737,7 @@ void LSkatView::drawStatus(QPainter *p)
}
// paint function
-void LSkatView::Paint(QPainter *p)
+void LSkatView::Paint(TQPainter *p)
{
// If game is running
drawStatus(p);
@@ -753,13 +753,13 @@ void LSkatView::Paint(QPainter *p)
}
// paint event
-void LSkatView::paintEvent( QPaintEvent * e)
+void LSkatView::paintEvent( TQPaintEvent * e)
{
if (getDocument()->IsIntro())
{
- QPixmap pm(this->rect().size());
- QPainter p;
- QBrush brush;
+ TQPixmap pm(this->rect().size());
+ TQPainter p;
+ TQBrush brush;
p.begin(&pm,this);
brush.setPixmap( getDocument()->mPixBackground );
p.fillRect(0,0,this->rect().width(),this->rect().height(),brush);
@@ -769,7 +769,7 @@ void LSkatView::paintEvent( QPaintEvent * e)
}
else
{
- QPainter paint( this );
+ TQPainter paint( this );
paint.setClipRect(e->rect());
Paint( &paint );
}
@@ -777,32 +777,32 @@ void LSkatView::paintEvent( QPaintEvent * e)
// x=0..4, y=0..4
-QPoint LSkatView::calcCardPos(int x,int y)
+TQPoint LSkatView::calcCardPos(int x,int y)
{
- QPoint point;
- point=QPoint(CARD_X_OFFSET+x*(CARD_X_SPACE+getDocument()->cardsize.width()),
+ TQPoint point;
+ point=TQPoint(CARD_X_OFFSET+x*(CARD_X_SPACE+getDocument()->cardsize.width()),
CARD_Y_OFFSET+y*(CARD_Y_SPACE+getDocument()->cardsize.height()));
- if (y>=2) point+=QPoint(0,CARD_Y_BOARD_OFFSET);
- point+=QPoint(CARD_X_DECK,CARD_Y_DECK);
+ if (y>=2) point+=TQPoint(0,CARD_Y_BOARD_OFFSET);
+ point+=TQPoint(CARD_X_DECK,CARD_Y_DECK);
return point;
}
// mouse click event
-void LSkatView::mousePressEvent( QMouseEvent *mouse )
+void LSkatView::mousePressEvent( TQMouseEvent *mouse )
{
if (mouse->button()!=LeftButton) return ;
if (!getDocument()->IsRunning()) return ;
if (getDocument()->GetMoveStatus()!=-1) return ;
- QPoint point;
+ TQPoint point;
int mx,my,player;
point=mouse->pos();
- point-=QPoint(CARD_X_OFFSET,CARD_Y_OFFSET);
+ point-=TQPoint(CARD_X_OFFSET,CARD_Y_OFFSET);
if (point.y()>2*(getDocument()->cardsize.height()+CARD_Y_SPACE))
{
- point-=QPoint(0,CARD_Y_BOARD_OFFSET+2*(getDocument()->cardsize.height()+CARD_Y_SPACE));
+ point-=TQPoint(0,CARD_Y_BOARD_OFFSET+2*(getDocument()->cardsize.height()+CARD_Y_SPACE));
player=1;
}
else
@@ -823,15 +823,15 @@ void LSkatView::mousePressEvent( QMouseEvent *mouse )
!getDocument()->IsLocked())
{
KEMessage *msg=new KEMessage;
- msg->AddData(QCString("Move"),(short)player);
- msg->AddData(QCString("MoveX"),(short)mx);
- msg->AddData(QCString("MoveY"),(short)my);
+ msg->AddData(TQCString("Move"),(short)player);
+ msg->AddData(TQCString("MoveX"),(short)mx);
+ msg->AddData(TQCString("MoveY"),(short)my);
getDocument()->QueryInputHandler()->SetInput(msg);
delete msg;
}
else
{
- QString m;
+ TQString m;
switch(getDocument()->random(4))
{
case 0:
@@ -861,16 +861,16 @@ void LSkatView::InitMove(int player,int mx,int my)
cardmovecnt=0;
cardorigin=calcCardPos(mx,my+2*player);
if (getDocument()->GetCurrentPlayer()==0)
- cardend=QPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
- else cardend=QPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
- update(QRect(
- cardorigin-QPoint(CARD_X_DECK,CARD_Y_DECK),
- getDocument()->cardsize+QSize(CARD_X_DECK,CARD_Y_DECK)));
-
- QPoint point1=QPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
- QPoint point2=QPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
- update(QRect(point1,getDocument()->cardsize));
- update(QRect(point2,getDocument()->cardsize));
+ cardend=TQPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
+ else cardend=TQPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
+ update(TQRect(
+ cardorigin-TQPoint(CARD_X_DECK,CARD_Y_DECK),
+ getDocument()->cardsize+TQSize(CARD_X_DECK,CARD_Y_DECK)));
+
+ TQPoint point1=TQPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
+ TQPoint point2=TQPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
+ update(TQRect(point1,getDocument()->cardsize));
+ update(TQRect(point2,getDocument()->cardsize));
}
void LSkatView::introTimerReady()
{
@@ -896,15 +896,15 @@ void LSkatView::introTimerReady()
void LSkatView::moveTimerReady()
{
- QPoint pos;
- QString ld,s;
+ TQPoint pos;
+ TQString ld,s;
if (cardmovecnt>=MOVECOUNTER)
{
LSkatApp *m=(LSkatApp *) parentWidget();
moveTimer->stop();
cardmovecnt=0;
- update(QRect(cardend,getDocument()->cardsize));
- update(QRect(cardorigin,getDocument()->cardsize));
+ update(TQRect(cardend,getDocument()->cardsize));
+ update(TQRect(cardorigin,getDocument()->cardsize));
update(status_rect1);
update(status_rect2);
m->MoveFinished();
@@ -913,14 +913,14 @@ void LSkatView::moveTimerReady()
else
{
pos=cardorigin+(cardend-cardorigin)*cardmovecnt/MOVECOUNTER;
- update(QRect(pos,getDocument()->cardsize));
+ update(TQRect(pos,getDocument()->cardsize));
cardmovecnt++;
pos=cardorigin+(cardend-cardorigin)*cardmovecnt/MOVECOUNTER;
- update(QRect(pos,getDocument()->cardsize));
+ update(TQRect(pos,getDocument()->cardsize));
// Turning of the card
if ( cardmoveunder>=0)
{
- update(QRect(cardorigin,getDocument()->cardsize));
+ update(TQRect(cardorigin,getDocument()->cardsize));
}
}
}