author | zecke <zecke> | 2004-11-14 22:10:14 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-14 22:10:14 (UTC) |
commit | 489818a4ee9b5328e31d184d5a0b43673b69dff2 (patch) (unidiff) | |
tree | 622000f4ca45ed066391881c0df1837aa1a5b71e | |
parent | efb1eb559bfc88bca064fceed976b1aec231bc21 (diff) | |
download | opie-489818a4ee9b5328e31d184d5a0b43673b69dff2.zip opie-489818a4ee9b5328e31d184d5a0b43673b69dff2.tar.gz opie-489818a4ee9b5328e31d184d5a0b43673b69dff2.tar.bz2 |
Make QuickLaunchable and see how good it frees resources
-rw-r--r-- | noncore/games/kpacman/kpacman.cpp | 4 | ||||
-rw-r--r-- | noncore/games/kpacman/kpacman.h | 4 | ||||
-rw-r--r-- | noncore/games/kpacman/kpacman.pro | 4 | ||||
-rw-r--r-- | noncore/games/kpacman/main.cpp | 27 | ||||
-rw-r--r-- | noncore/games/kpacman/opie-kpacman.control | 2 |
5 files changed, 9 insertions, 32 deletions
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp index 9820e5a..4a3b870 100644 --- a/noncore/games/kpacman/kpacman.cpp +++ b/noncore/games/kpacman/kpacman.cpp | |||
@@ -1,81 +1,81 @@ | |||
1 | 1 | ||
2 | #include "portable.h" | 2 | #include "portable.h" |
3 | 3 | ||
4 | #if defined( KDE2_PORT ) | 4 | #if defined( KDE2_PORT ) |
5 | #include <kpacman.h> | 5 | #include <kpacman.h> |
6 | #include <kpacman.moc> | 6 | #include <kpacman.moc> |
7 | #include <kcolordlg.h> | 7 | #include <kcolordlg.h> |
8 | #elif defined( QPE_PORT ) | 8 | #elif defined( QPE_PORT ) |
9 | #include <qmenubar.h> | 9 | #include <qmenubar.h> |
10 | #include <qpe/config.h> | 10 | #include <qpe/config.h> |
11 | #include <qapplication.h> | 11 | #include <qapplication.h> |
12 | #include "kpacman.h" | 12 | #include "kpacman.h" |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | 15 | ||
16 | Kpacman::Kpacman(QWidget *parent, const char *name) | 16 | Kpacman::Kpacman(QWidget *parent, const char *name, WFlags fl) |
17 | : KTMainWindow(parent, name) | 17 | : KTMainWindow(parent, name,fl) |
18 | { | 18 | { |
19 | schemesPopup = new QList<QPopupMenu>; | 19 | schemesPopup = new QList<QPopupMenu>; |
20 | schemesPopup->setAutoDelete(TRUE); | 20 | schemesPopup->setAutoDelete(TRUE); |
21 | 21 | ||
22 | menu(); | 22 | menu(); |
23 | 23 | ||
24 | m_view = new QWidget( this, "m_view" ); | 24 | m_view = new QWidget( this, "m_view" ); |
25 | m_view->setBackgroundColor( black ); | 25 | m_view->setBackgroundColor( black ); |
26 | m_layout = new QGridLayout( m_view ); | 26 | m_layout = new QGridLayout( m_view ); |
27 | m_layout->setMargin( 7 ); | 27 | m_layout->setMargin( 7 ); |
28 | 28 | ||
29 | view = new KpacmanWidget( this, QString(name)+"widget"); | 29 | view = new KpacmanWidget( this, QString(name)+"widget"); |
30 | m_layout->addWidget( view, 0, 0 ); | 30 | m_layout->addWidget( view, 0, 0 ); |
31 | 31 | ||
32 | setCaption( tr("KPacman") ); | 32 | setCaption( tr("KPacman") ); |
33 | 33 | ||
34 | view->referee->setFocus(); | 34 | view->referee->setFocus(); |
35 | 35 | ||
36 | connect(view->referee, SIGNAL(setScore(int,int)), | 36 | connect(view->referee, SIGNAL(setScore(int,int)), |
37 | view->score, SLOT(setScore(int,int))); | 37 | view->score, SLOT(setScore(int,int))); |
38 | connect(view->referee, SIGNAL(setPoints(int)), | 38 | connect(view->referee, SIGNAL(setPoints(int)), |
39 | view->score, SLOT(set(int))); | 39 | view->score, SLOT(set(int))); |
40 | connect(view->referee, SIGNAL(setLifes(int)), | 40 | connect(view->referee, SIGNAL(setLifes(int)), |
41 | view->status, SLOT(setLifes(int))); | 41 | view->status, SLOT(setLifes(int))); |
42 | connect(view->referee, SIGNAL(setLevel(int)), | 42 | connect(view->referee, SIGNAL(setLevel(int)), |
43 | view->status, SLOT(setLevel(int))); | 43 | view->status, SLOT(setLevel(int))); |
44 | connect(view->referee, SIGNAL(forcedHallOfFame(bool)), | 44 | connect(view->referee, SIGNAL(forcedHallOfFame(bool)), |
45 | this, SLOT(forcedHallOfFame(bool))); | 45 | this, SLOT(forcedHallOfFame(bool))); |
46 | connect(view->referee, SIGNAL(togglePaused()), this, SLOT(togglePaused())); | 46 | connect(view->referee, SIGNAL(togglePaused()), this, SLOT(togglePaused())); |
47 | connect(view->referee, SIGNAL(toggleNew()), this, SLOT(toggleNew())); | 47 | connect(view->referee, SIGNAL(toggleNew()), this, SLOT(toggleNew())); |
48 | 48 | ||
49 | connect(view->score, SIGNAL(toggleNew()), this, SLOT(toggleNew())); | 49 | connect(view->score, SIGNAL(toggleNew()), this, SLOT(toggleNew())); |
50 | connect(view->score, SIGNAL(forcedHallOfFame(bool)), | 50 | connect(view->score, SIGNAL(forcedHallOfFame(bool)), |
51 | this, SLOT(forcedHallOfFame(bool))); | 51 | this, SLOT(forcedHallOfFame(bool))); |
52 | 52 | ||
53 | APP_CONFIG_BEGIN( cfg ); | 53 | APP_CONFIG_BEGIN( cfg ); |
54 | focusOutPause = !cfg->readBoolEntry("FocusOutPause", TRUE); | 54 | focusOutPause = !cfg->readBoolEntry("FocusOutPause", TRUE); |
55 | focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE); | 55 | focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE); |
56 | hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE); | 56 | hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE); |
57 | APP_CONFIG_END( cfg ); | 57 | APP_CONFIG_END( cfg ); |
58 | 58 | ||
59 | toggleFocusOutPause(); | 59 | toggleFocusOutPause(); |
60 | toggleFocusInContinue(); | 60 | toggleFocusInContinue(); |
61 | toggleHideMouseCursor(); | 61 | toggleHideMouseCursor(); |
62 | 62 | ||
63 | setCentralWidget( m_view ); | 63 | setCentralWidget( m_view ); |
64 | } | 64 | } |
65 | 65 | ||
66 | Kpacman::~Kpacman() | 66 | Kpacman::~Kpacman() |
67 | { | 67 | { |
68 | /* APP_CONFIG_BEGIN( cfg ); | 68 | /* APP_CONFIG_BEGIN( cfg ); |
69 | cfg->writeEntry("FocusOutPause", focusOutPause); | 69 | cfg->writeEntry("FocusOutPause", focusOutPause); |
70 | cfg->writeEntry("FocusInContinue", focusInContinue); | 70 | cfg->writeEntry("FocusInContinue", focusInContinue); |
71 | cfg->writeEntry("HideMouseCursor", hideMouseCursor); | 71 | cfg->writeEntry("HideMouseCursor", hideMouseCursor); |
72 | APP_CONFIG_END( cfg ); | 72 | APP_CONFIG_END( cfg ); |
73 | */ | 73 | */ |
74 | delete _menuBar; | 74 | delete _menuBar; |
75 | } | 75 | } |
76 | 76 | ||
77 | void Kpacman::menu() | 77 | void Kpacman::menu() |
78 | { | 78 | { |
79 | gamePopup = new QPopupMenu(); | 79 | gamePopup = new QPopupMenu(); |
80 | CHECK_PTR( gamePopup ); | 80 | CHECK_PTR( gamePopup ); |
81 | newID = gamePopup->insertItem(tr("&New"), this, SLOT(newKpacman()),Key_F2); | 81 | newID = gamePopup->insertItem(tr("&New"), this, SLOT(newKpacman()),Key_F2); |
diff --git a/noncore/games/kpacman/kpacman.h b/noncore/games/kpacman/kpacman.h index 2c1de70..829714a 100644 --- a/noncore/games/kpacman/kpacman.h +++ b/noncore/games/kpacman/kpacman.h | |||
@@ -1,83 +1,85 @@ | |||
1 | #ifndef KPACMAN_H | 1 | #ifndef KPACMAN_H |
2 | #define KPACMAN_H | 2 | #define KPACMAN_H |
3 | 3 | ||
4 | #ifdef HAVE_CONFIG_H | 4 | #ifdef HAVE_CONFIG_H |
5 | #include <config.h> | 5 | #include <config.h> |
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | #include "portable.h" | 8 | #include "portable.h" |
9 | 9 | ||
10 | #include <qmainwindow.h> | 10 | #include <qmainwindow.h> |
11 | class QMenuBar; | 11 | class QMenuBar; |
12 | #include <qregexp.h> | 12 | #include <qregexp.h> |
13 | 13 | ||
14 | #include "kpacmanwidget.h" | 14 | #include "kpacmanwidget.h" |
15 | 15 | ||
16 | #include <qpopmenu.h> | 16 | #include <qpopmenu.h> |
17 | 17 | ||
18 | #include <qlist.h> | 18 | #include <qlist.h> |
19 | #include <qfileinf.h> | 19 | #include <qfileinf.h> |
20 | #include <qlayout.h> | 20 | #include <qlayout.h> |
21 | 21 | ||
22 | #include "referee.h" | 22 | #include "referee.h" |
23 | #include "status.h" | 23 | #include "status.h" |
24 | #include "score.h" | 24 | #include "score.h" |
25 | #include "keys.h" | 25 | #include "keys.h" |
26 | 26 | ||
27 | class Kpacman : public KTMainWindow | 27 | class Kpacman : public KTMainWindow |
28 | { | 28 | { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | public: | 30 | public: |
31 | Kpacman(QWidget *parent = 0, const char *name = 0); | 31 | Kpacman(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); |
32 | static QString appName() { return QString::fromLatin1("kpacman"); } | ||
33 | |||
32 | virtual ~Kpacman(); | 34 | virtual ~Kpacman(); |
33 | 35 | ||
34 | public slots: | 36 | public slots: |
35 | void forcedHallOfFame(bool); | 37 | void forcedHallOfFame(bool); |
36 | 38 | ||
37 | private slots: | 39 | private slots: |
38 | void newKpacman(); | 40 | void newKpacman(); |
39 | void pauseKpacman(); | 41 | void pauseKpacman(); |
40 | void toggleHallOfFame(); | 42 | void toggleHallOfFame(); |
41 | void toggleNew(); | 43 | void toggleNew(); |
42 | void togglePaused(); | 44 | void togglePaused(); |
43 | void quitKpacman(); | 45 | void quitKpacman(); |
44 | 46 | ||
45 | void schemeChecked(int); | 47 | void schemeChecked(int); |
46 | void toggleFocusOutPause(); | 48 | void toggleFocusOutPause(); |
47 | void toggleFocusInContinue(); | 49 | void toggleFocusInContinue(); |
48 | void toggleHideMouseCursor(); | 50 | void toggleHideMouseCursor(); |
49 | void confKeys(); | 51 | void confKeys(); |
50 | 52 | ||
51 | protected: | 53 | protected: |
52 | 54 | ||
53 | private: | 55 | private: |
54 | KpacmanWidget *view; | 56 | KpacmanWidget *view; |
55 | 57 | ||
56 | void menu(); | 58 | void menu(); |
57 | 59 | ||
58 | int lookupSchemes(); | 60 | int lookupSchemes(); |
59 | 61 | ||
60 | QGridLayout *m_layout; | 62 | QGridLayout *m_layout; |
61 | QWidget *m_view; | 63 | QWidget *m_view; |
62 | KMenuBar *_menuBar; | 64 | KMenuBar *_menuBar; |
63 | QPopupMenu *gamePopup; | 65 | QPopupMenu *gamePopup; |
64 | QPopupMenu *optionsPopup; | 66 | QPopupMenu *optionsPopup; |
65 | QPopupMenu *modesPopup; | 67 | QPopupMenu *modesPopup; |
66 | QList<QPopupMenu> *schemesPopup; | 68 | QList<QPopupMenu> *schemesPopup; |
67 | 69 | ||
68 | int newID; | 70 | int newID; |
69 | int pauseID; | 71 | int pauseID; |
70 | int hofID; | 72 | int hofID; |
71 | QArray<int> modeID; | 73 | QArray<int> modeID; |
72 | QArray<int> schemeID; | 74 | QArray<int> schemeID; |
73 | QArray<int> schemeMode; | 75 | QArray<int> schemeMode; |
74 | int focusOutPauseID; | 76 | int focusOutPauseID; |
75 | int focusInContinueID; | 77 | int focusInContinueID; |
76 | int hideMouseCursorID; | 78 | int hideMouseCursorID; |
77 | 79 | ||
78 | bool focusOutPause; | 80 | bool focusOutPause; |
79 | bool focusInContinue; | 81 | bool focusInContinue; |
80 | bool hideMouseCursor; | 82 | bool hideMouseCursor; |
81 | }; | 83 | }; |
82 | 84 | ||
83 | #endif // KPACMAN_H | 85 | #endif // KPACMAN_H |
diff --git a/noncore/games/kpacman/kpacman.pro b/noncore/games/kpacman/kpacman.pro index 45314f9..a231b01 100644 --- a/noncore/games/kpacman/kpacman.pro +++ b/noncore/games/kpacman/kpacman.pro | |||
@@ -1,39 +1,37 @@ | |||
1 | TEMPLATE= app | 1 | CONFIG = qt quick-app |
2 | CONFIG = qt warn_on | ||
3 | HEADERS = kpacmanwidget.h \ | 2 | HEADERS = kpacmanwidget.h \ |
4 | referee.h \ | 3 | referee.h \ |
5 | status.h \ | 4 | status.h \ |
6 | painter.h \ | 5 | painter.h \ |
7 | score.h \ | 6 | score.h \ |
8 | pacman.h \ | 7 | pacman.h \ |
9 | monster.h \ | 8 | monster.h \ |
10 | keys.h \ | 9 | keys.h \ |
11 | fruit.h \ | 10 | fruit.h \ |
12 | energizer.h \ | 11 | energizer.h \ |
13 | board.h \ | 12 | board.h \ |
14 | bitfont.h \ | 13 | bitfont.h \ |
15 | kpacman.h \ | 14 | kpacman.h \ |
16 | bitmaps.h \ | 15 | bitmaps.h \ |
17 | colors.h \ | 16 | colors.h \ |
18 | portable.h | 17 | portable.h |
19 | SOURCES = kpacmanwidget.cpp \ | 18 | SOURCES = kpacmanwidget.cpp \ |
20 | referee.cpp \ | 19 | referee.cpp \ |
21 | status.cpp \ | 20 | status.cpp \ |
22 | painter.cpp \ | 21 | painter.cpp \ |
23 | score.cpp \ | 22 | score.cpp \ |
24 | pacman.cpp \ | 23 | pacman.cpp \ |
25 | monster.cpp \ | 24 | monster.cpp \ |
26 | keys.cpp \ | 25 | keys.cpp \ |
27 | fruit.cpp \ | 26 | fruit.cpp \ |
28 | energizer.cpp \ | 27 | energizer.cpp \ |
29 | board.cpp \ | 28 | board.cpp \ |
30 | bitfont.cpp \ | 29 | bitfont.cpp \ |
31 | kpacman.cpp \ | 30 | kpacman.cpp \ |
32 | main.cpp | 31 | main.cpp |
33 | INCLUDEPATH+= $(OPIEDIR)/include | 32 | INCLUDEPATH+= $(OPIEDIR)/include |
34 | DEPENDPATH+= $(OPIEDIR)/include | 33 | DEPENDPATH+= $(OPIEDIR)/include |
35 | LIBS += -lqpe -lopiecore2 | 34 | LIBS += -lqpe -lopiecore2 |
36 | DESTDIR = $(OPIEDIR)/bin | ||
37 | TARGET = kpacman | 35 | TARGET = kpacman |
38 | 36 | ||
39 | include ( $(OPIEDIR)/include.pro ) | 37 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/games/kpacman/main.cpp b/noncore/games/kpacman/main.cpp index 76afb57..2906d2a 100644 --- a/noncore/games/kpacman/main.cpp +++ b/noncore/games/kpacman/main.cpp | |||
@@ -1,66 +1,43 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | main.cpp - description | 2 | main.cpp - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Sam Jan 19 13:37:57 CET 2002 | 4 | begin : Sam Jan 19 13:37:57 CET 2002 |
5 | copyright : (C) 2002 by Jörg Thönnissen | 5 | copyright : (C) 2002 by Jörg Thönnissen |
6 | email : joe@dsite.de | 6 | email : joe@dsite.de |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #include "portable.h" | 18 | #include "portable.h" |
19 | 19 | ||
20 | #if defined( KDE2_PORT ) | 20 | #if defined( KDE2_PORT ) |
21 | #include <kcmdlineargs.h> | 21 | #include <kcmdlineargs.h> |
22 | #include <kaboutdata.h> | 22 | #include <kaboutdata.h> |
23 | #include <klocale.h> | 23 | #include <klocale.h> |
24 | #elif defined( QPE_PORT ) | 24 | #elif defined( QPE_PORT ) |
25 | #include <qpe/qpeapplication.h> | 25 | #include <opie2/oapplicationfactory.h> |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #include "kpacman.h" | 28 | #include "kpacman.h" |
29 | 29 | ||
30 | #ifdef KDE2_PORT | 30 | #ifdef KDE2_PORT |
31 | static const char *description = | 31 | static const char *description = |
32 | I18N_NOOP("Kpacman"); | 32 | I18N_NOOP("Kpacman"); |
33 | // INSERT A DESCRIPTION FOR YOUR APPLICATION HERE | 33 | // INSERT A DESCRIPTION FOR YOUR APPLICATION HERE |
34 | 34 | ||
35 | 35 | ||
36 | static KCmdLineOptions options[] = | 36 | static KCmdLineOptions options[] = |
37 | { | 37 | { |
38 | { 0, 0, 0 } | 38 | { 0, 0, 0 } |
39 | // INSERT YOUR COMMANDLINE OPTIONS HERE | 39 | // INSERT YOUR COMMANDLINE OPTIONS HERE |
40 | }; | 40 | }; |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | int main(int argc, char *argv[]) | 43 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<Kpacman> ) |
44 | { | ||
45 | #if defined( KDE2_PORT ) | ||
46 | KAboutData aboutData( "kpacman", I18N_NOOP("Kpacman"), | ||
47 | VERSION, description, KAboutData::License_GPL, | ||
48 | "(c) 2002, Jörg Thönnissen", 0, 0, "joe@dsite.de"); | ||
49 | aboutData.addAuthor("Jörg Thönnissen",0, "joe@dsite.de"); | ||
50 | KCmdLineArgs::init( argc, argv, &aboutData ); | ||
51 | KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. | ||
52 | KApplication a; | ||
53 | #elif defined( QPE_PORT ) | ||
54 | QPEApplication a( argc, argv ); | ||
55 | #endif | ||
56 | Kpacman *kpacman = new Kpacman( NULL, "Kpacman" ); | ||
57 | a.setMainWidget(kpacman); | ||
58 | #if defined( KDE2_PORT ) | ||
59 | a.setTopWidget(kpacman); | ||
60 | kpacman->show(); | ||
61 | #elif defined( QPE_PORT ) | ||
62 | kpacman->showMaximized(); | ||
63 | #endif | ||
64 | |||
65 | return a.exec(); | ||
66 | } | ||
diff --git a/noncore/games/kpacman/opie-kpacman.control b/noncore/games/kpacman/opie-kpacman.control index 15e3056..68487ec 100644 --- a/noncore/games/kpacman/opie-kpacman.control +++ b/noncore/games/kpacman/opie-kpacman.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: opie-kpacman | 1 | Package: opie-kpacman |
2 | Files: bin/kpacman apps/Games/kpacman.desktop pics/kpacman/kpacman.png share/kpacman | 2 | Files: plugins/applications/libkpacman.so* bin/kpacman apps/Games/kpacman.desktop pics/kpacman/kpacman.png share/kpacman |
3 | Version: 0.3.1-$SUB_VERSION | 3 | Version: 0.3.1-$SUB_VERSION |
4 | Depends: task-opie-minimal | 4 | Depends: task-opie-minimal |
5 | Priority: optional | 5 | Priority: optional |
6 | Section: opie/games | 6 | Section: opie/games |
7 | Maintainer: Catalin Climov <catalin@climov.com> | 7 | Maintainer: Catalin Climov <catalin@climov.com> |
8 | Architecture: arm | 8 | Architecture: arm |
9 | License: GPL | 9 | License: GPL |
10 | Description: Kpacman | 10 | Description: Kpacman |
11 | A Pacman clone for Qtopia. | 11 | A Pacman clone for Qtopia. |