kgoldrunner
kgrtheme.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KGRTHEME_H
00020 #define KGRTHEME_H
00021
00022 #include <QString>
00023 #include <QColor>
00024 #include <QImage>
00025 #include <KSvgRenderer>
00026
00030 class KGrTheme
00031 {
00032 public:
00033 KGrTheme(const QString &systemDataDir);
00034
00038 bool load(const QString & themeFilepath);
00039
00043 QList<QPixmap> tiles(unsigned int size);
00044
00048 QList<QPixmap> hero(unsigned int size);
00049
00053 QList<QPixmap> enemy(unsigned int size);
00054
00059 QImage background(unsigned int width, unsigned int height,
00060 unsigned int variant);
00061
00062 bool isBorderRequired() const { return themeDrawBorder; }
00063
00067 bool isWithBackground() const { return numBackgrounds > 0; }
00068
00072 bool multipleBackgrounds() const { return numBackgrounds > 1; }
00073
00077 QColor borderColor() { return m_borderColor; }
00078
00082 QColor textColor() { return m_textColor; }
00083
00084 private:
00085 KSvgRenderer svgSet;
00086 KSvgRenderer svgActors;
00087 QColor m_borderColor, m_textColor;
00088
00089 QString themeDataDir;
00090 QString m_themeFilepath;
00091 short themeDrawBorder;
00092 QPixmap svgTile (QImage &image, QPainter &painter, const QString &name);
00093 QList<QPixmap> svgFrames (const QString & elementPattern,
00094 unsigned int size, int nFrames);
00095
00096 enum GraphicsType { NONE, SVG, PNG };
00097 GraphicsType tileGraphics;
00098 GraphicsType backgroundGraphics;
00099 GraphicsType runnerGraphics;
00100 int numBackgrounds;
00101 bool hasPanelTiles;
00102 };
00103
00104 #endif // KGRTHEME_H