Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Painter Class Reference

#include </home/clem/local/src/opie/noncore/games/kpacman/painter.h>

Collaboration diagram for Painter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Painter (Board *, QWidget *parent=0, int scheme=-1, int mode=-1, Bitfont *font=0)
QPixmap levelPix ()
void setScheme (int scheme=-1, int mode=-1, Bitfont *font=0)
void setLevel (int level=0)
QRect rect (int pos, PixMap pix, uint i=0)
QRect rect (int pos, QString str, int align=QLabel::AlignCenter)
QRect rect (QRect r1, QRect r2)
void draw (QPoint point, DrawWidget where, QPixmap pix)
void draw (QRect rect, DrawWidget where, QPixmap pix)
void draw (int pos, DrawWidget where, PixMap pix, uint i=0)
QPixmap draw (int pos, DrawWidget where, QString str, QColor fg, QColor bg=QColor(), int align=QLabel::AlignCenter)
QRect draw (int col, int row, DrawWidget where, QString str, QColor fg, QColor bg=QColor(), int align=QLabel::AlignCenter)
void drawBrick (int pos)
void drawPrison (int pos)
void drawPoint (int pos)
void erase (int pos, PixMap pix, uint i=0)
int maxPixmaps (PixMap pix)

Protected Member Functions

QString decodeHexOctString (QString str)
void fillScoreString (QStrList &, QArray< int > &)
void fillArray (QArray< int > &, QString, int)
void fillStrList (QStrList &, QString, int)
void fillPixmapName (QStrList &)
void confScheme ()
void confLevels (bool defGroup=TRUE)
void confMisc (bool defGroup=TRUE)
void confScoring (bool defGroup=TRUE)
void initPixmaps ()
void initRoomPixmap ()
void initbackPixmaps ()

Private Member Functions

QList< QPixmap > * loadPixmap (QWidget *parent, QString pixmapName, QList< QPixmap > *pixmaps=0)
QList< QPixmap > * textPixmap (QStrList &, QList< QPixmap > *pixmaps=0, QColor fg=BLACK, QColor bg=QColor())
QList< QPixmap > * textPixmap (QString str, QList< QPixmap > *pixmaps=0, QColor fg=BLACK, QColor bg=QColor())
QPoint point (int pos)
int checkRange (int value, int max, int min=0)

Private Attributes

QWidget * w
Boardboard
Bitfontbitfont
int BlockWidth
int BlockHeight
QArray< int > fruitScore
QStrList fruitScoreString
QArray< int > monsterScore
QStrList monsterScoreString
QString pixmapDirectory
QStrList pointPixmapName
QStrList wallPixmapName
QStrList prisonPixmapName
QStrList energizerPixmapName
QStrList fruitPixmapName
QStrList pacmanPixmapName
QStrList dyingPixmapName
QStrList eyesPixmapName
QStrList monsterPixmapName
QStrList fruitScorePixmapName
QStrList monsterScorePixmapName
QString lastPointPixmapName
QString lastWallPixmapName
QString lastPrisonPixmapName
QString lastEnergizerPixmapName
QString lastFruitPixmapName
QString lastPacmanPixmapName
QString lastDyingPixmapName
QString lastEyesPixmapName
QString lastMonsterPixmapName
QString lastFruitScorePixmapName
QString lastMonsterScorePixmapName
QList< QPixmap > * wallPix
QList< QPixmap > * prisonPix
QList< QPixmap > * pointPix
QList< QPixmap > * energizerPix
QList< QPixmap > * fruitPix
QList< QPixmap > * pacmanPix
QList< QPixmap > * dyingPix
QList< QPixmap > * eyesPix
QList< QPixmap > * monsterPix
QList< QPixmap > * fruitScorePix
QList< QPixmap > * monsterScorePix
QPixmap roomPix
QPixmap backPix
bool plainColor
QColor backgroundColor
int maxLevel
int level
int scheme
int mode

Constructor & Destructor Documentation

Painter::Painter Board ,
QWidget *  parent = 0,
int  scheme = -1,
int  mode = -1,
Bitfont font = 0
 

Definition at line 18 of file painter.cpp.

References bitfont, board, confScheme(), dyingPix, energizerPix, eyesPix, fruitPix, fruitScorePix, lastDyingPixmapName, lastEnergizerPixmapName, lastEyesPixmapName, lastFruitPixmapName, lastFruitScorePixmapName, lastMonsterPixmapName, lastMonsterScorePixmapName, lastPacmanPixmapName, lastPointPixmapName, lastPrisonPixmapName, lastWallPixmapName, level, mode, monsterPix, monsterScorePix, NULL, pacmanPix, pointPix, prisonPix, scheme, w, and wallPix.


Member Function Documentation

int Painter::checkRange int  value,
int  max,
int  min = 0
[private]
 

Definition at line 952 of file painter.cpp.

References printf.

Referenced by draw(), and rect().

void Painter::confLevels bool  defGroup = TRUE  )  [protected]
 

Definition at line 772 of file painter.cpp.

References APP_CONFIG_BEGIN, APP_CONFIG_END, and maxLevel.

Referenced by confScheme().

void Painter::confMisc bool  defGroup = TRUE  )  [protected]
 

Definition at line 780 of file painter.cpp.

References APP_CONFIG_BEGIN, APP_CONFIG_END, QString::append(), dyingPixmapName, energizerPixmapName, eyesPixmapName, fillStrList(), fruitPixmapName, fruitScorePixmapName, QString::insert(), QString::left(), maxLevel, monsterPixmapName, monsterScorePixmapName, pacmanPixmapName, pixmapDirectory, pointPixmapName, prisonPixmapName, QString::right(), and wallPixmapName.

Referenced by confScheme().

void Painter::confScheme  )  [protected]
 

Definition at line 850 of file painter.cpp.

References APP_CONFIG_BEGIN, APP_CONFIG_END, QPtrList< type >::at(), confLevels(), confMisc(), confScoring(), dyingPixmapName, energizerPixmapName, eyesPixmapName, FALSE, fillPixmapName(), fillScoreString(), fruitPixmapName, fruitScore, fruitScorePixmapName, fruitScoreString, initbackPixmaps(), initPixmaps(), initRoomPixmap(), mode, monsterPixmapName, monsterScore, monsterScorePixmapName, monsterScoreString, pacmanPixmapName, pointPixmapName, prisonPixmapName, RESTORE_CONFIG_GROUP, SAVE_CONFIG_GROUP, scheme, QString::sprintf(), and wallPixmapName.

Referenced by Painter(), and setScheme().

void Painter::confScoring bool  defGroup = TRUE  )  [protected]
 

Definition at line 829 of file painter.cpp.

References APP_CONFIG_BEGIN, APP_CONFIG_END, fillArray(), fillStrList(), fruitScore, fruitScoreString, maxLevel, monsterScore, and monsterScoreString.

Referenced by confScheme().

QString Painter::decodeHexOctString QString  str  )  [protected]
 

Definition at line 634 of file painter.cpp.

References FALSE, QString::fill(), QString::find(), len, QString::length(), QString::mid(), pos, QString::replace(), and v.

Referenced by fillStrList().

QRect Painter::draw int  col,
int  row,
DrawWidget  where,
QString  str,
QColor  fg,
QColor  bg = QColor(),
int  align = QLabel::AlignCenter
 

Definition at line 346 of file painter.cpp.

References bitfont, BoardWidth, draw(), rect(), and Bitfont::text().

QPixmap Painter::draw int  pos,
DrawWidget  where,
QString  str,
QColor  fg,
QColor  bg = QColor(),
int  align = QLabel::AlignCenter
 

Definition at line 323 of file painter.cpp.

References backPix, BackPix, bitBlt(), bitfont, rect(), roomPix, RoomPix, Bitfont::text(), w, and Widget.

void Painter::draw int  pos,
DrawWidget  where,
PixMap  pix,
uint  i = 0
 

Definition at line 275 of file painter.cpp.

References at(), backPix, BackPix, bitBlt(), checkRange(), dyingPix, DyingPix, energizerPix, EnergizerPix, eyesPix, EyesPix, fruitPix, FruitPix, fruitScorePix, FruitScorePix, monsterPix, MonsterPix, monsterScorePix, MonsterScorePix, NULL, pacmanPix, PacmanPix, point(), rect(), roomPix, RoomPix, w, and Widget.

void Painter::draw QRect  rect,
DrawWidget  where,
QPixmap  pix
 

Definition at line 270 of file painter.cpp.

References draw().

void Painter::draw QPoint  point,
DrawWidget  where,
QPixmap  pix
 

Definition at line 258 of file painter.cpp.

References backPix, BackPix, bitBlt(), roomPix, RoomPix, w, and Widget.

Referenced by draw(), Referee::introMonster(), Referee::introPaint(), and Referee::paintEvent().

void Painter::drawBrick int  pos  ) 
 

Definition at line 450 of file painter.cpp.

References bitBlt(), board, E, Board::isBrick(), Board::isOut(), Board::move(), N, NE, NW, rect(), roomPix, S, SE, SW, W, wallPix, and WallPix.

Referenced by initRoomPixmap().

void Painter::drawPoint int  pos  ) 
 

Definition at line 626 of file painter.cpp.

References bitBlt(), PointPix, pointPix, rect(), and roomPix.

Referenced by initRoomPixmap(), and Referee::introPlay().

void Painter::drawPrison int  pos  ) 
 

Definition at line 553 of file painter.cpp.

References bitBlt(), board, E, Board::isGate(), Board::isPrison(), Board::move(), N, NE, NW, prisonPix, PrisonPix, rect(), roomPix, S, SE, SW, and W.

Referenced by initRoomPixmap().

void Painter::erase int  pos,
PixMap  pix,
uint  i = 0
 

Definition at line 231 of file painter.cpp.

References backPix, bitBlt(), OUT, rect(), and roomPix.

Referenced by Referee::timerEvent().

void Painter::fillArray QArray< int > &  ,
QString  ,
int 
[protected]
 

Definition at line 700 of file painter.cpp.

References QString::find(), i, QString::left(), QString::length(), QString::remove(), and QString::toInt().

Referenced by confScoring().

void Painter::fillPixmapName QStrList  )  [protected]
 

Definition at line 747 of file painter.cpp.

References QString::append(), QPtrList< type >::at(), QPtrList< type >::count(), FIND_APP_DATA, i, QFileInfo::isFile(), QFileInfo::isReadable(), QString::left(), list, pixmapDirectory, and QFileInfo::setFile().

Referenced by confScheme().

void Painter::fillScoreString QStrList ,
QArray< int > & 
[protected]
 

Definition at line 672 of file painter.cpp.

References QString::data(), i, QString::insert(), and s.

Referenced by confScheme().

void Painter::fillStrList QStrList ,
QString  ,
int 
[protected]
 

Definition at line 724 of file painter.cpp.

References decodeHexOctString(), QString::find(), i, QString::isEmpty(), QString::left(), QString::length(), and QString::remove().

Referenced by confMisc(), and confScoring().

void Painter::initbackPixmaps  )  [protected]
 

Definition at line 427 of file painter.cpp.

References backgroundColor, backPix, BLACK, BlockHeight, BlockWidth, BoardHeight, and BoardWidth.

Referenced by confScheme(), and setLevel().

void Painter::initPixmaps  )  [protected]
 

Definition at line 357 of file painter.cpp.

References QPtrList< type >::at(), BlockHeight, BlockWidth, CYAN, dyingPix, dyingPixmapName, energizerPix, energizerPixmapName, eyesPix, eyesPixmapName, fruitPix, fruitPixmapName, fruitScorePix, fruitScorePixmapName, fruitScoreString, lastDyingPixmapName, lastEnergizerPixmapName, lastEyesPixmapName, lastFruitPixmapName, lastFruitScorePixmapName, lastMonsterPixmapName, lastMonsterScorePixmapName, lastPacmanPixmapName, lastPointPixmapName, lastPrisonPixmapName, lastWallPixmapName, level, loadPixmap(), monsterPix, monsterPixmapName, monsterScorePix, monsterScorePixmapName, monsterScoreString, pacmanPix, pacmanPixmapName, PINK, pointPix, pointPixmapName, prisonPix, prisonPixmapName, textPixmap(), w, wallPix, and wallPixmapName.

Referenced by confScheme(), and setLevel().

void Painter::initRoomPixmap  )  [protected]
 

Definition at line 435 of file painter.cpp.

References backPix, bitBlt(), BlockHeight, BlockWidth, board, BoardHeight, BoardWidth, drawBrick(), drawPoint(), drawPrison(), Board::isBrick(), Board::isGate(), Board::isPoint(), Board::isPrison(), roomPix, size, and Opie::MM::x.

Referenced by confScheme(), and setLevel().

QPixmap Painter::levelPix  )  [inline]
 

Definition at line 32 of file painter.h.

References roomPix.

Referenced by Referee::paintEvent(), Referee::Referee(), and Referee::setScheme().

QList< QPixmap > * Painter::loadPixmap QWidget *  parent,
QString  pixmapName,
QList< QPixmap > *  pixmaps = 0
[private]
 

Definition at line 56 of file painter.cpp.

References bitBlt(), QString::data(), height, NULL, printf, QString::replace(), TRUE, width, and Opie::MM::x.

Referenced by initPixmaps().

int Painter::maxPixmaps PixMap  pix  ) 
 

Definition at line 240 of file painter.cpp.

References dyingPix, DyingPix, energizerPix, EnergizerPix, eyesPix, EyesPix, fruitPix, FruitPix, fruitScorePix, FruitScorePix, monsterPix, MonsterPix, monsterScorePix, MonsterScorePix, pacmanPix, PacmanPix, pointPix, PointPix, prisonPix, PrisonPix, wallPix, and WallPix.

Referenced by Referee::initEnergizers(), Referee::initFruit(), Referee::initMonsters(), Referee::initPacman(), Referee::introMonster(), Referee::killedPlay(), Referee::paintEvent(), and Referee::setScheme().

QPoint Painter::point int  pos  )  [private]
 

Definition at line 137 of file painter.cpp.

References BlockHeight, BlockWidth, board, Board::x(), and Board::y().

Referenced by draw(), and rect().

QRect Painter::rect QRect  r1,
QRect  r2
 

Definition at line 220 of file painter.cpp.

References rect().

QRect Painter::rect int  pos,
QString  str,
int  align = QLabel::AlignCenter
 

Definition at line 190 of file painter.cpp.

References bitfont, Bitfont::height(), QString::length(), OUT, point(), Bitfont::rect(), rect(), and Bitfont::width().

QRect Painter::rect int  pos,
PixMap  pix,
uint  i = 0
 

Definition at line 143 of file painter.cpp.

References at(), checkRange(), dyingPix, DyingPix, energizerPix, EnergizerPix, eyesPix, EyesPix, fruitPix, FruitPix, fruitScorePix, FruitScorePix, monsterPix, MonsterPix, monsterScorePix, MonsterScorePix, NULL, OUT, pacmanPix, PacmanPix, point(), pointPix, PointPix, and wallPix.

Referenced by draw(), drawBrick(), drawPoint(), drawPrison(), Referee::eaten(), erase(), Referee::introMonster(), Referee::introPlay(), Referee::killedPlay(), Referee::levelUp(), Referee::levelUpPlay(), Referee::paintEvent(), Referee::pause(), Referee::play(), Referee::ready(), rect(), Referee::repaintFigures(), Referee::start(), and Referee::timerEvent().

void Painter::setLevel int  level = 0  ) 
 

Definition at line 943 of file painter.cpp.

References initbackPixmaps(), initPixmaps(), initRoomPixmap(), and level.

Referenced by Referee::demo(), Referee::intro(), Referee::levelUpPlay(), and Referee::play().

void Painter::setScheme int  scheme = -1,
int  mode = -1,
Bitfont font = 0
 

Definition at line 933 of file painter.cpp.

References bitfont, confScheme(), mode, and scheme.

Referenced by Referee::setScheme().

QList< QPixmap > * Painter::textPixmap QString  str,
QList< QPixmap > *  pixmaps = 0,
QColor  fg = BLACK,
QColor  bg = QColor()
[private]
 

Definition at line 117 of file painter.cpp.

References bitfont, NULL, Bitfont::text(), and TRUE.

QList< QPixmap > * Painter::textPixmap QStrList ,
QList< QPixmap > *  pixmaps = 0,
QColor  fg = BLACK,
QColor  bg = QColor()
[private]
 

Definition at line 98 of file painter.cpp.

References bitfont, NULL, s, Bitfont::text(), and TRUE.

Referenced by initPixmaps().


Member Data Documentation

QColor Painter::backgroundColor [private]
 

Definition at line 139 of file painter.h.

Referenced by initbackPixmaps().

QPixmap Painter::backPix [private]
 

Definition at line 136 of file painter.h.

Referenced by draw(), erase(), initbackPixmaps(), and initRoomPixmap().

Bitfont* Painter::bitfont [private]
 

Definition at line 77 of file painter.h.

Referenced by draw(), Painter(), rect(), setScheme(), and textPixmap().

int Painter::BlockHeight [private]
 

Definition at line 80 of file painter.h.

Referenced by initbackPixmaps(), initPixmaps(), initRoomPixmap(), and point().

int Painter::BlockWidth [private]
 

Definition at line 79 of file painter.h.

Referenced by initbackPixmaps(), initPixmaps(), initRoomPixmap(), and point().

Board* Painter::board [private]
 

Definition at line 76 of file painter.h.

Referenced by drawBrick(), drawPrison(), initRoomPixmap(), Painter(), and point().

QList<QPixmap>* Painter::dyingPix [private]
 

Definition at line 129 of file painter.h.

Referenced by draw(), initPixmaps(), maxPixmaps(), Painter(), and rect().

QStrList Painter::dyingPixmapName [private]
 

Definition at line 95 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().

QList<QPixmap>* Painter::energizerPix [private]
 

Definition at line 126 of file painter.h.

Referenced by draw(), initPixmaps(), maxPixmaps(), Painter(), and rect().

QStrList Painter::energizerPixmapName [private]
 

Definition at line 92 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().

QList<QPixmap>* Painter::eyesPix [private]
 

Definition at line 130 of file painter.h.

Referenced by draw(), initPixmaps(), maxPixmaps(), Painter(), and rect().

QStrList Painter::eyesPixmapName [private]
 

Definition at line 96 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().

QList<QPixmap>* Painter::fruitPix [private]
 

Definition at line 127 of file painter.h.

Referenced by draw(), initPixmaps(), maxPixmaps(), Painter(), and rect().

QStrList Painter::fruitPixmapName [private]
 

Definition at line 93 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().

QArray<int> Painter::fruitScore [private]
 

Definition at line 82 of file painter.h.

Referenced by confScheme(), and confScoring().

QList<QPixmap>* Painter::fruitScorePix [private]
 

Definition at line 132 of file painter.h.

Referenced by draw(), initPixmaps(), maxPixmaps(), Painter(), and rect().

QStrList Painter::fruitScorePixmapName [private]
 

Definition at line 98 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().

QStrList Painter::fruitScoreString [private]
 

Definition at line 83 of file painter.h.

Referenced by confScheme(), confScoring(), and initPixmaps().

QString Painter::lastDyingPixmapName [private]
 

Definition at line 107 of file painter.h.

Referenced by initPixmaps(), and Painter().

QString Painter::lastEnergizerPixmapName [private]
 

Definition at line 104 of file painter.h.

Referenced by initPixmaps(), and Painter().

QString Painter::lastEyesPixmapName [private]
 

Definition at line 108 of file painter.h.

Referenced by initPixmaps(), and Painter().

QString Painter::lastFruitPixmapName [private]
 

Definition at line 105 of file painter.h.

Referenced by initPixmaps(), and Painter().

QString Painter::lastFruitScorePixmapName [private]
 

Definition at line 110 of file painter.h.

Referenced by initPixmaps(), and Painter().

QString Painter::lastMonsterPixmapName [private]
 

Definition at line 109 of file painter.h.

Referenced by initPixmaps(), and Painter().

QString Painter::lastMonsterScorePixmapName [private]
 

Definition at line 111 of file painter.h.

Referenced by initPixmaps(), and Painter().

QString Painter::lastPacmanPixmapName [private]
 

Definition at line 106 of file painter.h.

Referenced by initPixmaps(), and Painter().

QString Painter::lastPointPixmapName [private]
 

Definition at line 101 of file painter.h.

Referenced by initPixmaps(), and Painter().

QString Painter::lastPrisonPixmapName [private]
 

Definition at line 103 of file painter.h.

Referenced by initPixmaps(), and Painter().

QString Painter::lastWallPixmapName [private]
 

Definition at line 102 of file painter.h.

Referenced by initPixmaps(), and Painter().

int Painter::level [private]
 

Definition at line 142 of file painter.h.

Referenced by initPixmaps(), Painter(), and setLevel().

int Painter::maxLevel [private]
 

Definition at line 141 of file painter.h.

Referenced by confLevels(), confMisc(), and confScoring().

int Painter::mode [private]
 

Definition at line 145 of file painter.h.

Referenced by confScheme(), Painter(), and setScheme().

QList<QPixmap>* Painter::monsterPix [private]
 

Definition at line 131 of file painter.h.

Referenced by draw(), initPixmaps(), maxPixmaps(), Painter(), and rect().

QStrList Painter::monsterPixmapName [private]
 

Definition at line 97 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().

QArray<int> Painter::monsterScore [private]
 

Definition at line 84 of file painter.h.

Referenced by confScheme(), and confScoring().

QList<QPixmap>* Painter::monsterScorePix [private]
 

Definition at line 133 of file painter.h.

Referenced by draw(), initPixmaps(), maxPixmaps(), Painter(), and rect().

QStrList Painter::monsterScorePixmapName [private]
 

Definition at line 99 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().

QStrList Painter::monsterScoreString [private]
 

Definition at line 85 of file painter.h.

Referenced by confScheme(), confScoring(), and initPixmaps().

QList<QPixmap>* Painter::pacmanPix [private]
 

Definition at line 128 of file painter.h.

Referenced by draw(), initPixmaps(), maxPixmaps(), Painter(), and rect().

QStrList Painter::pacmanPixmapName [private]
 

Definition at line 94 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().

QString Painter::pixmapDirectory [private]
 

Definition at line 87 of file painter.h.

Referenced by confMisc(), and fillPixmapName().

bool Painter::plainColor [private]
 

Definition at line 138 of file painter.h.

QList<QPixmap>* Painter::pointPix [private]
 

Definition at line 125 of file painter.h.

Referenced by drawPoint(), initPixmaps(), maxPixmaps(), Painter(), and rect().

QStrList Painter::pointPixmapName [private]
 

Definition at line 89 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().

QList<QPixmap>* Painter::prisonPix [private]
 

Definition at line 124 of file painter.h.

Referenced by drawPrison(), initPixmaps(), maxPixmaps(), and Painter().

QStrList Painter::prisonPixmapName [private]
 

Definition at line 91 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().

QPixmap Painter::roomPix [private]
 

Definition at line 135 of file painter.h.

Referenced by draw(), drawBrick(), drawPoint(), drawPrison(), erase(), initRoomPixmap(), and levelPix().

int Painter::scheme [private]
 

Definition at line 144 of file painter.h.

Referenced by confScheme(), Painter(), and setScheme().

QWidget* Painter::w [private]
 

Definition at line 75 of file painter.h.

Referenced by draw(), initPixmaps(), and Painter().

QList<QPixmap>* Painter::wallPix [private]
 

Definition at line 123 of file painter.h.

Referenced by drawBrick(), initPixmaps(), maxPixmaps(), Painter(), and rect().

QStrList Painter::wallPixmapName [private]
 

Definition at line 90 of file painter.h.

Referenced by confMisc(), confScheme(), and initPixmaps().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:44:16 2005 for OPIE by  doxygen 1.4.2