summaryrefslogtreecommitdiff
path: root/noncore/games
authorzecke <zecke>2004-02-06 12:14:56 (UTC)
committer zecke <zecke>2004-02-06 12:14:56 (UTC)
commit0c74629e8f5c12a9b5a282b817f884fa10dee491 (patch) (unidiff)
tree3294663b92023f8d24d68a01022e011a3c94002d /noncore/games
parent46ce5afcfbe7be19f4d5ac0fed6886a0759f1a25 (diff)
downloadopie-0c74629e8f5c12a9b5a282b817f884fa10dee491.zip
opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.tar.gz
opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.tar.bz2
Merge from the 1.0.x release
Diffstat (limited to 'noncore/games') (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 @@
1Package: backgammon 1Package: backgammon
2Files: bin/backgammon apps/Games/backgammon.desktop pics/backgammon help/en/html/backgammon.html 2Files: plugins/application/libbackgammon.so* bin/backgammon apps/Games/backgammon.desktop pics/backgammon help/en/html/backgammon.html
3Priority: optional 3Priority: 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:
87public: 87public:
88 static QString appName() { return QString::fromLatin1("backgammon"); }
88 BackGammon( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 89 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 @@
1 TEMPLATE = app 1 CONFIG = qt warn_on release quick-app
2 CONFIG = qt warn_on release
3 2
@@ -30,3 +29,2 @@ DEPENDPATH += $(OPIEDIR)/include
30 LIBS += -lqpe -lstdc++ 29 LIBS += -lqpe -lstdc++
31 DESTDIR = $(OPIEDIR)/bin
32 30
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 @@
3 3
4#include <opie/oapplicationfactory.h>
4 5
5int main( int argc, char** argv ) 6OPIE_EXPORT_APP( OApplicationFactory<BackGammon> )
6{
7 QPEApplication app( argc, argv );
8 7
9 BackGammon* view= new BackGammon();
10 app.showMainWidget(view);
11
12 return app.exec();
13}
14 8
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 @@
1 TEMPLATE= app
2 #CONFIG = qt warn_on debug 1 #CONFIG = qt warn_on debug
3 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release quick-app
4 HEADERS = game.h kbounce.h 3 HEADERS = game.h kbounce.h
@@ -8,3 +7,2 @@ DEPENDPATH += $(OPIEDIR)/include
8LIBS += -lqpe 7LIBS += -lqpe
9DESTDIR = $(OPIEDIR)/bin
10 TARGET = bounce 8 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 @@
29 29
30KJezzball::KJezzball() : QMainWindow(0), m_gameWidget( 0 ) 30KJezzball::KJezzball(QWidget *p, const char* n, WFlags f)
31 : QMainWindow(p,n,f), m_gameWidget( 0 )
31{ 32{
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
34public: 34public:
35 KJezzball(); 35 static QString appName() { return QString::fromLatin1("bounce"); }
36 KJezzball(QWidget *, const char*, WFlags );
36 37
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 @@
20#include "kbounce.h" 20#include "kbounce.h"
21#include <opie/oapplicationfactory.h>
21 22
22int main(int argc, char **argv) 23OPIE_EXPORT_APP( OApplicationFactory<KJezzball> )
23{
24 QPEApplication a( argc, argv );
25 KJezzball *top = new KJezzball;
26 a.showMainWidget(top);
27 24
28 return a.exec();
29}
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 @@
1Package: opie-bounce 1Package: opie-bounce
2Files: bin/bounce apps/Games/bounce.desktop pics/bounce/*.png 2Files: plugins/application/libbounce.so* bin/bounce apps/Games/bounce.desktop pics/bounce/*.png
3Version: 0.6-$SUB_VERSION 3Version: 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()
70 70
71BuzzWord::BuzzWord() : QMainWindow(0) 71BuzzWord::BuzzWord(QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl )
72{ 72{
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
66public: 66public:
67 BuzzWord(); 67 BuzzWord( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
68 static QString appName() { return QString::fromLatin1("buzzword"); }
68 69
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 @@
1 TEMPLATE= app 1 CONFIG = qt warn_on release quick-app
2 CONFIG = qt warn_on release
3 HEADERS = buzzword.h 2 HEADERS = buzzword.h
@@ -6,5 +5,5 @@ INCLUDEPATH += $(OPIEDIR)/include
6 DEPENDPATH+= $(OPIEDIR)/include 5 DEPENDPATH+= $(OPIEDIR)/include
7DESTDIR = $(OPIEDIR)/bin
8LIBS += -lqpe 6LIBS += -lqpe
9 TARGET = buzzword 7
8 TARGET = buzzword
10 9
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 @@
19#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
20 20#include <opie/oapplicationfactory.h>
21#include <stdlib.h>
22#include <time.h>
23 21
@@ -25,11 +23,2 @@
25 23
26int main(int argc, char **argv) 24OPIE_EXPORT_APP( OApplicationFactory<BuzzWord> )
27{
28 srand(time(0));
29
30 QPEApplication a( argc, argv );
31 BuzzWord *top = new BuzzWord;
32 a.showMainWidget(top);
33
34 return a.exec();
35}
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 @@
1Package: opie-buzzword 1Package: opie-buzzword
2Files: bin/buzzword apps/Games/buzzword.desktop pics/buzzword/buzzword.png share/buzzword/buzzwords 2Files: plugins/application/libbuzzword.so* bin/buzzword apps/Games/buzzword.desktop pics/buzzword/buzzword.png share/buzzword/buzzwords
3Version: 1.1-$SUB_VERSION 3Version: 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 @@
1Package: opie-fifteen 1Package: opie-fifteen
2Files: bin/fifteen apps/Games/fifteen.desktop pics/fifteen 2Files: plugins/application/libfifteen.so* bin/fifteen apps/Games/fifteen.desktop pics/fifteen
3Priority: optional 3Priority: 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 @@
1 DESTDIR = $(OPIEDIR)/bin 1 CONFIG = qt warn_on release quick-app
2 TEMPLATE= app
3 CONFIG = qt warn_on release
4 HEADERS = amigo.h \ 2 HEADERS = amigo.h \
@@ -18,2 +16,4 @@ TARGET = go
18 16
17
18
19include ( $(OPIEDIR)/include.pro ) 19include ( $(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;
53 53
54GoMainWidget::GoMainWidget( QWidget *parent, const char* name) : 54GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) :
55 QMainWindow( parent, name ) 55 QMainWindow( parent, name, fl )
56{ 56{
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
33public: 33public:
34 GoMainWidget( QWidget *parent=0, const char* name=0); 34 static QString appName() { return QString::fromLatin1("go"); }
35 GoMainWidget( QWidget *parent=0, const char* name=0, WFlags fl = 0);
35protected: 36protected:
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 @@
24 24
25#include <stdio.h> 25#include <opie/oapplicationfactory.h>
26
27OPIE_EXPORT_APP( OApplicationFactory<GoMainWidget> )
26 28
27int main( int argc, char ** argv)
28{
29 QPEApplication app( argc, argv );
30
31 GoMainWidget m;
32 m.setCaption( GoWidget::tr("Go") );
33 app.showMainWidget( &m );
34 return app.exec();
35}
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 @@
1Package: opie-go 1Package: opie-go
2Files: bin/go apps/Games/go.desktop pics/go 2Files: plugins/application/libgo.so* bin/go apps/Games/go.desktop pics/go
3Priority: optional 3Priority: optional
4Section: opie/games 4Section: opie/games
5Maintainer: Opie Project <opie@handhelds.org> 5Maintainer: Warwick Allison <warwick@trolltech.com>
6Architecture: arm 6Architecture: 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,
44 44
45KCheckers::KCheckers():QMainWindow(0,0,WStyle_DialogBorder) 45KCheckers::KCheckers(QWidget *p, const char* n, WFlags )
46 :QMainWindow(p,n,WStyle_DialogBorder)
46{ 47{
47 setCaption("KCheckers"); 48 setCaption(tr("KCheckers") );
48 setIcon(QPixmap(biglogo_xpm)); 49 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
31 public: 31 public:
32 KCheckers(); 32 static QString appName() { return QString::fromLatin1("kcheckers"); }
33 KCheckers(QWidget *parent, const char* name, WFlags fl);
33 34
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 @@
1 TEMPLATE= app 1 CONFIG = qt warn_on release quick-app
2 CONFIG = qt warn_on release
3 HEADERS = checkers.h \ 2 HEADERS = checkers.h \
@@ -16,5 +15,5 @@ INCLUDEPATH += $(OPIEDIR)/include
16 LIBS += -lqpe 15 LIBS += -lqpe
17 DESTDIR = $(OPIEDIR)/bin
18 TARGET = kcheckers 16 TARGET = kcheckers
19 17
18
20include ( $(OPIEDIR)/include.pro ) 19include ( $(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 @@
5#include "kcheckers.h" 5#include "kcheckers.h"
6#include <opie/oapplicationfactory.h>
6 7
8OPIE_EXPORT_APP( OApplicationFactory<KCheckers> )
7 9
8int main(int argc, char *argv[])
9{
10 QPEApplication app(argc,argv);
11
12 KCheckers kcheckers;
13 app.setMainWidget(&kcheckers);
14 kcheckers.showMaximized();
15
16 return app.exec();
17}
18 10
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 @@
1Package: opie-kcheckers 1Package: opie-kcheckers
2Files: bin/kcheckers apps/Games/kcheckers.desktop pics/kcheckers 2Files: plugins/application/libkcheckers.so* bin/kcheckers apps/Games/kcheckers.desktop pics/kcheckers
3Priority: optional 3Priority: 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 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
@@ -22,3 +22,3 @@
22 22
23#include <qpe/qpeapplication.h> 23#include <qtopia/qpeapplication.h>
24 24
@@ -28,4 +28,4 @@ int main( int argc, char **argv )
28 28
29 MindBreaker w(0, "new window"); 29 MindBreaker w;
30 w.setCaption("Mind Breaker"); 30 w.setCaption(MindBreaker::tr("Mind Breaker"));
31 QPEApplication::setInputMethodHint( &w, QPEApplication::AlwaysOff ); 31 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 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
@@ -22,4 +22,6 @@
22 22
23#include <qpe/resource.h> 23#include <qtopia/resource.h>
24#include <qpe/config.h> 24#include <qtopia/config.h>
25#include <qtopia/qpeapplication.h>
26#include <qtoolbar.h>
25 27
@@ -27,3 +29,2 @@
27#include <qpixmap.h> 29#include <qpixmap.h>
28#include <qpe/qpetoolbar.h>
29#include <qtoolbutton.h> 30#include <qtoolbutton.h>
@@ -32,3 +33,4 @@
32#include <qlabel.h> 33#include <qlabel.h>
33#include <qstyle.h> 34#include <qlayout.h>
35#include <qtimer.h>
34 36
@@ -40,2 +42,60 @@ static int pegRTTI = 3393393;
40 42
43static int adjusted_panel_height;
44static int adjusted_panel_width;
45
46static int adjusted_bin_margin;
47static int adjusted_peg_size;
48static int adjusted_answerpeg_size;
49
50static int adjusted_title_height;
51static int adjusted_title_width;
52
53static int adjusted_first_peg_x_diff;
54static int adjusted_first_peg_y_diff;
55static int adjusted_peg_spacing;
56
57static int adjusted_answerpegx;
58static int adjusted_answerpegy;
59static int adjusted_answerpeg_xdiff;
60static int adjusted_answerpeg_ydiff;
61
62static int adjusted_board_height;
63static int adjusted_board_width;
64
65static void setupBoardSize(int w, int h)
66{
67 adjusted_panel_width = w * 3/4;
68 adjusted_title_width = w * 3/4;
69
70 adjusted_title_height = h/10;
71 adjusted_panel_height = (h-adjusted_title_height)/9;
72
73 adjusted_bin_margin = w * 10/240;
74 adjusted_peg_size = adjusted_panel_height*3/4;
75 adjusted_answerpeg_size = QMIN(adjusted_panel_width*15/180,adjusted_panel_height*15/25);
76
77 // looks a bit dodgy on larger sizes
78 if ( adjusted_peg_size > 40 )
79 adjusted_peg_size = 40;
80
81 adjusted_first_peg_x_diff = w * 31/240-adjusted_peg_size/2;
82 adjusted_first_peg_y_diff = (adjusted_panel_height - adjusted_peg_size)/2;
83 adjusted_peg_spacing = w * 30/240;
84
85 // looks a bit dodgy on larger sizes (still does though, but not as much...)
86 if ( adjusted_answerpeg_size > 22 )
87 adjusted_answerpeg_size = 22;
88
89 adjusted_answerpegx = adjusted_panel_width * 159/180 - adjusted_answerpeg_size/2;
90 adjusted_answerpegy = adjusted_panel_height/3 - adjusted_answerpeg_size/2;
91 adjusted_answerpeg_xdiff = adjusted_panel_width * 10/180;
92 adjusted_answerpeg_ydiff = adjusted_panel_height * 9/25;
93
94 adjusted_board_height = adjusted_title_height + (adjusted_panel_height * 9);
95 adjusted_board_width = adjusted_panel_width + (adjusted_bin_margin * 2) + adjusted_peg_size;
96
97// qDebug("Adjusted width %d height %d", adjusted_board_width, adjusted_board_height);
98}
99
100
41/* helper class, */ 101/* helper class, */
@@ -50,3 +110,3 @@ public:
50 110
51/* a placed peg is one that has been set down on the board correctly and 111/* a placed peg is one that has been set down on the board correctly and
52 should not be moved, only copied */ 112 should not be moved, only copied */
@@ -79,3 +139,2 @@ private:
79}; 139};
80
81int Peg::eggLevel = 0; 140int Peg::eggLevel = 0;
@@ -86,5 +145,4 @@ void Peg::buildImages()
86{ 145{
87
88 QImage pegs = Resource::loadImage("mindbreaker/pegs"); 146 QImage pegs = Resource::loadImage("mindbreaker/pegs");
89 int x = 0; 147 int x = 0;
90 int y = 0; 148 int y = 0;
@@ -94,3 +152,4 @@ void Peg::buildImages()
94 for (i = 0; i < 6; i++) { 152 for (i = 0; i < 6; i++) {
95 normalPegs.insert(i, new QImage(pegs.copy(x, y, peg_size, peg_size))); 153 normalPegs.insert(i, new QImage(pegs.copy(x, y, peg_size, peg_size).
154 smoothScale(adjusted_peg_size, adjusted_peg_size) ));
96 x += peg_size; 155 x += peg_size;
@@ -99,3 +158,4 @@ void Peg::buildImages()
99 for (i = 0; i < 5; i++) { 158 for (i = 0; i < 5; i++) {
100 specialPegs.insert(i, new QImage(pegs.copy(x,y,peg_size, peg_size))); 159 specialPegs.insert(i, new QImage(pegs.copy(x,y,peg_size, peg_size).
160 smoothScale(adjusted_peg_size, adjusted_peg_size) ));
101 x += peg_size; 161 x += peg_size;
@@ -107,8 +167,12 @@ void Peg::buildImages()
107 y = panel_height; 167 y = panel_height;
108 normalPegs.insert(8, 168 normalPegs.insert(8,
109 new QImage(image.copy(x, y, panel_width, panel_height))); 169 new QImage( image.copy(x, y, panel_width, panel_height).
170 smoothScale( adjusted_panel_width, adjusted_panel_height)
171 ));
110 y += panel_height; 172 y += panel_height;
111 y += title_height; 173 y += title_height;
112 normalPegs.insert(9, 174 normalPegs.insert(9,
113 new QImage(image.copy(x, y, title_width, title_height))); 175 new QImage(image.copy(x, y, title_width, title_height).
176 smoothScale( adjusted_title_width, adjusted_title_height)
177 ));
114 y += title_height; 178 y += title_height;
@@ -116,10 +180,12 @@ void Peg::buildImages()
116 x = 6 * peg_size; 180 x = 6 * peg_size;
117 normalPegs.insert(6, 181 normalPegs.insert(6,
118 new QImage(image.copy(x, y, answerpeg_size, answerpeg_size))); 182 new QImage(image.copy(x, y, answerpeg_size, answerpeg_size).
183 smoothScale( adjusted_answerpeg_size, adjusted_answerpeg_size) ));
119 x += answerpeg_size; 184 x += answerpeg_size;
120 normalPegs.insert(7, 185 normalPegs.insert(7,
121 new QImage(image.copy(x, y, answerpeg_size, answerpeg_size))); 186 new QImage(image.copy(x, y, answerpeg_size, answerpeg_size).
187 smoothScale( adjusted_answerpeg_size, adjusted_answerpeg_size) ));
122} 188}
123 189
124QImage Peg::imageForType(int t) 190QImage Peg::imageForType(int t)
125{ 191{
@@ -135,3 +201,3 @@ QImage Peg::imageForType(int t)
135 201
136Peg::Peg(QCanvas *canvas , int t, int g, int p) 202Peg::Peg(QCanvas *canvas , int t, int g, int p)
137 : QCanvasRectangle(canvas) 203 : QCanvasRectangle(canvas)
@@ -159,5 +225,5 @@ void Peg::drawShape(QPainter &p )
159 if ((pegtype == 5) && eggLevel > 5) { 225 if ((pegtype == 5) && eggLevel > 5) {
160 p.drawImage(x(), y(), *normalPegs[aniStep]); 226 p.drawImage(int(x()), int(y()), *normalPegs[aniStep]);
161 } else 227 } else
162 p.drawImage(x(), y(), imageForType(pegtype)); 228 p.drawImage(int(x()), int(y()), imageForType(pegtype));
163} 229}
@@ -189,3 +255,3 @@ inline int Peg::pegPos() const
189 255
190inline void Peg::setPegPos(int p) 256inline void Peg::setPegPos(int p)
191{ 257{
@@ -194,3 +260,3 @@ inline void Peg::setPegPos(int p)
194 260
195inline void Peg::setPlaced(bool p) 261inline void Peg::setPlaced(bool p)
196{ 262{
@@ -199,3 +265,3 @@ inline void Peg::setPlaced(bool p)
199 265
200inline int Peg::type() const 266inline int Peg::type() const
201{ 267{
@@ -204,3 +270,3 @@ inline int Peg::type() const
204 270
205/* Load the main image, copy from it the pegs, the board, and the answer image 271/* Load the main image, copy from it the pegs, the board, and the answer image
206 * and use these to create the tray, answer and board 272 * and use these to create the tray, answer and board
@@ -208,8 +274,18 @@ inline int Peg::type() const
208MindBreaker::MindBreaker( QWidget *parent, const char *name, int wFlags ) 274MindBreaker::MindBreaker( QWidget *parent, const char *name, int wFlags )
209: QMainWindow(parent, name, wFlags), 275 : QMainWindow(parent, name, wFlags)
210 canvas(board_height, board_width)
211{ 276{
212 MindBreakerBoard *m = new MindBreakerBoard(canvas, this); 277 setCaption( tr("Mind Breaker"));
213 setCentralWidget(m); 278 QPEApplication::setInputMethodHint( this, QPEApplication::AlwaysOff );
214 279 setMinimumSize(160,210);
280
281 QWidget *w = new QWidget( this );
282 w->setBackgroundColor( black );
283 QHBoxLayout *hb = new QHBoxLayout( w );
284 hb->addStretch();
285 board = new MindBreakerBoard(w);
286 hb->addWidget( board, 100 );
287 hb->addStretch();
288
289 setCentralWidget(w);
290
215 setToolBarsMovable( FALSE ); 291 setToolBarsMovable( FALSE );
@@ -219,5 +295,5 @@ MindBreaker::MindBreaker( QWidget *parent, const char *name, int wFlags )
219 295
220 QPixmap newicon = Resource::loadPixmap("new"); 296 QIconSet newicon = Resource::loadIconSet("new");
221 new QToolButton(newicon, tr("New Game"), 0, 297 new QToolButton(newicon, tr("New Game"), 0,
222 m, SLOT(clear()), tb, "NewGame"); 298 board, SLOT(clear()), tb, "NewGame");
223 299
@@ -229,8 +305,10 @@ MindBreaker::MindBreaker( QWidget *parent, const char *name, int wFlags )
229 305
230 connect(m, SIGNAL(scoreChanged(int, int)), this, SLOT(setScore(int, int))); 306 connect(board, SIGNAL(scoreChanged(int,int)), this, SLOT(setScore(int,int)));
231 connect(score, SIGNAL(clicked()), m, SLOT(resetScore())); 307 connect(score, SIGNAL(clicked()), board, SLOT(resetScore()));
232 308
233 int a, b; 309 int a, b;
234 m->getScore(&a, &b); 310 board->getScore(&a, &b);
235 setScore(a,b); 311 setScore(a,b);
312
313 layout()->setResizeMode(QLayout::FreeResize);
236} 314}
@@ -243,5 +321,5 @@ void MindBreaker::setScore(int turns, int games)
243 321
244 if(total_games > 0) 322 if(total_games > 0)
245 average = total_turns / total_games; 323 average = total_turns / total_games;
246 else 324 else
247 average = 0.0; 325 average = 0.0;
@@ -251,8 +329,20 @@ void MindBreaker::setScore(int turns, int games)
251 329
330void MindBreaker::resizeEvent( QResizeEvent *e )
331{
332 board->fixSize();
333 QMainWindow::resizeEvent( e );
334}
335
252 336
253MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent, 337MindBreakerBoard::MindBreakerBoard( QWidget *parent,
254 const char *name, int wFlags ) 338 const char *name, int wFlags )
255 : QCanvasView(&canv, parent, name, wFlags) 339 : QCanvasView(0, parent, name, wFlags),
340 moving(0), game_over(FALSE), total_turns(0), total_games(0)
256{ 341{
257 int i, x, y; 342 setFrameStyle( NoFrame );
343 setupBoardSize(qApp->desktop()->width(),qApp->desktop()->height());
344 cnv.resize(100,100);
345 setCanvas(&cnv);
346 setBackgroundColor( black );
347
258 struct timeval tv; 348 struct timeval tv;
@@ -261,3 +351,2 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
261 gettimeofday(&tv, 0); 351 gettimeofday(&tv, 0);
262
263 srand(tv.tv_usec); 352 srand(tv.tv_usec);
@@ -265,25 +354,14 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
265 canvas()->setAdvancePeriod(500); 354 canvas()->setAdvancePeriod(500);
355 current_highlight = 0;
266 356
267 QImage image = Resource::loadImage("mindbreaker/mindbreaker"); 357 widthTimer = new QTimer( this );
268 358 connect(widthTimer, SIGNAL(timeout()), this, SLOT(doFixSize()) );
269 /* copy from master image to functional images */
270 x = 0;
271 y = 0;
272 panelImage = image.copy(x,y, panel_width, panel_height);
273 y += panel_height;
274 y += panel_height;
275
276 titleImage = image.copy(x, y, title_width, title_height);
277
278 Peg::buildImages(); // must be done BEFORE any pegs are made
279
280 current_highlight = new Peg(canvas(), 8);
281 current_highlight->setPlaced(TRUE);
282 current_highlight->setX(0);
283 current_highlight->setY(board_height - ((current_go + 1) * panel_height));
284 current_highlight->setZ(0);
285 current_highlight->show();
286 359
360 setMaximumWidth( QMIN(qApp->desktop()->height(),qApp->desktop()->width()) );
361 //doFixSize(); // build images... needs to be done before reading config.
362 //readConfig(); // first read... to ensure initial labels and side look right.
363}
287 364
288 /* set up the game */ 365void MindBreakerBoard::readConfig()
366{
289 Config c("MindBreaker", Config::User); 367 Config c("MindBreaker", Config::User);
@@ -291,2 +369,3 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
291 game_over = FALSE; 369 game_over = FALSE;
370 int i;
292 if (c.readNumEntry("Answer0") < 0) { 371 if (c.readNumEntry("Answer0") < 0) {
@@ -311,3 +390,3 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
311 c.setGroup("Board"); 390 c.setGroup("Board");
312 for(i = 0; i < 4; i++) 391 for(i = 0; i < 4; i++)
313 answer[i] = c.readNumEntry(QString("Answer%1").arg(i)); 392 answer[i] = c.readNumEntry(QString("Answer%1").arg(i));
@@ -330,3 +409,3 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
330 current_guess[i] = c.readNumEntry(QString("CurrentGo%1").arg(i)); 409 current_guess[i] = c.readNumEntry(QString("CurrentGo%1").arg(i));
331 if (current_guess[i] != 6) 410 if (current_guess[i] != 6)
332 placeGuessPeg(i, current_guess[i]); 411 placeGuessPeg(i, current_guess[i]);
@@ -334,6 +413,2 @@ MindBreakerBoard::MindBreakerBoard( QCanvas &canv, QWidget *parent,
334 } 413 }
335
336 /* draw initial screen */
337 drawBackground();
338 canvas()->update();
339} 414}
@@ -342,3 +417,3 @@ MindBreakerBoard::~MindBreakerBoard()
342{ 417{
343 int i, j; 418 int i;
344 if (game_over) { 419 if (game_over) {
@@ -351,3 +426,7 @@ MindBreakerBoard::~MindBreakerBoard()
351 } 426 }
352 427 writeConfig();
428}
429
430void MindBreakerBoard::writeConfig()
431{
353 Config c("MindBreaker", Config::User); 432 Config c("MindBreaker", Config::User);
@@ -356,10 +435,11 @@ MindBreakerBoard::~MindBreakerBoard()
356 /* write the board */ 435 /* write the board */
436 int i,j;
357 for (i = 0; i < current_go; i++) { 437 for (i = 0; i < current_go; i++) {
358 for(j = 0; j < 4; j++) 438 for(j = 0; j < 4; j++)
359 c.writeEntry(tr("Go%1p%2").arg(i).arg(j), past_guesses[4*i+j]); 439 c.writeEntry(QString("Go%1p%2").arg(i).arg(j), past_guesses[4*i+j]);
360 } 440 }
361 for(j = 0; j < 4; j++) 441 for(j = 0; j < 4; j++)
362 c.writeEntry(tr("CurrentGo%1").arg(j), current_guess[j]); 442 c.writeEntry(QString("CurrentGo%1").arg(j), current_guess[j]);
363 for(j = 0; j < 4; j++) 443 for(j = 0; j < 4; j++)
364 c.writeEntry(tr("Answer%1").arg(j), answer[j]); 444 c.writeEntry(QString("Answer%1").arg(j), answer[j]);
365 445
@@ -379,7 +459,71 @@ void MindBreakerBoard::getScore(int *a, int *b)
379 459
460void MindBreakerBoard::fixSize()
461{
462 hide();
463 setMaximumWidth( parentWidget()->height() );
464 widthTimer->start( 20, TRUE );
465}
466
467void MindBreakerBoard::doFixSize()
468{
469 QSize s = size();
470 int fw = frameWidth();
471 s.setWidth(s.width() - fw);
472 s.setHeight(s.height() - fw);
473
474 /* min size is 200 x 260 */
475/*
476 if (s.width() < adjusted_board_width)
477 s.setWidth(adjusted_board_width);
478
479 if (s.height() < adjusted_board_height)
480 s.setHeight(adjusted_board_height);
481*/
482
483 if ( current_highlight ) // non-first resize
484 writeConfig();
485
486 setupBoardSize(s.width() - fw, s.height() - fw);
487 canvas()->resize(s.width() - fw, s.height() - fw);
488 Peg::buildImages(); // must be done BEFORE any pegs are made
489
490 QImage image = Resource::loadImage("mindbreaker/mindbreaker");
491
492 /* copy from master image to functional images */
493 int x = 0;
494 int y = 0;
495 panelImage = image.copy(x, y, panel_width, panel_height).
496 smoothScale( adjusted_panel_width, adjusted_panel_height);
497
498 y += panel_height;
499 y += panel_height;
500
501 titleImage = image.copy(x, y, title_width, title_height).
502 smoothScale( adjusted_title_width, adjusted_title_height);
503 show();
504
505 delete current_highlight;
506 current_highlight = new Peg(canvas(), 8);
507 current_highlight->setPlaced(TRUE);
508 current_highlight->setX(0);
509 current_highlight->setY(adjusted_board_height - ((current_go + 1) * adjusted_panel_height));
510 current_highlight->setZ(0);
511 current_highlight->show();
512
513 /* set up the game */
514 //readConfig();
515
516 /* draw initial screen */
517 //drawBackground();
518 //canvas()->update();
519 clear();
520
521 readConfig();
522}
523
380void MindBreakerBoard::placeGuessPeg(int pos, int pegId) 524void MindBreakerBoard::placeGuessPeg(int pos, int pegId)
381{ 525{
382 int x = first_peg_x_diff + (pos * peg_spacing); 526 int x = adjusted_first_peg_x_diff + (pos * adjusted_peg_spacing);
383 int y = board_height - ((current_go + 1) * panel_height) 527 int y = adjusted_board_height - ((current_go + 1) * adjusted_panel_height)
384 + first_peg_y_diff; 528 + adjusted_first_peg_y_diff;
385 529
@@ -407,14 +551,14 @@ void MindBreakerBoard::drawBackground()
407 painter.setPen(pen); 551 painter.setPen(pen);
408 x_gap = canvas()->width() - (panel_width + (2 * bin_margin)); 552 x_gap = canvas()->width() - (adjusted_panel_width + (2 * adjusted_bin_margin));
409 //x_gap += peg_size >> 1; 553 //x_gap += peg_size >> 1;
410 if (x_gap < 1) 554 if (x_gap < 1)
411 x_gap = 1; 555 x_gap = 1;
412 556
413 y_gap = board_height / 6; 557 y_gap = adjusted_board_height / 6;
414 y_gap -= (2 * bin_margin); 558 y_gap -= (2 * adjusted_bin_margin);
415 //y_gap += peg_size >> 1; 559 //y_gap += peg_size >> 1;
416 if (y_gap < 1) 560 if (y_gap < 1)
417 y_gap = 1; 561 y_gap = 1;
418 x = panel_width + bin_margin - (peg_size >> 1); 562 x = adjusted_panel_width + adjusted_bin_margin - (adjusted_peg_size >> 1);
419 y = bin_margin - (peg_size >> 1) + 2; 563 y = adjusted_bin_margin - (adjusted_peg_size >> 1) + 2;
420 564
@@ -426,9 +570,9 @@ void MindBreakerBoard::drawBackground()
426 } 570 }
427 y += board_height / 6; 571 y += adjusted_board_height / 6;
428 } 572 }
429 /* now draw the surrounding boxes */ 573 /* now draw the surrounding boxes */
430 x_gap = canvas()->width() - panel_width; 574 x_gap = canvas()->width() - adjusted_panel_width;
431 if (x_gap < 1) x_gap = 1; 575 if (x_gap < 1) x_gap = 1;
432 y_gap = board_height / 6; 576 y_gap = adjusted_board_height / 6;
433 x = panel_width; 577 x = adjusted_panel_width;
434 y = 1; 578 y = 1;
@@ -436,3 +580,3 @@ void MindBreakerBoard::drawBackground()
436 for (i = 0; i < 6; i++) { 580 for (i = 0; i < 6; i++) {
437 painter.drawRect(x, y, x_gap, y_gap); 581 painter.drawRect(x, y, x_gap, y_gap);
438 y += y_gap; 582 y += y_gap;
@@ -444,3 +588,3 @@ void MindBreakerBoard::drawBackground()
444 painter.drawImage(x,y, titleImage); 588 painter.drawImage(x,y, titleImage);
445 y = title_height; 589 y = adjusted_title_height;
446 /* now nine gues panels */ 590 /* now nine gues panels */
@@ -448,3 +592,3 @@ void MindBreakerBoard::drawBackground()
448 painter.drawImage(x, y, panelImage); 592 painter.drawImage(x, y, panelImage);
449 y += panel_height; 593 y += adjusted_panel_height;
450 } 594 }
@@ -471,3 +615,3 @@ void MindBreakerBoard::checkGuess()
471 copy_answer[i] = 6; 615 copy_answer[i] = 6;
472 copy_guess[i] = 7; 616 copy_guess[i] = 7;
473 } 617 }
@@ -488,5 +632,5 @@ void MindBreakerBoard::checkGuess()
488 632
489 int x = answerpegx; 633 int x = adjusted_answerpegx;
490 int y = (board_height - ((current_go + 1) * panel_height)) + answerpegy; 634 int y = (adjusted_board_height - ((current_go + 1) * adjusted_panel_height)) + adjusted_answerpegy;
491 635
492 if (num_black == 4) 636 if (num_black == 4)
@@ -502,8 +646,8 @@ void MindBreakerBoard::checkGuess()
502 num_black--; 646 num_black--;
503 647
504 if (x == answerpegx) 648 if (x == adjusted_answerpegx)
505 x = answerpegx + answerpeg_diff; 649 x = adjusted_answerpegx + adjusted_answerpeg_xdiff;
506 else { 650 else {
507 x = answerpegx; 651 x = adjusted_answerpegx;
508 y += answerpeg_diff; 652 y += adjusted_answerpeg_ydiff;
509 } 653 }
@@ -518,8 +662,8 @@ void MindBreakerBoard::checkGuess()
518 num_white--; 662 num_white--;
519 663
520 if (x == answerpegx) 664 if (x == adjusted_answerpegx)
521 x = answerpegx + answerpeg_diff; 665 x = adjusted_answerpegx + adjusted_answerpeg_xdiff;
522 else { 666 else {
523 x = answerpegx; 667 x = adjusted_answerpegx;
524 y += answerpeg_diff; 668 y += adjusted_answerpeg_ydiff;
525 } 669 }
@@ -537,3 +681,3 @@ void MindBreakerBoard::checkGuess()
537 total_turns += 10; 681 total_turns += 10;
538 else 682 else
539 total_turns += current_go; 683 total_turns += current_go;
@@ -548,7 +692,7 @@ void MindBreakerBoard::checkGuess()
548 p->show(); 692 p->show();
549 693
550 for (i = 0; i < 4; i++) { 694 for (i = 0; i < 4; i++) {
551 p = new Peg(canvas(), answer[i], -1); 695 p = new Peg(canvas(), answer[i], -1);
552 p->setX(first_peg_x_diff + (i * peg_spacing)); 696 p->setX(adjusted_first_peg_x_diff + (i * adjusted_peg_spacing));
553 p->setY(5); 697 p->setY(adjusted_first_peg_y_diff);
554 p->setZ(3); 698 p->setZ(3);
@@ -557,3 +701,3 @@ void MindBreakerBoard::checkGuess()
557 } else { 701 } else {
558 current_highlight->setY(board_height - ((current_go + 1) * panel_height)); 702 current_highlight->setY(adjusted_board_height - ((current_go + 1) * adjusted_panel_height));
559 } 703 }
@@ -588,3 +732,3 @@ void MindBreakerBoard::clear()
588 732
589 current_highlight->setY(board_height - ((current_go + 1) * panel_height)); 733 current_highlight->setY(adjusted_board_height - ((current_go + 1) * adjusted_panel_height));
590 checkScores(); 734 checkScores();
@@ -594,3 +738,3 @@ void MindBreakerBoard::clear()
594 738
595void MindBreakerBoard::resetScore() 739void MindBreakerBoard::resetScore()
596{ 740{
@@ -598,3 +742,3 @@ void MindBreakerBoard::resetScore()
598 742
599 if (QMessageBox::information(this, tr( "Reset Statistics" ), 743 if (QMessageBox::information(this, tr( "Reset Statistics" ),
600 tr( "Reset the win ratio?" ), 744 tr( "Reset the win ratio?" ),
@@ -614,2 +758,9 @@ void MindBreakerBoard::contentsMousePressEvent(QMouseEvent *e)
614{ 758{
759 if (game_over) {
760 null_press = TRUE;
761 null_point = e->pos();
762 moving = 0;
763 return;
764 }
765
615 copy_press = FALSE; 766 copy_press = FALSE;
@@ -618,7 +769,7 @@ void MindBreakerBoard::contentsMousePressEvent(QMouseEvent *e)
618 got clicked */ 769 got clicked */
619 if (e->x() > panel_width) { 770 if (e->x() > adjusted_panel_width) {
620 /* its a bin, but which bin */ 771 /* its a bin, but which bin */
621 if(e->y() > board_height) 772 int bin = (e->y() + 2) / (adjusted_board_height / 6);
773 if (bin > 5)
622 return; // missed everything 774 return; // missed everything
623 int bin = (e->y() + 2) / (board_height / 6);
624 775
@@ -627,4 +778,4 @@ void MindBreakerBoard::contentsMousePressEvent(QMouseEvent *e)
627 moving = new Peg(canvas(), bin, current_go); 778 moving = new Peg(canvas(), bin, current_go);
628 moving->setX(e->x() - (peg_size >> 1)); 779 moving->setX(e->x() - (adjusted_peg_size >> 1));
629 moving->setY(e->y() - (peg_size >> 1)); 780 moving->setY(e->y() - (adjusted_peg_size >> 1));
630 moving->setZ(5); 781 moving->setZ(5);
@@ -654,6 +805,6 @@ void MindBreakerBoard::contentsMousePressEvent(QMouseEvent *e)
654 } 805 }
655 moving = new Peg(canvas(), 806 moving = new Peg(canvas(),
656 item->type(), current_go); 807 item->type(), current_go);
657 moving->setX(e->x() - (peg_size >> 1)); 808 moving->setX(e->x() - (adjusted_peg_size >> 1));
658 moving->setY(e->y() - (peg_size >> 1)); 809 moving->setY(e->y() - (adjusted_peg_size >> 1));
659 moving->setZ(5); 810 moving->setZ(5);
@@ -683,3 +834,3 @@ void MindBreakerBoard::contentsMouseMoveEvent(QMouseEvent* e)
683 return; 834 return;
684 } 835 }
685} 836}
@@ -695,3 +846,3 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
695 for (QCanvasItemList::Iterator it=l.begin(); it !=l.end(); ++it) { 846 for (QCanvasItemList::Iterator it=l.begin(); it !=l.end(); ++it) {
696 if (*it == copy_peg) 847 if (*it == copy_peg)
697 copy_press = TRUE; 848 copy_press = TRUE;
@@ -709,5 +860,5 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
709 } 860 }
710 861
711 /* first work out if in y */ 862 /* first work out if in y */
712 if (e->y() > (board_height - (current_go * panel_height))) { 863 if (e->y() > (adjusted_board_height - (current_go * adjusted_panel_height))) {
713 delete moving; 864 delete moving;
@@ -717,3 +868,3 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
717 } 868 }
718 if (e->y() < (board_height - ((current_go + 1) * panel_height))) { 869 if (e->y() < (adjusted_board_height - ((current_go + 1) * adjusted_panel_height))) {
719 delete moving; 870 delete moving;
@@ -724,14 +875,14 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
724 /* ok, a valid go, but which peg */ 875 /* ok, a valid go, but which peg */
725 int x_bar = first_peg_x_diff - (peg_size >> 1); 876 int x_bar = adjusted_first_peg_x_diff - (adjusted_peg_size >> 1);
726 x_bar += peg_spacing; 877 x_bar += adjusted_peg_spacing;
727 int pos = 0; 878 int pos = 0;
728 if (e->x() > x_bar) 879 if (e->x() > x_bar)
729 pos = 1; 880 pos = 1;
730 x_bar += peg_spacing; 881 x_bar += adjusted_peg_spacing;
731 if (e->x() > x_bar) 882 if (e->x() > x_bar)
732 pos = 2; 883 pos = 2;
733 x_bar += peg_spacing; 884 x_bar += adjusted_peg_spacing;
734 if (e->x() > x_bar) 885 if (e->x() > x_bar)
735 pos = 3; 886 pos = 3;
736 x_bar += peg_spacing; 887 x_bar += adjusted_peg_spacing;
737 888
@@ -745,5 +896,5 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
745 896
746 int x = first_peg_x_diff + (pos * peg_spacing); 897 int x = adjusted_first_peg_x_diff + (pos * adjusted_peg_spacing);
747 int y = board_height - ((current_go + 1) * panel_height) 898 int y = adjusted_board_height - ((current_go + 1) * adjusted_panel_height)
748 + first_peg_y_diff; 899 + adjusted_first_peg_y_diff;
749 moving->setPegPos(pos); 900 moving->setPegPos(pos);
@@ -771,5 +922,5 @@ void MindBreakerBoard::contentsMouseReleaseEvent(QMouseEvent* e)
771 if(null_point.manhattanLength() < 6) { 922 if(null_point.manhattanLength() < 6) {
772 if (game_over) 923 if (game_over)
773 clear(); 924 clear();
774 else 925 else
775 checkGuess(); 926 checkGuess();
@@ -780,16 +931,4 @@ void MindBreakerBoard::resizeEvent(QResizeEvent *e)
780{ 931{
781 QSize s = e->size(); 932 QCanvasView::resizeEvent(e);
782 int fw = style().defaultFrameWidth(); 933 fixSize();
783 s.setWidth(s.width() - fw);
784 s.setHeight(s.height() - fw);
785
786 /* min size is 200 x 260 */
787 if (s.width() < board_width)
788 s.setWidth(board_width);
789
790 if (s.height() < board_height)
791 s.setHeight(board_height);
792
793 canvas()->resize(s.width() - fw, s.height() - fw);
794 drawBackground();
795} 934}
@@ -806,3 +945,3 @@ void MindBreakerBoard::checkScores()
806 double break_even = 5.0; 945 double break_even = 5.0;
807 if (g < 1.0) 946 if (g < 1.0)
808 return; 947 return;
@@ -811,3 +950,3 @@ void MindBreakerBoard::checkScores()
811 while (break_even >= 0.0) { 950 while (break_even >= 0.0) {
812 if (avg >= (break_even + g)) 951 if (avg >= (break_even + g))
813 return; 952 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 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
@@ -53,2 +53,3 @@ class Peg;
53class QToolButton; 53class QToolButton;
54class QTimer;
54 55
@@ -58,3 +59,3 @@ class MindBreakerBoard : public QCanvasView // QWidget
58public: 59public:
59 MindBreakerBoard(QCanvas &c, QWidget *parent=0, const char *name=0, int wFlags=0 ); 60 MindBreakerBoard(QWidget *parent=0, const char *name=0, int wFlags=0 );
60 ~MindBreakerBoard(); 61 ~MindBreakerBoard();
@@ -62,2 +63,6 @@ public:
62 void getScore(int *, int *); 63 void getScore(int *, int *);
64
65 void resizeEvent(QResizeEvent*);
66 void fixSize();
67
63signals: 68signals:
@@ -69,2 +74,5 @@ public slots:
69 74
75private slots:
76 void doFixSize();
77
70protected: 78protected:
@@ -73,5 +81,9 @@ protected:
73 void contentsMouseReleaseEvent(QMouseEvent *); 81 void contentsMouseReleaseEvent(QMouseEvent *);
74 void resizeEvent(QResizeEvent *);
75 82
76private: 83private:
84 QCanvas cnv;
85
86 void readConfig();
87 void writeConfig();
88
77 void drawBackground(); 89 void drawBackground();
@@ -102,2 +114,4 @@ private:
102 int total_games; 114 int total_games;
115
116 QTimer *widthTimer;
103}; 117};
@@ -109,3 +123,3 @@ public:
109 MindBreaker(QWidget *parent=0, const char *name=0, int wFlags=0 ); 123 MindBreaker(QWidget *parent=0, const char *name=0, int wFlags=0 );
110 124 static QString appName() { return QString::fromLatin1("mindbreaker"); }
111public slots: 125public slots:
@@ -113,2 +127,5 @@ public slots:
113 127
128protected:
129 void resizeEvent( QResizeEvent * );
130
114private: 131private:
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 @@
1TEMPLATE = app 1CONFIG += qt warn_on release quick-app
2CONFIG += qt warn_on release
3DESTDIR = $(OPIEDIR)/bin
4 HEADERS = mindbreaker.h 2 HEADERS = mindbreaker.h
@@ -11,2 +9,3 @@ LIBS += -lqpe
11 9
10
12include ( $(OPIEDIR)/include.pro ) 11include ( $(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 @@
1Package: opie-mindbreaker 1Package: opie-mindbreaker
2Files: bin/mindbreaker apps/Games/mindbreaker.desktop pics/mindbreaker 2Files: plugins/application/libmindbreaker.so* bin/mindbreaker apps/Games/mindbreaker.desktop pics/mindbreaker
3Priority: optional 3Priority: 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 @@
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <opie/oapplicationfactory.h>
24 25
25int main( int argc, char** argv ) 26OPIE_EXPORT_APP( OApplicationFactory<MineSweep> )
26{
27 QPEApplication a( argc, argv );
28 27
29 MineSweep ms;
30 QPEApplication::setInputMethodHint( &ms, QPEApplication::AlwaysOff );
31 a.showMainWidget( &ms );
32
33 return a.exec();
34}
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 )
355 } 355 }
356 mines = new (Mine*)[numRows*numCols]; 356 mines = new Mine*[numRows*numCols];
357 for ( i = 0; i < numCols*numRows; i++ ) 357 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 @@
23 23
24#include <qpe/qpeapplication.h>
24#include <qpe/resource.h> 25#include <qpe/resource.h>
@@ -157,8 +158,8 @@ class ResultIndicator : private QLabel
157{ 158{
158public: 159public:
159 static void showResult( QWidget *ref, bool won ); 160 static void showResult( QWidget *ref, bool won );
160private: 161private:
161 ResultIndicator( QWidget *parent, const char *name, WFlags f) 162 ResultIndicator( QWidget *parent, const char *name, WFlags f)
162 :QLabel( parent, name, f ) {} 163 :QLabel( parent, name, f ) {}
163 164
164 void timerEvent( QTimerEvent *); 165 void timerEvent( QTimerEvent *);
@@ -172,3 +173,3 @@ void ResultIndicator::showResult( QWidget *ref, bool won )
172 ResultIndicator *r = new ResultIndicator( ref, 0, WStyle_Customize | WStyle_Tool | WType_TopLevel ); 173 ResultIndicator *r = new ResultIndicator( ref, 0, WStyle_Customize | WStyle_Tool | WType_TopLevel );
173 174
174 r->setAlignment( AlignCenter ); 175 r->setAlignment( AlignCenter );
@@ -197,3 +198,3 @@ void ResultIndicator::center()
197 198
198 QPoint pp = w->mapToGlobal( QPoint(0,0) ); 199 QPoint pp = w->mapToGlobal( QPoint(0,0) );
199 QSize s = sizeHint()*3; 200 QSize s = sizeHint()*3;
@@ -203,3 +204,3 @@ void ResultIndicator::center()
203 setGeometry( QRect(pp, s) ); 204 setGeometry( QRect(pp, s) );
204 205
205} 206}
@@ -230,3 +231,3 @@ protected:
230 field->setAvailableRect( contentsRect()); 231 field->setAvailableRect( contentsRect());
231 QFrame::resizeEvent(e); 232 QFrame::resizeEvent(e);
232 } 233 }
@@ -241,2 +242,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
241{ 242{
243 QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff );
242 srand(::time(0)); 244 srand(::time(0));
@@ -256,3 +258,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
256 menuBar->insertItem( tr("Game"), gameMenu ); 258 menuBar->insertItem( tr("Game"), gameMenu );
257 259
258 guessLCD = new QLCDNumber( toolBar ); 260 guessLCD = new QLCDNumber( toolBar );
@@ -263,3 +265,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
263 lcdPal.setColor( QColorGroup::Button, QApplication::palette().active().button() ); 265 lcdPal.setColor( QColorGroup::Button, QApplication::palette().active().button() );
264 266
265// guessLCD->setPalette( lcdPal ); 267// guessLCD->setPalette( lcdPal );
@@ -273,3 +275,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
273 connect( newGameButton, SIGNAL(clicked()), this, SLOT(newGame()) ); 275 connect( newGameButton, SIGNAL(clicked()), this, SLOT(newGame()) );
274 276
275 timeLCD = new QLCDNumber( toolBar ); 277 timeLCD = new QLCDNumber( toolBar );
@@ -280,3 +282,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
280 timeLCD->setBackgroundMode( PaletteButton ); 282 timeLCD->setBackgroundMode( PaletteButton );
281 283
282 setToolBarsMovable ( FALSE ); 284 setToolBarsMovable ( FALSE );
@@ -298,3 +300,3 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
298 setCentralWidget( mainframe ); 300 setCentralWidget( mainframe );
299 301
300 connect( field, SIGNAL( gameOver( bool ) ), this, SLOT( gameOver( bool ) ) ); 302 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
33public: 33public:
34 static QString appName() { return QString::fromLatin1("minesweep"); }
34 MineSweep( QWidget* parent = 0, const char* name = 0, WFlags f = 0 ); 35 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 @@
1 TEMPLATE= app 1 CONFIG = qt warn_on release quick-app
2 CONFIG = qt warn_on release 2 HEADERS = minefield.h \
3 DESTDIR = $(OPIEDIR)/bin 3 minesweep.h
4 HEADERS = minefield.h \ 4 SOURCES = main.cpp \
5 minesweep.h 5 minefield.cpp \
6 SOURCES = main.cpp \ 6 minesweep.cpp
7 minefield.cpp \ 7INCLUDEPATH += $(OPIEDIR)/include
8 minesweep.cpp 8 DEPENDPATH+= $(OPIEDIR)/include
9INCLUDEPATH += $(OPIEDIR)/include 9LIBS += -lqpe
10 DEPENDPATH+= $(OPIEDIR)/include 10 INTERFACES=
11LIBS += -lqpe 11 TARGET = minesweep
12 INTERFACES= 12
13 TARGET = minesweep 13include ( $(OPIEDIR)/include.pro )
14
15include ( $(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 @@
1Package: opie-minesweep 1Package: opie-minesweep
2Files: bin/minesweep apps/Games/minesweep.desktop pics/minesweep 2Files: plugins/application/libminesweep.so* bin/minesweep apps/Games/minesweep.desktop pics/minesweep
3Priority: optional 3Priority: 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 @@
24#include <qpe/resource.h> 24#include <qpe/resource.h>
25#include <qpe/qpeapplication.h>
25 26
@@ -31,3 +32,3 @@
31#include <qtoolbutton.h> 32#include <qtoolbutton.h>
32 33
33ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : 34ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
@@ -38,2 +39,4 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
38{ 39{
40 QPEApplication::grabKeyboard();
41 QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff );
39 canvas.setAdvancePeriod(80); 42 canvas.setAdvancePeriod(80);
@@ -61,3 +64,3 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
61 showScore(0,0); 64 showScore(0,0);
62 65
63 setCentralWidget(pb); 66 setCentralWidget(pb);
@@ -66,5 +69,5 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
66 connect (autoDropTimer, SIGNAL(timeout()), this, SLOT(play()) ); 69 connect (autoDropTimer, SIGNAL(timeout()), this, SLOT(play()) );
67 70
68 pauseTimer = new QTimer(this); 71 pauseTimer = new QTimer(this);
69 connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) ); 72 connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) );
70 73
@@ -93,3 +96,3 @@ void ParaShoot::newGame()
93 clear(); 96 clear();
94 if (pauseTimer->isActive()) 97 if (pauseTimer->isActive())
95 pauseTimer->stop(); 98 pauseTimer->stop();
@@ -121,3 +124,3 @@ void ParaShoot::clear()
121 for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { 124 for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
122 delete *it; 125 delete *it;
123 } 126 }
@@ -129,3 +132,3 @@ void ParaShoot::gameOver()
129 QCanvasItemList l = canvas.allItems(); 132 QCanvasItemList l = canvas.allItems();
130 for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { 133 for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
131 item = *it; 134 item = *it;
@@ -140,3 +143,3 @@ void ParaShoot::gameOver()
140 int shotsFired = cannon->shotsFired(); 143 int shotsFired = cannon->shotsFired();
141 if ( shotsFired == 0 ) 144 if ( shotsFired == 0 )
142 shotsFired = 1; 145 shotsFired = 1;
@@ -146,3 +149,3 @@ void ParaShoot::gameOver()
146 " Parachuters Killed: %2\n" 149 " Parachuters Killed: %2\n"
147 " Accuracy: %3% " ).arg(score).arg(shots).arg(shots * 100 / shotsFired ), 150 " Accuracy: %3% " ).arg(score).arg(shots).arg(shots * 100 / shotsFired ),
148 &canvas); 151 &canvas);
@@ -165,3 +168,3 @@ void ParaShoot::wait()
165void ParaShoot::play() 168void ParaShoot::play()
166{ 169{
167 if (Man::getManCount() < nomen ) { 170 if (Man::getManCount() < nomen ) {
@@ -179,3 +182,3 @@ void ParaShoot::increaseScore(int x)
179 if ( score / 150 != (score-x) / 150 ) 182 if ( score / 150 != (score-x) / 150 )
180 levelUp(); 183 levelUp();
181 showScore(level,score); 184 showScore(level,score);
@@ -185,3 +188,3 @@ void ParaShoot::levelUp()
185{ 188{
186 level++; 189 level++;
187 int stage = level % 3; 190 int stage = level % 3;
@@ -195,3 +198,3 @@ void ParaShoot::levelUp()
195 new Helicopter(&canvas); 198 new Helicopter(&canvas);
196 break; 199 break;
197 case 2: 200 case 2:
@@ -199,3 +202,3 @@ void ParaShoot::levelUp()
199 fanfare.play(); 202 fanfare.play();
200 break; 203 break;
201 default: return; 204 default: return;
@@ -218,3 +221,3 @@ void ParaShoot::keyPressEvent(QKeyEvent* event)
218 newGame(); 221 newGame();
219 else 222 else
220 return; 223 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 {
40public: 40public:
41 static QString appName() { return QString::fromLatin1("parashoot"); }
41 ParaShoot(QWidget* parent=0, const char* name=0, WFlags f=0); 42 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 @@
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <opie/oapplicationfactory.h>
24 25
25int main(int argc, char **argv) 26OPIE_EXPORT_APP( OApplicationFactory<ParaShoot> )
26{
27 QPEApplication app(argc,argv);
28 27
29 QPEApplication::grabKeyboard();
30
31 ParaShoot m;
32 QPEApplication::setInputMethodHint( &m, QPEApplication::AlwaysOff );
33 app.showMainWidget(&m);
34
35 return app.exec();
36}
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 @@
1Package: opie-parashoot 1Package: opie-parashoot
2Files: bin/parashoot apps/Games/parashoot.desktop pics/parashoot 2Files: plugins/application/libparashoot.so* bin/parashoot apps/Games/parashoot.desktop pics/parashoot
3Priority: optional 3Priority: 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 @@
1 TEMPLATE= app 1 CONFIG += qt warn_on release quick-app
2 CONFIG += qt warn_on release
3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS = interface.h man.h cannon.h base.h bullet.h helicopter.h 2 HEADERS = interface.h man.h cannon.h base.h bullet.h helicopter.h
@@ -10,2 +8,4 @@ LIBS += -lqpe
10 8
9
10
11include ( $(OPIEDIR)/include.pro ) 11include ( $(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 @@
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <opie/oapplicationfactory.h>
24 25
25int main( int argc, char *argv[] )
26{
27 QPEApplication app( argc, argv );
28
29 QPEApplication::grabKeyboard();
30
31 KAstTopLevel *mainWidget = new KAstTopLevel();
32 app.showMainWidget( mainWidget );
33
34 app.exec();
35}
36 26
27OPIE_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 @@
1Package: opie-qasteroids 1Package: opie-qasteroids
2Files: bin/qasteroids apps/Games/qasteroids.desktop pics/qasteroids/* 2Files: plugins/application/libqasteroids.so* bin/qasteroids apps/Games/qasteroids.desktop pics/qasteroids/*
3Priority: optional 3Priority: 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 @@
1 TEMPLATE= app 1 CONFIG += qt warn_on release quick-app
2 CONFIG += qt warn_on release
3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS = ledmeter.h sprites.h toplevel.h view.h 2 HEADERS = ledmeter.h sprites.h toplevel.h view.h
@@ -10,2 +8,4 @@ LIBS += -lqpe
10 8
9
10
11include ( $(OPIEDIR)/include.pro ) 11include ( $(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] =
71 71
72const char *soundEvents[] = 72const char *soundEvents[] =
73{ 73{
@@ -78,3 +78,3 @@ const char *soundEvents[] =
78 78
79const char *soundDefaults[] = 79const char *soundDefaults[] =
80{ 80{
@@ -85,7 +85,10 @@ const char *soundDefaults[] =
85 85
86 86
87KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name ) 87KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name, WFlags fl )
88 : QMainWindow( parent, _name ) 88 : QMainWindow( parent, _name, fl )
89{ 89{
90 setCaption( tr("Asteroids") ); 90 setCaption( tr("Asteroids") );
91
92 QPEApplication::grabKeyboard();
93
91 QWidget *border = new QWidget( this ); 94 QWidget *border = new QWidget( this );
@@ -95,3 +98,3 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name )
95 QVBoxLayout *borderLayout = new QVBoxLayout( border ); 98 QVBoxLayout *borderLayout = new QVBoxLayout( border );
96 99
97 QWidget *mainWin = new QWidget( border ); 100 QWidget *mainWin = new QWidget( border );
@@ -259,3 +262,3 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name )
259 262
260 struct utsname name; /* check for embedix kernel running on the zaurus, if 263 struct utsname name; /* check for embedix kernel running on the zaurus, if
261 lineo change string, this break 264 lineo change string, this break
@@ -397,3 +400,3 @@ void KAstTopLevel::keyReleaseEvent( QKeyEvent *event )
397 break; 400 break;
398 401
399 case NewGame: 402 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
41public: 41public:
42 KAstTopLevel( QWidget *parent=0, const char *name=0 ); 42 KAstTopLevel( QWidget *parent=0, const char *name=0, WFlags fl = 0 );
43 virtual ~KAstTopLevel(); 43 virtual ~KAstTopLevel();
44 static QString appName() { return QString::fromLatin1("qasteroids"); }
45
44 46
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 @@
23#include <qpe/resource.h> 23#include <qpe/resource.h>
24#include <qpe/qpeapplication.h>
24 25
@@ -35,2 +36,3 @@ SnakeGame::SnakeGame(QWidget* parent, const char* name, WFlags f) :
35 setCaption( tr("Snake") ); 36 setCaption( tr("Snake") );
37 QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff );
36 QPixmap bg = Resource::loadPixmap("snake/grass"); 38 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 @@
20#include <qmainwindow.h> 20#include <qmainwindow.h>
21#include <qpe/qpeapplication.h>
21#include <qcanvas.h> 22#include <qcanvas.h>
@@ -35,3 +36,3 @@ public:
35 ~SnakeGame(); 36 ~SnakeGame();
36 37
37 void clear(); 38 void clear();
@@ -39,2 +40,4 @@ public:
39 40
41 static QString appName() { return QString::fromLatin1("snake"); }
42
40protected: 43protected:
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 @@
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "interface.h" 21#include "interface.h"
@@ -23,13 +23,7 @@
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <opie/oapplicationfactory.h>
25
24 26
27OPIE_EXPORT_APP( OApplicationFactory<SnakeGame> )
25 28
26int main(int argc, char **argv)
27{
28 QPEApplication app(argc,argv);
29 29
30 SnakeGame* m = new SnakeGame;
31 QPEApplication::setInputMethodHint( m, QPEApplication::AlwaysOff );
32 app.showMainWidget(m);
33
34 return app.exec();
35}
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 @@
1Package: opie-snake 1Package: opie-snake
2Files: bin/snake apps/Games/snake.desktop pics/snake 2Files: plugins/application/libsnake.so* bin/snake apps/Games/snake.desktop pics/snake
3Priority: optional 3Priority: 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 @@
1 TEMPLATE= app 1 CONFIG += qt warn_on release quick-app
2 CONFIG += qt warn_on release
3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS = snake.h target.h obstacle.h interface.h codes.h 2 HEADERS = snake.h target.h obstacle.h interface.h codes.h
@@ -10,2 +8,3 @@ LIBS += -lqpe
10 8
9
11include ( $(OPIEDIR)/include.pro ) 10include ( $(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)
39 setIcon( Resource::loadPixmap( "cards" ) ); 39 setIcon( Resource::loadPixmap( "cards" ) );
40 setCaption(tr("Patience"));
40 41
@@ -47,3 +48,3 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
47 QPixmap bg; 48 QPixmap bg;
48 bg.convertFromImage( Resource::loadImage( "table_pattern" ), ThresholdDither ); 49 bg.convertFromImage( Resource::loadImage( "table_pattern" ), ThresholdDither );
49 canvas.setBackgroundPixmap(bg); 50 canvas.setBackgroundPixmap(bg);
@@ -68,3 +69,3 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
68 menu->insertItem(tr("&Game"), file); 69 menu->insertItem(tr("&Game"), file);
69 70
70 menu->insertSeparator(); 71 menu->insertSeparator();
@@ -93,3 +94,3 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
93 menu->insertItem(tr("Play"), file); 94 menu->insertItem(tr("Play"), file);
94 95
95 menu->insertSeparator(); 96 menu->insertSeparator();
@@ -120,3 +121,3 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
120 cardGame->setNumberToDraw(drawThree ? 3 : 1); 121 cardGame->setNumberToDraw(drawThree ? 3 : 1);
121 122
122 setCaption(tr("Patience")); 123 setCaption(tr("Patience"));
@@ -188,3 +189,3 @@ void CanvasCardWindow::initPatience()
188{ 189{
189 // Create New Game 190 // Create New Game
190 if ( cardGame ) 191 if ( cardGame )
@@ -255,3 +256,3 @@ void CanvasCardWindow::initTeeclub()
255 cardGame = new TeeclubCardGame( &canvas, snapOn, this ); 256 cardGame = new TeeclubCardGame( &canvas, snapOn, this );
256 cardGame->setNumberToDraw(1); 257 cardGame->setNumberToDraw(1);
257 gameType = 4; 258 gameType = 4;
@@ -261,3 +262,3 @@ void CanvasCardWindow::initTeeclub()
261 setCardBacks(); 262 setCardBacks();
262} 263}
263 264
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 {
35public: 35public:
36 static QString appName() { return QString::fromLatin1("patience"); }
36 CanvasCardWindow(QWidget* parent=0, const char* name=0, WFlags f=0); 37 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
27{ 27{
28 cards = new (Card *)[getNumberOfCards()]; 28 cards = new Card *[getNumberOfCards()];
29} 29}
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 @@
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <opie/oapplicationfactory.h>
24 25
25 26OPIE_EXPORT_APP( OApplicationFactory<CanvasCardWindow> ) \ No newline at end of file
26int main( int argc, char ** argv )
27{
28 QPEApplication a( argc, argv );
29
30 CanvasCardWindow m;
31 m.setCaption( CanvasCardWindow::tr("Patience") );
32 a.showMainWidget( &m );
33
34 return a.exec();
35}
36
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 @@
1TEMPLATE = app
2 1
3CONFIG += qt warn_on release 2CONFIG += qt warn_on release quick-app
4DESTDIR = $(OPIEDIR)/bin
5 3
@@ -20,2 +18,3 @@ LIBS += -lqpe
20 18
19
21include ( $(OPIEDIR)/include.pro ) 20include ( $(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 @@
24 24
25int main( int argc, char **argv ) 25#include <opie/oapplicationfactory.h>
26{
27 QPEApplication a(argc,argv);
28 26
29 QTetrix *tetrix = new QTetrix; 27OPIE_EXPORT_APP( OApplicationFactory<QTetrix> )
30 a.showMainWidget(tetrix);
31 28
32 return a.exec();
33}
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 @@
1Package: opie-tetrix 1Package: opie-tetrix
2Files: bin/tetrix apps/Games/tetrix.desktop pics/tetrix/* 2Files: plugins/application/libtetrix.so* bin/tetrix apps/Games/tetrix.desktop pics/tetrix/*
3Priority: optional 3Priority: 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
54public: 54public:
55 static QString appName() { return QString::fromLatin1("tetrix"); }
55 QTetrix( QWidget *parent=0, const char *name=0, WFlags f=0 ); 56 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 @@
1 TEMPLATE= app 1 CONFIG = qt warn_on release quick-app
2 CONFIG = qt warn_on release
3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS = gtetrix.h \ 2 HEADERS = gtetrix.h \
@@ -20,2 +18,5 @@ TARGET = tetrix
20 18
19
20
21
21include ( $(OPIEDIR)/include.pro ) 22include ( $(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 @@
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <opie/oapplicationfactory.h>
24 25
25int main( int argc, char ** argv )
26{
27 QPEApplication a( argc, argv );
28 26
29 WordGame mw; 27OPIE_EXPORT_APP( OApplicationFactory<WordGame> )
30 //QPEApplication::setInputMethodHint( &mw, QPEApplication::AlwaysOff );
31 a.showMainWidget(&mw);
32 28
33 return a.exec();
34}
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:
311 ~WordGame(); 311 ~WordGame();
312 static QString appName() { return QString::fromLatin1("wordgame"); }
312 313
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 @@
1 TEMPLATE= app 1 CONFIG = qt warn_on release quick-app
2 CONFIG = qt warn_on release
3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS = wordgame.h 2 HEADERS = wordgame.h
@@ -12,2 +10,3 @@ LIBS += -lqpe
12 10
11
13include ( $(OPIEDIR)/include.pro ) 12include ( $(OPIEDIR)/include.pro )