summaryrefslogtreecommitdiff
path: root/noncore/games/snake
Side-by-side diff
Diffstat (limited to 'noncore/games/snake') (more/less context) (ignore whitespace changes)
-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
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 @@
**
**********************************************************************/
#include "interface.h"
#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
#include <qpe/qpetoolbar.h>
#include <qtoolbutton.h>
#include <qstyle.h>
#include <qapplication.h>
#include <qmessagebox.h>
SnakeGame::SnakeGame(QWidget* parent, const char* name, WFlags f) :
QMainWindow(parent,name,f),
canvas(232, 258)
{
setCaption( tr("Snake") );
+ QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff );
QPixmap bg = Resource::loadPixmap("snake/grass");
canvas.setBackgroundPixmap(bg);
canvas.setUpdatePeriod(100);
snake = 0;
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 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qmainwindow.h>
+#include <qpe/qpeapplication.h>
#include <qcanvas.h>
#include <qlabel.h>
#include "snake.h"
#include "target.h"
#include "obstacle.h"
@@ -30,16 +31,18 @@
class SnakeGame : public QMainWindow {
Q_OBJECT
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);
signals:
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 @@
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** 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,8 +1,8 @@
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>
Architecture: arm
Depends: task-opie-minimal
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 @@
-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
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
+
include ( $(OPIEDIR)/include.pro )