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 | |||
@@ -21,6 +21,7 @@ | |||
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> |
@@ -33,6 +34,7 @@ SnakeGame::SnakeGame(QWidget* parent, const char* name, WFlags 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); |
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 | |||
@@ -18,6 +18,7 @@ | |||
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 | ||
@@ -33,10 +34,12 @@ class SnakeGame : public QMainWindow { | |||
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); |
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 | |||
@@ -17,19 +17,13 @@ | |||
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,5 +1,5 @@ | |||
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> |
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,6 +1,4 @@ | |||
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 |
@@ -8,4 +6,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 ) |