From e2de64d6f1beb9e492daf5b886e19933c1fa41dd 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/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- noatun/modules/kjofol-skin/kjfont.h | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 noatun/modules/kjofol-skin/kjfont.h (limited to 'noatun/modules/kjofol-skin/kjfont.h') diff --git a/noatun/modules/kjofol-skin/kjfont.h b/noatun/modules/kjofol-skin/kjfont.h new file mode 100644 index 00000000..4ea5319b --- /dev/null +++ b/noatun/modules/kjofol-skin/kjfont.h @@ -0,0 +1,50 @@ +#ifndef KJFONT_H +#define KJFONT_H + +#include +#include +#include +#include + +class KJLoader; + +class KJFont +{ +public: + KJFont(const QString &prefix, KJLoader *parent); + // draw the string str to dev at position pos, within rectangle limit in relation to pos + QPixmap draw(const QCString &str, int wide, const QPoint &pt=QPoint(0,0)) const; + QPixmap draw(const QString &str, int wide, const QPoint &pt=QPoint(0,0)) const + { return draw(QCString(str.latin1()), wide, pt); } + + int fontHeight() const {return mHeight;} + int fontWidth() const {return mWidth;} + int fontSpacing() const {return mSpacing;} + bool isTransparent() const {return mTransparent;} + + // !!! Call if you changed the systemfont !!! + void recalcSysFont(void); + +protected: + QPixmap drawSysFont(const QCString &s, int wide, const QPoint &pos=QPoint(0,0)) const; + QPixmap drawPixmapFont(const QCString &, int, const QPoint &pos=QPoint(0,0)) const; + + void drawCharacter(QPixmap *dev, QBitmap *devMask, const QPoint &to, char c) const; + QPoint charSource(char c) const; + +private: + QPixmap mText; + QBitmap mTextMask; + QRgb mTransparentRGB; // this color will be transparent + int mSpacing; + int mWidth, mHeight; + bool mTransparent; // indicates wether there's transparency + const char *mString[3]; + char mNullChar; + QFontMetrics *sysFontMetrics; + QFont sysFont; + QColor sysFontColor; + bool mUseSysFont; +}; + +#endif -- cgit v1.2.1