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/kjseeker.cpp | 53 +++++++++++++++------------------ 1 file changed, 24 insertions(+), 29 deletions(-) (limited to 'noatun/modules/kjofol-skin/kjseeker.cpp') diff --git a/noatun/modules/kjofol-skin/kjseeker.cpp b/noatun/modules/kjofol-skin/kjseeker.cpp index b9b441b1..0d30e506 100644 --- a/noatun/modules/kjofol-skin/kjseeker.cpp +++ b/noatun/modules/kjofol-skin/kjseeker.cpp @@ -22,62 +22,57 @@ KJSeeker::KJSeeker(const TQStringList &i, KJLoader *l) : KJWidget(l), g(0) { kdDebug(66666) << k_funcinfo << "No pressed background found for seeker," << " using default background!" << endl; - parent()->image(parser()["backgroundimage"][1]); + tqparent()->image(parser()["backgroundimage"][1]); } else - mActive = parent()->image(activeBg); + mActive = tqparent()->image(activeBg); - mScale = parent()->image(parser()["seekimage"][1]); - TQImage pixmapNoPress = parent()->image(parser()["backgroundimage"][1]); + mScale = tqparent()->image(parser()["seekimage"][1]); + TQImage pixmapNoPress = tqparent()->image(parser()["backgroundimage"][1]); - // generate transparent mask + // generate transparent tqmask int x, y, xs, ys; x=i[1].toInt(); y=i[2].toInt(); xs=i[3].toInt()-x; ys=i[4].toInt()-y; setRect(x,y,xs,ys); - TQImage transmask(xs, ys, 1, 2, TQImage::LittleEndian); -#if QT_VERSION < 0x030300 - transmask.setColor(0, qRgb(0,0,0)); - transmask.setColor(1, qRgb(255,255,255)); -#else - transmask.setColor(1, qRgb(0,0,0)); - transmask.setColor(0, qRgb(255,255,255)); -#endif + TQImage transtqmask(xs, ys, 1, 2, TQImage::LittleEndian); + transtqmask.setColor(1, tqRgb(0,0,0)); + transtqmask.setColor(0, tqRgb(255,255,255)); // clear the pointers memset(barmodeImages, 0, 256*sizeof(TQImage*)); memset(barmode, 0, 256*sizeof(TQPixmap*)); - // Now do the pixel føking + // Now do the pixel f�king // kdDebug(66666) << "creating Pixmaps for Seeker" << endl; for (int iy=y;iy255) level=255; // allocate the pixmap of the level proper // copy the color to the surface proper - QRgb activeColor=mActive.pixel(ix,iy); - QRgb inactiveColor=pixmapNoPress.pixel(ix,iy); + TQRgb activeColor=mActive.pixel(ix,iy); + TQRgb inactiveColor=pixmapNoPress.pixel(ix,iy); // set this pixel and everything before it for(int i=0; iscanLine(iy-y); + TQRgb *l=(TQRgb*)barmodeImages[i]->scanLine(iy-y); l[ix-x]=inactiveColor; } @@ -85,7 +80,7 @@ KJSeeker::KJSeeker(const TQStringList &i, KJLoader *l) : KJWidget(l), g(0) { if (!barmodeImages[level]) barmodeImages[level]=new TQImage(xs,ys, 32); - QRgb *l=(QRgb*)barmodeImages[level]->scanLine(iy-y); + TQRgb *l=(TQRgb*)barmodeImages[level]->scanLine(iy-y); l[ix-x]=activeColor; } while (level++<255); } @@ -94,10 +89,10 @@ KJSeeker::KJSeeker(const TQStringList &i, KJLoader *l) : KJWidget(l), g(0) // create the blank one barmode[0]=new TQPixmap(xs, ys); - TQPixmap px=parent()->pixmap(parser()["backgroundimage"][1]); - bitBlt(barmode[0], 0, 0, &px, x, y, xs, ys, Qt::CopyROP); - px.convertFromImage(transmask); - barModeMask=px; + TQPixmap px=tqparent()->pixmap(parser()["backgroundimage"][1]); + bitBlt(barmode[0], 0, 0, &px, x, y, xs, ys, TQt::CopyROP); + px.convertFromImage(transtqmask); + barModeMask=TQBitmap(px); // kdDebug(66666) << "END KJSeeker constructor" << endl; } @@ -135,7 +130,7 @@ void KJSeeker::paint(TQPainter *p, const TQRect &) TQPixmap *pixmap = toPixmap(g); pixmap->setMask(barModeMask); bitBlt(p->device(), rect().topLeft().x(), rect().topLeft().y(), - pixmap, 0, 0, rect().width(), rect().height(), Qt::CopyROP); + pixmap, 0, 0, rect().width(), rect().height(), TQt::CopyROP); } bool KJSeeker::mousePress(const TQPoint &pos) @@ -154,14 +149,14 @@ void KJSeeker::mouseRelease(const TQPoint &pos, bool in) if(!mScale.valid(x, y)) return; - QRgb color=mScale.pixel(x, y); + TQRgb color=mScale.pixel(x, y); // user released mousebutton outside of the seeker-area (which is gray) if ( (!isGray(color)) || (!in) ) return; g = grayRgb(color); - repaint(); + tqrepaint(); // kdDebug(66666) << "length : " << napp->player()->getLength() << endl; // kdDebug(66666) << "skip to: " << ((long long)g*(long long)napp->player()->getLength())/255 << endl; @@ -185,7 +180,7 @@ void KJSeeker::timeUpdate(int sec) g = sec * 255 / length; //kdDebug(66666) << "sec: " << sec << " len: " << length << " g: " << g << endl; - TQPainter p(parent()); + TQPainter p(tqparent()); paint(&p, rect()); } -- cgit v1.2.1