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 /katomic/molek.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 'katomic/molek.h')
-rw-r--r-- | katomic/molek.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/katomic/molek.h b/katomic/molek.h new file mode 100644 index 00000000..6189e4e8 --- /dev/null +++ b/katomic/molek.h @@ -0,0 +1,52 @@ +/**************************************************************** +** +** Definition of Molek class, +** +****************************************************************/ + +#ifndef MOLEK_H +#define MOLEK_H + +#include <stdio.h> +#include <stdlib.h> +#include <qwidget.h> +#include <qpoint.h> +#include <qpainter.h> +#include <qpixmap.h> +#include "atom.h" +#include <qvaluelist.h> + +class KSimpleConfig; + +#define MOLEK_SIZE 15 + +class Molek : public QWidget +{ + Q_OBJECT + +public: + Molek (QWidget *parent=0, const char *name=0); + ~Molek (); + + void load(const KSimpleConfig& config); + + const atom& getAtom(uint index) const; + int atomSize() const { return atoms.count(); } + + QSize molecSize() const { return _size; } + uint getAtom(int x, int y) const { return molek[x][y]; } + +protected: + void paintEvent( QPaintEvent * ); + +private: + QPixmap data; + uint molek[MOLEK_SIZE][MOLEK_SIZE]; // the indexes within atoms + QValueList<atom> atoms; + QString mname; + QSize _size; + + +}; + +#endif // MOLEK_H |