Diffstat (limited to 'noncore/games/solitaire/canvascardgame.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/solitaire/canvascardgame.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/games/solitaire/canvascardgame.h b/noncore/games/solitaire/canvascardgame.h index d159de6..b93cfbf 100644 --- a/noncore/games/solitaire/canvascardgame.h +++ b/noncore/games/solitaire/canvascardgame.h | |||
@@ -1,79 +1,79 @@ | |||
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 | #ifndef CANVAS_CARD_GAME_H | 20 | #ifndef CANVAS_CARD_GAME_H |
21 | #define CANVAS_CARD_GAME_H | 21 | #define CANVAS_CARD_GAME_H |
22 | 22 | ||
23 | #include "cardgame.h" | 23 | #include "cardgame.h" |
24 | #include "canvasshapes.h" | 24 | #include "canvasshapes.h" |
25 | #include "canvascard.h" | 25 | #include "canvascard.h" |
26 | 26 | ||
27 | #include <qpe/resource.h> | 27 | #include <qpe/resource.h> |
28 | #include <qpe/config.h> | 28 | #include <qpe/config.h> |
29 | 29 | ||
30 | #include <qmainwindow.h> | 30 | #include <qmainwindow.h> |
31 | #include <qpe/qpemenubar.h> | 31 | #include <qmenubar.h> |
32 | #include <qpainter.h> | 32 | #include <qpainter.h> |
33 | 33 | ||
34 | #include <stdlib.h> | 34 | #include <stdlib.h> |
35 | #include <time.h> | 35 | #include <time.h> |
36 | 36 | ||
37 | 37 | ||
38 | class CanvasCardPile; | 38 | class CanvasCardPile; |
39 | 39 | ||
40 | 40 | ||
41 | class CanvasCardGame : public QCanvasView, public CardGame | 41 | class CanvasCardGame : public QCanvasView, public CardGame |
42 | { | 42 | { |
43 | public: | 43 | public: |
44 | CanvasCardGame(QCanvas &c, bool snap, QWidget *parent = 0, int numOfDecks = 1, const char *name = 0, WFlags f = 0) : | 44 | CanvasCardGame(QCanvas &c, bool snap, QWidget *parent = 0, int numOfDecks = 1, const char *name = 0, WFlags f = 0) : |
45 | QCanvasView( &c, parent, name, f ), | 45 | QCanvasView( &c, parent, name, f ), |
46 | CardGame(0,numOfDecks), | 46 | CardGame(0,numOfDecks), |
47 | moved(FALSE), | 47 | moved(FALSE), |
48 | moving(NULL), | 48 | moving(NULL), |
49 | alphaCardPile( NULL ), | 49 | alphaCardPile( NULL ), |
50 | cardXOff(0), cardYOff(0), | 50 | cardXOff(0), cardYOff(0), |
51 | snapOn(snap), | 51 | snapOn(snap), |
52 | numberToDraw(1) { } | 52 | numberToDraw(1) { } |
53 | 53 | ||
54 | virtual ~CanvasCardGame(); | 54 | virtual ~CanvasCardGame(); |
55 | 55 | ||
56 | virtual Card *newCard( eValue v, eSuit s, bool f ) { | 56 | virtual Card *newCard( eValue v, eSuit s, bool f ) { |
57 | return new CanvasCard( v, s, f, canvas() ); | 57 | return new CanvasCard( v, s, f, canvas() ); |
58 | } | 58 | } |
59 | 59 | ||
60 | virtual void readConfig( Config& cfg ) { Q_UNUSED( cfg ); } | 60 | virtual void readConfig( Config& cfg ) { Q_UNUSED( cfg ); } |
61 | virtual void writeConfig( Config& cfg ) { Q_UNUSED( cfg ); } | 61 | virtual void writeConfig( Config& cfg ) { Q_UNUSED( cfg ); } |
62 | 62 | ||
63 | virtual void gameWon(); | 63 | virtual void gameWon(); |
64 | virtual bool haveWeWon() { return FALSE; } | 64 | virtual bool haveWeWon() { return FALSE; } |
65 | 65 | ||
66 | virtual bool mousePressCard(Card *card, QPoint p) { Q_UNUSED(card); Q_UNUSED(p); return FALSE; } | 66 | virtual bool mousePressCard(Card *card, QPoint p) { Q_UNUSED(card); Q_UNUSED(p); return FALSE; } |
67 | virtual void mouseReleaseCard(Card *card, QPoint p) { Q_UNUSED(card); Q_UNUSED(p); } | 67 | virtual void mouseReleaseCard(Card *card, QPoint p) { Q_UNUSED(card); Q_UNUSED(p); } |
68 | 68 | ||
69 | void cancelMoving() { moving = NULL; } | 69 | void cancelMoving() { moving = NULL; } |
70 | void toggleSnap() { snapOn = (snapOn == TRUE) ? FALSE : TRUE; } | 70 | void toggleSnap() { snapOn = (snapOn == TRUE) ? FALSE : TRUE; } |
71 | void toggleCardsDrawn() { numberToDraw = (numberToDraw == 1) ? 3 : 1; } | 71 | void toggleCardsDrawn() { numberToDraw = (numberToDraw == 1) ? 3 : 1; } |
72 | int cardsDrawn() { return numberToDraw; } | 72 | int cardsDrawn() { return numberToDraw; } |
73 | void setNumberToDraw(int numToDraw) { this->numberToDraw = numToDraw; } | 73 | void setNumberToDraw(int numToDraw) { this->numberToDraw = numToDraw; } |
74 | 74 | ||
75 | void readPile( Config& cfg, CardPile *pile, QString name, int& highestZ ); | 75 | void readPile( Config& cfg, CardPile *pile, QString name, int& highestZ ); |
76 | 76 | ||
77 | protected: | 77 | protected: |
78 | void contentsMousePressEvent(QMouseEvent *e); | 78 | void contentsMousePressEvent(QMouseEvent *e); |
79 | void contentsMouseReleaseEvent(QMouseEvent *e); | 79 | void contentsMouseReleaseEvent(QMouseEvent *e); |