From ae2a03c2941bf92573f89b88ef73f8aa842bea0a Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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/kdetoys@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ktux/spritemisc.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ktux/spritemisc.h (limited to 'ktux/spritemisc.h') diff --git a/ktux/spritemisc.h b/ktux/spritemisc.h new file mode 100644 index 0000000..0a0d058 --- /dev/null +++ b/ktux/spritemisc.h @@ -0,0 +1,41 @@ +//----------------------------------------------------------------------------- +// +// spritemisc +// +// Copyright (c) Martin R. Jones 1999 +// + +#ifndef __SPRITEMISC_H__ +#define __SPRITEMISC_H__ + +#include +#include + +class SpriteRange +{ +public: + SpriteRange(const QString &str); + SpriteRange(int l=0, int h=0) : mMin(l), mMax(h) {} + + int min() const { return mMin; } + int max() const { return mMax; } + + int random() const; + + void set(int l, int h) { mMin=l; mMax=h; } + void set(const QString &str); + + static void setFieldSize(const QSize &size); + static QSize fieldSize() { return mFieldSize; } + +protected: + int parse(const QString &str); + +protected: + int mMin; + int mMax; + static QSize mFieldSize; +}; + +#endif + -- cgit v1.2.1