summaryrefslogtreecommitdiffstats
path: root/noatun/modules/kjofol-skin/kjseeker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'noatun/modules/kjofol-skin/kjseeker.cpp')
-rw-r--r--noatun/modules/kjofol-skin/kjseeker.cpp53
1 files changed, 24 insertions, 29 deletions
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;iy<y+ys; iy++)
{
for (int ix=x;ix<x+xs; ix++)
{
- QRgb checkmScale = mScale.pixel(ix, iy);
+ TQRgb checkmScale = mScale.pixel(ix, iy);
// am I transparent?
if (!isGray(checkmScale))
{
- setPixel1BPP(transmask, ix-x, iy-y, 0);
+ setPixel1BPP(transtqmask, ix-x, iy-y, 0);
continue;
}
- setPixel1BPP(transmask, ix-x, iy-y, 1);
+ setPixel1BPP(transtqmask, ix-x, iy-y, 1);
// what is the level
int level=grayRgb(checkmScale)+1;
if (level>255) 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; i<level; i++)
{
if (!barmodeImages[i])
barmodeImages[i]=new TQImage(xs,ys, 32);
- QRgb *l=(QRgb*)barmodeImages[i]->scanLine(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());
}