KStyles
TileSet Class Reference
#include <tileset.h>
Detailed Description
Definition at line 25 of file tileset.h.
Public Types | |
enum | Tile { Top = 0x1, Left = 0x2, Right = 0x8, Bottom = 0x4, Center = 0x10, Ring = 0x0f, Horizontal = 0x1a, Vertical = 0x15, Full = 0x1f } |
Public Member Functions | |
TileSet & | operator= (const TileSet &) |
void | render (const QRect &, QPainter *, Tiles=Ring) const |
TileSet (const TileSet &) | |
TileSet () | |
TileSet (const QPixmap &pix, int w1, int h1, int w3, int h3, int x2, int y2, int w2, int h2) | |
TileSet (const QPixmap &, int w1, int h1, int w2, int h2) | |
virtual | ~TileSet () |
Protected Member Functions | |
void | initPixmap (int s, const QPixmap &, int w, int h, const QRect ®ion) |
Protected Attributes | |
bool | _empty |
int | _h1 |
int | _h3 |
QPixmap | _pixmap [9] |
int | _w1 |
int | _w3 |
Member Enumeration Documentation
enum TileSet::Tile |
Flags specifying what sides to draw in render.
Corners are drawn when the sides forming that corner are drawn, e.g. Top|Left draws the top-center, center-left, and top-left chunks. The center-center chunk is only drawn when Center is requested.
Constructor & Destructor Documentation
TileSet::TileSet | ( | const QPixmap & | pix, | |
int | w1, | |||
int | h1, | |||
int | w2, | |||
int | h2 | |||
) |
Create a TileSet from a pixmap.
The size of the bottom/right chunks is whatever is left over from the other chunks, whose size is specified in the required parameters.
- Parameters:
-
w1 width of the left chunks h1 height of the top chunks w2 width of the not-left-or-right chunks h2 height of the not-top-or-bottom chunks
Definition at line 37 of file tileset.cpp.
TileSet::TileSet | ( | const QPixmap & | pix, | |
int | w1, | |||
int | h1, | |||
int | w3, | |||
int | h3, | |||
int | x2, | |||
int | y2, | |||
int | w2, | |||
int | h2 | |||
) |
Create a TileSet from a pixmap.
The size of the top/left and bottom/right chunks is specified, with the middle chunks created from the specified portion of the pixmap. This allows the middle chunks to overlap the outer chunks (or to not use all pixels). The top/left and bottom/right chunks are carved out of the corners of the pixmap.
- Parameters:
-
w1 width of the left chunks h1 height of the top chunks w3 width of the right chunks h3 height of bottom chunks x2 x-coordinate of the top of the not-left-or-right chunks y2 y-coordinate of the left of the not-top-or-bottom chunks w2 width of the not-left-or-right chunks h2 height of the not-top-or-bottom chunks
Definition at line 59 of file tileset.cpp.
TileSet::TileSet | ( | const TileSet & | other | ) |
Definition at line 81 of file tileset.cpp.
Member Function Documentation
void TileSet::initPixmap | ( | int | s, | |
const QPixmap & | pix, | |||
int | w, | |||
int | h, | |||
const QRect & | region | |||
) | [protected] |
Definition at line 23 of file tileset.cpp.
Definition at line 89 of file tileset.cpp.
Fills the specified rect with tiled chunks.
Corners are never tiled, edges are tiled in one direction, and the center chunk is tiled in both directions. Partial tiles are used as needed so that the entire rect is perfectly filled. Filling is performed as if all chunks are being drawn.
Definition at line 106 of file tileset.cpp.
Member Data Documentation
bool TileSet::_empty [protected] |
int TileSet::_h1 [protected] |
int TileSet::_h3 [protected] |
QPixmap TileSet::_pixmap[9] [protected] |
int TileSet::_w1 [protected] |
int TileSet::_w3 [protected] |
The documentation for this class was generated from the following files: