Trinity Qt initial conversion

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1157642 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 83f9dfafc1
commit 0a6e0958c0

@ -7,7 +7,7 @@
* (at your option) any later version. *
***************************************************************************/
#include <qtimer.h>
#include <tqtimer.h>
#include <config.h>
@ -22,8 +22,8 @@
artsPlayer::artsPlayer() : m_playobj(0)
{
m_endChecker = new QTimer(this);
connect(m_endChecker, SIGNAL(timeout()), this, SLOT(checkEnded()));
m_endChecker = new TQTimer(this);
connect(m_endChecker, TQT_SIGNAL(timeout()), this, TQT_SLOT(checkEnded()));
#ifndef WITHOUT_ARTS
m_dispatcher = new KArtsDispatcher;
@ -87,7 +87,7 @@ void artsPlayer::play(blinkenGame::color c, bool stopCurrent)
void artsPlayer::play()
{
#ifndef WITHOUT_ARTS
QString path;
TQString path;
blinkenGame::color c = m_nextSounds.first();
m_nextSounds.pop_front();
switch (c)

@ -28,7 +28,7 @@ namespace KDE
#include <arts/kplayobjectfactory.h>
#endif
#include <qvaluelist.h>
#include <tqvaluelist.h>
#include "blinkengame.h"
@ -51,11 +51,11 @@ Q_OBJECT
void checkEnded();
private:
QValueList<blinkenGame::color> m_nextSounds;
TQValueList<blinkenGame::color> m_nextSounds;
QString m_greenPath, m_redPath, m_bluePath, m_yellowPath, m_allPath;
TQString m_greenPath, m_redPath, m_bluePath, m_yellowPath, m_allPath;
QTimer *m_endChecker;
TQTimer *m_endChecker;
KArtsDispatcher *m_dispatcher;
KArtsServer *m_server;

@ -7,10 +7,10 @@
* (at your option) any later version. *
***************************************************************************/
#include <qcursor.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qtimer.h>
#include <tqcursor.h>
#include <tqpainter.h>
#include <tqpixmap.h>
#include <tqtimer.h>
#include <kaction.h>
#include <kapplication.h>
@ -30,52 +30,52 @@
#include "highscoredialog.h"
#include "settings.h"
blinken::blinken() : QWidget(0, 0, WStaticContents | WNoAutoErase), m_overHighscore(false), m_overQuit(false), m_overCentralText(false), m_overMenu(false), m_overAboutKDE(false), m_overAboutBlinken(false), m_overManual(false), m_overCentralLetters(false), m_overCounter(false), m_overFont(false), m_overSound(false), m_showPreferences(false), m_updateButtonHighlighting(false), m_highlighted(blinkenGame::none)
blinken::blinken() : TQWidget(0, 0, WStaticContents | WNoAutoErase), m_overHighscore(false), m_overQuit(false), m_overCentralText(false), m_overMenu(false), m_overAboutKDE(false), m_overAboutBlinken(false), m_overManual(false), m_overCentralLetters(false), m_overCounter(false), m_overFont(false), m_overSound(false), m_showPreferences(false), m_updateButtonHighlighting(false), m_highlighted(blinkenGame::none)
{
m_back = new QPixmap(locate("appdata", "images/blinken.png"));
m_back = new TQPixmap(locate("appdata", "images/blinken.png"));
m_buttons[0] = new button(blinkenGame::blue);
m_buttons[1] = new button(blinkenGame::yellow);
m_buttons[2] = new button(blinkenGame::red);
m_buttons[3] = new button(blinkenGame::green);
m_highscore = new QPixmap(locate("appdata", "images/highscore.png"));
m_highscoreHover = new QPixmap(locate("appdata", "images/highscore_hover.png"));
m_quit = new QPixmap(locate("appdata", "images/quit.png"));
m_quitHover = new QPixmap(locate("appdata", "images/quit_hover.png"));
m_menu = new QPixmap(locate("appdata", "images/menu.png"));
m_menuHover = new QPixmap(locate("appdata", "images/menu_hover.png"));
m_mark = new QPixmap(locate("appdata", "images/mark.png"));
m_highscoreRect = QRect(10, 10, 72, 72);
m_quitRect = QRect(562, 10, 72, 73);
m_menuRect = QRect(562, 443, 72, 72);
m_aboutKDERect = QRect(452, 461, 54, 54);
m_aboutBlinkenRect = QRect(506, 461, 56, 54);
m_manualRect = QRect(578, 389, 54, 54);
m_centralLettersRect = QRect(192, 194, 254, 54);
m_counterRect = QRect(268, 110, 102, 52);
m_fillColor = QColor(40, 40, 40);
m_fontColor = QColor(126, 126, 126);
m_fontHighlightColor = QColor(230, 230, 230);
m_countDownColor = QColor(55, 55, 55);
m_highscore = new TQPixmap(locate("appdata", "images/highscore.png"));
m_highscoreHover = new TQPixmap(locate("appdata", "images/highscore_hover.png"));
m_quit = new TQPixmap(locate("appdata", "images/quit.png"));
m_quitHover = new TQPixmap(locate("appdata", "images/quit_hover.png"));
m_menu = new TQPixmap(locate("appdata", "images/menu.png"));
m_menuHover = new TQPixmap(locate("appdata", "images/menu_hover.png"));
m_mark = new TQPixmap(locate("appdata", "images/mark.png"));
m_highscoreRect = TQRect(10, 10, 72, 72);
m_quitRect = TQRect(562, 10, 72, 73);
m_menuRect = TQRect(562, 443, 72, 72);
m_aboutKDERect = TQRect(452, 461, 54, 54);
m_aboutBlinkenRect = TQRect(506, 461, 56, 54);
m_manualRect = TQRect(578, 389, 54, 54);
m_centralLettersRect = TQRect(192, 194, 254, 54);
m_counterRect = TQRect(268, 110, 102, 52);
m_fillColor = TQColor(40, 40, 40);
m_fontColor = TQColor(126, 126, 126);
m_fontHighlightColor = TQColor(230, 230, 230);
m_countDownColor = TQColor(55, 55, 55);
setMouseTracking(true);
setFixedSize(644, 525);
show();
m_unhighlighter = new QTimer(this);
connect(m_unhighlighter, SIGNAL(timeout()), this, SLOT(unhighlight()));
m_unhighlighter = new TQTimer(this);
connect(m_unhighlighter, TQT_SIGNAL(timeout()), this, TQT_SLOT(unhighlight()));
connect(&m_game, SIGNAL(gameEnded()), this, SLOT(checkHS()));
connect(&m_game, SIGNAL(phaseChanged()), this, SLOT(update()));
connect(&m_game, SIGNAL(highlight(blinkenGame::color, bool)), this, SLOT(highlight(blinkenGame::color, bool)));
connect(&m_game, TQT_SIGNAL(gameEnded()), this, TQT_SLOT(checkHS()));
connect(&m_game, TQT_SIGNAL(phaseChanged()), this, TQT_SLOT(update()));
connect(&m_game, TQT_SIGNAL(highlight(blinkenGame::color, bool)), this, TQT_SLOT(highlight(blinkenGame::color, bool)));
m_helpMenu = new KHelpMenu(this, kapp->aboutData());
for (int i = 0; i < 3; i++) m_overLevels[i] = false;
QString aux = i18n("If the Steve font that is used by bliken by default to show status messages does not support any of the characters of your language, please translate that message to 1 and KDE standard font will be used to show the texts, if not translate it to 0", "0");
TQString aux = i18n("If the Steve font that is used by bliken by default to show status messages does not support any of the characters of your language, please translate that message to 1 and KDE standard font will be used to show the texts, if not translate it to 0", "0");
m_alwaysUseNonCoolFont = aux == "1";
}
@ -94,22 +94,22 @@ blinken::~blinken()
delete m_helpMenu;
}
void blinken::paintEvent(QPaintEvent *)
void blinken::paintEvent(TQPaintEvent *)
{
QPixmap buf(width(), height());
QPainter p(&buf);
TQPixmap buf(width(), height());
TQPainter p(&buf);
p.drawPixmap(0, 0, *m_back);
drawMenuQuit(p);
QFont f1, f = p.font();
TQFont f1, f = p.font();
f1 = f;
f.setBold(true);
p.setFont(f);
switch (m_game.phase())
{
case blinkenGame::starting:
drawText(p, i18n("Start"), QPoint(318, 316), true, 10, 5, &m_centralTextRect, m_overCentralText, false);
drawText(p, i18n("Start"), TQPoint(318, 316), true, 10, 5, &m_centralTextRect, m_overCentralText, false);
break;
case blinkenGame::choosingLevel:
@ -121,7 +121,7 @@ void blinken::paintEvent(QPaintEvent *)
case blinkenGame::waiting1:
case blinkenGame::learningTheSequence:
case blinkenGame::typingTheSequence:
drawText(p, i18n("Restart"), QPoint(318, 316), true, 10, 5, &m_centralTextRect, m_overCentralText, false);
drawText(p, i18n("Restart"), TQPoint(318, 316), true, 10, 5, &m_centralTextRect, m_overCentralText, false);
break;
}
p.setFont(f1);
@ -129,14 +129,14 @@ void blinken::paintEvent(QPaintEvent *)
if (m_showPreferences)
{
// draw the current keys
drawText(p, m_buttons[0]->shortcut(), QPoint(115, 285), true, 20, 5, 0, m_buttons[0]->selected(), false);
drawText(p, m_buttons[1]->shortcut(), QPoint(115, 155), true, 20, 5, 0, m_buttons[1]->selected(), false);
drawText(p, m_buttons[2]->shortcut(), QPoint(520, 155), true, 20, 5, 0, m_buttons[2]->selected(), false);
drawText(p, m_buttons[3]->shortcut(), QPoint(520, 285), true, 20, 5, 0, m_buttons[3]->selected(), false);
const QPen &oPen = p.pen();
const QBrush &oBrush = p.brush();
const QFont &oFont = p.font();
drawText(p, m_buttons[0]->shortcut(), TQPoint(115, 285), true, 20, 5, 0, m_buttons[0]->selected(), false);
drawText(p, m_buttons[1]->shortcut(), TQPoint(115, 155), true, 20, 5, 0, m_buttons[1]->selected(), false);
drawText(p, m_buttons[2]->shortcut(), TQPoint(520, 155), true, 20, 5, 0, m_buttons[2]->selected(), false);
drawText(p, m_buttons[3]->shortcut(), TQPoint(520, 285), true, 20, 5, 0, m_buttons[3]->selected(), false);
const TQPen &oPen = p.pen();
const TQBrush &oBrush = p.brush();
const TQFont &oFont = p.font();
// draw the internal square plus a bit of ellipse on the sides and the
// two delimiter lines
@ -144,16 +144,16 @@ void blinken::paintEvent(QPaintEvent *)
p.setBrush(m_fillColor);
p.drawPie(169, 192, 4, 58, 1440, 2880);
p.drawPie(465, 192, 4, 58, -1440, 2880);
p.setPen(QPen(Qt::black, 3));
p.setPen(TQPen(Qt::black, 3));
p.fillRect(171, 192, 296, 58, m_fillColor);
p.drawLine(169, 192, 469, 192);
p.drawLine(169, 250, 469, 250);
// draw the two squares of the options
p.setPen(QPen(m_fontColor, 2, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin));
p.setPen(TQPen(m_fontColor, 2, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin));
m_soundRect = QRect(181, 209, 25, 25);
m_fontRect = QRect(432, 209, 25, 25);
m_soundRect = TQRect(181, 209, 25, 25);
m_fontRect = TQRect(432, 209, 25, 25);
#ifndef WITHOUT_ARTS
p.drawRect(m_soundRect);
if (blinkenSettings::playSounds())
@ -173,25 +173,25 @@ void blinken::paintEvent(QPaintEvent *)
}
// draw the options' text
QFont f1 = QFont();
TQFont f1 = TQFont();
p.setFont(f1);
int size, sizeAux;
QRect area;
QString sounds = i18n("Sounds");
QString font = i18n("Font");
TQRect area;
TQString sounds = i18n("Sounds");
TQString font = i18n("Font");
size = fontUtils::fontSize(p, sounds, 95, 20);
sizeAux = fontUtils::fontSize(p, font, 95, 20);
if (sizeAux > size) size = sizeAux;
f1.setPointSize(size);
#ifndef WITHOUT_ARTS
area = p.boundingRect(QRect(), Qt::AlignAuto, sounds);
area = p.boundingRect(TQRect(), Qt::AlignAuto, sounds);
area.moveBy(212, 221 - (area.height() / 2));
p.drawText(area, Qt::AlignCenter, sounds);
m_soundRect = m_soundRect.unite(area);
#endif
if (!m_alwaysUseNonCoolFont)
{
area = p.boundingRect(QRect(), Qt::AlignAuto, font);
area = p.boundingRect(TQRect(), Qt::AlignAuto, font);
area.moveBy(426 - area.width(), 221 - (area.height() / 2));
p.drawText(area, Qt::AlignCenter, font);
m_fontRect = m_fontRect.unite(area);
@ -213,10 +213,10 @@ void blinken::paintEvent(QPaintEvent *)
bitBlt(this, 0, 0, &buf);
if (m_updateButtonHighlighting) updateButtonHighlighting(mapFromGlobal(QCursor::pos()));
if (m_updateButtonHighlighting) updateButtonHighlighting(mapFromGlobal(TQCursor::pos()));
}
void blinken::keyPressEvent(QKeyEvent *e)
void blinken::keyPressEvent(TQKeyEvent *e)
{
if (e -> isAutoRepeat()) return;
@ -263,7 +263,7 @@ void blinken::keyPressEvent(QKeyEvent *e)
}
}
void blinken::keyReleaseEvent(QKeyEvent *e)
void blinken::keyReleaseEvent(TQKeyEvent *e)
{
if (e -> isAutoRepeat()) return;
@ -271,17 +271,17 @@ void blinken::keyReleaseEvent(QKeyEvent *e)
{
m_showPreferences = !m_showPreferences;
for (int i = 0; i < 4; i++) m_buttons[i] -> setSelected(false);
updateButtonHighlighting(mapFromGlobal(QCursor::pos()));
updateButtonHighlighting(mapFromGlobal(TQCursor::pos()));
update();
}
}
void blinken::mouseMoveEvent(QMouseEvent *e)
void blinken::mouseMoveEvent(TQMouseEvent *e)
{
updateButtonHighlighting(e->pos());
}
void blinken::mousePressEvent(QMouseEvent *e)
void blinken::mousePressEvent(TQMouseEvent *e)
{
if (m_overHighscore || m_overCounter)
{
@ -328,8 +328,8 @@ void blinken::mousePressEvent(QMouseEvent *e)
}
}
QPoint p = e->pos();
p -= QPoint(319, 221);
TQPoint p = e->pos();
p -= TQPoint(319, 221);
if (insideGreen(p))
{
if (m_showPreferences) selectButton(3);
@ -358,7 +358,7 @@ void blinken::checkHS()
if (hsd->scoreGoodEnough(m_game.level(), m_game.score()))
{
bool ok;
QString name = KInputDialog::getText(i18n("Enter Your Name"), i18n("Name:"), m_lastName, &ok);
TQString name = KInputDialog::getText(i18n("Enter Your Name"), i18n("Name:"), m_lastName, &ok);
if (!name.isNull() && ok)
{
m_lastName = name;
@ -376,7 +376,7 @@ void blinken::highlight(blinkenGame::color c, bool unhighlight)
else if (c == blinkenGame::none)
{
m_unhighlighter -> stop();
updateCursor(mapFromGlobal(QCursor::pos()));
updateCursor(mapFromGlobal(TQCursor::pos()));
}
}
@ -446,27 +446,27 @@ void blinken::selectButton(int button)
}
}
bool blinken::insideGreen(const QPoint &p) const
bool blinken::insideGreen(const TQPoint &p) const
{
return insideButtonsArea(p) && p.x() > 6 && p.y() > 6;
}
bool blinken::insideBlue(const QPoint &p) const
bool blinken::insideBlue(const TQPoint &p) const
{
return insideButtonsArea(p) && p.x() < -6 && p.y() > 6;
}
bool blinken::insideYellow(const QPoint &p) const
bool blinken::insideYellow(const TQPoint &p) const
{
return insideButtonsArea(p) && p.x() < -6 && p.y() < -6;
}
bool blinken::insideRed(const QPoint &p) const
bool blinken::insideRed(const TQPoint &p) const
{
return insideButtonsArea(p) && p.x() > 6 && p.y() < -6;
}
bool blinken::insideButtonsArea(const QPoint &p) const
bool blinken::insideButtonsArea(const TQPoint &p) const
{
double x, y, x2, y2;
x = (double)p.x();
@ -484,7 +484,7 @@ bool blinken::insideButtonsArea(const QPoint &p) const
return false;
}
void blinken::drawMenuQuit(QPainter &p)
void blinken::drawMenuQuit(TQPainter &p)
{
if (!m_overHighscore) p.drawPixmap(10, 10, *m_highscore);
else p.drawPixmap(10, 10, *m_highscoreHover);
@ -507,9 +507,9 @@ void blinken::drawMenuQuit(QPainter &p)
}
}
void blinken::drawScoreAndCounter(QPainter &p)
void blinken::drawScoreAndCounter(TQPainter &p)
{
QColor c1, c2, c3;
TQColor c1, c2, c3;
p.translate(268, 110);
switch (m_game.phase())
@ -544,14 +544,14 @@ void blinken::drawScoreAndCounter(QPainter &p)
p.translate(-268, -110);
}
void blinken::drawStatusText(QPainter &p)
void blinken::drawStatusText(TQPainter &p)
{
p.translate(25, 505);
p.rotate(-3.29);
p.setPen(blue);
QString restartText = i18n("Restart the game");
QString text;
TQString restartText = i18n("Restart the game");
TQString text;
if (m_overQuit) text = i18n("Quit blinKen");
else if (m_overHighscore || m_overCounter) text = i18n("View Highscore Table");
else if (m_overAboutBlinken || m_overCentralLetters) text = m_helpMenu -> menu() -> text(KHelpMenu::menuAboutApp).remove("&");
@ -603,50 +603,50 @@ void blinken::drawStatusText(QPainter &p)
}
}
QFont f;
if (blinkenSettings::customFont() && !m_alwaysUseNonCoolFont) f = QFont("Steve");
TQFont f;
if (blinkenSettings::customFont() && !m_alwaysUseNonCoolFont) f = TQFont("Steve");
p.setFont(f);
f.setPointSize(fontUtils::fontSize(p, text, 380, 30));
p.setFont(f);
p.drawText(0, 0, text);
}
void blinken::drawLevel(QPainter &p)
void blinken::drawLevel(TQPainter &p)
{
QString n[3];
TQString n[3];
n[0] = i18n("2");
n[1] = i18n("1");
n[2] = i18n("?");
drawText(p, i18n("Level"), QPoint(322, 281), false, 0, 0, 0, false, true);
drawText(p, i18n("Level"), TQPoint(322, 281), false, 0, 0, 0, false, true);
QPoint cp;
TQPoint cp;
for (int i = 0; i < 3; i++)
{
if (i == 0) cp = QPoint(319, 315);
else if (i == 1) cp = QPoint(m_levelsRect[0].left() - m_levelsRect[0].width(), 315);
else if (i == 2) cp = QPoint(m_levelsRect[0].right() + m_levelsRect[0].width(), 315);
if (i == 0) cp = TQPoint(319, 315);
else if (i == 1) cp = TQPoint(m_levelsRect[0].left() - m_levelsRect[0].width(), 315);
else if (i == 2) cp = TQPoint(m_levelsRect[0].right() + m_levelsRect[0].width(), 315);
drawText(p, n[i], cp, true, 20, 5, &(m_levelsRect[i]), m_overLevels[i], true);
}
}
void blinken::drawText(QPainter &p, const QString &text, const QPoint &center, bool withMargin, int xMargin, int yMargin, QRect *rect, bool highlight, bool bold)
void blinken::drawText(TQPainter &p, const TQString &text, const TQPoint &center, bool withMargin, int xMargin, int yMargin, TQRect *rect, bool highlight, bool bold)
{
QRect r;
QFont oldFont, f = p.font();
TQRect r;
TQFont oldFont, f = p.font();
oldFont = f;
f.setPointSize(fontUtils::fontSize(p, text, 190, 30));
if (bold) f.setBold(true);
p.setFont(f);
r = p.boundingRect(QRect(), Qt::AlignAuto, text);
r = QRect(0, 0, r.width() + xMargin, r.height() + yMargin);
r = p.boundingRect(TQRect(), Qt::AlignAuto, text);
r = TQRect(0, 0, r.width() + xMargin, r.height() + yMargin);
r.moveBy(center.x() - r.width() / 2, center.y() - r.height() / 2);
if (withMargin)
{
p.fillRect(r, m_fillColor);
p.setPen(QPen(black, 3));
p.setPen(TQPen(black, 3));
p.drawRoundRect(r.left(), r.top(), r.width(), r.height(), 15, 15);
}
@ -659,7 +659,7 @@ void blinken::drawText(QPainter &p, const QString &text, const QPoint &center, b
}
void blinken::updateButtonHighlighting(const QPoint &p)
void blinken::updateButtonHighlighting(const TQPoint &p)
{
bool haveToUpdate;
m_updateButtonHighlighting = false;
@ -844,9 +844,9 @@ void blinken::updateButtonHighlighting(const QPoint &p)
if (haveToUpdate) update();
}
void blinken::updateCursor(const QPoint &p)
void blinken::updateCursor(const TQPoint &p)
{
QPoint p2 = p - QPoint(319, 221);
TQPoint p2 = p - TQPoint(319, 221);
if (m_overHighscore || m_overQuit || m_overCentralText || m_overMenu || m_overAboutKDE || m_overAboutBlinken || m_overManual || m_overLevels[0] || m_overLevels[1] || m_overLevels[2] || m_overCentralLetters || m_overCounter || (m_game.canType() && (insideGreen(p2) || insideRed(p2) || insideBlue(p2) || insideYellow(p2))) || m_overFont || m_overSound) setCursor(PointingHandCursor);
else setCursor(ArrowCursor);

@ -10,7 +10,7 @@
#ifndef BLINKEN_H
#define BLINKEN_H
#include <qwidget.h>
#include <tqwidget.h>
#include "blinkengame.h"
@ -30,11 +30,11 @@ Q_OBJECT
~blinken();
protected:
void paintEvent(QPaintEvent *);
void mouseMoveEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e);
void keyPressEvent(QKeyEvent *e);
void keyReleaseEvent(QKeyEvent *e);
void paintEvent(TQPaintEvent *);
void mouseMoveEvent(TQMouseEvent *e);
void mousePressEvent(TQMouseEvent *e);
void keyPressEvent(TQKeyEvent *e);
void keyReleaseEvent(TQKeyEvent *e);
private slots:
void checkHS();
@ -48,27 +48,27 @@ Q_OBJECT
private:
void selectButton(int button);
bool insideGreen(const QPoint &p) const;
bool insideYellow(const QPoint &p) const;
bool insideRed(const QPoint &p) const;
bool insideBlue(const QPoint &p) const;
bool insideButtonsArea(const QPoint &p) const;
void updateCursor(const QPoint &p);
bool insideGreen(const TQPoint &p) const;
bool insideYellow(const TQPoint &p) const;
bool insideRed(const TQPoint &p) const;
bool insideBlue(const TQPoint &p) const;
bool insideButtonsArea(const TQPoint &p) const;
void updateCursor(const TQPoint &p);
void drawMenuQuit(QPainter &p);
void drawScoreAndCounter(QPainter &p);
void drawStatusText(QPainter &p);
void drawLevel(QPainter &p);
void drawText(QPainter &p, const QString &text, const QPoint &center, bool withMargin, int xMargin, int yMargin, QRect *rect, bool highlight, bool bold);
void updateButtonHighlighting(const QPoint &p);
void drawMenuQuit(TQPainter &p);
void drawScoreAndCounter(TQPainter &p);
void drawStatusText(TQPainter &p);
void drawLevel(TQPainter &p);
void drawText(TQPainter &p, const TQString &text, const TQPoint &center, bool withMargin, int xMargin, int yMargin, TQRect *rect, bool highlight, bool bold);
void updateButtonHighlighting(const TQPoint &p);
button *m_buttons[4];
QPixmap *m_back, *m_highscore, *m_highscoreHover, *m_quit, *m_quitHover, *m_menu, *m_menuHover, *m_mark;
TQPixmap *m_back, *m_highscore, *m_highscoreHover, *m_quit, *m_quitHover, *m_menu, *m_menuHover, *m_mark;
bool m_overHighscore, m_overQuit, m_overCentralText, m_overMenu, m_overAboutKDE, m_overAboutBlinken, m_overManual, m_overLevels[3], m_overCentralLetters, m_overCounter, m_overFont, m_overSound;
// i obviously suck but m_levelsRect[0] is 2, m_levelsRect[1] is 1 and m_levelsRect[3] is ?
QRect m_highscoreRect, m_quitRect, m_centralTextRect, m_menuRect, m_aboutKDERect, m_aboutBlinkenRect, m_manualRect, m_levelsRect[3], m_centralLettersRect, m_counterRect, m_soundRect, m_fontRect;
QColor m_fillColor, m_fontColor, m_fontHighlightColor, m_countDownColor;
TQRect m_highscoreRect, m_quitRect, m_centralTextRect, m_menuRect, m_aboutKDERect, m_aboutBlinkenRect, m_manualRect, m_levelsRect[3], m_centralLettersRect, m_counterRect, m_soundRect, m_fontRect;
TQColor m_fillColor, m_fontColor, m_fontHighlightColor, m_countDownColor;
// Preferences setting handling
bool m_showPreferences;
@ -80,9 +80,9 @@ Q_OBJECT
bool m_alwaysUseNonCoolFont;
blinkenGame::color m_highlighted;
QTimer *m_unhighlighter;
TQTimer *m_unhighlighter;
QString m_lastName;
TQString m_lastName;
blinkenGame m_game;

@ -9,7 +9,7 @@
#include <stdlib.h> // for RAND_MAX
#include <qtimer.h>
#include <tqtimer.h>
#include <kapplication.h>
@ -19,8 +19,8 @@
blinkenGame::blinkenGame() : m_phase(starting)
{
m_artsPlayer = new artsPlayer;
m_waitTimer = new QTimer(this);
connect(m_waitTimer, SIGNAL(timeout()), this, SLOT(waiting()));
m_waitTimer = new TQTimer(this);
connect(m_waitTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(waiting()));
}
blinkenGame::~blinkenGame()
@ -114,8 +114,8 @@ void blinkenGame::nextSound()
void blinkenGame::soundEnded()
{
QTimer::singleShot(100, this, SLOT(nextSound()));
QTimer::singleShot(50, this, SLOT(unhighlight()));
TQTimer::singleShot(100, this, TQT_SLOT(nextSound()));
TQTimer::singleShot(50, this, TQT_SLOT(unhighlight()));
}
void blinkenGame::unhighlight()
@ -135,7 +135,7 @@ void blinkenGame::waiting()
}
else m_sequence.append(generateColor());
connect(m_artsPlayer, SIGNAL(ended()), this, SLOT(soundEnded()));
connect(m_artsPlayer, TQT_SIGNAL(ended()), this, TQT_SLOT(soundEnded()));
m_nextColor = m_sequence.begin();
soundEnded();
}

@ -10,8 +10,8 @@
#ifndef BLINKENGAME_H
#define BLINKENGAME_H
#include <qobject.h>
#include <qvaluelist.h>
#include <tqobject.h>
#include <tqvaluelist.h>
class QTimer;
@ -62,11 +62,11 @@ Q_OBJECT
int m_level;
int m_sequenceLength;
QTimer *m_waitTimer;
TQTimer *m_waitTimer;
artsPlayer *m_artsPlayer;
QValueList<color> m_sequence;
QValueList<color>::const_iterator m_nextColor;
TQValueList<color> m_sequence;
TQValueList<color>::const_iterator m_nextColor;
};
#endif

@ -19,8 +19,8 @@ button::button(blinkenGame::color c) : m_selected(false), m_color(c)
{
KConfig *kc = kapp->config();
kc->setGroup("General");
QString cs = getColorString();
QString pixmap = QString("images/%1h.png").arg(cs);
TQString cs = getColorString();
TQString pixmap = TQString("images/%1h.png").arg(cs);
switch (c)
{
@ -45,7 +45,7 @@ button::button(blinkenGame::color c) : m_selected(false), m_color(c)
break;
}
m_highlighted = new QPixmap(locate("appdata", pixmap));
m_highlighted = new TQPixmap(locate("appdata", pixmap));
}
button::~button()
@ -64,7 +64,7 @@ void button::setShortcut(int key)
kc->sync();
}
QString button::shortcut() const
TQString button::shortcut() const
{
return KShortcut(m_key).toString();
}
@ -84,12 +84,12 @@ bool button::selected() const
return m_selected;
}
QPixmap *button::pixmap() const
TQPixmap *button::pixmap() const
{
return m_highlighted;
}
QString button::getColorString() const
TQString button::getColorString() const
{
switch (m_color)
{
@ -115,5 +115,5 @@ QString button::getColorString() const
}
// never happens
return QString::null;
return TQString::null;
}

@ -10,7 +10,7 @@
#ifndef BUTTON_H
#define BUTTON_H
#include <qobject.h>
#include <tqobject.h>
#include "blinkengame.h"
@ -25,16 +25,16 @@ class button
~button();
void setShortcut(int key);
QString shortcut() const;
TQString shortcut() const;
int key() const;
void setSelected(bool b);
bool selected() const;
QPixmap *pixmap() const;
TQPixmap *pixmap() const;
private:
QString getColorString() const;
TQString getColorString() const;
QPixmap *m_highlighted;
TQPixmap *m_highlighted;
bool m_selected;
int m_key;
blinkenGame::color m_color;

@ -7,18 +7,18 @@
* (at your option) any later version. *
***************************************************************************/
#include <qcolor.h>
#include <qpainter.h>
#include <tqcolor.h>
#include <tqpainter.h>
#include "counter.h"
#include "number.h"
void counter::paint(QPainter &p, bool drawScore, int score, bool drawTimer, const QColor &c1, const QColor &c2, const QColor &c3)
void counter::paint(TQPainter &p, bool drawScore, int score, bool drawTimer, const TQColor &c1, const TQColor &c2, const TQColor &c3)
{
p.save();
p.translate(45, 15);
p.setPen(QPen(Qt::black, 3));
p.setBrush(QColor(40, 40, 40));
p.setPen(TQPen(Qt::black, 3));
p.setBrush(TQColor(40, 40, 40));
if (drawTimer)
{
p.fillRect(-44, -13, 98, 48, p.brush());

@ -15,7 +15,7 @@ class QPainter;
class counter
{
public:
static void paint(QPainter &p, bool drawScore, int score, bool drawTimer, const QColor &c1, const QColor &c2, const QColor &c3);
static void paint(TQPainter &p, bool drawScore, int score, bool drawTimer, const TQColor &c1, const TQColor &c2, const TQColor &c3);
static int width(bool drawTimer);
static int height();
};

@ -7,16 +7,16 @@
* (at your option) any later version. *
***************************************************************************/
#include <qfont.h>
#include <qfontinfo.h>
#include <tqfont.h>
#include <tqfontinfo.h>
#include <kio/netaccess.h>
#include "fontchecker.h"
bool fontChecker::checkInstalled(const QFont &font, const QString &fontPath)
bool fontChecker::checkInstalled(const TQFont &font, const TQString &fontPath)
{
QFontInfo fi(font);
TQFontInfo fi(font);
// Works with Steve may need some tweaking to work with other fonts
if (!fi.exactMatch())
{

@ -15,7 +15,7 @@ class QFont;
class fontChecker
{
public:
static bool checkInstalled(const QFont &font, const QString &fontPath);
static bool checkInstalled(const TQFont &font, const TQString &fontPath);
};
#endif

@ -7,24 +7,24 @@
* (at your option) any later version. *
***************************************************************************/
#include <qpainter.h>
#include <tqpainter.h>
#include "fontutils.h"
int fontUtils::fontSize(QPainter &p, const QString &s1, int w, int h)
int fontUtils::fontSize(TQPainter &p, const TQString &s1, int w, int h)
{
int size;
QRect aux1;
TQRect aux1;
bool done = false;
size = 28;
while (!done)
{
QFont f = p.font();
TQFont f = p.font();
f.setPointSize(size);
p.setFont(f);
aux1 = p.boundingRect(QRect(), Qt::AlignAuto, s1);
aux1 = p.boundingRect(TQRect(), Qt::AlignAuto, s1);
if (aux1.width() > w || aux1.height() > h) size = QMIN(w * size / aux1.width(), h * size / aux1.height());
else done = true;
}

@ -12,7 +12,7 @@
namespace fontUtils
{
int fontSize(QPainter &p, const QString &s1, int w, int h);
int fontSize(TQPainter &p, const TQString &s1, int w, int h);
}
#endif

@ -7,10 +7,10 @@
* (at your option) any later version. *
***************************************************************************/
#include <qpainter.h>
#include <qpixmap.h>
#include <qtabbar.h>
#include <qtabwidget.h>
#include <tqpainter.h>
#include <tqpixmap.h>
#include <tqtabbar.h>
#include <tqtabwidget.h>
#include <kapplication.h>
#include <kconfig.h>
@ -30,46 +30,46 @@ static const int namesFontSize = 25;
class scoresWidget : public QWidget
{
public:
scoresWidget(QWidget *parent, const QValueList< QPair<int, QString> > &scores);
QSize calcSize();
scoresWidget(TQWidget *parent, const TQValueList< QPair<int, TQString> > &scores);
TQSize calcSize();
protected:
void paintEvent(QPaintEvent *);
void paintEvent(TQPaintEvent *);
private:
const QValueList< QPair<int, QString> > &m_scores;
const TQValueList< QPair<int, TQString> > &m_scores;
};
scoresWidget::scoresWidget(QWidget *parent, const QValueList< QPair<int, QString> > &scores) : QWidget(parent, 0, WStaticContents | WNoAutoErase), m_scores(scores)
scoresWidget::scoresWidget(TQWidget *parent, const TQValueList< QPair<int, TQString> > &scores) : TQWidget(parent, 0, WStaticContents | WNoAutoErase), m_scores(scores)
{
}
void scoresWidget::paintEvent(QPaintEvent *)
void scoresWidget::paintEvent(TQPaintEvent *)
{
int w = width();
int h = height();
QFont f;
QPixmap buf(w, h);
QPainter p(&buf);
QRect r;
QColor bg = paletteBackgroundColor();
TQFont f;
TQPixmap buf(w, h);
TQPainter p(&buf);
TQRect r;
TQColor bg = paletteBackgroundColor();
// bg color
p.fillRect(0, 0, w, h, bg);
p.setPen(black);
if (blinkenSettings::customFont()) f = QFont("Steve");
if (blinkenSettings::customFont()) f = TQFont("Steve");
p.setFont(f);
f.setPointSize(fontUtils::fontSize(p, "A", 1000, namesFontSize));
p.setFont(f);
p.translate(margin, margin);
QValueList< QPair<int, QString> >::const_iterator it;
TQValueList< QPair<int, TQString> >::const_iterator it;
for (it = m_scores.begin(); it != m_scores.end(); ++it)
{
counter::paint(p, !(*it).second.isEmpty(), (*it).first, false, QColor(), QColor(), QColor());
counter::paint(p, !(*it).second.isEmpty(), (*it).first, false, TQColor(), TQColor(), TQColor());
p.setPen(black);
p.drawText(counter::width(false) + 2 * smallMargin, 30, (*it).second);
p.translate(0, counter::height() + smallMargin);
@ -78,24 +78,24 @@ void scoresWidget::paintEvent(QPaintEvent *)
bitBlt(this, 0, 0, &buf);
}
QSize scoresWidget::calcSize()
TQSize scoresWidget::calcSize()
{
int mw, mh, lt;
QRect r;
QPainter p(this);
QFont f;
TQRect r;
TQPainter p(this);
TQFont f;
if (blinkenSettings::customFont()) f = QFont("Steve");
if (blinkenSettings::customFont()) f = TQFont("Steve");
p.setFont(f);
f.setPointSize(fontUtils::fontSize(p, "A", 1000, namesFontSize));
p.setFont(f);
for (int i = 0; i < 3; i++)
{
lt = 0;
QValueList< QPair<int, QString> >::const_iterator it;
TQValueList< QPair<int, TQString> >::const_iterator it;
for (it = m_scores.begin(); it != m_scores.end(); ++it)
{
r = p.boundingRect(QRect(), Qt::AlignAuto, (*it).second);
r = p.boundingRect(TQRect(), Qt::AlignAuto, (*it).second);
lt = QMAX(lt, r.width());
}
}
@ -103,7 +103,7 @@ QSize scoresWidget::calcSize()
mw = margin + counter::width(false) + 2 * smallMargin + lt + margin;
mh = margin * 2 + counter::height() * 5 + smallMargin * 4;
QSize size(mw, mh);
TQSize size(mw, mh);
setMinimumSize(size);
resize(size);
@ -115,9 +115,9 @@ QSize scoresWidget::calcSize()
class myTabWidget : public QTabWidget
{
public:
myTabWidget(QWidget *parent) : QTabWidget(parent) {}
myTabWidget(TQWidget *parent) : TQTabWidget(parent) {}
QSize tabBarSizeHint() const
TQSize tabBarSizeHint() const
{
return tabBar() -> sizeHint();
}
@ -125,7 +125,7 @@ class myTabWidget : public QTabWidget
/* highScoreDialog */
highScoreDialog::highScoreDialog(QWidget *parent) : KDialogBase(parent, 0, true, i18n("Highscores"), KDialogBase::Close)
highScoreDialog::highScoreDialog(TQWidget *parent) : KDialogBase(parent, 0, true, i18n("Highscores"), KDialogBase::Close)
{
m_tw = new myTabWidget(this);
setMainWidget(m_tw);
@ -133,10 +133,10 @@ highScoreDialog::highScoreDialog(QWidget *parent) : KDialogBase(parent, 0, true,
KConfig *cfg = kapp -> config();
for (int i = 1; i <= 3; i++)
{
cfg -> setGroup(QString("Level%1").arg(i));
cfg -> setGroup(TQString("Level%1").arg(i));
for (int j = 1; j <= 5; j++)
{
m_scores[i-1].append(qMakePair(cfg->readNumEntry(QString("Score%1").arg(j)), cfg->readEntry(QString("Name%1").arg(j))));
m_scores[i-1].append(qMakePair(cfg->readNumEntry(TQString("Score%1").arg(j)), cfg->readEntry(TQString("Name%1").arg(j))));
}
}
@ -148,7 +148,7 @@ highScoreDialog::highScoreDialog(QWidget *parent) : KDialogBase(parent, 0, true,
bool highScoreDialog::scoreGoodEnough(int level, int score)
{
level--;
QValueList< QPair<int, QString> >::iterator it, itEnd;
TQValueList< QPair<int, TQString> >::iterator it, itEnd;
it = m_scores[level].begin();
itEnd = m_scores[level].end();
while (it != itEnd && (*it).first >= score) it++;
@ -156,10 +156,10 @@ bool highScoreDialog::scoreGoodEnough(int level, int score)
return (it != itEnd);
}
void highScoreDialog::addScore(int level, int score, const QString &name)
void highScoreDialog::addScore(int level, int score, const TQString &name)
{
level--;
QValueList< QPair<int, QString> >::iterator it, itEnd;
TQValueList< QPair<int, TQString> >::iterator it, itEnd;
it = m_scores[level].begin();
itEnd = m_scores[level].end();
while (it != itEnd && (*it).first >= score) it++;
@ -170,12 +170,12 @@ void highScoreDialog::addScore(int level, int score, const QString &name)
m_scores[level].remove(--m_scores[level].end());
KConfig *cfg = kapp -> config();
cfg -> setGroup(QString("Level%1").arg(level + 1));
cfg -> setGroup(TQString("Level%1").arg(level + 1));
int j;
for (it = m_scores[level].begin(), j = 1; it != m_scores[level].end(); ++it, j++)
{
cfg->writeEntry(QString("Score%1").arg(j), (*it).first);
cfg->writeEntry(QString("Name%1").arg(j), (*it).second);
cfg->writeEntry(TQString("Score%1").arg(j), (*it).first);
cfg->writeEntry(TQString("Name%1").arg(j), (*it).second);
}
cfg -> sync();
}
@ -183,7 +183,7 @@ void highScoreDialog::addScore(int level, int score, const QString &name)
void highScoreDialog::showLevel(int level)
{
QSize max, aux;
TQSize max, aux;
m_tw -> setCurrentPage(level -1);
for (int i = 0; i < 3; i++)

@ -10,8 +10,8 @@
#ifndef HIGHSCOREDIALOG_H
#define HIGHSCOREDIALOG_H
#include <qpair.h>
#include <qvaluelist.h>
#include <tqpair.h>
#include <tqvaluelist.h>
#include <kdialogbase.h>
@ -20,13 +20,13 @@ class myTabWidget;
class highScoreDialog : private KDialogBase
{
public:
highScoreDialog(QWidget *parent);
highScoreDialog(TQWidget *parent);
bool scoreGoodEnough(int level, int score);
void addScore(int level, int score, const QString &name);
void addScore(int level, int score, const TQString &name);
void showLevel(int level);
QValueList< QPair<int, QString> > m_scores[3];
TQValueList< QPair<int, TQString> > m_scores[3];
myTabWidget *m_tw;
};

@ -24,9 +24,9 @@ int main(int argc, char *argv[])
about.addCredit("Steve Jordi", I18N_NOOP("GPL'ed his 'Steve' font so that we could use it"), "steve@sjordi.com");
KCmdLineArgs::init(argc, argv, &about);
KApplication app;
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
app.connect(&app, TQT_SIGNAL(lastWindowClosed()), &app, TQT_SLOT(quit()));
QFont f("Steve", 12, QFont::Normal, true);
TQFont f("Steve", 12, TQFont::Normal, true);
if (!fontChecker::checkInstalled(f, locate("appdata", "fonts/steve.ttf")))
{
KProcess *proc = new KProcess;

@ -7,9 +7,9 @@
* (at your option) any later version. *