author | zecke <zecke> | 2004-02-06 12:14:56 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-06 12:14:56 (UTC) |
commit | 0c74629e8f5c12a9b5a282b817f884fa10dee491 (patch) (unidiff) | |
tree | 3294663b92023f8d24d68a01022e011a3c94002d /noncore/games/snake | |
parent | 46ce5afcfbe7be19f4d5ac0fed6886a0759f1a25 (diff) | |
download | opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.zip opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.tar.gz opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.tar.bz2 |
Merge from the 1.0.x release
-rw-r--r-- | noncore/games/snake/interface.cpp | 2 | ||||
-rw-r--r-- | noncore/games/snake/interface.h | 5 | ||||
-rw-r--r-- | noncore/games/snake/main.cpp | 14 | ||||
-rw-r--r-- | noncore/games/snake/opie-snake.control | 2 | ||||
-rw-r--r-- | noncore/games/snake/snake.pro | 5 |
5 files changed, 13 insertions, 15 deletions
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 | |||
@@ -18,24 +18,26 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "interface.h" | 21 | #include "interface.h" |
22 | 22 | ||
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/qpeapplication.h> | ||
24 | 25 | ||
25 | #include <qpe/qpetoolbar.h> | 26 | #include <qpe/qpetoolbar.h> |
26 | #include <qtoolbutton.h> | 27 | #include <qtoolbutton.h> |
27 | #include <qstyle.h> | 28 | #include <qstyle.h> |
28 | #include <qapplication.h> | 29 | #include <qapplication.h> |
29 | #include <qmessagebox.h> | 30 | #include <qmessagebox.h> |
30 | 31 | ||
31 | SnakeGame::SnakeGame(QWidget* parent, const char* name, WFlags f) : | 32 | SnakeGame::SnakeGame(QWidget* parent, const char* name, WFlags f) : |
32 | QMainWindow(parent,name,f), | 33 | QMainWindow(parent,name,f), |
33 | canvas(232, 258) | 34 | canvas(232, 258) |
34 | { | 35 | { |
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"); |
37 | canvas.setBackgroundPixmap(bg); | 39 | canvas.setBackgroundPixmap(bg); |
38 | canvas.setUpdatePeriod(100); | 40 | canvas.setUpdatePeriod(100); |
39 | snake = 0; | 41 | snake = 0; |
40 | 42 | ||
41 | cv = new QCanvasView(&canvas, this); | 43 | cv = new QCanvasView(&canvas, this); |
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 | |||
@@ -15,12 +15,13 @@ | |||
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qmainwindow.h> | 20 | #include <qmainwindow.h> |
21 | #include <qpe/qpeapplication.h> | ||
21 | #include <qcanvas.h> | 22 | #include <qcanvas.h> |
22 | #include <qlabel.h> | 23 | #include <qlabel.h> |
23 | 24 | ||
24 | #include "snake.h" | 25 | #include "snake.h" |
25 | #include "target.h" | 26 | #include "target.h" |
26 | #include "obstacle.h" | 27 | #include "obstacle.h" |
@@ -30,16 +31,18 @@ | |||
30 | class SnakeGame : public QMainWindow { | 31 | class SnakeGame : public QMainWindow { |
31 | Q_OBJECT | 32 | Q_OBJECT |
32 | 33 | ||
33 | public: | 34 | public: |
34 | SnakeGame(QWidget* parent=0, const char* name=0, WFlags f=0); | 35 | SnakeGame(QWidget* parent=0, const char* name=0, WFlags f=0); |
35 | ~SnakeGame(); | 36 | ~SnakeGame(); |
36 | 37 | ||
37 | void clear(); | 38 | void clear(); |
38 | void createTargets(); | 39 | void createTargets(); |
39 | 40 | ||
41 | static QString appName() { return QString::fromLatin1("snake"); } | ||
42 | |||
40 | protected: | 43 | protected: |
41 | virtual void keyPressEvent(QKeyEvent*); | 44 | virtual void keyPressEvent(QKeyEvent*); |
42 | virtual void resizeEvent(QResizeEvent *e); | 45 | virtual void resizeEvent(QResizeEvent *e); |
43 | 46 | ||
44 | signals: | 47 | signals: |
45 | void moveFaster(); | 48 | void moveFaster(); |
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 | |||
@@ -14,22 +14,16 @@ | |||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "interface.h" | 21 | #include "interface.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <opie/oapplicationfactory.h> | ||
25 | |||
24 | 26 | ||
27 | OPIE_EXPORT_APP( OApplicationFactory<SnakeGame> ) | ||
25 | 28 | ||
26 | int 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,8 +1,8 @@ | |||
1 | Package: opie-snake | 1 | Package: opie-snake |
2 | Files: bin/snake apps/Games/snake.desktop pics/snake | 2 | Files: plugins/application/libsnake.so* bin/snake apps/Games/snake.desktop pics/snake |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
8 | Description: Game: control the snake | 8 | Description: Game: control the snake |
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,11 +1,10 @@ | |||
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 |
5 | SOURCES = snake.cpp target.cpp obstacle.cpp interface.cpp main.cpp | 3 | SOURCES = snake.cpp target.cpp obstacle.cpp interface.cpp main.cpp |
6 | TARGET = snake | 4 | TARGET = snake |
7 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH+= $(OPIEDIR)/include | 6 | DEPENDPATH+= $(OPIEDIR)/include |
9 | LIBS += -lqpe | 7 | LIBS += -lqpe |
10 | 8 | ||
9 | |||
11 | include ( $(OPIEDIR)/include.pro ) | 10 | include ( $(OPIEDIR)/include.pro ) |