summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/backgammon/backgammon.control2
-rw-r--r--noncore/games/backgammon/backgammon.h1
-rw-r--r--noncore/games/backgammon/backgammon.pro4
-rw-r--r--noncore/games/backgammon/main.cpp10
-rw-r--r--noncore/games/bounce/bounce.pro4
-rw-r--r--noncore/games/bounce/kbounce.cpp3
-rw-r--r--noncore/games/bounce/kbounce.h3
-rw-r--r--noncore/games/bounce/main.cpp9
-rw-r--r--noncore/games/bounce/opie-bounce.control2
-rw-r--r--noncore/games/buzzword/buzzword.cpp2
-rw-r--r--noncore/games/buzzword/buzzword.h3
-rw-r--r--noncore/games/buzzword/buzzword.pro7
-rw-r--r--noncore/games/buzzword/main.cpp15
-rw-r--r--noncore/games/buzzword/opie-buzzword.control2
-rw-r--r--noncore/games/fifteen/opie-fifteen.control2
-rw-r--r--noncore/games/go/go.pro6
-rw-r--r--noncore/games/go/gowidget.cpp4
-rw-r--r--noncore/games/go/gowidget.h3
-rw-r--r--noncore/games/go/main.cpp13
-rw-r--r--noncore/games/go/opie-go.control4
-rw-r--r--noncore/games/kcheckers/kcheckers.cpp5
-rw-r--r--noncore/games/kcheckers/kcheckers.h3
-rw-r--r--noncore/games/kcheckers/kcheckers.pro5
-rw-r--r--noncore/games/kcheckers/main.cpp12
-rw-r--r--noncore/games/kcheckers/opie-kcheckers.control2
-rw-r--r--noncore/games/mindbreaker/main.cpp10
-rw-r--r--noncore/games/mindbreaker/mindbreaker.cpp455
-rw-r--r--noncore/games/mindbreaker/mindbreaker.h27
-rw-r--r--noncore/games/mindbreaker/mindbreaker.pro5
-rw-r--r--noncore/games/mindbreaker/opie-mindbreaker.control2
-rw-r--r--noncore/games/minesweep/main.cpp11
-rw-r--r--noncore/games/minesweep/minefield.cpp2
-rw-r--r--noncore/games/minesweep/minesweep.cpp26
-rw-r--r--noncore/games/minesweep/minesweep.h1
-rw-r--r--noncore/games/minesweep/minesweep.pro28
-rw-r--r--noncore/games/minesweep/opie-minesweep.control2
-rw-r--r--noncore/games/parashoot/interface.cpp33
-rw-r--r--noncore/games/parashoot/interface.h1
-rw-r--r--noncore/games/parashoot/main.cpp13
-rw-r--r--noncore/games/parashoot/opie-parashoot.control2
-rw-r--r--noncore/games/parashoot/parashoot.pro6
-rw-r--r--noncore/games/qasteroids/main.cpp13
-rw-r--r--noncore/games/qasteroids/opie-qasteroids.control2
-rw-r--r--noncore/games/qasteroids/qasteroids.pro6
-rw-r--r--noncore/games/qasteroids/toplevel.cpp19
-rw-r--r--noncore/games/qasteroids/toplevel.h4
-rw-r--r--noncore/games/snake/interface.cpp2
-rw-r--r--noncore/games/snake/interface.h5
-rw-r--r--noncore/games/snake/main.cpp14
-rw-r--r--noncore/games/snake/opie-snake.control2
-rw-r--r--noncore/games/snake/snake.pro5
-rw-r--r--noncore/games/solitaire/canvascardwindow.cpp15
-rw-r--r--noncore/games/solitaire/canvascardwindow.h1
-rw-r--r--noncore/games/solitaire/carddeck.cpp2
-rw-r--r--noncore/games/solitaire/main.cpp14
-rwxr-xr-xnoncore/games/solitaire/solitaire.pro5
-rw-r--r--noncore/games/tetrix/main.cpp9
-rw-r--r--noncore/games/tetrix/opie-tetrix.control2
-rw-r--r--noncore/games/tetrix/qtetrix.h1
-rw-r--r--noncore/games/tetrix/tetrix.pro7
-rw-r--r--noncore/games/wordgame/main.cpp10
-rw-r--r--noncore/games/wordgame/wordgame.h1
-rw-r--r--noncore/games/wordgame/wordgame.pro5
63 files changed, 489 insertions, 405 deletions
diff --git a/noncore/games/backgammon/backgammon.control b/noncore/games/backgammon/backgammon.control
index 6468181..d78b547 100644
--- a/noncore/games/backgammon/backgammon.control
+++ b/noncore/games/backgammon/backgammon.control
@@ -1,3 +1,3 @@
Package: backgammon
-Files: bin/backgammon apps/Games/backgammon.desktop pics/backgammon help/en/html/backgammon.html
+Files: plugins/application/libbackgammon.so* bin/backgammon apps/Games/backgammon.desktop pics/backgammon help/en/html/backgammon.html
Priority: optional
diff --git a/noncore/games/backgammon/backgammon.h b/noncore/games/backgammon/backgammon.h
index e3276f1..fb50500 100644
--- a/noncore/games/backgammon/backgammon.h
+++ b/noncore/games/backgammon/backgammon.h
@@ -87,2 +87,3 @@ private:
public:
+ static QString appName() { return QString::fromLatin1("backgammon"); }
BackGammon( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
diff --git a/noncore/games/backgammon/backgammon.pro b/noncore/games/backgammon/backgammon.pro
index 4be9491..063d617 100644
--- a/noncore/games/backgammon/backgammon.pro
+++ b/noncore/games/backgammon/backgammon.pro
@@ -1,3 +1,2 @@
-TEMPLATE = app
-CONFIG = qt warn_on release
+CONFIG = qt warn_on release quick-app
@@ -30,3 +29,2 @@ DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lstdc++
-DESTDIR = $(OPIEDIR)/bin
diff --git a/noncore/games/backgammon/main.cpp b/noncore/games/backgammon/main.cpp
index 86b452d..58ced10 100644
--- a/noncore/games/backgammon/main.cpp
+++ b/noncore/games/backgammon/main.cpp
@@ -3,12 +3,6 @@
+#include <opie/oapplicationfactory.h>
-int main( int argc, char** argv )
-{
- QPEApplication app( argc, argv );
+OPIE_EXPORT_APP( OApplicationFactory<BackGammon> )
- BackGammon* view= new BackGammon();
- app.showMainWidget(view);
-
- return app.exec();
-}
diff --git a/noncore/games/bounce/bounce.pro b/noncore/games/bounce/bounce.pro
index 338daf6..75e4a6b 100644
--- a/noncore/games/bounce/bounce.pro
+++ b/noncore/games/bounce/bounce.pro
@@ -1,4 +1,3 @@
-TEMPLATE = app
#CONFIG = qt warn_on debug
-CONFIG = qt warn_on release
+CONFIG = qt warn_on release quick-app
HEADERS = game.h kbounce.h
@@ -8,3 +7,2 @@ DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
-DESTDIR = $(OPIEDIR)/bin
TARGET = bounce
diff --git a/noncore/games/bounce/kbounce.cpp b/noncore/games/bounce/kbounce.cpp
index 50f4ef6..211f0ff 100644
--- a/noncore/games/bounce/kbounce.cpp
+++ b/noncore/games/bounce/kbounce.cpp
@@ -29,3 +29,4 @@
-KJezzball::KJezzball() : QMainWindow(0), m_gameWidget( 0 )
+KJezzball::KJezzball(QWidget *p, const char* n, WFlags f)
+ : QMainWindow(p,n,f), m_gameWidget( 0 )
{
diff --git a/noncore/games/bounce/kbounce.h b/noncore/games/bounce/kbounce.h
index de41710..c59109f 100644
--- a/noncore/games/bounce/kbounce.h
+++ b/noncore/games/bounce/kbounce.h
@@ -34,3 +34,4 @@ class KJezzball : public QMainWindow
public:
- KJezzball();
+ static QString appName() { return QString::fromLatin1("bounce"); }
+ KJezzball(QWidget *, const char*, WFlags );
diff --git a/noncore/games/bounce/main.cpp b/noncore/games/bounce/main.cpp
index a6b7c1a..9ea86a6 100644
--- a/noncore/games/bounce/main.cpp
+++ b/noncore/games/bounce/main.cpp
@@ -20,10 +20,5 @@
#include "kbounce.h"
+#include <opie/oapplicationfactory.h>
-int main(int argc, char **argv)
-{
- QPEApplication a( argc, argv );
- KJezzball *top = new KJezzball;
- a.showMainWidget(top);
+OPIE_EXPORT_APP( OApplicationFactory<KJezzball> )
- return a.exec();
-}
diff --git a/noncore/games/bounce/opie-bounce.control b/noncore/games/bounce/opie-bounce.control
index 8b3fdb9..bfe85d3 100644
--- a/noncore/games/bounce/opie-bounce.control
+++ b/noncore/games/bounce/opie-bounce.control
@@ -1,3 +1,3 @@
Package: opie-bounce
-Files: bin/bounce apps/Games/bounce.desktop pics/bounce/*.png
+Files: plugins/application/libbounce.so* bin/bounce apps/Games/bounce.desktop pics/bounce/*.png
Version: 0.6-$SUB_VERSION
diff --git a/noncore/games/buzzword/buzzword.cpp b/noncore/games/buzzword/buzzword.cpp
index 97a17a1..f746065 100644
--- a/noncore/games/buzzword/buzzword.cpp
+++ b/noncore/games/buzzword/buzzword.cpp
@@ -70,3 +70,3 @@ void BuzzItem::flip()
-BuzzWord::BuzzWord() : QMainWindow(0)
+BuzzWord::BuzzWord(QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl )
{
diff --git a/noncore/games/buzzword/buzzword.h b/noncore/games/buzzword/buzzword.h
index 37dd5b4..c0e43d0 100644
--- a/noncore/games/buzzword/buzzword.h
+++ b/noncore/games/buzzword/buzzword.h
@@ -66,3 +66,4 @@ class BuzzWord : public QMainWindow
public:
- BuzzWord();
+ BuzzWord( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ static QString appName() { return QString::fromLatin1("buzzword"); }
diff --git a/noncore/games/buzzword/buzzword.pro b/noncore/games/buzzword/buzzword.pro
index 0faede8..247b593 100644
--- a/noncore/games/buzzword/buzzword.pro
+++ b/noncore/games/buzzword/buzzword.pro
@@ -1,3 +1,2 @@
-TEMPLATE = app
-CONFIG = qt warn_on release
+CONFIG = qt warn_on release quick-app
HEADERS = buzzword.h
@@ -6,5 +5,5 @@ INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-DESTDIR = $(OPIEDIR)/bin
LIBS += -lqpe
-TARGET = buzzword
+
+TARGET = buzzword
diff --git a/noncore/games/buzzword/main.cpp b/noncore/games/buzzword/main.cpp
index 2d9ff81..67f2c26 100644
--- a/noncore/games/buzzword/main.cpp
+++ b/noncore/games/buzzword/main.cpp
@@ -19,5 +19,3 @@
#include <qpe/qpeapplication.h>
-
-#include <stdlib.h>
-#include <time.h>
+#include <opie/oapplicationfactory.h>
@@ -25,11 +23,2 @@
-int main(int argc, char **argv)
-{
- srand(time(0));
-
- QPEApplication a( argc, argv );
- BuzzWord *top = new BuzzWord;
- a.showMainWidget(top);
-
- return a.exec();
-}
+OPIE_EXPORT_APP( OApplicationFactory<BuzzWord> )
diff --git a/noncore/games/buzzword/opie-buzzword.control b/noncore/games/buzzword/opie-buzzword.control
index 08b442b..b3e2496 100644
--- a/noncore/games/buzzword/opie-buzzword.control
+++ b/noncore/games/buzzword/opie-buzzword.control
@@ -1,3 +1,3 @@
Package: opie-buzzword
-Files: bin/buzzword apps/Games/buzzword.desktop pics/buzzword/buzzword.png share/buzzword/buzzwords
+Files: plugins/application/libbuzzword.so* bin/buzzword apps/Games/buzzword.desktop pics/buzzword/buzzword.png share/buzzword/buzzwords
Version: 1.1-$SUB_VERSION
diff --git a/noncore/games/fifteen/opie-fifteen.control b/noncore/games/fifteen/opie-fifteen.control
index 8fa355f..a6e8314 100644
--- a/noncore/games/fifteen/opie-fifteen.control
+++ b/noncore/games/fifteen/opie-fifteen.control
@@ -1,3 +1,3 @@
Package: opie-fifteen
-Files: bin/fifteen apps/Games/fifteen.desktop pics/fifteen
+Files: plugins/application/libfifteen.so* bin/fifteen apps/Games/fifteen.desktop pics/fifteen
Priority: optional
diff --git a/noncore/games/go/go.pro b/noncore/games/go/go.pro
index 2bc0787..f6c6a54 100644
--- a/noncore/games/go/go.pro
+++ b/noncore/games/go/go.pro
@@ -1,4 +1,2 @@
-DESTDIR = $(OPIEDIR)/bin
-TEMPLATE = app
-CONFIG = qt warn_on release
+CONFIG = qt warn_on release quick-app
HEADERS = amigo.h \
@@ -18,2 +16,4 @@ TARGET = go
+
+
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/go/gowidget.cpp b/noncore/games/go/gowidget.cpp
index 6d06f3b..cf89267 100644
--- a/noncore/games/go/gowidget.cpp
+++ b/noncore/games/go/gowidget.cpp
@@ -53,4 +53,4 @@ static bool smallStones = FALSE;
-GoMainWidget::GoMainWidget( QWidget *parent, const char* name) :
- QMainWindow( parent, name )
+GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) :
+ QMainWindow( parent, name, fl )
{
diff --git a/noncore/games/go/gowidget.h b/noncore/games/go/gowidget.h
index 94de2cc..429dc33 100644
--- a/noncore/games/go/gowidget.h
+++ b/noncore/games/go/gowidget.h
@@ -33,3 +33,4 @@ class GoMainWidget : public QMainWindow
public:
- GoMainWidget( QWidget *parent=0, const char* name=0);
+ static QString appName() { return QString::fromLatin1("go"); }
+ GoMainWidget( QWidget *parent=0, const char* name=0, WFlags fl = 0);
protected:
diff --git a/noncore/games/go/main.cpp b/noncore/games/go/main.cpp
index c7e2669..f24e3c3 100644
--- a/noncore/games/go/main.cpp
+++ b/noncore/games/go/main.cpp
@@ -24,12 +24,5 @@
-#include <stdio.h>
+#include <opie/oapplicationfactory.h>
+
+OPIE_EXPORT_APP( OApplicationFactory<GoMainWidget> )
-int main( int argc, char ** argv)
-{
- QPEApplication app( argc, argv );
-
- GoMainWidget m;
- m.setCaption( GoWidget::tr("Go") );
- app.showMainWidget( &m );
- return app.exec();
-}
diff --git a/noncore/games/go/opie-go.control b/noncore/games/go/opie-go.control
index b07e8be..95b319e 100644
--- a/noncore/games/go/opie-go.control
+++ b/noncore/games/go/opie-go.control
@@ -1,6 +1,6 @@
Package: opie-go
-Files: bin/go apps/Games/go.desktop pics/go
+Files: plugins/application/libgo.so* bin/go apps/Games/go.desktop pics/go
Priority: optional
Section: opie/games
-Maintainer: Opie Project <opie@handhelds.org>
+Maintainer: Warwick Allison <warwick@trolltech.com>
Architecture: arm
diff --git a/noncore/games/kcheckers/kcheckers.cpp b/noncore/games/kcheckers/kcheckers.cpp
index c2eba0d..2eb37e5 100644
--- a/noncore/games/kcheckers/kcheckers.cpp
+++ b/noncore/games/kcheckers/kcheckers.cpp
@@ -44,5 +44,6 @@ const int KCheckers::t[]={6,7,8,9,11,12,13,14,17,18,19,20,22,23,
-KCheckers::KCheckers():QMainWindow(0,0,WStyle_DialogBorder)
+KCheckers::KCheckers(QWidget *p, const char* n, WFlags )
+ :QMainWindow(p,n,WStyle_DialogBorder)
{
- setCaption("KCheckers");
+ setCaption(tr("KCheckers") );
setIcon(QPixmap(biglogo_xpm));
diff --git a/noncore/games/kcheckers/kcheckers.h b/noncore/games/kcheckers/kcheckers.h
index ccf5bae..bd4afc7 100644
--- a/noncore/games/kcheckers/kcheckers.h
+++ b/noncore/games/kcheckers/kcheckers.h
@@ -31,3 +31,4 @@ class KCheckers:public QMainWindow
public:
- KCheckers();
+ static QString appName() { return QString::fromLatin1("kcheckers"); }
+ KCheckers(QWidget *parent, const char* name, WFlags fl);
diff --git a/noncore/games/kcheckers/kcheckers.pro b/noncore/games/kcheckers/kcheckers.pro
index a23e83a..0d417bf 100644
--- a/noncore/games/kcheckers/kcheckers.pro
+++ b/noncore/games/kcheckers/kcheckers.pro
@@ -1,3 +1,2 @@
-TEMPLATE = app
-CONFIG = qt warn_on release
+CONFIG = qt warn_on release quick-app
HEADERS = checkers.h \
@@ -16,5 +15,5 @@ INCLUDEPATH += $(OPIEDIR)/include
LIBS += -lqpe
-DESTDIR = $(OPIEDIR)/bin
TARGET = kcheckers
+
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/kcheckers/main.cpp b/noncore/games/kcheckers/main.cpp
index b8dd620..6ac570a 100644
--- a/noncore/games/kcheckers/main.cpp
+++ b/noncore/games/kcheckers/main.cpp
@@ -5,14 +5,6 @@
#include "kcheckers.h"
+#include <opie/oapplicationfactory.h>
+OPIE_EXPORT_APP( OApplicationFactory<KCheckers> )
-int main(int argc, char *argv[])
-{
- QPEApplication app(argc,argv);
-
- KCheckers kcheckers;
- app.setMainWidget(&kcheckers);
- kcheckers.showMaximized();
-
- return app.exec();
-}
diff --git a/noncore/games/kcheckers/opie-kcheckers.control b/noncore/games/kcheckers/opie-kcheckers.control
index e228209..71f83af 100644
--- a/noncore/games/kcheckers/opie-kcheckers.control
+++ b/noncore/games/kcheckers/opie-kcheckers.control
@@ -1,3 +1,3 @@
Package: opie-kcheckers
-Files: bin/kcheckers apps/Games/kcheckers.desktop pics/kcheckers
+Files: plugins/application/libkcheckers.so* bin/kcheckers apps/Games/kcheckers.desktop pics/kcheckers
Priority: optional
diff --git a/noncore/games/mindbreaker/main.cpp b/noncore/games/mindbreaker/main.cpp
index 8ba0fde..2ca16e3 100644
--- a/noncore/games/mindbreaker/main.cpp
+++ b/noncore/games/mindbreaker/main.cpp
@@ -1,5 +1,5 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
@@ -22,3 +22,3 @@
-#include <qpe/qpeapplication.h>
+#include <qtopia/qpeapplication.h>
@@ -28,4 +28,4 @@ int main( int argc, char **argv )
- MindBreaker w(0, "new window");
- w.setCaption("Mind Breaker");
+ MindBreaker w;
+ w.setCaption(MindBreaker::tr("Mind Breaker"));
QPEApplication::setInputMethodHint( &w, QPEApplication::AlwaysOff );
diff --git a/noncore/games/mindbreaker/mindbreaker.cpp b/noncore/games/mindbreaker/mindbreaker.cpp
index 7802e38..e1f43d0 100644
--- a/noncore/games/mindbreaker/mindbreaker.cpp
+++ b/noncore/games/mindbreaker/mindbreaker.cpp
@@ -1,5 +1,5 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
@@ -22,4 +22,6 @@
-#include <qpe/resource.h>
-#include <qpe/config.h>
+#include <qtopia/resource.h>
+#include <qtopia/config.h>
+#include <qtopia/qpeapplication.h>
+#include <qtoolbar.h>
@@ -27,3 +29,2 @@
#include <qpixmap.h>
-#include <qpe/qpetoolbar.h>
#include <qtoolbutton.h>
@@ -32,3 +33,4 @@
#include <qlabel.h>
-#include <qstyle.h>
+#include <qlayout.h>
+#include <qtimer.h>
@@ -40,2 +42,60 @@ static int pegRTTI = 3393393;
+static int adjusted_panel_height;
+static int adjusted_panel_width;
+
+static int adjusted_bin_margin;
+static int adjusted_peg_size;
+static int adjusted_answerpeg_size;
+
+static int adjusted_title_height;
+static int adjusted_title_width;
+
+static int adjusted_first_peg_x_diff;
+static int adjusted_first_peg_y_diff;
+static int adjusted_peg_spacing;
+
+static int adjusted_answerpegx;
+static int adjusted_answerpegy;
+static int adjusted_answerpeg_xdiff;
+static int adjusted_answerpeg_ydiff;
+
+static int adjusted_board_height;
+static int adjusted_board_width;
+
+static void setupBoardSize(int w, int h)
+{
+ adjusted_panel_width = w * 3/4;
+ adjusted_title_width = w * 3/4;
+
+ adjusted_title_height = h/10;
+ adjusted_panel_height = (h-adjusted_title_height)/9;
+
+ adjusted_bin_margin = w * 10/240;
+ adjusted_peg_size = adjusted_panel_height*3/4;
+ adjusted_answerpeg_size = QMIN(adjusted_panel_width*15/180,adjusted_panel_height*15/25);
+
+ // looks a bit dodgy on larger sizes
+ if ( adjusted_peg_size > 40 )
+ adjusted_peg_size = 40;
+
+ adjusted_first_peg_x_diff = w * 31/240-adjusted_peg_size/2;
+ adjusted_first_peg_y_diff = (adjusted_panel_height - adjusted_peg_size)/2;
+ adjusted_peg_spacing = w * 30/240;
+
+ // looks a bit dodgy on larger sizes (still does though, but not as much...)
+ if ( adjusted_answerpeg_size > 22 )
+ adjusted_answerpeg_size = 22;
+
+ adjusted_answerpegx = adjusted_panel_width * 159/180 - adjusted_answerpeg_size/2;
+ adjusted_answerpegy = adjusted_panel_height/3 - adjusted_answerpeg_size/2;
+ adjusted_answerpeg_xdiff = adjusted_panel_width * 10/180;
+ adjusted_answerpeg_ydiff = adjusted_panel_height * 9/25;
+
+ adjusted_board_height = adjusted_title_height + (adjusted_panel_height * 9);
+ adjusted_board_width = adjusted_panel_width + (adjusted_bin_margin * 2) + adjusted_peg_size;
+
+// qDebug("Adjusted width %d height %d", adjusted_board_width, adjusted_board_height);
+}
+
+
/* helper class, */
@@ -50,3 +110,3 @@ public:
-/* a placed peg is one that has been set down on the board correctly and
+/* a placed peg is one that has been set down on the board correctly and
should not be moved, only copied */
@@ -79,3 +139,2 @@ private:
};
-
int Peg::eggLevel = 0;
@@ -86,5 +145,4 @@ void Peg::buildImages()
{
-
QImage pegs = Resource::loadImage("mindbreaker/pegs");
- int x = 0;
+ int x = 0;
int y = 0;
@@ -94,3 +152,4 @@ void Peg::buildImages()
for (i = 0; i < 6; i++) {
- normalPegs.insert(i, new QImage(pegs.copy(x, y, peg_size, peg_size)));
+ normalPegs.insert(i, new QImage(pegs.copy(x, y, peg_size, peg_size).
+ smoothScale(adjusted_peg_size, adjusted_peg_size) ));
x += peg_size;
@@ -99,3 +158,4 @@ void Peg::buildImages()
for (i = 0; i < 5; i++) {
- specialPegs.insert(i, new QImage(pegs.copy(x,y,peg_size, peg_size)));
+ specialPegs.insert(i, new QImage(pegs.copy(x,y,peg_size, peg_size).
+ smoothScale(adjusted_peg_size, adjusted_peg_size) ));
x += peg_size;
@@ -107,8 +167,12 @@ void Peg::buildImages()
y = panel_height;
- normalPegs.insert(8,
- new QImage(image.copy(x, y, panel_width, panel_height)));
+ normalPegs.insert(8,
+ new QImage( image.copy(x, y, panel_width, panel_height).
+ smoothScale( adjusted_panel_width, adjusted_panel_height)
+ ));
y += panel_height;
y += title_height;
- normalPegs.insert(9,
- new QImage(image.copy(x, y, title_width, title_height)));
+ normalPegs.insert(9,
+ new QImage(image.copy(x, y, title_width, title_height).
+ smoothScale( adjusted_title_width, adjusted_title_height)
+ ));
y += title_height;
@@ -116,10 +180,12 @@ void Peg::buildImages()
x = 6 * peg_size;
- normalPegs.insert(6,
- new QImage(image.copy(x, y, answerpeg_size, answerpeg_size)));
+ normalPegs.insert(6,
+ new QImage(image.copy(x, y, answerpeg_size, answerpeg_size).
+ smoothScale( adjusted_answerpeg_size, adjusted_answerpeg_size) ));
x += answerpeg_size;
- normalPegs.insert(7,
- new QImage(image.copy(x, y, answerpeg_size, answerpeg_size)));
+ normalPegs.insert(7,
+ new QImage(image.copy(x, y, answerpeg_size, answerpeg_size).
+ smoothScale( adjusted_answerpeg_size, adjusted_answerpeg_size) ));
}
-QImage Peg::imageForType(int t)
+QImage Peg::imageForType(int t)
{
@@ -135,3 +201,3 @@ QImage Peg::imageForType(int t)
-Peg::Peg(QCanvas *canvas , int t, int g, int p)
+Peg::Peg(QCanvas *canvas , int t, int g, int p)
: QCanvasRectangle(canvas)
@@ -159,5 +225,5 @@ void Peg::drawShape(QPainter &p )
if ((pegtype == 5) && eggLevel > 5) {
- p.drawImage(x(), y(), *normalPegs[aniStep]);
- } else
- p.drawImage(x(), y(), imageForType(pegtype));
+ p.drawImage(int(x()), int(y()), *normalPegs[aniStep]);
+ } else
+ p.drawImage(int(x()), int(y()), imageForType(pegtype));
}
@@ -189,3 +255,3 @@ inline int Peg::pegPos() const
-inline void Peg::setPegPos(int p)
+inline void Peg::setPegPos(int p)
{
@@ -194,3 +260,3 @@ inline void Peg::setPegPos(int p)
-inline void Peg::setPlaced(bool p)
+inline void Peg::setPlaced(bool p)
{
@@ -199,3 +265,3 @@ inline void Peg::setPlaced(bool p)
-inline int Peg::type() const
+inline int Peg::type() const
{
@@ -204,3 +270,3 @@ inline int Peg::type() const
-/* Load the main image, copy from it the pegs, the board, and the answer image
+/* Load the main image, copy from it the pegs, the board, and the answer image
* and use these to create the tray, answer and board
@@ -208,8 +274,18 @@ inline int Peg::type() const
MindBreaker::MindBreaker( QWidget *parent, const char *name, int wFlags )
-: QMainWindow(parent, name, wFlags),
- canvas(board_height, board_width)
+ : QMainWindow(parent, name, wFlags)
{
- MindBreakerBoard *m = new MindBreakerBoard(canvas, this);
- setCentralWidget(m);
-
+ setCaption( tr("Mind Breaker"));
+ QPEApplication::setInputMethodHint( this, QPEApplication::AlwaysOff );
+ setMinimumSize(160,210);
+
+ QWidget *w = new QWidget( this );
+ w->setBackgroundColor( black );
+ QHBoxLayout *hb = new QHBoxLayout( w );
+ hb->addStretch();
+ board = new MindBreakerBoard(w);
+ hb->addWidget( board, 100 );
+ hb->addStretch();
+
+ setCentralWidget(w);
+
setToolBarsMovable( FALSE );
@@ -219,5 +295,5 @@ MindBreaker::MindBreaker( QWidget *parent, const char *name, int wFlags )
- QPixmap newicon = Resource::loadPixmap("new");
- new QToolButton(newicon, tr("New Game"), 0,
- m, SLOT(clear()), tb, "NewGame");
+ QIconSet newicon = Resource::loadIconSet("new");
+ new QToolButton(newicon, tr("New Game"), 0,
+ board, SLOT(clear()), tb, "NewGame");
@@ -229,8 +305,10 @@ MindBreaker::MindBreaker( QWidget *parent, const char *name, int wFlags )
- connect(m, SIGNAL(scoreChanged(int, int)), this, SLOT(setScore(int, int)));
- connect(score, SIGNAL(clicked()), m, SLOT(resetScore()));
+ connect(board, SIGNAL(scoreChanged(int,int)), this, SLOT(setScore(int,int)));
+ connect(score, SIGNAL(clicked()), board, SLOT(resetScore()));
int a, b;
- m->getScore(&a, &b);
+ board->getScore(&a, &b);
setScore(a,b);
+
+ layout()->setResizeMode(QLayout::FreeResize);
}
@@ -243,5 +321,5 @@ void MindBreaker::setScore(int turns, int games)
- if(total_games > 0)
+ if(total_games > 0)
average = total_turns / total_games;
- else
+ else
average = 0.0;
@@ -251,8 +329,20 @@ void MindBreaker::setScore(int turns, int games)
+void MindBreaker::resizeEvent( QResizeEvent *e )
+{
+ board->fixSize();
+ QMainWindow::resizeEvent( e );
+}
+
-MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
+MindBreakerBoard::MindBreakerBoard( QWidget *parent,
const char *name, int wFlags )
- : QCanvasView(&canv, parent, name, wFlags)
+ : QCanvasView(0, parent, name, wFlags),
+ moving(0), game_over(FALSE), total_turns(0), total_games(0)
{
- int i, x, y;
+ setFrameStyle( NoFrame );
+ setupBoardSize(qApp->desktop()->width(),qApp->desktop()->height());
+ cnv.resize(100,100);
+ setCanvas(&cnv);
+ setBackgroundColor( black );
+
struct timeval tv;
@@ -261,3 +351,2 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
gettimeofday(&tv, 0);
-
srand(tv.tv_usec);
@@ -265,25 +354,14 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
canvas()->setAdvancePeriod(500);
+ current_highlight = 0;
- QImage image = Resource::loadImage("mindbreaker/mindbreaker");
-
- /* copy from master image to functional images */
- x = 0;
- y = 0;
- panelImage = image.copy(x,y, panel_width, panel_height);
- y += panel_height;
- y += panel_height;
-
- titleImage = image.copy(x, y, title_width, title_height);
-
- Peg::buildImages(); // must be done BEFORE any pegs are made
-
- current_highlight = new Peg(canvas(), 8);
- current_highlight->setPlaced(TRUE);
- current_highlight->setX(0);
- current_highlight->setY(board_height - ((current_go + 1) * panel_height));
- current_highlight->setZ(0);
- current_highlight->show();
+ widthTimer = new QTimer( this );
+ connect(widthTimer, SIGNAL(timeout()), this, SLOT(doFixSize()) );
+ setMaximumWidth( QMIN(qApp->desktop()->height(),qApp->desktop()->width()) );
+ //doFixSize(); // build images... needs to be done before reading config.
+ //readConfig(); // first read... to ensure initial labels and side look right.
+}
- /* set up the game */
+void MindBreakerBoard::readConfig()
+{
Config c("MindBreaker", Config::User);
@@ -291,2 +369,3 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
game_over = FALSE;
+ int i;
if (c.readNumEntry("Answer0") < 0) {
@@ -311,3 +390,3 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
c.setGroup("Board");
- for(i = 0; i < 4; i++)
+ for(i = 0; i < 4; i++)
answer[i] = c.readNumEntry(QString("Answer%1").arg(i));
@@ -330,3 +409,3 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
current_guess[i] = c.readNumEntry(QString("CurrentGo%1").arg(i));
- if (current_guess[i] != 6)
+ if (current_guess[i] != 6)
placeGuessPeg(i, current_guess[i]);
@@ -334,6 +413,2 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
}
-
- /* draw initial screen */
- drawBackground();
- canvas()->update();
}
@@ -342,3 +417,3 @@ MindBreakerBoard::~MindBreakerBoard()
{
- int i, j;
+ int i;
if (game_over) {
@@ -351,3 +426,7 @@ MindBreakerBoard::~MindBreakerBoard()
}
-
+ writeConfig();
+}
+
+void MindBreakerBoard::writeConfig()
+{
Config c("MindBreaker", Config::User);
@@ -356,10 +435,11 @@ MindBreakerBoard::~MindBreakerBoard()
/* write the board */
+ int i,j;
for (i = 0; i < current_go; i++) {
for(j = 0; j < 4; j++)
- c.writeEntry(tr("Go%1p%2").arg(i).arg(j), past_guesses[4*i+j]);
+ c.writeEntry(QString("Go%1p%2").arg(i).arg(j), past_guesses[4*i+j]);
}
- for(j = 0; j < 4; j++)
- c.writeEntry(tr("CurrentGo%1").arg(j), current_guess[j]);
- for(j = 0; j < 4; j++)
- c.writeEntry(tr("Answer%1").arg(j), answer[j]);
+ for(j = 0; j < 4; j++)
+ c.writeEntry(QString("CurrentGo%1").arg(j), current_guess[j]);
+ for(j = 0; j < 4; j++)
+ c.writeEntry(QString("Answer%1").arg(j), answer[j]);
@@ -379,7 +459,71 @@ void MindBreakerBoard::getScore(int *a, int *b)
+void MindBreakerBoard::fixSize()
+{
+ hide();
+ setMaximumWidth( parentWidget()->height() );
+ widthTimer->start( 20, TRUE );
+}
+
+void MindBreakerBoard::doFixSize()
+{
+ QSize s = size();
+ int fw = frameWidth();
+ s.setWidth(s.width() - fw);
+ s.setHeight(s.height() - fw);
+
+ /* min size is 200 x 260 */
+/*
+ if (s.width() < adjusted_board_width)
+ s.setWidth(adjusted_board_width);
+
+ if (s.height() < adjusted_board_height)
+ s.setHeight(adjusted_board_height);
+*/
+
+ if ( current_highlight ) // non-first resize
+ writeConfig();
+
+ setupBoardSize(s.width() - fw, s.height() - fw);
+ canvas()->resize(s.width() - fw, s.height() - fw);
+ Peg::buildImages(); // must be done BEFORE any pegs are made
+
+ QImage image = Resource::loadImage("mindbreaker/mindbreaker");
+
+ /* copy from master image to functional images */
+ int x = 0;
+ int y = 0;
+ panelImage = image.copy(x, y, panel_width, panel_height).
+ smoothScale( adjusted_panel_width, adjusted_panel_height);
+
+ y += panel_height;
+ y += panel_height;
+
+ titleImage = image.copy(x, y, title_width, title_height).
+ smoothScale( adjusted_title_width, adjusted_title_height);
+ show();
+
+ delete current_highlight;
+ current_highlight = new Peg(canvas(), 8);
+ current_highlight->setPlaced(TRUE);
+ current_highlight->setX(0);
+ current_highlight->setY(adjusted_board_height - ((current_go + 1) * adjusted_panel_height));
+ current_highlight->setZ(0);
+ current_highlight->show();
+
+ /* set up the game */
+ //readConfig();
+
+ /* draw initial screen */
+ //drawBackground();
+ //canvas()->update();
+ clear();
+
+ readConfig();
+}
+
void MindBreakerBoard::placeGuessPeg(int pos, int pegId)
{
- int x = first_peg_x_diff + (pos * peg_spacing);
- int y = board_height - ((current_go + 1) * panel_height)
- + first_peg_y_diff;
+ int x = adjusted_first_peg_x_diff + (pos * adjusted_peg_spacing);
+ int y = adjusted_board_height - ((current_go + 1) * adjusted_panel_height)
+ + adjusted_first_peg_y_diff;
@@ -407,14 +551,14 @@ void MindBreakerBoard::drawBackground()
painter.setPen(pen);
- x_gap = canvas()->width() - (panel_width + (2 * bin_margin));
+ x_gap = canvas()->width() - (adjusted_panel_width + (2 * adjusted_bin_margin));
//x_gap += peg_size >> 1;
- if (x_gap < 1)
+ if (x_gap < 1)
x_gap = 1;
- y_gap = board_height / 6;
- y_gap -= (2 * bin_margin);
+ y_gap = adjusted_board_height / 6;
+ y_gap -= (2 * adjusted_bin_margin);
//y_gap += peg_size >> 1;
- if (y_gap < 1)
+ if (y_gap < 1)
y_gap = 1;
- x = panel_width + bin_margin - (peg_size >> 1);
- y = bin_margin - (peg_size >> 1) + 2;
+ x = adjusted_panel_width + adjusted_bin_margin - (adjusted_peg_size >> 1);
+ y = adjusted_bin_margin - (adjusted_peg_size >> 1) + 2;
@@ -426,9 +570,9 @@ void MindBreakerBoard::drawBackground()
}
- y += board_height / 6;
+ y += adjusted_board_height / 6;
}
/* now draw the surrounding boxes */
- x_gap = canvas()->width() - panel_width;
+ x_gap = canvas()->width() - adjusted_panel_width;
if (x_gap < 1) x_gap = 1;
- y_gap = board_height / 6;
- x = panel_width;
+ y_gap = adjusted_board_height / 6;
+ x = adjusted_panel_width;
y = 1;
@@ -436,3 +580,3 @@ void MindBreakerBoard::drawBackground()
for (i = 0; i < 6; i++) {
- painter.drawRect(x, y, x_gap, y_gap);
+ painter.drawRect(x, y, x_gap, y_gap);
y += y_gap;
@@ -444,3 +588,3 @@ void MindBreakerBoard::drawBackground()
painter.drawImage(x,y, titleImage);
- y = title_height;
+ y = adjusted_title_height;
/* now nine gues panels */
@@ -448,3 +592,3 @@ void MindBreakerBoard::drawBackground()
painter.drawImage(x, y, panelImage);
- y += panel_height;
+ y += adjusted_panel_height;
}
@@ -471,3 +615,3 @@ void MindBreakerBoard::checkGuess()
copy_answer[i] = 6;
- copy_guess[i] = 7;
+ copy_guess[i] = 7;
}
@@ -488,5 +632,5 @@ void MindBreakerBoard::checkGuess()
- int x = answerpegx;
- int y = (board_height - ((current_go + 1) * panel_height)) + answerpegy;
-
+ int x = adjusted_answerpegx;
+ int y = (adjusted_board_height - ((current_go + 1) * adjusted_panel_height)) + adjusted_answerpegy;
+
if (num_black == 4)
@@ -502,8 +646,8 @@ void MindBreakerBoard::checkGuess()
num_black--;
-
- if (x == answerpegx)
- x = answerpegx + answerpeg_diff;
+
+ if (x == adjusted_answerpegx)
+ x = adjusted_answerpegx + adjusted_answerpeg_xdiff;
else {
- x = answerpegx;
- y += answerpeg_diff;
+ x = adjusted_answerpegx;
+ y += adjusted_answerpeg_ydiff;
}
@@ -518,8 +662,8 @@ void MindBreakerBoard::checkGuess()
num_white--;
-
- if (x == answerpegx)
- x = answerpegx + answerpeg_diff;
+
+ if (x == adjusted_answerpegx)
+ x = adjusted_answerpegx + adjusted_answerpeg_xdiff;
else {
- x = answerpegx;
- y += answerpeg_diff;
+ x = adjusted_answerpegx;
+ y += adjusted_answerpeg_ydiff;
}
@@ -537,3 +681,3 @@ void MindBreakerBoard::checkGuess()
total_turns += 10;
- else
+ else
total_turns += current_go;
@@ -548,7 +692,7 @@ void MindBreakerBoard::checkGuess()
p->show();
-
+
for (i = 0; i < 4; i++) {
p = new Peg(canvas(), answer[i], -1);
- p->setX(first_peg_x_diff + (i * peg_spacing));
- p->setY(5);
+ p->setX(adjusted_first_peg_x_diff + (i * adjusted_peg_spacing));
+ p->setY(adjusted_first_peg_y_diff);
p->setZ(3);
@@ -557,3 +701,3 @@ void MindBreakerBoard::checkGuess()
} else {
- current_highlight->setY(board_height - ((current_go + 1) * panel_height));
+ current_highlight->setY(adjusted_board_height - ((current_go + 1) * adjusted_panel_height));
}
@@ -588,3 +732,3 @@ void MindBreakerBoard::clear()
- current_highlight->setY(board_height - ((current_go + 1) * panel_height));
+ current_highlight->setY(adjusted_board_height - ((current_go + 1) * adjusted_panel_height));
checkScores();
@@ -594,3 +738,3 @@ void MindBreakerBoard::clear()
-void MindBreakerBoard::resetScore()
+void MindBreakerBoard::resetScore()
{
@@ -598,3 +742,3 @@ void MindBreakerBoard::resetScore()
- if (QMessageBox::information(this, tr( "Reset Statistics" ),
+ if (QMessageBox::information(this, tr( "Reset Statistics" ),
tr( "Reset the win ratio?" ),
@@ -614,2 +758,9 @@ void MindBreakerBoard::contentsMousePressEvent(QMouseEvent *e)
{
+ if (game_over) {
+ null_press = TRUE;
+ null_point = e->pos();
+ moving = 0;
+ return;
+ }
+
copy_press = FALSE;
@@ -618,7 +769,7 @@ void MindBreakerBoard::contentsMousePressEvent(QMouseEvent *e)
got clicked */
- if (e->x() > panel_width) {
+ if (e->x() > adjusted_panel_width) {
/* its a bin, but which bin */
- if(e->y() > board_height)
+ int bin = (e->y() + 2) / (adjusted_board_height / 6);
+ if (bin > 5)
return; // missed everything
- int bin = (e->y() + 2) / (board_height / 6);
@@ -627,4 +778,4 @@ void MindBreakerBoard::contentsMousePressEvent(QMouseEvent *e)
moving = new Peg(canvas(), bin, current_go);
- moving->setX(e->x() - (peg_size >> 1));
- moving->setY(e->y() - (peg_size >> 1));
+ moving->setX(e->x() - (adjusted_peg_size >> 1));
+ moving->setY(e->y() - (adjusted_peg_size >> 1));
moving->setZ(5);
@@ -654,6 +805,6 @@ void MindBreakerBoard::contentsMousePressEvent(QMouseEvent *e)
}
- moving = new Peg(canvas(),
+ moving = new Peg(canvas(),
item->type(), current_go);
- moving->setX(e->x() - (peg_size >> 1));
- moving->setY(e->y() - (peg_size >> 1));
+ moving->setX(e->x() - (adjusted_peg_size >> 1));
+ moving->setY(e->y() - (adjusted_peg_size >> 1));
moving->setZ(5);
@@ -683,3 +834,3 @@ void MindBreakerBoard::contentsMouseMoveEvent(QMouseEvent* e)
return;
- }
+ }
}
@@ -695,3 +846,3 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
for (QCanvasItemList::Iterator it=l.begin(); it !=l.end(); ++it) {
- if (*it == copy_peg)
+ if (*it == copy_peg)
copy_press = TRUE;
@@ -709,5 +860,5 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
}
-
+
/* first work out if in y */
- if (e->y() > (board_height - (current_go * panel_height))) {
+ if (e->y() > (adjusted_board_height - (current_go * adjusted_panel_height))) {
delete moving;
@@ -717,3 +868,3 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
}
- if (e->y() < (board_height - ((current_go + 1) * panel_height))) {
+ if (e->y() < (adjusted_board_height - ((current_go + 1) * adjusted_panel_height))) {
delete moving;
@@ -724,14 +875,14 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
/* ok, a valid go, but which peg */
- int x_bar = first_peg_x_diff - (peg_size >> 1);
- x_bar += peg_spacing;
+ int x_bar = adjusted_first_peg_x_diff - (adjusted_peg_size >> 1);
+ x_bar += adjusted_peg_spacing;
int pos = 0;
- if (e->x() > x_bar)
+ if (e->x() > x_bar)
pos = 1;
- x_bar += peg_spacing;
+ x_bar += adjusted_peg_spacing;
if (e->x() > x_bar)
pos = 2;
- x_bar += peg_spacing;
+ x_bar += adjusted_peg_spacing;
if (e->x() > x_bar)
pos = 3;
- x_bar += peg_spacing;
+ x_bar += adjusted_peg_spacing;
@@ -745,5 +896,5 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
- int x = first_peg_x_diff + (pos * peg_spacing);
- int y = board_height - ((current_go + 1) * panel_height)
- + first_peg_y_diff;
+ int x = adjusted_first_peg_x_diff + (pos * adjusted_peg_spacing);
+ int y = adjusted_board_height - ((current_go + 1) * adjusted_panel_height)
+ + adjusted_first_peg_y_diff;
moving->setPegPos(pos);
@@ -771,5 +922,5 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
if(null_point.manhattanLength() < 6) {
- if (game_over)
+ if (game_over)
clear();
- else
+ else
checkGuess();
@@ -780,16 +931,4 @@ void MindBreakerBoard::resizeEvent(QResizeEvent *e)
{
- QSize s = e->size();
- int fw = style().defaultFrameWidth();
- s.setWidth(s.width() - fw);
- s.setHeight(s.height() - fw);
-
- /* min size is 200 x 260 */
- if (s.width() < board_width)
- s.setWidth(board_width);
-
- if (s.height() < board_height)
- s.setHeight(board_height);
-
- canvas()->resize(s.width() - fw, s.height() - fw);
- drawBackground();
+ QCanvasView::resizeEvent(e);
+ fixSize();
}
@@ -806,3 +945,3 @@ void MindBreakerBoard::checkScores()
double break_even = 5.0;
- if (g < 1.0)
+ if (g < 1.0)
return;
@@ -811,3 +950,3 @@ void MindBreakerBoard::checkScores()
while (break_even >= 0.0) {
- if (avg >= (break_even + g))
+ if (avg >= (break_even + g))
return;
diff --git a/noncore/games/mindbreaker/mindbreaker.h b/noncore/games/mindbreaker/mindbreaker.h
index fca649a..3132e80 100644
--- a/noncore/games/mindbreaker/mindbreaker.h
+++ b/noncore/games/mindbreaker/mindbreaker.h
@@ -1,5 +1,5 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
@@ -53,2 +53,3 @@ class Peg;
class QToolButton;
+class QTimer;
@@ -58,3 +59,3 @@ class MindBreakerBoard : public QCanvasView // QWidget
public:
- MindBreakerBoard(QCanvas &c, QWidget *parent=0, const char *name=0, int wFlags=0 );
+ MindBreakerBoard(QWidget *parent=0, const char *name=0, int wFlags=0 );
~MindBreakerBoard();
@@ -62,2 +63,6 @@ public:
void getScore(int *, int *);
+
+ void resizeEvent(QResizeEvent*);
+ void fixSize();
+
signals:
@@ -69,2 +74,5 @@ public slots:
+private slots:
+ void doFixSize();
+
protected:
@@ -73,5 +81,9 @@ protected:
void contentsMouseReleaseEvent(QMouseEvent *);
- void resizeEvent(QResizeEvent *);
private:
+ QCanvas cnv;
+
+ void readConfig();
+ void writeConfig();
+
void drawBackground();
@@ -102,2 +114,4 @@ private:
int total_games;
+
+ QTimer *widthTimer;
};
@@ -109,3 +123,3 @@ public:
MindBreaker(QWidget *parent=0, const char *name=0, int wFlags=0 );
-
+ static QString appName() { return QString::fromLatin1("mindbreaker"); }
public slots:
@@ -113,2 +127,5 @@ public slots:
+protected:
+ void resizeEvent( QResizeEvent * );
+
private:
diff --git a/noncore/games/mindbreaker/mindbreaker.pro b/noncore/games/mindbreaker/mindbreaker.pro
index 4ca3b84..0a37fa7 100644
--- a/noncore/games/mindbreaker/mindbreaker.pro
+++ b/noncore/games/mindbreaker/mindbreaker.pro
@@ -1,4 +1,2 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
HEADERS = mindbreaker.h
@@ -11,2 +9,3 @@ LIBS += -lqpe
+
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/mindbreaker/opie-mindbreaker.control b/noncore/games/mindbreaker/opie-mindbreaker.control
index 7b5ead6..5b342da 100644
--- a/noncore/games/mindbreaker/opie-mindbreaker.control
+++ b/noncore/games/mindbreaker/opie-mindbreaker.control
@@ -1,3 +1,3 @@
Package: opie-mindbreaker
-Files: bin/mindbreaker apps/Games/mindbreaker.desktop pics/mindbreaker
+Files: plugins/application/libmindbreaker.so* bin/mindbreaker apps/Games/mindbreaker.desktop pics/mindbreaker
Priority: optional
diff --git a/noncore/games/minesweep/main.cpp b/noncore/games/minesweep/main.cpp
index 83de9a3..bd70f7c 100644
--- a/noncore/games/minesweep/main.cpp
+++ b/noncore/games/minesweep/main.cpp
@@ -23,12 +23,5 @@
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
-int main( int argc, char** argv )
-{
- QPEApplication a( argc, argv );
+OPIE_EXPORT_APP( OApplicationFactory<MineSweep> )
- MineSweep ms;
- QPEApplication::setInputMethodHint( &ms, QPEApplication::AlwaysOff );
- a.showMainWidget( &ms );
-
- return a.exec();
-}
diff --git a/noncore/games/minesweep/minefield.cpp b/noncore/games/minesweep/minefield.cpp
index eca1a36..04cfb97 100644
--- a/noncore/games/minesweep/minefield.cpp
+++ b/noncore/games/minesweep/minefield.cpp
@@ -355,3 +355,3 @@ void MineField::setup( int level )
}
- mines = new (Mine*)[numRows*numCols];
+ mines = new Mine*[numRows*numCols];
for ( i = 0; i < numCols*numRows; i++ )
diff --git a/noncore/games/minesweep/minesweep.cpp b/noncore/games/minesweep/minesweep.cpp
index 48644b3..7214a73 100644
--- a/noncore/games/minesweep/minesweep.cpp
+++ b/noncore/games/minesweep/minesweep.cpp
@@ -23,2 +23,3 @@
+#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
@@ -157,8 +158,8 @@ class ResultIndicator : private QLabel
{
-public:
+public:
static void showResult( QWidget *ref, bool won );
-private:
+private:
ResultIndicator( QWidget *parent, const char *name, WFlags f)
:QLabel( parent, name, f ) {}
-
+
void timerEvent( QTimerEvent *);
@@ -172,3 +173,3 @@ void ResultIndicator::showResult( QWidget *ref, bool won )
ResultIndicator *r = new ResultIndicator( ref, 0, WStyle_Customize | WStyle_Tool | WType_TopLevel );
-
+
r->setAlignment( AlignCenter );
@@ -197,3 +198,3 @@ void ResultIndicator::center()
- QPoint pp = w->mapToGlobal( QPoint(0,0) );
+ QPoint pp = w->mapToGlobal( QPoint(0,0) );
QSize s = sizeHint()*3;
@@ -203,3 +204,3 @@ void ResultIndicator::center()
setGeometry( QRect(pp, s) );
-
+
}
@@ -230,3 +231,3 @@ protected:
field->setAvailableRect( contentsRect());
- QFrame::resizeEvent(e);
+ QFrame::resizeEvent(e);
}
@@ -241,2 +242,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
{
+ QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff );
srand(::time(0));
@@ -256,3 +258,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
menuBar->insertItem( tr("Game"), gameMenu );
-
+
guessLCD = new QLCDNumber( toolBar );
@@ -263,3 +265,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
lcdPal.setColor( QColorGroup::Button, QApplication::palette().active().button() );
-
+
// guessLCD->setPalette( lcdPal );
@@ -273,3 +275,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
connect( newGameButton, SIGNAL(clicked()), this, SLOT(newGame()) );
-
+
timeLCD = new QLCDNumber( toolBar );
@@ -280,3 +282,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
timeLCD->setBackgroundMode( PaletteButton );
-
+
setToolBarsMovable ( FALSE );
@@ -298,3 +300,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
setCentralWidget( mainframe );
-
+
connect( field, SIGNAL( gameOver( bool ) ), this, SLOT( gameOver( bool ) ) );
diff --git a/noncore/games/minesweep/minesweep.h b/noncore/games/minesweep/minesweep.h
index e860573..527dc9e 100644
--- a/noncore/games/minesweep/minesweep.h
+++ b/noncore/games/minesweep/minesweep.h
@@ -33,2 +33,3 @@ class MineSweep : public QMainWindow
public:
+ static QString appName() { return QString::fromLatin1("minesweep"); }
MineSweep( QWidget* parent = 0, const char* name = 0, WFlags f = 0 );
diff --git a/noncore/games/minesweep/minesweep.pro b/noncore/games/minesweep/minesweep.pro
index 8e4001e..9746651 100644
--- a/noncore/games/minesweep/minesweep.pro
+++ b/noncore/games/minesweep/minesweep.pro
@@ -1,15 +1,13 @@
-TEMPLATE = app
-CONFIG = qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
-HEADERS = minefield.h \
- minesweep.h
-SOURCES = main.cpp \
- minefield.cpp \
- minesweep.cpp
-INCLUDEPATH += $(OPIEDIR)/include
-DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe
-INTERFACES =
-TARGET = minesweep
-
-include ( $(OPIEDIR)/include.pro )
+CONFIG = qt warn_on release quick-app
+HEADERS = minefield.h \
+ minesweep.h
+SOURCES = main.cpp \
+ minefield.cpp \
+ minesweep.cpp
+INCLUDEPATH += $(OPIEDIR)/include
+DEPENDPATH += $(OPIEDIR)/include
+LIBS += -lqpe
+INTERFACES =
+TARGET = minesweep
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/minesweep/opie-minesweep.control b/noncore/games/minesweep/opie-minesweep.control
index 32f0352..91343ea 100644
--- a/noncore/games/minesweep/opie-minesweep.control
+++ b/noncore/games/minesweep/opie-minesweep.control
@@ -1,3 +1,3 @@
Package: opie-minesweep
-Files: bin/minesweep apps/Games/minesweep.desktop pics/minesweep
+Files: plugins/application/libminesweep.so* bin/minesweep apps/Games/minesweep.desktop pics/minesweep
Priority: optional
diff --git a/noncore/games/parashoot/interface.cpp b/noncore/games/parashoot/interface.cpp
index db98720..a40426d 100644
--- a/noncore/games/parashoot/interface.cpp
+++ b/noncore/games/parashoot/interface.cpp
@@ -24,2 +24,3 @@
#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
@@ -31,3 +32,3 @@
#include <qtoolbutton.h>
-
+
ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
@@ -38,2 +39,4 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
{
+ QPEApplication::grabKeyboard();
+ QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff );
canvas.setAdvancePeriod(80);
@@ -61,3 +64,3 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
showScore(0,0);
-
+
setCentralWidget(pb);
@@ -66,5 +69,5 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
connect (autoDropTimer, SIGNAL(timeout()), this, SLOT(play()) );
-
+
pauseTimer = new QTimer(this);
- connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) );
+ connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) );
@@ -93,3 +96,3 @@ void ParaShoot::newGame()
clear();
- if (pauseTimer->isActive())
+ if (pauseTimer->isActive())
pauseTimer->stop();
@@ -121,3 +124,3 @@ void ParaShoot::clear()
for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
- delete *it;
+ delete *it;
}
@@ -129,3 +132,3 @@ void ParaShoot::gameOver()
QCanvasItemList l = canvas.allItems();
- for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
+ for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
item = *it;
@@ -140,3 +143,3 @@ void ParaShoot::gameOver()
int shotsFired = cannon->shotsFired();
- if ( shotsFired == 0 )
+ if ( shotsFired == 0 )
shotsFired = 1;
@@ -146,3 +149,3 @@ void ParaShoot::gameOver()
" Parachuters Killed: %2\n"
- " Accuracy: %3% " ).arg(score).arg(shots).arg(shots * 100 / shotsFired ),
+ " Accuracy: %3% " ).arg(score).arg(shots).arg(shots * 100 / shotsFired ),
&canvas);
@@ -165,3 +168,3 @@ void ParaShoot::wait()
void ParaShoot::play()
-{
+{
if (Man::getManCount() < nomen ) {
@@ -179,3 +182,3 @@ void ParaShoot::increaseScore(int x)
if ( score / 150 != (score-x) / 150 )
- levelUp();
+ levelUp();
showScore(level,score);
@@ -185,3 +188,3 @@ void ParaShoot::levelUp()
{
- level++;
+ level++;
int stage = level % 3;
@@ -195,3 +198,3 @@ void ParaShoot::levelUp()
new Helicopter(&canvas);
- break;
+ break;
case 2:
@@ -199,3 +202,3 @@ void ParaShoot::levelUp()
fanfare.play();
- break;
+ break;
default: return;
@@ -218,3 +221,3 @@ void ParaShoot::keyPressEvent(QKeyEvent* event)
newGame();
- else
+ else
return;
diff --git a/noncore/games/parashoot/interface.h b/noncore/games/parashoot/interface.h
index 3f36d0b..5abbe0b 100644
--- a/noncore/games/parashoot/interface.h
+++ b/noncore/games/parashoot/interface.h
@@ -40,2 +40,3 @@ class ParaShoot : public QMainWindow {
public:
+ static QString appName() { return QString::fromLatin1("parashoot"); }
ParaShoot(QWidget* parent=0, const char* name=0, WFlags f=0);
diff --git a/noncore/games/parashoot/main.cpp b/noncore/games/parashoot/main.cpp
index 60eea18..ee36d26 100644
--- a/noncore/games/parashoot/main.cpp
+++ b/noncore/games/parashoot/main.cpp
@@ -23,14 +23,5 @@
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
-int main(int argc, char **argv)
-{
- QPEApplication app(argc,argv);
+OPIE_EXPORT_APP( OApplicationFactory<ParaShoot> )
- QPEApplication::grabKeyboard();
-
- ParaShoot m;
- QPEApplication::setInputMethodHint( &m, QPEApplication::AlwaysOff );
- app.showMainWidget(&m);
-
- return app.exec();
-}
diff --git a/noncore/games/parashoot/opie-parashoot.control b/noncore/games/parashoot/opie-parashoot.control
index 758d24d..139dd3c 100644
--- a/noncore/games/parashoot/opie-parashoot.control
+++ b/noncore/games/parashoot/opie-parashoot.control
@@ -1,3 +1,3 @@
Package: opie-parashoot
-Files: bin/parashoot apps/Games/parashoot.desktop pics/parashoot
+Files: plugins/application/libparashoot.so* bin/parashoot apps/Games/parashoot.desktop pics/parashoot
Priority: optional
diff --git a/noncore/games/parashoot/parashoot.pro b/noncore/games/parashoot/parashoot.pro
index c2746f9..f5d103a 100644
--- a/noncore/games/parashoot/parashoot.pro
+++ b/noncore/games/parashoot/parashoot.pro
@@ -1,4 +1,2 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
HEADERS = interface.h man.h cannon.h base.h bullet.h helicopter.h
@@ -10,2 +8,4 @@ LIBS += -lqpe
+
+
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/qasteroids/main.cpp b/noncore/games/qasteroids/main.cpp
index 7d1682c..c762990 100644
--- a/noncore/games/qasteroids/main.cpp
+++ b/noncore/games/qasteroids/main.cpp
@@ -23,14 +23,5 @@
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
-int main( int argc, char *argv[] )
-{
- QPEApplication app( argc, argv );
-
- QPEApplication::grabKeyboard();
-
- KAstTopLevel *mainWidget = new KAstTopLevel();
- app.showMainWidget( mainWidget );
-
- app.exec();
-}
+OPIE_EXPORT_APP( OApplicationFactory<KAstTopLevel> )
diff --git a/noncore/games/qasteroids/opie-qasteroids.control b/noncore/games/qasteroids/opie-qasteroids.control
index 25a49b4..8764578 100644
--- a/noncore/games/qasteroids/opie-qasteroids.control
+++ b/noncore/games/qasteroids/opie-qasteroids.control
@@ -1,3 +1,3 @@
Package: opie-qasteroids
-Files: bin/qasteroids apps/Games/qasteroids.desktop pics/qasteroids/*
+Files: plugins/application/libqasteroids.so* bin/qasteroids apps/Games/qasteroids.desktop pics/qasteroids/*
Priority: optional
diff --git a/noncore/games/qasteroids/qasteroids.pro b/noncore/games/qasteroids/qasteroids.pro
index 1a3a8d5..aafc701 100644
--- a/noncore/games/qasteroids/qasteroids.pro
+++ b/noncore/games/qasteroids/qasteroids.pro
@@ -1,4 +1,2 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
HEADERS = ledmeter.h sprites.h toplevel.h view.h
@@ -10,2 +8,4 @@ LIBS += -lqpe
+
+
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/qasteroids/toplevel.cpp b/noncore/games/qasteroids/toplevel.cpp
index 71daf60..c4fea89 100644
--- a/noncore/games/qasteroids/toplevel.cpp
+++ b/noncore/games/qasteroids/toplevel.cpp
@@ -71,3 +71,3 @@ SLevel levels[MAX_LEVELS] =
-const char *soundEvents[] =
+const char *soundEvents[] =
{
@@ -78,3 +78,3 @@ const char *soundEvents[] =
-const char *soundDefaults[] =
+const char *soundDefaults[] =
{
@@ -85,7 +85,10 @@ const char *soundDefaults[] =
-
-KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name )
- : QMainWindow( parent, _name )
+
+KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name, WFlags fl )
+ : QMainWindow( parent, _name, fl )
{
setCaption( tr("Asteroids") );
+
+ QPEApplication::grabKeyboard();
+
QWidget *border = new QWidget( this );
@@ -95,3 +98,3 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name )
QVBoxLayout *borderLayout = new QVBoxLayout( border );
-
+
QWidget *mainWin = new QWidget( border );
@@ -259,3 +262,3 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name )
- struct utsname name; /* check for embedix kernel running on the zaurus, if
+ struct utsname name; /* check for embedix kernel running on the zaurus, if
lineo change string, this break
@@ -397,3 +400,3 @@ void KAstTopLevel::keyReleaseEvent( QKeyEvent *event )
break;
-
+
case NewGame:
diff --git a/noncore/games/qasteroids/toplevel.h b/noncore/games/qasteroids/toplevel.h
index 4e1ac9c..0270763 100644
--- a/noncore/games/qasteroids/toplevel.h
+++ b/noncore/games/qasteroids/toplevel.h
@@ -41,4 +41,6 @@ class KAstTopLevel : public QMainWindow
public:
- KAstTopLevel( QWidget *parent=0, const char *name=0 );
+ KAstTopLevel( QWidget *parent=0, const char *name=0, WFlags fl = 0 );
virtual ~KAstTopLevel();
+ static QString appName() { return QString::fromLatin1("qasteroids"); }
+
diff --git a/noncore/games/snake/interface.cpp b/noncore/games/snake/interface.cpp
index f1227cb..2c60693 100644
--- a/noncore/games/snake/interface.cpp
+++ b/noncore/games/snake/interface.cpp
@@ -23,2 +23,3 @@
#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
@@ -35,2 +36,3 @@ SnakeGame::SnakeGame(QWidget* parent, const char* name, WFlags f) :
setCaption( tr("Snake") );
+ QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff );
QPixmap bg = Resource::loadPixmap("snake/grass");
diff --git a/noncore/games/snake/interface.h b/noncore/games/snake/interface.h
index 454d4ee..fa1dee4 100644
--- a/noncore/games/snake/interface.h
+++ b/noncore/games/snake/interface.h
@@ -20,2 +20,3 @@
#include <qmainwindow.h>
+#include <qpe/qpeapplication.h>
#include <qcanvas.h>
@@ -35,3 +36,3 @@ public:
~SnakeGame();
-
+
void clear();
@@ -39,2 +40,4 @@ public:
+ static QString appName() { return QString::fromLatin1("snake"); }
+
protected:
diff --git a/noncore/games/snake/main.cpp b/noncore/games/snake/main.cpp
index 90a93b7..77a2769 100644
--- a/noncore/games/snake/main.cpp
+++ b/noncore/games/snake/main.cpp
@@ -19,3 +19,3 @@
**********************************************************************/
-
+
#include "interface.h"
@@ -23,13 +23,7 @@
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
+
+OPIE_EXPORT_APP( OApplicationFactory<SnakeGame> )
-int main(int argc, char **argv)
-{
- QPEApplication app(argc,argv);
- SnakeGame* m = new SnakeGame;
- QPEApplication::setInputMethodHint( m, QPEApplication::AlwaysOff );
- app.showMainWidget(m);
-
- return app.exec();
-}
diff --git a/noncore/games/snake/opie-snake.control b/noncore/games/snake/opie-snake.control
index ef4fc61..f110acd 100644
--- a/noncore/games/snake/opie-snake.control
+++ b/noncore/games/snake/opie-snake.control
@@ -1,3 +1,3 @@
Package: opie-snake
-Files: bin/snake apps/Games/snake.desktop pics/snake
+Files: plugins/application/libsnake.so* bin/snake apps/Games/snake.desktop pics/snake
Priority: optional
diff --git a/noncore/games/snake/snake.pro b/noncore/games/snake/snake.pro
index 3da8631..2b7444c 100644
--- a/noncore/games/snake/snake.pro
+++ b/noncore/games/snake/snake.pro
@@ -1,4 +1,2 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
HEADERS = snake.h target.h obstacle.h interface.h codes.h
@@ -10,2 +8,3 @@ LIBS += -lqpe
+
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/solitaire/canvascardwindow.cpp b/noncore/games/solitaire/canvascardwindow.cpp
index dec5591..c12344a 100644
--- a/noncore/games/solitaire/canvascardwindow.cpp
+++ b/noncore/games/solitaire/canvascardwindow.cpp
@@ -39,2 +39,3 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
setIcon( Resource::loadPixmap( "cards" ) );
+ setCaption(tr("Patience"));
@@ -47,3 +48,3 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
QPixmap bg;
- bg.convertFromImage( Resource::loadImage( "table_pattern" ), ThresholdDither );
+ bg.convertFromImage( Resource::loadImage( "table_pattern" ), ThresholdDither );
canvas.setBackgroundPixmap(bg);
@@ -68,3 +69,3 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
menu->insertItem(tr("&Game"), file);
-
+
menu->insertSeparator();
@@ -93,3 +94,3 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
menu->insertItem(tr("Play"), file);
-
+
menu->insertSeparator();
@@ -120,3 +121,3 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
cardGame->setNumberToDraw(drawThree ? 3 : 1);
-
+
setCaption(tr("Patience"));
@@ -188,3 +189,3 @@ void CanvasCardWindow::initPatience()
{
- // Create New Game
+ // Create New Game
if ( cardGame )
@@ -255,3 +256,3 @@ void CanvasCardWindow::initTeeclub()
cardGame = new TeeclubCardGame( &canvas, snapOn, this );
- cardGame->setNumberToDraw(1);
+ cardGame->setNumberToDraw(1);
gameType = 4;
@@ -261,3 +262,3 @@ void CanvasCardWindow::initTeeclub()
setCardBacks();
-}
+}
diff --git a/noncore/games/solitaire/canvascardwindow.h b/noncore/games/solitaire/canvascardwindow.h
index eddb184..abd6af6 100644
--- a/noncore/games/solitaire/canvascardwindow.h
+++ b/noncore/games/solitaire/canvascardwindow.h
@@ -35,2 +35,3 @@ class CanvasCardWindow : public QMainWindow {
public:
+ static QString appName() { return QString::fromLatin1("patience"); }
CanvasCardWindow(QWidget* parent=0, const char* name=0, WFlags f=0);
diff --git a/noncore/games/solitaire/carddeck.cpp b/noncore/games/solitaire/carddeck.cpp
index a2d0076..b130131 100644
--- a/noncore/games/solitaire/carddeck.cpp
+++ b/noncore/games/solitaire/carddeck.cpp
@@ -27,3 +27,3 @@ CardDeck::CardDeck(int jokers, int numOfDecks) : numberOfJokers(jokers), numberO
{
- cards = new (Card *)[getNumberOfCards()];
+ cards = new Card *[getNumberOfCards()];
}
diff --git a/noncore/games/solitaire/main.cpp b/noncore/games/solitaire/main.cpp
index f81aa3c..bd3cf8b 100644
--- a/noncore/games/solitaire/main.cpp
+++ b/noncore/games/solitaire/main.cpp
@@ -23,14 +23,4 @@
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
-
-int main( int argc, char ** argv )
-{
- QPEApplication a( argc, argv );
-
- CanvasCardWindow m;
- m.setCaption( CanvasCardWindow::tr("Patience") );
- a.showMainWidget( &m );
-
- return a.exec();
-}
-
+OPIE_EXPORT_APP( OApplicationFactory<CanvasCardWindow> ) \ No newline at end of file
diff --git a/noncore/games/solitaire/solitaire.pro b/noncore/games/solitaire/solitaire.pro
index 1ac62c3..b1b8bda 100755
--- a/noncore/games/solitaire/solitaire.pro
+++ b/noncore/games/solitaire/solitaire.pro
@@ -1,5 +1,3 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
@@ -20,2 +18,3 @@ LIBS += -lqpe
+
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/tetrix/main.cpp b/noncore/games/tetrix/main.cpp
index e36d52d..fcf4b33 100644
--- a/noncore/games/tetrix/main.cpp
+++ b/noncore/games/tetrix/main.cpp
@@ -24,10 +24,5 @@
-int main( int argc, char **argv )
-{
- QPEApplication a(argc,argv);
+#include <opie/oapplicationfactory.h>
- QTetrix *tetrix = new QTetrix;
- a.showMainWidget(tetrix);
+OPIE_EXPORT_APP( OApplicationFactory<QTetrix> )
- return a.exec();
-}
diff --git a/noncore/games/tetrix/opie-tetrix.control b/noncore/games/tetrix/opie-tetrix.control
index e901dbf..b1e0bcf 100644
--- a/noncore/games/tetrix/opie-tetrix.control
+++ b/noncore/games/tetrix/opie-tetrix.control
@@ -1,3 +1,3 @@
Package: opie-tetrix
-Files: bin/tetrix apps/Games/tetrix.desktop pics/tetrix/*
+Files: plugins/application/libtetrix.so* bin/tetrix apps/Games/tetrix.desktop pics/tetrix/*
Priority: optional
diff --git a/noncore/games/tetrix/qtetrix.h b/noncore/games/tetrix/qtetrix.h
index cb33941..c8959c5 100644
--- a/noncore/games/tetrix/qtetrix.h
+++ b/noncore/games/tetrix/qtetrix.h
@@ -54,2 +54,3 @@ class QTetrix : public QMainWindow
public:
+ static QString appName() { return QString::fromLatin1("tetrix"); }
QTetrix( QWidget *parent=0, const char *name=0, WFlags f=0 );
diff --git a/noncore/games/tetrix/tetrix.pro b/noncore/games/tetrix/tetrix.pro
index 35fe82b..3b95c84 100644
--- a/noncore/games/tetrix/tetrix.pro
+++ b/noncore/games/tetrix/tetrix.pro
@@ -1,4 +1,2 @@
-TEMPLATE = app
-CONFIG = qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG = qt warn_on release quick-app
HEADERS = gtetrix.h \
@@ -20,2 +18,5 @@ TARGET = tetrix
+
+
+
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/wordgame/main.cpp b/noncore/games/wordgame/main.cpp
index cd4600e..f32acff 100644
--- a/noncore/games/wordgame/main.cpp
+++ b/noncore/games/wordgame/main.cpp
@@ -23,12 +23,6 @@
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
-int main( int argc, char ** argv )
-{
- QPEApplication a( argc, argv );
- WordGame mw;
- //QPEApplication::setInputMethodHint( &mw, QPEApplication::AlwaysOff );
- a.showMainWidget(&mw);
+OPIE_EXPORT_APP( OApplicationFactory<WordGame> )
- return a.exec();
-}
diff --git a/noncore/games/wordgame/wordgame.h b/noncore/games/wordgame/wordgame.h
index f73c85a..020a4b5 100644
--- a/noncore/games/wordgame/wordgame.h
+++ b/noncore/games/wordgame/wordgame.h
@@ -311,2 +311,3 @@ public:
~WordGame();
+ static QString appName() { return QString::fromLatin1("wordgame"); }
diff --git a/noncore/games/wordgame/wordgame.pro b/noncore/games/wordgame/wordgame.pro
index e997adc..7ef2bfd 100644
--- a/noncore/games/wordgame/wordgame.pro
+++ b/noncore/games/wordgame/wordgame.pro
@@ -1,4 +1,2 @@
-TEMPLATE = app
-CONFIG = qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG = qt warn_on release quick-app
HEADERS = wordgame.h
@@ -12,2 +10,3 @@ LIBS += -lqpe
+
include ( $(OPIEDIR)/include.pro )