From b1057f437bf65300831a0ccb45b920787c6b318d Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 06:00:15 +0000 Subject: TQt4 port kdemultimedia This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1236079 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- noatun/modules/kjofol-skin/kjfont.cpp | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'noatun/modules/kjofol-skin/kjfont.cpp') diff --git a/noatun/modules/kjofol-skin/kjfont.cpp b/noatun/modules/kjofol-skin/kjfont.cpp index c6b16b77..cf82fa43 100644 --- a/noatun/modules/kjofol-skin/kjfont.cpp +++ b/noatun/modules/kjofol-skin/kjfont.cpp @@ -23,9 +23,9 @@ * KJFont *******************************************/ -KJFont::KJFont(const TQString &prefix, KJLoader *parent) : mTextMask(0), mTransparentRGB(0) +KJFont::KJFont(const TQString &prefix, KJLoader *tqparent) : mTextMask(0), mTransparentRGB(0) { -// kdDebug(66666) << "KJFont::KJFont(const TQString &prefix, KJLoader *parent)" << prefix.latin1() << endl; +// kdDebug(66666) << "KJFont::KJFont(const TQString &prefix, KJLoader *tqparent)" << prefix.latin1() << endl; if (prefix=="timefont") { @@ -47,12 +47,12 @@ KJFont::KJFont(const TQString &prefix, KJLoader *parent) : mTextMask(0), mTransp mNullChar=' '; } - mText = parent->pixmap(parent->item(prefix+"image")[1]); + mText = tqparent->pixmap(tqparent->item(prefix+"image")[1]); - if ( parent->exist(prefix+"size") ) + if ( tqparent->exist(prefix+"size") ) { - mWidth = parent->item(prefix+"size")[1].toInt(); - mHeight = parent->item(prefix+"size")[2].toInt(); + mWidth = tqparent->item(prefix+"size")[1].toInt(); + mHeight = tqparent->item(prefix+"size")[2].toInt(); } else // try to load the font even we are missing important settings { // this still can cause crashes! @@ -73,13 +73,13 @@ KJFont::KJFont(const TQString &prefix, KJLoader *parent) : mTextMask(0), mTransp mHeight = mText.height(); // Stupid Skin authors tend to forget keys :/ - if ( parent->exist(prefix+"spacing") ) - mSpacing = parent->item(prefix+"spacing")[1].toInt(); + if ( tqparent->exist(prefix+"spacing") ) + mSpacing = tqparent->item(prefix+"spacing")[1].toInt(); else mSpacing = 0; // FIXME: What's default for this in kjöfol??? - if ( parent->exist(prefix+"transparent") ) - mTransparent = (bool)parent->item(prefix+"transparent")[1].toInt(); + if ( tqparent->exist(prefix+"transparent") ) + mTransparent = (bool)tqparent->item(prefix+"transparent")[1].toInt(); else mTransparent = true; // transparency seems to be default in kjöfol @@ -88,7 +88,7 @@ KJFont::KJFont(const TQString &prefix, KJLoader *parent) : mTextMask(0), mTransp { TQImage ibackground = mText.convertToImage(); mTransparentRGB = ibackground.pixel( ibackground.width()-1, ibackground.height()-1 ); -// kdDebug(66666) << "color (" << qRed(mTransparentRGB) << "," << qGreen(mTransparentRGB) << "," << qBlue(mTransparentRGB) << ") will be transparent for " << prefix.latin1() << endl; +// kdDebug(66666) << "color (" << tqRed(mTransparentRGB) << "," << tqGreen(mTransparentRGB) << "," << tqBlue(mTransparentRGB) << ") will be transparent for " << prefix.latin1() << endl; mTextMask = KJWidget::getMask(ibackground,mTransparentRGB); } @@ -153,8 +153,8 @@ TQPixmap KJFont::drawSysFont(const TQCString &s, int wide, const TQPoint &pos) c TQBitmap regionMask( (stringWidth > wide ? stringWidth : wide), - mHeight, true); // fully transparent mask - TQPainter mp(®ionMask); // mask painter + mHeight, true); // fully transparent tqmask + TQPainter mp(®ionMask); // tqmask painter // kdDebug(66666) << "region; w=" << region.width() << ", h=" << region.height() << endl; @@ -163,25 +163,25 @@ TQPixmap KJFont::drawSysFont(const TQCString &s, int wide, const TQPoint &pos) c if ( stringWidth < wide ) { freeSpace = wide - stringWidth; - mp.fillRect ( to.x(), 0, (freeSpace/2), mHeight, Qt::color0 ); + mp.fillRect ( to.x(), 0, (freeSpace/2), mHeight, TQt::color0 ); to += TQPoint ( (freeSpace/2), 0 ); // kdDebug(66666) << "centering text, freeSpace=" << freeSpace << endl; } rp.setFont(sysFont); rp.setPen(sysFontColor); - rp.drawText(to.x(), to.y(), region.width()-freeSpace, mHeight, Qt::AlignLeft|Qt::AlignTop, string); + rp.drawText(to.x(), to.y(), region.width()-freeSpace, mHeight, TQt::AlignLeft|TQt::AlignTop, string); mp.setFont(sysFont); - mp.setPen(Qt::color1); - mp.drawText(to.x(), to.y(), region.width()-freeSpace, mHeight, Qt::AlignLeft|Qt::AlignTop, string); + mp.setPen(TQt::color1); + mp.drawText(to.x(), to.y(), region.width()-freeSpace, mHeight, TQt::AlignLeft|TQt::AlignTop, string); to += TQPoint(region.width()-freeSpace,0); // kdDebug(66666) << "text width=" << region.width()-freeSpace << endl; if (freeSpace > 0) { - mp.fillRect ( to.x(), 0, (freeSpace/2), mHeight, Qt::color0 ); + mp.fillRect ( to.x(), 0, (freeSpace/2), mHeight, TQt::color0 ); to += TQPoint ( (freeSpace/2), 0 ); // kdDebug(66666) << "centering text, freeSpace=" << freeSpace << endl; } @@ -206,8 +206,8 @@ TQPixmap KJFont::drawPixmapFont(const TQCString &str, int wide, const TQPoint &p TQBitmap regionMask( (string.length()*mWidth+string.length()*mSpacing > (unsigned int)wide ? string.length()*mWidth+string.length()*mSpacing : wide), - mHeight, true); // fully transparent mask - TQPainter mask( ®ionMask ); + mHeight, true); // fully transparent tqmask + TQPainter tqmask( ®ionMask ); // kdDebug(66666) << "draw: {" << str << "}" << endl; @@ -216,7 +216,7 @@ TQPixmap KJFont::drawPixmapFont(const TQCString &str, int wide, const TQPoint &p if ( string.length()*mWidth+string.length()*mSpacing < (unsigned int)wide ) { freeSpace = wide - string.length()*mWidth+string.length()*mSpacing; - mask.fillRect ( to.x(), 0, (freeSpace/2), mHeight, Qt::color0 ); + tqmask.fillRect ( to.x(), 0, (freeSpace/2), mHeight, TQt::color0 ); to += TQPoint ( (freeSpace/2), 0 ); } @@ -234,14 +234,14 @@ TQPixmap KJFont::drawPixmapFont(const TQCString &str, int wide, const TQPoint &p // draw according to "spacing" if ( (charPos < string.length()-1) && mSpacing > 0 ) { // make the spacing-area transparent - mask.fillRect ( to.x(), 0, mSpacing, mHeight, Qt::color0 ); + tqmask.fillRect ( to.x(), 0, mSpacing, mHeight, TQt::color0 ); to += TQPoint ( mSpacing, 0 ); } } if (freeSpace > 0) { - mask.fillRect ( to.x(), 0, (freeSpace/2), mHeight, Qt::color0 ); + tqmask.fillRect ( to.x(), 0, (freeSpace/2), mHeight, TQt::color0 ); to += TQPoint ( (freeSpace/2), 0 ); } @@ -258,17 +258,17 @@ void KJFont::drawCharacter(TQPixmap *dev, TQBitmap *devMask, const TQPoint &to, int xs=mWidth; int ys=mHeight; - bitBlt(dev, to, &mText, TQRect(x,y,xs,ys), Qt::CopyROP); + bitBlt(dev, to, &mText, TQRect(x,y,xs,ys), TQt::CopyROP); - // bitBlt mask for transparency + // bitBlt tqmask for transparency if ( mTransparent ) { - bitBlt(devMask, to, &mTextMask, TQRect(x,y,xs,ys), Qt::OrROP); + bitBlt(devMask, to, &mTextMask, TQRect(x,y,xs,ys), TQt::OrROP); } - else // fill mask + else // fill tqmask { TQPainter tempPainter (devMask); - tempPainter.fillRect ( to.x(), 0, xs,ys, Qt::color1 ); + tempPainter.fillRect ( to.x(), 0, xs,ys, TQt::color1 ); } } -- cgit v1.2.1