diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | c90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch) | |
tree | 6d8391395bce9eaea4ad78958617edb20c6a7573 /kasteroids/toplevel.h | |
download | tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kasteroids/toplevel.h')
-rw-r--r-- | kasteroids/toplevel.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/kasteroids/toplevel.h b/kasteroids/toplevel.h new file mode 100644 index 00000000..70545f71 --- /dev/null +++ b/kasteroids/toplevel.h @@ -0,0 +1,94 @@ +/* + * KAsteroids - Copyright (c) Martin R. Jones 1997 + * + * Part of the KDE project + */ + +#ifndef __KAST_TOPLEVEL_H__ +#define __KAST_TOPLEVEL_H__ + +#include <kmainwindow.h> +#include <kaccel.h> +#include <qdict.h> +#include <qmap.h> + +#include "view.h" + +//#define KA_ENABLE_SOUND + +class KALedMeter; +class QLCDNumber; +class KDialogBase; + +class KAstTopLevel : public KMainWindow +{ + Q_OBJECT +public: + KAstTopLevel(); + virtual ~KAstTopLevel(); + +private: + void initKAction(); + void playSound( const char *snd ); + void readSoundMapping(); + void doStats(); + bool queryExit(); + bool processKeyPress( QKeyEvent *event ); + bool processKeyRelease( QKeyEvent *event ); + +protected: + virtual bool eventFilter( QObject *object, QEvent *event ); + virtual void focusInEvent( QFocusEvent *event ); + virtual void focusOutEvent( QFocusEvent *event ); + +private slots: + void loadSettings(); + void slotNewGame(); + void slotGameOver(); + + void slotShipKilled(); + void slotRockHit( int size ); + void slotRocksRemoved(); + + void slotUpdateVitals(); + + void slotKeyConfig(); + void slotPref(); + void slotShowHighscores(); + + void slotPause(); + void slotLaunch(); + +private: + KAsteroidsView *view; + QLCDNumber *scoreLCD; + QLCDNumber *levelLCD; + QLCDNumber *shipsLCD; + + QLCDNumber *teleportsLCD; +// QLCDNumber *bombsLCD; + QLCDNumber *brakesLCD; + QLCDNumber *shieldLCD; + QLCDNumber *shootLCD; + KALedMeter *powerMeter; + + QDict<QString> soundDict; + + // waiting for user to press Enter to launch a ship + bool waitShip; + bool gameOver; + + int shipsRemain; + int score; + int level; + + enum Action { Invalid, Launch, Thrust, RotateLeft, RotateRight, Shoot, + Teleport, Brake, Shield }; + + QMap<Action, KAction*> keycodes; + + KAction *launchAction; +}; + +#endif + |