• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KStyles

TileSet Class Reference

#include <tileset.h>

List of all members.


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 &region)

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.

Enumerator:
Top 
Left 
Right 
Bottom 
Center 
Ring 
Horizontal 
Vertical 
Full 

Definition at line 71 of file tileset.h.


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 (  )  [inline]

Definition at line 58 of file tileset.h.

TileSet::TileSet ( const TileSet &  other  ) 

Definition at line 81 of file tileset.cpp.

virtual TileSet::~TileSet (  )  [inline, virtual]

Definition at line 61 of file tileset.h.


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.

TileSet & TileSet::operator= ( const TileSet &  other  ) 

Definition at line 89 of file tileset.cpp.

void TileSet::render ( const QRect &  r,
QPainter *  p,
Tiles  t = Ring 
) const

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]

Definition at line 95 of file tileset.h.

int TileSet::_h1 [protected]

Definition at line 97 of file tileset.h.

int TileSet::_h3 [protected]

Definition at line 97 of file tileset.h.

QPixmap TileSet::_pixmap[9] [protected]

Definition at line 96 of file tileset.h.

int TileSet::_w1 [protected]

Definition at line 97 of file tileset.h.

int TileSet::_w3 [protected]

Definition at line 97 of file tileset.h.


The documentation for this class was generated from the following files:
  • tileset.h
  • tileset.cpp

KStyles

Skip menu "KStyles"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KCMShell
  • KNotify
  • KStyles
  • Nepomuk Daemons
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal