KStyles
tileset.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 TILESET_H
00020 #define TILESET_H
00021
00022 #include <QtGui/QPixmap>
00023 #include <QtCore/QRect>
00024
00025 class TileSet
00026 {
00027 public:
00038 TileSet(const QPixmap&, int w1, int h1, int w2, int h2);
00039
00056 TileSet(const QPixmap &pix, int w1, int h1, int w3, int h3, int x2, int y2, int w2, int h2);
00057
00058 TileSet() : _empty(true) {}
00059 TileSet(const TileSet&);
00060
00061 virtual ~TileSet() {}
00062
00063 TileSet& operator=(const TileSet&);
00064
00071 enum Tile {
00072 Top = 0x1,
00073 Left = 0x2,
00074 Right = 0x8,
00075 Bottom = 0x4,
00076 Center = 0x10,
00077 Ring = 0x0f,
00078 Horizontal = 0x1a,
00079 Vertical = 0x15,
00080 Full = 0x1f
00081 };
00082 Q_DECLARE_FLAGS(Tiles, Tile)
00083
00084
00090 void render(const QRect&, QPainter*, Tiles = Ring) const;
00091
00092 protected:
00093 void initPixmap(int s, const QPixmap&, int w, int h, const QRect ®ion);
00094
00095 bool _empty;
00096 QPixmap _pixmap[9];
00097 int _w1, _h1, _w3, _h3;
00098 };
00099
00100 Q_DECLARE_OPERATORS_FOR_FLAGS(TileSet::Tiles)
00101
00102 #endif //TILESET_H