Diffstat (limited to 'noncore/games/mindbreaker/mindbreaker.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/mindbreaker/mindbreaker.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/noncore/games/mindbreaker/mindbreaker.h b/noncore/games/mindbreaker/mindbreaker.h index fca649a..3132e80 100644 --- a/noncore/games/mindbreaker/mindbreaker.h +++ b/noncore/games/mindbreaker/mindbreaker.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the 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 |
@@ -51,15 +51,20 @@ static const int board_width = (panel_width + (bin_margin * 2) + peg_size); | |||
51 | 51 | ||
52 | class Peg; | 52 | class Peg; |
53 | class QToolButton; | 53 | class QToolButton; |
54 | class QTimer; | ||
54 | 55 | ||
55 | class MindBreakerBoard : public QCanvasView // QWidget | 56 | class MindBreakerBoard : public QCanvasView // QWidget |
56 | { | 57 | { |
57 | Q_OBJECT | 58 | Q_OBJECT |
58 | public: | 59 | public: |
59 | MindBreakerBoard(QCanvas &c, QWidget *parent=0, const char *name=0, int wFlags=0 ); | 60 | MindBreakerBoard(QWidget *parent=0, const char *name=0, int wFlags=0 ); |
60 | ~MindBreakerBoard(); | 61 | ~MindBreakerBoard(); |
61 | 62 | ||
62 | void getScore(int *, int *); | 63 | void getScore(int *, int *); |
64 | |||
65 | void resizeEvent(QResizeEvent*); | ||
66 | void fixSize(); | ||
67 | |||
63 | signals: | 68 | signals: |
64 | void scoreChanged(int, int); | 69 | void scoreChanged(int, int); |
65 | 70 | ||
@@ -67,13 +72,20 @@ public slots: | |||
67 | void clear(); | 72 | void clear(); |
68 | void resetScore(); | 73 | void resetScore(); |
69 | 74 | ||
75 | private slots: | ||
76 | void doFixSize(); | ||
77 | |||
70 | protected: | 78 | protected: |
71 | void contentsMousePressEvent(QMouseEvent *); | 79 | void contentsMousePressEvent(QMouseEvent *); |
72 | void contentsMouseMoveEvent(QMouseEvent *); | 80 | void contentsMouseMoveEvent(QMouseEvent *); |
73 | void contentsMouseReleaseEvent(QMouseEvent *); | 81 | void contentsMouseReleaseEvent(QMouseEvent *); |
74 | void resizeEvent(QResizeEvent *); | ||
75 | 82 | ||
76 | private: | 83 | private: |
84 | QCanvas cnv; | ||
85 | |||
86 | void readConfig(); | ||
87 | void writeConfig(); | ||
88 | |||
77 | void drawBackground(); | 89 | void drawBackground(); |
78 | void checkGuess(); | 90 | void checkGuess(); |
79 | void checkScores(); | 91 | void checkScores(); |
@@ -100,6 +112,8 @@ private: | |||
100 | 112 | ||
101 | int total_turns; | 113 | int total_turns; |
102 | int total_games; | 114 | int total_games; |
115 | |||
116 | QTimer *widthTimer; | ||
103 | }; | 117 | }; |
104 | 118 | ||
105 | class MindBreaker : public QMainWindow // QWidget | 119 | class MindBreaker : public QMainWindow // QWidget |
@@ -107,10 +121,13 @@ class MindBreaker : public QMainWindow // QWidget | |||
107 | Q_OBJECT | 121 | Q_OBJECT |
108 | public: | 122 | public: |
109 | MindBreaker(QWidget *parent=0, const char *name=0, int wFlags=0 ); | 123 | MindBreaker(QWidget *parent=0, const char *name=0, int wFlags=0 ); |
110 | 124 | static QString appName() { return QString::fromLatin1("mindbreaker"); } | |
111 | public slots: | 125 | public slots: |
112 | void setScore(int, int); | 126 | void setScore(int, int); |
113 | 127 | ||
128 | protected: | ||
129 | void resizeEvent( QResizeEvent * ); | ||
130 | |||
114 | private: | 131 | private: |
115 | QCanvas canvas; | 132 | QCanvas canvas; |
116 | MindBreakerBoard *board; | 133 | MindBreakerBoard *board; |