-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 @@ #include "interface.h" #include <qpe/resource.h> +#include <qpe/qpeapplication.h> #include <qpe/qpetoolbar.h> #include <qtoolbutton.h> @@ -33,6 +34,7 @@ SnakeGame::SnakeGame(QWidget* parent, const char* name, WFlags f) : canvas(232, 258) { setCaption( tr("Snake") ); + QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff ); QPixmap bg = Resource::loadPixmap("snake/grass"); canvas.setBackgroundPixmap(bg); 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 @@ ** **********************************************************************/ #include <qmainwindow.h> +#include <qpe/qpeapplication.h> #include <qcanvas.h> #include <qlabel.h> @@ -33,10 +34,12 @@ class SnakeGame : public QMainWindow { public: SnakeGame(QWidget* parent=0, const char* name=0, WFlags f=0); ~SnakeGame(); - + void clear(); void createTargets(); + static QString appName() { return QString::fromLatin1("snake"); } + protected: virtual void keyPressEvent(QKeyEvent*); 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 @@ ** not clear to you. ** **********************************************************************/ - + #include "interface.h" #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,5 +1,5 @@ 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 Section: opie/games 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 @@ -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 SOURCES = snake.cpp target.cpp obstacle.cpp interface.cpp main.cpp TARGET = snake @@ -8,4 +6,5 @@ INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe + include ( $(OPIEDIR)/include.pro ) |