-rw-r--r-- | noncore/games/bounce/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/buzzword/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/fifteen/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/go/gowidget.cpp | 2 | ||||
-rw-r--r-- | noncore/games/go/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/kcheckers/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/minesweep/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/parashoot/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/qasteroids/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/snake/interface.cpp | 2 | ||||
-rw-r--r-- | noncore/games/snake/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/solitaire/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/tetrix/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/tictac/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/wordgame/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/wordgame/wordgame.cpp | 2 | ||||
-rw-r--r-- | noncore/games/zlines/main.cpp | 1 | ||||
-rw-r--r-- | noncore/games/zsame/ZSameWidget.cpp | 1 |
18 files changed, 18 insertions, 3 deletions
diff --git a/noncore/games/bounce/main.cpp b/noncore/games/bounce/main.cpp index eb8d561..bec4a86 100644 --- a/noncore/games/bounce/main.cpp +++ b/noncore/games/bounce/main.cpp | |||
@@ -1,24 +1,25 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000 Stefan Schimanski <schimmi@kde.org> | 2 | * Copyright (C) 2000 Stefan Schimanski <schimmi@kde.org> |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or | 4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Library General Public | 5 | * modify it under the terms of the GNU Library General Public |
6 | * License as published by the Free Software Foundation; either | 6 | * License as published by the Free Software Foundation; either |
7 | * version 2 of the License, or (at your option) any later version. | 7 | * version 2 of the License, or (at your option) any later version. |
8 | * | 8 | * |
9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Library General Public License for more details. | 12 | * Library General Public License for more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public |
15 | * License along with this program; if not, write to the Free | 15 | * License along with this program; if not, write to the Free |
16 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 16 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include "kbounce.h" | 19 | #include "kbounce.h" |
20 | 20 | ||
21 | #include <opie2/oapplicationfactory.h> | 21 | #include <opie2/oapplicationfactory.h> |
22 | 22 | ||
23 | using namespace Opie::Core; | ||
23 | OPIE_EXPORT_APP( OApplicationFactory<KJezzball> ) | 24 | OPIE_EXPORT_APP( OApplicationFactory<KJezzball> ) |
24 | 25 | ||
diff --git a/noncore/games/buzzword/main.cpp b/noncore/games/buzzword/main.cpp index 596cf16..a95e91a 100644 --- a/noncore/games/buzzword/main.cpp +++ b/noncore/games/buzzword/main.cpp | |||
@@ -1,23 +1,24 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch> | 2 | * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch> |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or | 4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public | 5 | * modify it under the terms of the GNU General Public |
6 | * License as published by the Free Software Foundation; either | 6 | * License as published by the Free Software Foundation; either |
7 | * version 2 of the License,Life or (at your option) any later version. | 7 | * version 2 of the License,Life or (at your option) any later version. |
8 | * | 8 | * |
9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Library General Public License for more details. | 12 | * Library General Public License for more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public |
15 | * License along with this program; if not, write to the Free | 15 | * License along with this program; if not, write to the Free |
16 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 16 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <opie2/oapplicationfactory.h> | 19 | #include <opie2/oapplicationfactory.h> |
20 | 20 | ||
21 | #include "buzzword.h" | 21 | #include "buzzword.h" |
22 | 22 | ||
23 | using namespace Opie::Core; | ||
23 | OPIE_EXPORT_APP( OApplicationFactory<BuzzWord> ) | 24 | OPIE_EXPORT_APP( OApplicationFactory<BuzzWord> ) |
diff --git a/noncore/games/fifteen/main.cpp b/noncore/games/fifteen/main.cpp index ed74a47..800a270 100644 --- a/noncore/games/fifteen/main.cpp +++ b/noncore/games/fifteen/main.cpp | |||
@@ -1,23 +1,24 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2004 Holger Freyther. All rights reserved. | 2 | ** Copyright (C) 2004 Holger Freyther. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 | **********************************************************************/ | 16 | **********************************************************************/ |
17 | 17 | ||
18 | #include "fifteen.h" | 18 | #include "fifteen.h" |
19 | 19 | ||
20 | #include <opie2/oapplicationfactory.h> | 20 | #include <opie2/oapplicationfactory.h> |
21 | 21 | ||
22 | using namespace Opie::Core; | ||
22 | OPIE_EXPORT_APP( OApplicationFactory<FifteenMainWindow> ) | 23 | OPIE_EXPORT_APP( OApplicationFactory<FifteenMainWindow> ) |
23 | 24 | ||
diff --git a/noncore/games/go/gowidget.cpp b/noncore/games/go/gowidget.cpp index 79820b1..d134540 100644 --- a/noncore/games/go/gowidget.cpp +++ b/noncore/games/go/gowidget.cpp | |||
@@ -1,155 +1,155 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 "gowidget.h" | 21 | #include "gowidget.h" |
22 | 22 | ||
23 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
25 | 25 | ||
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qpe/qpetoolbar.h> | 27 | #include <qtoolbar.h> |
28 | #include <qmenubar.h> | 28 | #include <qmenubar.h> |
29 | #include <qaction.h> | 29 | #include <qaction.h> |
30 | #include <qapplication.h> //processEvents() | 30 | #include <qapplication.h> //processEvents() |
31 | #include <qlabel.h> | 31 | #include <qlabel.h> |
32 | 32 | ||
33 | //#include <stdio.h> | 33 | //#include <stdio.h> |
34 | 34 | ||
35 | 35 | ||
36 | static const enum bVal computer_color = BLACK; | 36 | static const enum bVal computer_color = BLACK; |
37 | 37 | ||
38 | static int current_handicap = 1; | 38 | static int current_handicap = 1; |
39 | 39 | ||
40 | static QBrush *goBrush; | 40 | static QBrush *goBrush; |
41 | //static QImage *newBlackStone; | 41 | //static QImage *newBlackStone; |
42 | //static QImage *blackStone; | 42 | //static QImage *blackStone; |
43 | //static QImage *whiteStone; | 43 | //static QImage *whiteStone; |
44 | static QPixmap *newBlackStone; | 44 | static QPixmap *newBlackStone; |
45 | static QPixmap *blackStone; | 45 | static QPixmap *blackStone; |
46 | static QPixmap *whiteStone; | 46 | static QPixmap *whiteStone; |
47 | 47 | ||
48 | static bool smallStones = FALSE; | 48 | static bool smallStones = FALSE; |
49 | 49 | ||
50 | GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) : | 50 | GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) : |
51 | QMainWindow( parent, name, fl ) | 51 | QMainWindow( parent, name, fl ) |
52 | { | 52 | { |
53 | setToolBarsMovable( FALSE ); | 53 | setToolBarsMovable( FALSE ); |
54 | GoWidget *go = new GoWidget(this); | 54 | GoWidget *go = new GoWidget(this); |
55 | 55 | ||
56 | setCentralWidget(go); | 56 | setCentralWidget(go); |
57 | toolbar = new QToolBar(this); | 57 | toolbar = new QToolBar(this); |
58 | toolbar->setHorizontalStretchable( TRUE ); | 58 | toolbar->setHorizontalStretchable( TRUE ); |
59 | addToolBar(toolbar); | 59 | addToolBar(toolbar); |
60 | 60 | ||
61 | QMenuBar *mb = new QMenuBar( toolbar ); | 61 | QMenuBar *mb = new QMenuBar( toolbar ); |
62 | mb->setMargin(0); | 62 | mb->setMargin(0); |
63 | QPopupMenu *file = new QPopupMenu( this ); | 63 | QPopupMenu *file = new QPopupMenu( this ); |
64 | 64 | ||
65 | QAction *a = new QAction( tr( "New Game" ), QString::null, 0, this, 0 ); | 65 | QAction *a = new QAction( tr( "New Game" ), QString::null, 0, this, 0 ); |
66 | connect( a, SIGNAL( activated() ), go, SLOT( newGame() ) ); | 66 | connect( a, SIGNAL( activated() ), go, SLOT( newGame() ) ); |
67 | a->addTo( file ); | 67 | a->addTo( file ); |
68 | 68 | ||
69 | a = new QAction( tr( "Pass" ), Resource::loadPixmap( "pass" ), QString::null, 0, this, 0 ); | 69 | a = new QAction( tr( "Pass" ), Resource::loadPixmap( "pass" ), QString::null, 0, this, 0 ); |
70 | connect( a, SIGNAL( activated() ), go, SLOT( pass() ) ); | 70 | connect( a, SIGNAL( activated() ), go, SLOT( pass() ) ); |
71 | a->addTo( file ); | 71 | a->addTo( file ); |
72 | a->addTo( toolbar ); | 72 | a->addTo( toolbar ); |
73 | 73 | ||
74 | 74 | ||
75 | a = new QAction( tr( "Resign" ), Resource::loadPixmap( "reset" ), QString::null, 0, this, 0 ); | 75 | a = new QAction( tr( "Resign" ), Resource::loadPixmap( "reset" ), QString::null, 0, this, 0 ); |
76 | connect( a, SIGNAL( activated() ), go, SLOT( resign() ) ); | 76 | connect( a, SIGNAL( activated() ), go, SLOT( resign() ) ); |
77 | a->addTo( file ); | 77 | a->addTo( file ); |
78 | 78 | ||
79 | a = new QAction( tr( "Two player option" ), QString::null, 0, this, 0 ); | 79 | a = new QAction( tr( "Two player option" ), QString::null, 0, this, 0 ); |
80 | a->setToggleAction( TRUE ); | 80 | a->setToggleAction( TRUE ); |
81 | connect( a, SIGNAL( toggled(bool) ), go, SLOT( setTwoplayer(bool) ) ); | 81 | connect( a, SIGNAL( toggled(bool) ), go, SLOT( setTwoplayer(bool) ) ); |
82 | a->addTo( file ); | 82 | a->addTo( file ); |
83 | 83 | ||
84 | mb->insertItem( tr( "Game" ), file ); | 84 | mb->insertItem( tr( "Game" ), file ); |
85 | 85 | ||
86 | QLabel *turnLabel = new QLabel( toolbar ); | 86 | QLabel *turnLabel = new QLabel( toolbar ); |
87 | turnLabel->setBackgroundMode( PaletteButton ); | 87 | turnLabel->setBackgroundMode( PaletteButton ); |
88 | connect( go, SIGNAL(showTurn(const QPixmap&)), | 88 | connect( go, SIGNAL(showTurn(const QPixmap&)), |
89 | turnLabel, SLOT(setPixmap(const QPixmap&)) ); | 89 | turnLabel, SLOT(setPixmap(const QPixmap&)) ); |
90 | 90 | ||
91 | 91 | ||
92 | QLabel * scoreLabel = new QLabel( toolbar ); | 92 | QLabel * scoreLabel = new QLabel( toolbar ); |
93 | scoreLabel->setBackgroundMode( PaletteButton ); | 93 | scoreLabel->setBackgroundMode( PaletteButton ); |
94 | connect( go, SIGNAL(showScore(const QString&)), | 94 | connect( go, SIGNAL(showScore(const QString&)), |
95 | scoreLabel, SLOT(setText(const QString&)) ); | 95 | scoreLabel, SLOT(setText(const QString&)) ); |
96 | 96 | ||
97 | toolbar->setStretchableWidget( scoreLabel ); | 97 | toolbar->setStretchableWidget( scoreLabel ); |
98 | 98 | ||
99 | go->readConfig(); | 99 | go->readConfig(); |
100 | } | 100 | } |
101 | 101 | ||
102 | void GoMainWidget::resizeEvent( QResizeEvent * ) | 102 | void GoMainWidget::resizeEvent( QResizeEvent * ) |
103 | { | 103 | { |
104 | //### this won't work because of the text label... | 104 | //### this won't work because of the text label... |
105 | /* | 105 | /* |
106 | if ( width() > height() ) | 106 | if ( width() > height() ) |
107 | moveToolBar( toolbar, Left ); | 107 | moveToolBar( toolbar, Left ); |
108 | else | 108 | else |
109 | moveToolBar( toolbar, Top ); | 109 | moveToolBar( toolbar, Top ); |
110 | */ | 110 | */ |
111 | } | 111 | } |
112 | 112 | ||
113 | GoWidget *GoWidget::self = 0; | 113 | GoWidget *GoWidget::self = 0; |
114 | 114 | ||
115 | GoWidget::GoWidget( QWidget *parent, const char* name) : | 115 | GoWidget::GoWidget( QWidget *parent, const char* name) : |
116 | QWidget( parent, name ) | 116 | QWidget( parent, name ) |
117 | { | 117 | { |
118 | if ( self ) | 118 | if ( self ) |
119 | fatal( "Only one Go widget allowed" ); | 119 | fatal( "Only one Go widget allowed" ); |
120 | self = this; | 120 | self = this; |
121 | twoplayer = FALSE; | 121 | twoplayer = FALSE; |
122 | 122 | ||
123 | 123 | ||
124 | d = bx = by = 1; | 124 | d = bx = by = 1; |
125 | 125 | ||
126 | QPixmap pix = Resource::loadPixmap( "go/pine" ); | 126 | QPixmap pix = Resource::loadPixmap( "go/pine" ); |
127 | goBrush = new QBrush( black, pix ); | 127 | goBrush = new QBrush( black, pix ); |
128 | /* | 128 | /* |
129 | QString fn = Resource::findPixmap("Go-black"); | 129 | QString fn = Resource::findPixmap("Go-black"); |
130 | blackStone = new QImage( fn ); | 130 | blackStone = new QImage( fn ); |
131 | fn = Resource::findPixmap("Go-black-highlight"); | 131 | fn = Resource::findPixmap("Go-black-highlight"); |
132 | newBlackStone = new QImage( fn ); | 132 | newBlackStone = new QImage( fn ); |
133 | fn = Resource::findPixmap("Go-white"); | 133 | fn = Resource::findPixmap("Go-white"); |
134 | whiteStone = new QImage( fn ); | 134 | whiteStone = new QImage( fn ); |
135 | */ | 135 | */ |
136 | blackStone = new QPixmap(Resource::loadPixmap( "Go-black" )); | 136 | blackStone = new QPixmap(Resource::loadPixmap( "Go-black" )); |
137 | whiteStone = new QPixmap(Resource::loadPixmap( "Go-white" )); | 137 | whiteStone = new QPixmap(Resource::loadPixmap( "Go-white" )); |
138 | newBlackStone = new QPixmap(Resource::loadPixmap( "Go-black-highlight" )); | 138 | newBlackStone = new QPixmap(Resource::loadPixmap( "Go-black-highlight" )); |
139 | 139 | ||
140 | init(); | 140 | init(); |
141 | } | 141 | } |
142 | 142 | ||
143 | GoWidget::~GoWidget() | 143 | GoWidget::~GoWidget() |
144 | { | 144 | { |
145 | writeConfig(); | 145 | writeConfig(); |
146 | } | 146 | } |
147 | 147 | ||
148 | void GoWidget::writeConfig() | 148 | void GoWidget::writeConfig() |
149 | { | 149 | { |
150 | Config cfg("Go"); | 150 | Config cfg("Go"); |
151 | cfg.setGroup("Game"); | 151 | cfg.setGroup("Game"); |
152 | cfg.writeEntry("TwoPlayer", twoplayer); | 152 | cfg.writeEntry("TwoPlayer", twoplayer); |
153 | cfg.writeEntry("CurrentPlayer", currentPlayer); | 153 | cfg.writeEntry("CurrentPlayer", currentPlayer); |
154 | cfg.writeEntry("NPassed", nPassed); | 154 | cfg.writeEntry("NPassed", nPassed); |
155 | QString b; | 155 | QString b; |
diff --git a/noncore/games/go/main.cpp b/noncore/games/go/main.cpp index 46817d1..f6bb813 100644 --- a/noncore/games/go/main.cpp +++ b/noncore/games/go/main.cpp | |||
@@ -1,27 +1,28 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 "gowidget.h" | 21 | #include "gowidget.h" |
22 | 22 | ||
23 | 23 | ||
24 | #include <opie2/oapplicationfactory.h> | 24 | #include <opie2/oapplicationfactory.h> |
25 | 25 | ||
26 | using namespace Opie::Core; | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<GoMainWidget> ) | 27 | OPIE_EXPORT_APP( OApplicationFactory<GoMainWidget> ) |
27 | 28 | ||
diff --git a/noncore/games/kcheckers/main.cpp b/noncore/games/kcheckers/main.cpp index 79b5ac7..8c708e2 100644 --- a/noncore/games/kcheckers/main.cpp +++ b/noncore/games/kcheckers/main.cpp | |||
@@ -1,9 +1,10 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #include "kcheckers.h" | 3 | #include "kcheckers.h" |
4 | 4 | ||
5 | #include <opie2/oapplicationfactory.h> | 5 | #include <opie2/oapplicationfactory.h> |
6 | 6 | ||
7 | using namespace Opie::Core; | ||
7 | OPIE_EXPORT_APP( OApplicationFactory<KCheckers> ) | 8 | OPIE_EXPORT_APP( OApplicationFactory<KCheckers> ) |
8 | 9 | ||
9 | 10 | ||
diff --git a/noncore/games/minesweep/main.cpp b/noncore/games/minesweep/main.cpp index f3070f5..629afbf 100644 --- a/noncore/games/minesweep/main.cpp +++ b/noncore/games/minesweep/main.cpp | |||
@@ -1,26 +1,27 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 "minesweep.h" | 21 | #include "minesweep.h" |
22 | 22 | ||
23 | #include <opie2/oapplicationfactory.h> | 23 | #include <opie2/oapplicationfactory.h> |
24 | 24 | ||
25 | using namespace Opie::Core; | ||
25 | OPIE_EXPORT_APP( OApplicationFactory<MineSweep> ) | 26 | OPIE_EXPORT_APP( OApplicationFactory<MineSweep> ) |
26 | 27 | ||
diff --git a/noncore/games/parashoot/main.cpp b/noncore/games/parashoot/main.cpp index 81d513d..da21c25 100644 --- a/noncore/games/parashoot/main.cpp +++ b/noncore/games/parashoot/main.cpp | |||
@@ -1,26 +1,27 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 <opie2/oapplicationfactory.h> | 23 | #include <opie2/oapplicationfactory.h> |
24 | 24 | ||
25 | using namespace Opie::Core; | ||
25 | OPIE_EXPORT_APP( OApplicationFactory<ParaShoot> ) | 26 | OPIE_EXPORT_APP( OApplicationFactory<ParaShoot> ) |
26 | 27 | ||
diff --git a/noncore/games/qasteroids/main.cpp b/noncore/games/qasteroids/main.cpp index 33e4729..6ddb238 100644 --- a/noncore/games/qasteroids/main.cpp +++ b/noncore/games/qasteroids/main.cpp | |||
@@ -1,26 +1,27 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 "toplevel.h" | 21 | #include "toplevel.h" |
22 | 22 | ||
23 | #include <opie2/oapplicationfactory.h> | 23 | #include <opie2/oapplicationfactory.h> |
24 | 24 | ||
25 | 25 | ||
26 | using namespace Opie::Core; | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<KAstTopLevel> ) | 27 | OPIE_EXPORT_APP( OApplicationFactory<KAstTopLevel> ) |
diff --git a/noncore/games/snake/interface.cpp b/noncore/games/snake/interface.cpp index b5fb5bf..9d9550a 100644 --- a/noncore/games/snake/interface.cpp +++ b/noncore/games/snake/interface.cpp | |||
@@ -1,153 +1,153 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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/resource.h> | 23 | #include <qpe/resource.h> |
24 | 24 | ||
25 | #include <qpe/qpetoolbar.h> | 25 | #include <qtoolbar.h> |
26 | #include <qtoolbutton.h> | 26 | #include <qtoolbutton.h> |
27 | 27 | ||
28 | SnakeGame::SnakeGame(QWidget* parent, const char* name, WFlags f) : | 28 | SnakeGame::SnakeGame(QWidget* parent, const char* name, WFlags f) : |
29 | QMainWindow(parent,name,f), | 29 | QMainWindow(parent,name,f), |
30 | canvas(232, 258) | 30 | canvas(232, 258) |
31 | { | 31 | { |
32 | setCaption( tr("Snake") ); | 32 | setCaption( tr("Snake") ); |
33 | QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff ); | 33 | QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff ); |
34 | QPixmap bg = Resource::loadPixmap("snake/grass"); | 34 | QPixmap bg = Resource::loadPixmap("snake/grass"); |
35 | canvas.setBackgroundPixmap(bg); | 35 | canvas.setBackgroundPixmap(bg); |
36 | canvas.setUpdatePeriod(100); | 36 | canvas.setUpdatePeriod(100); |
37 | snake = 0; | 37 | snake = 0; |
38 | 38 | ||
39 | cv = new QCanvasView(&canvas, this); | 39 | cv = new QCanvasView(&canvas, this); |
40 | 40 | ||
41 | pauseTimer = new QTimer(this); | 41 | pauseTimer = new QTimer(this); |
42 | connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) ); | 42 | connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) ); |
43 | 43 | ||
44 | setToolBarsMovable( FALSE ); | 44 | setToolBarsMovable( FALSE ); |
45 | 45 | ||
46 | QToolBar* toolbar = new QToolBar( this); | 46 | QToolBar* toolbar = new QToolBar( this); |
47 | toolbar->setHorizontalStretchable( TRUE ); | 47 | toolbar->setHorizontalStretchable( TRUE ); |
48 | 48 | ||
49 | QPixmap newicon = Resource::loadPixmap("ksnake"); | 49 | QPixmap newicon = Resource::loadPixmap("ksnake"); |
50 | setIcon(newicon); | 50 | setIcon(newicon); |
51 | (void)new QToolButton(newicon, tr("New Game"), 0, | 51 | (void)new QToolButton(newicon, tr("New Game"), 0, |
52 | this, SLOT(newGame()), toolbar, "New Game"); | 52 | this, SLOT(newGame()), toolbar, "New Game"); |
53 | 53 | ||
54 | scorelabel = new QLabel(toolbar); | 54 | scorelabel = new QLabel(toolbar); |
55 | showScore(0); | 55 | showScore(0); |
56 | scorelabel->setBackgroundMode( PaletteButton ); | 56 | scorelabel->setBackgroundMode( PaletteButton ); |
57 | scorelabel->setAlignment( AlignRight | AlignVCenter | ExpandTabs ); | 57 | scorelabel->setAlignment( AlignRight | AlignVCenter | ExpandTabs ); |
58 | toolbar->setStretchableWidget( scorelabel ); | 58 | toolbar->setStretchableWidget( scorelabel ); |
59 | 59 | ||
60 | setFocusPolicy(StrongFocus); | 60 | setFocusPolicy(StrongFocus); |
61 | 61 | ||
62 | setCentralWidget(cv); | 62 | setCentralWidget(cv); |
63 | 63 | ||
64 | QTimer::singleShot( 16, this, SLOT(welcomescreen()) ); | 64 | QTimer::singleShot( 16, this, SLOT(welcomescreen()) ); |
65 | gamestopped = true; | 65 | gamestopped = true; |
66 | waitover = true; | 66 | waitover = true; |
67 | } | 67 | } |
68 | 68 | ||
69 | SnakeGame::~SnakeGame() | 69 | SnakeGame::~SnakeGame() |
70 | { | 70 | { |
71 | delete snake; | 71 | delete snake; |
72 | } | 72 | } |
73 | 73 | ||
74 | void SnakeGame::resizeEvent(QResizeEvent *) | 74 | void SnakeGame::resizeEvent(QResizeEvent *) |
75 | { | 75 | { |
76 | QSize s = centralWidget()->size(); | 76 | QSize s = centralWidget()->size(); |
77 | int fw = style().defaultFrameWidth(); | 77 | int fw = style().defaultFrameWidth(); |
78 | canvas.resize( s.width() - fw - 2, s.height() - fw - 2); | 78 | canvas.resize( s.width() - fw - 2, s.height() - fw - 2); |
79 | } | 79 | } |
80 | 80 | ||
81 | void SnakeGame::welcomescreen() | 81 | void SnakeGame::welcomescreen() |
82 | { | 82 | { |
83 | QCanvasText* title = new QCanvasText(tr("SNAKE!"), &canvas); | 83 | QCanvasText* title = new QCanvasText(tr("SNAKE!"), &canvas); |
84 | title->setColor(yellow); | 84 | title->setColor(yellow); |
85 | title->setFont( QFont("times", 18, QFont::Bold) ); | 85 | title->setFont( QFont("times", 18, QFont::Bold) ); |
86 | int w = title->boundingRect().width(); | 86 | int w = title->boundingRect().width(); |
87 | title->move(canvas.width()/2 -w/2, canvas.height()/2-110); | 87 | title->move(canvas.width()/2 -w/2, canvas.height()/2-110); |
88 | title->show(); | 88 | title->show(); |
89 | QCanvasPixmapArray* titlearray = new QCanvasPixmapArray(Resource::findPixmap("snake/title")); | 89 | QCanvasPixmapArray* titlearray = new QCanvasPixmapArray(Resource::findPixmap("snake/title")); |
90 | QCanvasSprite* titlepic = new QCanvasSprite(titlearray, &canvas); | 90 | QCanvasSprite* titlepic = new QCanvasSprite(titlearray, &canvas); |
91 | titlepic->move(canvas.width()/2 - 33, canvas.height()/2-85); | 91 | titlepic->move(canvas.width()/2 - 33, canvas.height()/2-85); |
92 | titlepic->show(); | 92 | titlepic->show(); |
93 | QCanvasText* instr = new QCanvasText(tr("Use the arrow keys to guide the\n" | 93 | QCanvasText* instr = new QCanvasText(tr("Use the arrow keys to guide the\n" |
94 | "snake to eat the mouse. You must not\n" | 94 | "snake to eat the mouse. You must not\n" |
95 | "crash into the walls, edges or its tail."), | 95 | "crash into the walls, edges or its tail."), |
96 | &canvas); | 96 | &canvas); |
97 | w = instr->boundingRect().width(); | 97 | w = instr->boundingRect().width(); |
98 | instr->move(canvas.width()/2-w/2, canvas.height()/2-20); | 98 | instr->move(canvas.width()/2-w/2, canvas.height()/2-20); |
99 | instr->setColor(white); | 99 | instr->setColor(white); |
100 | instr->show(); | 100 | instr->show(); |
101 | QCanvasText* cont = new QCanvasText(tr("Press any key to start"), &canvas); | 101 | QCanvasText* cont = new QCanvasText(tr("Press any key to start"), &canvas); |
102 | w = cont->boundingRect().width(); | 102 | w = cont->boundingRect().width(); |
103 | cont->move(canvas.width()/2-w/2, canvas.height()-20); | 103 | cont->move(canvas.width()/2-w/2, canvas.height()-20); |
104 | cont->setColor(yellow); | 104 | cont->setColor(yellow); |
105 | cont->show(); | 105 | cont->show(); |
106 | 106 | ||
107 | } | 107 | } |
108 | 108 | ||
109 | void SnakeGame::newGame() | 109 | void SnakeGame::newGame() |
110 | { | 110 | { |
111 | clear(); | 111 | clear(); |
112 | snake = new Snake(&canvas); | 112 | snake = new Snake(&canvas); |
113 | connect(snake, SIGNAL(dead()), this, SLOT(gameOver()) ); | 113 | connect(snake, SIGNAL(dead()), this, SLOT(gameOver()) ); |
114 | connect(snake, SIGNAL(targethit()), this, SLOT(levelUp()) ); | 114 | connect(snake, SIGNAL(targethit()), this, SLOT(levelUp()) ); |
115 | connect(snake, SIGNAL(scorechanged()), this, SLOT(scoreInc()) ); | 115 | connect(snake, SIGNAL(scorechanged()), this, SLOT(scoreInc()) ); |
116 | connect(this, SIGNAL(moveFaster()), snake, SLOT(increaseSpeed()) ); | 116 | connect(this, SIGNAL(moveFaster()), snake, SLOT(increaseSpeed()) ); |
117 | last = 0; | 117 | last = 0; |
118 | targetamount = 1; | 118 | targetamount = 1; |
119 | notargets = 1; | 119 | notargets = 1; |
120 | level = 1; | 120 | level = 1; |
121 | stage = 1; | 121 | stage = 1; |
122 | showScore(0); | 122 | showScore(0); |
123 | gamestopped = false; | 123 | gamestopped = false; |
124 | waitover = true; | 124 | waitover = true; |
125 | int y = canvas.height()-50; | 125 | int y = canvas.height()-50; |
126 | (void)new Obstacle(&canvas, 32); | 126 | (void)new Obstacle(&canvas, 32); |
127 | (void)new Obstacle(&canvas, y); | 127 | (void)new Obstacle(&canvas, y); |
128 | createTargets(); | 128 | createTargets(); |
129 | } | 129 | } |
130 | 130 | ||
131 | 131 | ||
132 | void SnakeGame::showScore(int score) | 132 | void SnakeGame::showScore(int score) |
133 | { | 133 | { |
134 | scorelabel->setText(tr(" Score : %1 ").arg(score) ); | 134 | scorelabel->setText(tr(" Score : %1 ").arg(score) ); |
135 | } | 135 | } |
136 | 136 | ||
137 | 137 | ||
138 | void SnakeGame::scoreInc() | 138 | void SnakeGame::scoreInc() |
139 | { | 139 | { |
140 | showScore( snake->getScore() ); | 140 | showScore( snake->getScore() ); |
141 | } | 141 | } |
142 | 142 | ||
143 | void SnakeGame::levelUp() | 143 | void SnakeGame::levelUp() |
144 | { | 144 | { |
145 | notargets--; | 145 | notargets--; |
146 | if (notargets == 0) { | 146 | if (notargets == 0) { |
147 | stage++; | 147 | stage++; |
148 | if (stage == 3) { | 148 | if (stage == 3) { |
149 | level++; | 149 | level++; |
150 | emit moveFaster(); | 150 | emit moveFaster(); |
151 | targetamount++; | 151 | targetamount++; |
152 | stage = 0; | 152 | stage = 0; |
153 | } | 153 | } |
diff --git a/noncore/games/snake/main.cpp b/noncore/games/snake/main.cpp index 44f742f..81eb9ee 100644 --- a/noncore/games/snake/main.cpp +++ b/noncore/games/snake/main.cpp | |||
@@ -1,28 +1,29 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 <opie2/oapplicationfactory.h> | 23 | #include <opie2/oapplicationfactory.h> |
24 | 24 | ||
25 | 25 | ||
26 | using namespace Opie::Core; | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<SnakeGame> ) | 27 | OPIE_EXPORT_APP( OApplicationFactory<SnakeGame> ) |
27 | 28 | ||
28 | 29 | ||
diff --git a/noncore/games/solitaire/main.cpp b/noncore/games/solitaire/main.cpp index d4f6673..c8d4040 100644 --- a/noncore/games/solitaire/main.cpp +++ b/noncore/games/solitaire/main.cpp | |||
@@ -1,25 +1,26 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 "canvascardwindow.h" | 21 | #include "canvascardwindow.h" |
22 | 22 | ||
23 | #include <opie2/oapplicationfactory.h> | 23 | #include <opie2/oapplicationfactory.h> |
24 | 24 | ||
25 | using namespace Opie::Core; | ||
25 | OPIE_EXPORT_APP( OApplicationFactory<CanvasCardWindow> ) \ No newline at end of file | 26 | OPIE_EXPORT_APP( OApplicationFactory<CanvasCardWindow> ) \ No newline at end of file |
diff --git a/noncore/games/tetrix/main.cpp b/noncore/games/tetrix/main.cpp index 147d13d..6194bbf 100644 --- a/noncore/games/tetrix/main.cpp +++ b/noncore/games/tetrix/main.cpp | |||
@@ -1,27 +1,28 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 "qtetrix.h" | 21 | #include "qtetrix.h" |
22 | 22 | ||
23 | 23 | ||
24 | #include <opie2/oapplicationfactory.h> | 24 | #include <opie2/oapplicationfactory.h> |
25 | 25 | ||
26 | using namespace Opie::Core; | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<QTetrix> ) | 27 | OPIE_EXPORT_APP( OApplicationFactory<QTetrix> ) |
27 | 28 | ||
diff --git a/noncore/games/tictac/main.cpp b/noncore/games/tictac/main.cpp index b8193f7..f3df375 100644 --- a/noncore/games/tictac/main.cpp +++ b/noncore/games/tictac/main.cpp | |||
@@ -1,13 +1,14 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of an example program for Qt. This example | 4 | ** This file is part of an example program for Qt. This example |
5 | ** program may be used, distributed and modified without limitation. | 5 | ** program may be used, distributed and modified without limitation. |
6 | ** | 6 | ** |
7 | *****************************************************************************/ | 7 | *****************************************************************************/ |
8 | 8 | ||
9 | #include "tictac.h" | 9 | #include "tictac.h" |
10 | 10 | ||
11 | #include <opie2/oapplicationfactory.h> | 11 | #include <opie2/oapplicationfactory.h> |
12 | 12 | ||
13 | using namespace Opie::Core; | ||
13 | OPIE_EXPORT_APP( OApplicationFactory<TicTacToe> ) | 14 | OPIE_EXPORT_APP( OApplicationFactory<TicTacToe> ) |
diff --git a/noncore/games/wordgame/main.cpp b/noncore/games/wordgame/main.cpp index 7fd5f50..c388775 100644 --- a/noncore/games/wordgame/main.cpp +++ b/noncore/games/wordgame/main.cpp | |||
@@ -1,27 +1,28 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 "wordgame.h" | 21 | #include "wordgame.h" |
22 | 22 | ||
23 | #include <opie2/oapplicationfactory.h> | 23 | #include <opie2/oapplicationfactory.h> |
24 | 24 | ||
25 | 25 | ||
26 | using namespace Opie::Core; | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<WordGame> ) | 27 | OPIE_EXPORT_APP( OApplicationFactory<WordGame> ) |
27 | 28 | ||
diff --git a/noncore/games/wordgame/wordgame.cpp b/noncore/games/wordgame/wordgame.cpp index 43a54f8..a80bd35 100644 --- a/noncore/games/wordgame/wordgame.cpp +++ b/noncore/games/wordgame/wordgame.cpp | |||
@@ -1,164 +1,164 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
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 | 21 | ||
22 | #include "wordgame.h" | 22 | #include "wordgame.h" |
23 | 23 | ||
24 | #include <qpe/global.h> | 24 | #include <qpe/global.h> |
25 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
26 | #include <qpe/config.h> | 26 | #include <qpe/config.h> |
27 | 27 | ||
28 | #include <qapplication.h> | 28 | #include <qapplication.h> |
29 | #include <qmessagebox.h> | 29 | #include <qmessagebox.h> |
30 | #include <qcombobox.h> | 30 | #include <qcombobox.h> |
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | #include <qlineedit.h> | 32 | #include <qlineedit.h> |
33 | #include <qpushbutton.h> | 33 | #include <qpushbutton.h> |
34 | #include <qtextstream.h> | 34 | #include <qtextstream.h> |
35 | #include <qtimer.h> | 35 | #include <qtimer.h> |
36 | #include <qpe/qpetoolbar.h> | 36 | #include <qtoolbar.h> |
37 | #include <qtoolbutton.h> | 37 | #include <qtoolbutton.h> |
38 | #include <qvbox.h> | 38 | #include <qvbox.h> |
39 | #include <qwidgetstack.h> | 39 | #include <qwidgetstack.h> |
40 | #include <qlayout.h> | 40 | #include <qlayout.h> |
41 | 41 | ||
42 | #include <stdlib.h> | 42 | #include <stdlib.h> |
43 | #include <unistd.h> | 43 | #include <unistd.h> |
44 | #include <pwd.h> | 44 | #include <pwd.h> |
45 | #include <sys/types.h> | 45 | #include <sys/types.h> |
46 | 46 | ||
47 | enum RuleEffects { | 47 | enum RuleEffects { |
48 | Multiplier=15, | 48 | Multiplier=15, |
49 | MultiplyAll=64, | 49 | MultiplyAll=64, |
50 | Start=128 | 50 | Start=128 |
51 | }; | 51 | }; |
52 | 52 | ||
53 | static int tile_smallw = 16; | 53 | static int tile_smallw = 16; |
54 | static int tile_smallh = 16; | 54 | static int tile_smallh = 16; |
55 | static int tile_bigw = 22; | 55 | static int tile_bigw = 22; |
56 | static int tile_bigh = 22; | 56 | static int tile_bigh = 22; |
57 | static int tile_stweak = -2; | 57 | static int tile_stweak = -2; |
58 | static int tile_btweak = -1; | 58 | static int tile_btweak = -1; |
59 | 59 | ||
60 | static const int rack_tiles=7; | 60 | static const int rack_tiles=7; |
61 | 61 | ||
62 | const char* sampleWGR= | 62 | const char* sampleWGR= |
63 | "wordgame_shapes\n" | 63 | "wordgame_shapes\n" |
64 | "15 15\n" | 64 | "15 15\n" |
65 | "400001040100004\n" | 65 | "400001040100004\n" |
66 | "030000000000030\n" | 66 | "030000000000030\n" |
67 | "002002000200200\n" | 67 | "002002000200200\n" |
68 | "000300020003000\n" | 68 | "000300020003000\n" |
69 | "000020000020000\n" | 69 | "000020000020000\n" |
70 | "102001000100201\n" | 70 | "102001000100201\n" |
71 | "000000202000000\n" | 71 | "000000202000000\n" |
72 | "400200050002004\n" | 72 | "400200050002004\n" |
73 | "000000202000000\n" | 73 | "000000202000000\n" |
74 | "102001000100201\n" | 74 | "102001000100201\n" |
75 | "000020000020000\n" | 75 | "000020000020000\n" |
76 | "000300020003000\n" | 76 | "000300020003000\n" |
77 | "002002000200200\n" | 77 | "002002000200200\n" |
78 | "030000000000030\n" | 78 | "030000000000030\n" |
79 | "400001040100004\n" | 79 | "400001040100004\n" |
80 | "1 2 3 66 67 194 100 0\n" | 80 | "1 2 3 66 67 194 100 0\n" |
81 | "1 j 8\n" | 81 | "1 j 8\n" |
82 | "1 q 7\n" | 82 | "1 q 7\n" |
83 | "1 x 6\n" | 83 | "1 x 6\n" |
84 | "1 z 6\n" | 84 | "1 z 6\n" |
85 | "1 w 4\n" | 85 | "1 w 4\n" |
86 | "1 k 4\n" | 86 | "1 k 4\n" |
87 | "1 v 3\n" | 87 | "1 v 3\n" |
88 | "1 f 3\n" | 88 | "1 f 3\n" |
89 | "2 y 3\n" | 89 | "2 y 3\n" |
90 | "2 h 2\n" | 90 | "2 h 2\n" |
91 | "2 b 2\n" | 91 | "2 b 2\n" |
92 | "2 m 2\n" | 92 | "2 m 2\n" |
93 | "3 p 2\n" | 93 | "3 p 2\n" |
94 | "3 g 2\n" | 94 | "3 g 2\n" |
95 | "3 u 2\n" | 95 | "3 u 2\n" |
96 | "4 d 2\n" | 96 | "4 d 2\n" |
97 | "4 c 2\n" | 97 | "4 c 2\n" |
98 | "5 l 1\n" | 98 | "5 l 1\n" |
99 | "5 o 1\n" | 99 | "5 o 1\n" |
100 | "7 t 1\n" | 100 | "7 t 1\n" |
101 | "7 n 1\n" | 101 | "7 n 1\n" |
102 | "7 a 1\n" | 102 | "7 a 1\n" |
103 | "7 r 1\n" | 103 | "7 r 1\n" |
104 | "8 s 1\n" | 104 | "8 s 1\n" |
105 | "8 i 1\n" | 105 | "8 i 1\n" |
106 | "11 e 1\n" | 106 | "11 e 1\n" |
107 | "0\n"; | 107 | "0\n"; |
108 | 108 | ||
109 | WordGame::WordGame( QWidget* parent, const char* name, WFlags fl ) : | 109 | WordGame::WordGame( QWidget* parent, const char* name, WFlags fl ) : |
110 | QMainWindow(parent, name, fl) | 110 | QMainWindow(parent, name, fl) |
111 | { | 111 | { |
112 | if ( qApp->desktop()->width() < 240 ) { | 112 | if ( qApp->desktop()->width() < 240 ) { |
113 | tile_smallw = 10; | 113 | tile_smallw = 10; |
114 | tile_smallh = 10; | 114 | tile_smallh = 10; |
115 | tile_bigw = 16; | 115 | tile_bigw = 16; |
116 | tile_bigh = 16; | 116 | tile_bigh = 16; |
117 | tile_stweak = 0; | 117 | tile_stweak = 0; |
118 | tile_btweak = 0; | 118 | tile_btweak = 0; |
119 | } | 119 | } |
120 | 120 | ||
121 | setIcon( Resource::loadPixmap( "wordgame/WordGame.png" ) ); | 121 | setIcon( Resource::loadPixmap( "wordgame/WordGame.png" ) ); |
122 | setCaption( tr("Word Game") ); | 122 | setCaption( tr("Word Game") ); |
123 | 123 | ||
124 | setToolBarsMovable( FALSE ); | 124 | setToolBarsMovable( FALSE ); |
125 | vbox = new QVBox(this); | 125 | vbox = new QVBox(this); |
126 | 126 | ||
127 | setCentralWidget(vbox); | 127 | setCentralWidget(vbox); |
128 | toolbar = new QToolBar(this); | 128 | toolbar = new QToolBar(this); |
129 | addToolBar(toolbar, Bottom); | 129 | addToolBar(toolbar, Bottom); |
130 | reset = new QToolButton(Resource::loadPixmap("back"), tr("Back"), "", this, SLOT(resetTurn()), toolbar); | 130 | reset = new QToolButton(Resource::loadPixmap("back"), tr("Back"), "", this, SLOT(resetTurn()), toolbar); |
131 | done = new QToolButton(Resource::loadPixmap("done"), tr("Done"), "", this, SLOT(endTurn()), toolbar); | 131 | done = new QToolButton(Resource::loadPixmap("done"), tr("Done"), "", this, SLOT(endTurn()), toolbar); |
132 | scoreinfo = new ScoreInfo(toolbar); | 132 | scoreinfo = new ScoreInfo(toolbar); |
133 | scoreinfo->setFont(QFont("Helvetica",10)); | 133 | scoreinfo->setFont(QFont("Helvetica",10)); |
134 | new QToolButton(Resource::loadPixmap("finish"), tr("Close"), "", this, SLOT(endGame()), toolbar); | 134 | new QToolButton(Resource::loadPixmap("finish"), tr("Close"), "", this, SLOT(endGame()), toolbar); |
135 | toolbar->setStretchableWidget(scoreinfo); | 135 | toolbar->setStretchableWidget(scoreinfo); |
136 | 136 | ||
137 | cpu = 0; | 137 | cpu = 0; |
138 | board = 0; | 138 | board = 0; |
139 | bag = 0; | 139 | bag = 0; |
140 | racks = 0; | 140 | racks = 0; |
141 | 141 | ||
142 | aiheart = new QTimer(this); | 142 | aiheart = new QTimer(this); |
143 | connect(aiheart, SIGNAL(timeout()), this, SLOT(think())); | 143 | connect(aiheart, SIGNAL(timeout()), this, SLOT(think())); |
144 | 144 | ||
145 | readConfig(); | 145 | readConfig(); |
146 | } | 146 | } |
147 | 147 | ||
148 | WordGame::~WordGame() | 148 | WordGame::~WordGame() |
149 | { | 149 | { |
150 | writeConfig(); | 150 | writeConfig(); |
151 | } | 151 | } |
152 | 152 | ||
153 | void WordGame::writeConfig() | 153 | void WordGame::writeConfig() |
154 | { | 154 | { |
155 | Config cfg("WordGame"); | 155 | Config cfg("WordGame"); |
156 | cfg.setGroup("Game"); | 156 | cfg.setGroup("Game"); |
157 | cfg.writeEntry("NameList",namelist,';'); | 157 | cfg.writeEntry("NameList",namelist,';'); |
158 | cfg.writeEntry("CurrentPlayer",gameover ? 0 : player+1); | 158 | cfg.writeEntry("CurrentPlayer",gameover ? 0 : player+1); |
159 | if ( !gameover ) { | 159 | if ( !gameover ) { |
160 | cfg.writeEntry("Rules",rules); | 160 | cfg.writeEntry("Rules",rules); |
161 | bag->writeConfig(cfg); | 161 | bag->writeConfig(cfg); |
162 | board->writeConfig(cfg); | 162 | board->writeConfig(cfg); |
163 | scoreinfo->writeConfig(cfg); | 163 | scoreinfo->writeConfig(cfg); |
164 | } | 164 | } |
diff --git a/noncore/games/zlines/main.cpp b/noncore/games/zlines/main.cpp index d1709e4..8d80bae 100644 --- a/noncore/games/zlines/main.cpp +++ b/noncore/games/zlines/main.cpp | |||
@@ -1,28 +1,29 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | main.cpp - description | 2 | main.cpp - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Fri May 19 2000 | 4 | begin : Fri May 19 2000 |
5 | copyright : (C) 2000 by Roman Merzlyakov | 5 | copyright : (C) 2000 by Roman Merzlyakov |
6 | email : roman@sbrf.barrt.ru | 6 | email : roman@sbrf.barrt.ru |
7 | copyright : (C) 2000 by Roman Razilov | 7 | copyright : (C) 2000 by Roman Razilov |
8 | email : Roman.Razilov@gmx.de | 8 | email : Roman.Razilov@gmx.de |
9 | ***************************************************************************/ | 9 | ***************************************************************************/ |
10 | 10 | ||
11 | /*************************************************************************** | 11 | /*************************************************************************** |
12 | * * | 12 | * * |
13 | * This program is free software; you can redistribute it and/or modify * | 13 | * This program is free software; you can redistribute it and/or modify * |
14 | * it under the terms of the GNU General Public License as published by * | 14 | * it under the terms of the GNU General Public License as published by * |
15 | * the Free Software Foundation; either version 2 of the License, or * | 15 | * the Free Software Foundation; either version 2 of the License, or * |
16 | * (at your option) any later version. * | 16 | * (at your option) any later version. * |
17 | * * | 17 | * * |
18 | ***************************************************************************/ | 18 | ***************************************************************************/ |
19 | /* | 19 | /* |
20 | * Roman Razilov 2000-05-19 debug dummmy | 20 | * Roman Razilov 2000-05-19 debug dummmy |
21 | * Roman Razilov 2000-05-21 qimgio | 21 | * Roman Razilov 2000-05-21 qimgio |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "klines.h" | 24 | #include "klines.h" |
25 | 25 | ||
26 | #include <opie2/oapplicationfactory.h> | 26 | #include <opie2/oapplicationfactory.h> |
27 | 27 | ||
28 | using namespace Opie::Core; | ||
28 | OPIE_EXPORT_APP( OApplicationFactory<KLines> ) | 29 | OPIE_EXPORT_APP( OApplicationFactory<KLines> ) |
diff --git a/noncore/games/zsame/ZSameWidget.cpp b/noncore/games/zsame/ZSameWidget.cpp index 3c58c93..4fab0f6 100644 --- a/noncore/games/zsame/ZSameWidget.cpp +++ b/noncore/games/zsame/ZSameWidget.cpp | |||
@@ -1,170 +1,171 @@ | |||
1 | /* Yo Emacs, this is -*- C++ -*- */ | 1 | /* Yo Emacs, this is -*- C++ -*- */ |
2 | /* | 2 | /* |
3 | * ksame 0.4 - simple Game | 3 | * ksame 0.4 - simple Game |
4 | * Copyright (C) 1997,1998 Marcus Kreutzberger | 4 | * Copyright (C) 1997,1998 Marcus Kreutzberger |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2 of the License, or | 8 | * the Free Software Foundation; either version 2 of the License, or |
9 | * (at your option) any later version. | 9 | * (at your option) any later version. |
10 | * | 10 | * |
11 | * This program is distributed in the hope that it will be useful, | 11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | * | 15 | * |
16 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <stdio.h> | 22 | #include <stdio.h> |
23 | 23 | ||
24 | #include <opie2/oapplicationfactory.h> | 24 | #include <opie2/oapplicationfactory.h> |
25 | 25 | ||
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | 27 | ||
28 | #include <qtoolbar.h> | 28 | #include <qtoolbar.h> |
29 | #include <qmenubar.h> | 29 | #include <qmenubar.h> |
30 | #include <qapplication.h> | 30 | #include <qapplication.h> |
31 | #include <qaction.h> | 31 | #include <qaction.h> |
32 | #include <qmessagebox.h> | 32 | #include <qmessagebox.h> |
33 | 33 | ||
34 | #include <kapplication.h> | 34 | #include <kapplication.h> |
35 | 35 | ||
36 | #include "ZSameWidget.h" | 36 | #include "ZSameWidget.h" |
37 | 37 | ||
38 | static int default_colors=3; | 38 | static int default_colors=3; |
39 | 39 | ||
40 | #define i18n tr | 40 | #define i18n tr |
41 | 41 | ||
42 | 42 | ||
43 | using namespace Opie::Core; | ||
43 | OPIE_EXPORT_APP( OApplicationFactory<ZSameWidget> ) | 44 | OPIE_EXPORT_APP( OApplicationFactory<ZSameWidget> ) |
44 | 45 | ||
45 | 46 | ||
46 | 47 | ||
47 | ZSameWidget::ZSameWidget( QWidget* parent, const char* name, WFlags fl ) | 48 | ZSameWidget::ZSameWidget( QWidget* parent, const char* name, WFlags fl ) |
48 | : QMainWindow( parent, name, fl ) | 49 | : QMainWindow( parent, name, fl ) |
49 | { | 50 | { |
50 | setCaption(tr("ZSame")); | 51 | setCaption(tr("ZSame")); |
51 | 52 | ||
52 | setToolBarsMovable( false ); | 53 | setToolBarsMovable( false ); |
53 | QToolBar* con = new QToolBar( this ); | 54 | QToolBar* con = new QToolBar( this ); |
54 | con->setHorizontalStretchable( true ); | 55 | con->setHorizontalStretchable( true ); |
55 | QMenuBar* mb = new QMenuBar( con ); | 56 | QMenuBar* mb = new QMenuBar( con ); |
56 | QToolBar* tb = new QToolBar( this ); | 57 | QToolBar* tb = new QToolBar( this ); |
57 | 58 | ||
58 | QPopupMenu* fileMenu = new QPopupMenu( this ); | 59 | QPopupMenu* fileMenu = new QPopupMenu( this ); |
59 | 60 | ||
60 | QAction* a = new QAction(tr("New Game"), Resource::loadIconSet("new") , | 61 | QAction* a = new QAction(tr("New Game"), Resource::loadIconSet("new") , |
61 | QString::null, 0, this, "new_icon"); | 62 | QString::null, 0, this, "new_icon"); |
62 | a->addTo( fileMenu ); | 63 | a->addTo( fileMenu ); |
63 | a->addTo( tb ); | 64 | a->addTo( tb ); |
64 | connect(a, SIGNAL(activated()), this, SLOT(m_new())); | 65 | connect(a, SIGNAL(activated()), this, SLOT(m_new())); |
65 | 66 | ||
66 | a = new QAction(tr("Restart This Board"), Resource::loadIconSet("redo"), | 67 | a = new QAction(tr("Restart This Board"), Resource::loadIconSet("redo"), |
67 | QString::null, 0, this, "restart_board" ); | 68 | QString::null, 0, this, "restart_board" ); |
68 | a->addTo( fileMenu ); | 69 | a->addTo( fileMenu ); |
69 | connect( a, SIGNAL(activated()), this, SLOT(m_restart())); | 70 | connect( a, SIGNAL(activated()), this, SLOT(m_restart())); |
70 | restart = a; | 71 | restart = a; |
71 | 72 | ||
72 | a = new QAction( tr("Undo"), Resource::loadIconSet("undo"), | 73 | a = new QAction( tr("Undo"), Resource::loadIconSet("undo"), |
73 | QString::null, 0, this, "undo_action" ); | 74 | QString::null, 0, this, "undo_action" ); |
74 | a->addTo( fileMenu ); | 75 | a->addTo( fileMenu ); |
75 | a->addTo( tb ); | 76 | a->addTo( tb ); |
76 | connect( a, SIGNAL(activated()), this, SLOT(m_undo())); | 77 | connect( a, SIGNAL(activated()), this, SLOT(m_undo())); |
77 | 78 | ||
78 | a = new QAction(tr("Quit"), Resource::loadIconSet("quit_icon"), | 79 | a = new QAction(tr("Quit"), Resource::loadIconSet("quit_icon"), |
79 | QString::null, 0, this, "quit_action"); | 80 | QString::null, 0, this, "quit_action"); |
80 | a->addTo( fileMenu ); | 81 | a->addTo( fileMenu ); |
81 | a->addTo( tb ); | 82 | a->addTo( tb ); |
82 | connect(a, SIGNAL(activated()), this, SLOT(m_quit())); | 83 | connect(a, SIGNAL(activated()), this, SLOT(m_quit())); |
83 | 84 | ||
84 | mb->insertItem(tr("Game" ), fileMenu ); | 85 | mb->insertItem(tr("Game" ), fileMenu ); |
85 | 86 | ||
86 | int foo[2]; | 87 | int foo[2]; |
87 | desktop_widget(foo); | 88 | desktop_widget(foo); |
88 | stone = new StoneWidget(this,foo[0],foo[1]); | 89 | stone = new StoneWidget(this,foo[0],foo[1]); |
89 | 90 | ||
90 | connect( stone, SIGNAL(s_gameover()), this, SLOT(gameover())); | 91 | connect( stone, SIGNAL(s_gameover()), this, SLOT(gameover())); |
91 | 92 | ||
92 | connect( stone, SIGNAL(s_colors(int)), this, SLOT(setColors(int))); | 93 | connect( stone, SIGNAL(s_colors(int)), this, SLOT(setColors(int))); |
93 | connect( stone, SIGNAL(s_board(int)), this, SLOT(setBoard(int))); | 94 | connect( stone, SIGNAL(s_board(int)), this, SLOT(setBoard(int))); |
94 | connect( stone, SIGNAL(s_marked(int)), this, SLOT(setMarked(int))); | 95 | connect( stone, SIGNAL(s_marked(int)), this, SLOT(setMarked(int))); |
95 | connect( stone, SIGNAL(s_score(int)), this, SLOT(setScore(int))); | 96 | connect( stone, SIGNAL(s_score(int)), this, SLOT(setScore(int))); |
96 | connect( stone, SIGNAL(s_remove(int,int)), this, SLOT(stonesRemoved(int,int))); | 97 | connect( stone, SIGNAL(s_remove(int,int)), this, SLOT(stonesRemoved(int,int))); |
97 | 98 | ||
98 | connect(stone, SIGNAL(s_sizechanged()), this, SLOT(sizeChanged())); | 99 | connect(stone, SIGNAL(s_sizechanged()), this, SLOT(sizeChanged())); |
99 | 100 | ||
100 | sizeChanged(); | 101 | sizeChanged(); |
101 | setCentralWidget(stone); | 102 | setCentralWidget(stone); |
102 | 103 | ||
103 | 104 | ||
104 | setScore(0); | 105 | setScore(0); |
105 | } | 106 | } |
106 | 107 | ||
107 | ZSameWidget::~ZSameWidget() { | 108 | ZSameWidget::~ZSameWidget() { |
108 | 109 | ||
109 | } | 110 | } |
110 | 111 | ||
111 | void ZSameWidget::readProperties(Config *conf) { | 112 | void ZSameWidget::readProperties(Config *conf) { |
112 | /* | 113 | /* |
113 | Q_ASSERT(conf); | 114 | Q_ASSERT(conf); |
114 | stone->readProperties(conf); | 115 | stone->readProperties(conf); |
115 | */ | 116 | */ |
116 | } | 117 | } |
117 | 118 | ||
118 | void ZSameWidget::saveProperties(Config *conf) { | 119 | void ZSameWidget::saveProperties(Config *conf) { |
119 | /* | 120 | /* |
120 | Q_ASSERT(conf); | 121 | Q_ASSERT(conf); |
121 | stone->saveProperties(conf); | 122 | stone->saveProperties(conf); |
122 | conf->sync(); | 123 | conf->sync(); |
123 | */ | 124 | */ |
124 | } | 125 | } |
125 | 126 | ||
126 | void ZSameWidget::sizeChanged() { | 127 | void ZSameWidget::sizeChanged() { |
127 | //stone->setFixedSize(stone->sizeHint()); | 128 | //stone->setFixedSize(stone->sizeHint()); |
128 | } | 129 | } |
129 | 130 | ||
130 | void ZSameWidget::newGame(unsigned int board,int colors) { | 131 | void ZSameWidget::newGame(unsigned int board,int colors) { |
131 | while (board>=1000000) board-=1000000; | 132 | while (board>=1000000) board-=1000000; |
132 | // kdDebug() << "newgame board " << board << " colors " << colors << endl; | 133 | // kdDebug() << "newgame board " << board << " colors " << colors << endl; |
133 | stone->newGame(board,colors); | 134 | stone->newGame(board,colors); |
134 | setScore(0); | 135 | setScore(0); |
135 | } | 136 | } |
136 | 137 | ||
137 | bool ZSameWidget::confirmAbort() { | 138 | bool ZSameWidget::confirmAbort() { |
138 | return stone->isGameover() || | 139 | return stone->isGameover() || |
139 | stone->isOriginalBoard() || | 140 | stone->isOriginalBoard() || |
140 | (QMessageBox::warning(this, i18n("Resign"), i18n("<qt>Do you want to resign?</qt>"), | 141 | (QMessageBox::warning(this, i18n("Resign"), i18n("<qt>Do you want to resign?</qt>"), |
141 | QMessageBox::Yes, | 142 | QMessageBox::Yes, |
142 | QMessageBox::No|QMessageBox::Default|QMessageBox::Escape, 0) == QMessageBox::Yes ); | 143 | QMessageBox::No|QMessageBox::Default|QMessageBox::Escape, 0) == QMessageBox::Yes ); |
143 | } | 144 | } |
144 | 145 | ||
145 | void ZSameWidget::m_new() { | 146 | void ZSameWidget::m_new() { |
146 | if (confirmAbort()) | 147 | if (confirmAbort()) |
147 | newGame(_random(),default_colors); | 148 | newGame(_random(),default_colors); |
148 | 149 | ||
149 | } | 150 | } |
150 | 151 | ||
151 | void ZSameWidget::m_restart() { | 152 | void ZSameWidget::m_restart() { |
152 | if (confirmAbort()) | 153 | if (confirmAbort()) |
153 | newGame(stone->board(),default_colors); | 154 | newGame(stone->board(),default_colors); |
154 | } | 155 | } |
155 | 156 | ||
156 | void ZSameWidget::m_load() { | 157 | void ZSameWidget::m_load() { |
157 | // kdDebug() << "menu load not supported" << endl; | 158 | // kdDebug() << "menu load not supported" << endl; |
158 | } | 159 | } |
159 | 160 | ||
160 | void ZSameWidget::m_save() { | 161 | void ZSameWidget::m_save() { |
161 | // kdDebug() << "menu save not supported" << endl; | 162 | // kdDebug() << "menu save not supported" << endl; |
162 | } | 163 | } |
163 | 164 | ||
164 | void ZSameWidget::m_undo() { | 165 | void ZSameWidget::m_undo() { |
165 | //Q_ASSERT(stone); | 166 | //Q_ASSERT(stone); |
166 | stone->undo(); | 167 | stone->undo(); |
167 | } | 168 | } |
168 | 169 | ||
169 | 170 | ||
170 | void ZSameWidget::m_showhs() { | 171 | void ZSameWidget::m_showhs() { |