Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

PixmapProvider Class Reference

This class can provide pixmaps from a theme. More...

#include <pixmap_provider.h>

List of all members.

Public Methods

 PixmapProvider (Theme const &theme)
 ~PixmapProvider ()
bool hasBackgroundImage () const
QPixmap const & backgroundImage () const
QColor backgroundColor () const
QPixmap createPixmap (int index, int size) const
QPoint offset (int index, int size) const
bool smoothScaling () const
void setSmoothScaling (bool smooth_scaling)

Private Methods

QPixmap convertToPixmap (PieceImage const &image) const
QPixmap scale (QPixmap const &pixmap, int size) const

Private Attributes

Theme const & m_theme
QPixmap m_background_image
QColor m_background_color
std::vector< QPixmap *> m_pixmaps
bool m_smooth_scaling


Detailed Description

This class can provide pixmaps from a theme.

Author:
Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
Version:
0.1


Constructor & Destructor Documentation

PixmapProvider::PixmapProvider Theme const & theme
 

Constructs the object.

Parameters:
theme   The theme to use. Note that this theme object has to live as long as the pixmap provider itself lives.

PixmapProvider::~PixmapProvider
 

Releases the created pixmaps.


Member Function Documentation

QColor PixmapProvider::backgroundColor const
 

Returns the background color.

QPixmap const& PixmapProvider::backgroundImage const
 

Returns the background image.

QPixmap PixmapProvider::convertToPixmap PieceImage const & image const [private]
 

Converts an immage to a pixmap.

Parameters:
image   The image to convert.

QPixmap PixmapProvider::createPixmap int index,
int size
const
 

Returns the given piece image in the desired size.

Parameters:
index   The index of the piece image.
size   The desired size of the image.

bool PixmapProvider::hasBackgroundImage const
 

Returns true, if we have a background image.

QPoint PixmapProvider::offset int index,
int size
const
 

Returns the offset of the given piece image in the desired size.

Parameters:
index   The index of the piece image.
size   The desired size of the image.

QPixmap PixmapProvider::scale QPixmap const & pixmap,
int size
const [private]
 

Scales the pixmap.

Parameters:
pixmap   The pixmap.
size   The needed size.

void PixmapProvider::setSmoothScaling bool smooth_scaling
 

Parameters:
smooth_scaling   If true, we use smooth scaling.

bool PixmapProvider::smoothScaling const
 

Returns true, if we use smooth scaling.


Member Data Documentation

QColor PixmapProvider::m_background_color [private]
 

The background color to use.

QPixmap PixmapProvider::m_background_image [private]
 

The background image to use.

std::vector<QPixmap *> PixmapProvider::m_pixmaps [private]
 

The vector of the pixmaps;.

bool PixmapProvider::m_smooth_scaling [private]
 

If true, we use smooth scaling.

Theme const& PixmapProvider::m_theme [private]
 

The theme to use.


The documentation for this class was generated from the following file:
Generated at Sun Jan 6 18:49:12 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001