diff options
Diffstat (limited to 'kstyles/keramik/pixmaploader.cpp')
-rw-r--r-- | kstyles/keramik/pixmaploader.cpp | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/kstyles/keramik/pixmaploader.cpp b/kstyles/keramik/pixmaploader.cpp index 3013c8277..01cdf5fc6 100644 --- a/kstyles/keramik/pixmaploader.cpp +++ b/kstyles/keramik/pixmaploader.cpp @@ -69,13 +69,13 @@ TQImage* PixmapLoader::getDisabled(int name, const TQColor& color, const TQColor //OK, now, fill it in, using the color.. - TQ_UINT32 r, g,b; - TQ_UINT32 i = tqGray(color.rgb()); + Q_UINT32 r, g,b; + Q_UINT32 i = qGray(color.rgb()); r = (3*color.red()+i)>>2; g = (3*color.green()+i)>>2; b = (3*color.blue()+i)>>2; - TQ_UINT32 br = back.red(), bg = back.green(), bb = back.blue(); + Q_UINT32 br = back.red(), bg = back.green(), bb = back.blue(); if (edata->haveAlpha) @@ -83,21 +83,21 @@ TQImage* PixmapLoader::getDisabled(int name, const TQColor& color, const TQColor if (blend) { img->setAlphaBuffer(false); - TQ_UINT32* write = reinterpret_cast< TQ_UINT32* >(img->bits() ); + Q_UINT32* write = reinterpret_cast< Q_UINT32* >(img->bits() ); int size = img->width()*img->height() * 3; for (int pos = 0; pos < size; pos+=3) { - TQ_UINT32 scale = edata->data[pos]; - TQ_UINT32 add = (edata->data[pos+1]*i+127)>>8; - TQ_UINT32 alpha = edata->data[pos+2]; - TQ_UINT32 destAlpha = 256 - alpha; + Q_UINT32 scale = edata->data[pos]; + Q_UINT32 add = (edata->data[pos+1]*i+127)>>8; + Q_UINT32 alpha = edata->data[pos+2]; + Q_UINT32 destAlpha = 256 - alpha; - TQ_UINT32 rr = clamp[((r*scale+127)>>8) + add]; - TQ_UINT32 rg = clamp[((g*scale+127)>>8) + add]; - TQ_UINT32 rb = clamp[((b*scale+127)>>8) + add]; + Q_UINT32 rr = clamp[((r*scale+127)>>8) + add]; + Q_UINT32 rg = clamp[((g*scale+127)>>8) + add]; + Q_UINT32 rb = clamp[((b*scale+127)>>8) + add]; - *write =tqRgb(((rr*alpha+127)>>8) + ((br*destAlpha+127)>>8), + *write =qRgb(((rr*alpha+127)>>8) + ((br*destAlpha+127)>>8), ((rg*alpha+127)>>8) + ((bg*destAlpha+127)>>8), ((rb*alpha+127)>>8) + ((bb*destAlpha+127)>>8)); @@ -107,20 +107,20 @@ TQImage* PixmapLoader::getDisabled(int name, const TQColor& color, const TQColor else { img->setAlphaBuffer(true); - TQ_UINT32* write = reinterpret_cast< TQ_UINT32* >(img->bits() ); + Q_UINT32* write = reinterpret_cast< Q_UINT32* >(img->bits() ); int size = img->width()*img->height() * 3; for (int pos = 0; pos < size; pos+=3) { - TQ_UINT32 scale = edata->data[pos]; - TQ_UINT32 add = (edata->data[pos+1]*i+127)>>8; - TQ_UINT32 alpha = edata->data[pos+2]; + Q_UINT32 scale = edata->data[pos]; + Q_UINT32 add = (edata->data[pos+1]*i+127)>>8; + Q_UINT32 alpha = edata->data[pos+2]; - TQ_UINT32 rr = clamp[((r*scale+127)>>8) + add]; - TQ_UINT32 rg = clamp[((g*scale+127)>>8) + add]; - TQ_UINT32 rb = clamp[((b*scale+127)>>8) + add]; + Q_UINT32 rr = clamp[((r*scale+127)>>8) + add]; + Q_UINT32 rg = clamp[((g*scale+127)>>8) + add]; + Q_UINT32 rb = clamp[((b*scale+127)>>8) + add]; - *write =tqRgba(rr, rg, rb, alpha); + *write =qRgba(rr, rg, rb, alpha); write++; } @@ -130,17 +130,17 @@ TQImage* PixmapLoader::getDisabled(int name, const TQColor& color, const TQColor else { img->setAlphaBuffer(false); - TQ_UINT32* write = reinterpret_cast< TQ_UINT32* >(img->bits() ); + Q_UINT32* write = reinterpret_cast< Q_UINT32* >(img->bits() ); int size = img->width()*img->height() * 2; for (int pos = 0; pos < size; pos+=2) { - TQ_UINT32 scale = edata->data[pos]; - TQ_UINT32 add = (edata->data[pos+1]*i+127)>>8; - TQ_UINT32 rr = clamp[((r*scale+127)>>8) + add]; - TQ_UINT32 rg = clamp[((g*scale+127)>>8) + add]; - TQ_UINT32 rb = clamp[((b*scale+127)>>8) + add]; - *write =tqRgb(rr, rg, rb); + Q_UINT32 scale = edata->data[pos]; + Q_UINT32 add = (edata->data[pos+1]*i+127)>>8; + Q_UINT32 rr = clamp[((r*scale+127)>>8) + add]; + Q_UINT32 rg = clamp[((g*scale+127)>>8) + add]; + Q_UINT32 rb = clamp[((b*scale+127)>>8) + add]; + *write =qRgb(rr, rg, rb); write++; } } @@ -158,14 +158,14 @@ TQImage* PixmapLoader::getColored(int name, const TQColor& color, const TQColor& TQImage* img = new TQImage(edata->width, edata->height, 32); //OK, now, fill it in, using the color.. - TQ_UINT32 r, g,b; + Q_UINT32 r, g,b; r = color.red() + 2; g = color.green() + 2; b = color.blue() + 2; -// int i = tqGray(color.rgb()); +// int i = qGray(color.rgb()); - TQ_UINT32 br = back.red(), bg = back.green(), bb = back.blue(); + Q_UINT32 br = back.red(), bg = back.green(), bb = back.blue(); if (edata->haveAlpha) { @@ -173,23 +173,23 @@ TQImage* PixmapLoader::getColored(int name, const TQColor& color, const TQColor& { img->setAlphaBuffer(false); - TQ_UINT32* write = reinterpret_cast< TQ_UINT32* >(img->bits() ); + Q_UINT32* write = reinterpret_cast< Q_UINT32* >(img->bits() ); int size = img->width()*img->height() * 3; for (int pos = 0; pos < size; pos+=3) { - TQ_UINT32 scale = edata->data[pos]; - TQ_UINT32 add = edata->data[pos+1]; - TQ_UINT32 alpha = edata->data[pos+2]; - TQ_UINT32 destAlpha = 256 - alpha; + Q_UINT32 scale = edata->data[pos]; + Q_UINT32 add = edata->data[pos+1]; + Q_UINT32 alpha = edata->data[pos+2]; + Q_UINT32 destAlpha = 256 - alpha; if (scale != 0) add = add*5/4; - TQ_UINT32 rr = clamp[((r*scale+127)>>8) + add]; - TQ_UINT32 rg = clamp[((g*scale+127)>>8) + add]; - TQ_UINT32 rb = clamp[((b*scale+127)>>8) + add]; + Q_UINT32 rr = clamp[((r*scale+127)>>8) + add]; + Q_UINT32 rg = clamp[((g*scale+127)>>8) + add]; + Q_UINT32 rb = clamp[((b*scale+127)>>8) + add]; - *write =tqRgb(((rr*alpha+127)>>8) + ((br*destAlpha+127)>>8), + *write =qRgb(((rr*alpha+127)>>8) + ((br*destAlpha+127)>>8), ((rg*alpha+127)>>8) + ((bg*destAlpha+127)>>8), ((rb*alpha+127)>>8) + ((bb*destAlpha+127)>>8)); @@ -200,22 +200,22 @@ TQImage* PixmapLoader::getColored(int name, const TQColor& color, const TQColor& { img->setAlphaBuffer(true); - TQ_UINT32* write = reinterpret_cast< TQ_UINT32* >(img->bits() ); + Q_UINT32* write = reinterpret_cast< Q_UINT32* >(img->bits() ); int size = img->width()*img->height() * 3; for (int pos = 0; pos < size; pos+=3) { - TQ_UINT32 scale = edata->data[pos]; - TQ_UINT32 add = edata->data[pos+1]; - TQ_UINT32 alpha = edata->data[pos+2]; + Q_UINT32 scale = edata->data[pos]; + Q_UINT32 add = edata->data[pos+1]; + Q_UINT32 alpha = edata->data[pos+2]; if (scale != 0) add = add*5/4; - TQ_UINT32 rr = clamp[((r*scale+127)>>8) + add]; - TQ_UINT32 rg = clamp[((g*scale+127)>>8) + add]; - TQ_UINT32 rb = clamp[((b*scale+127)>>8) + add]; + Q_UINT32 rr = clamp[((r*scale+127)>>8) + add]; + Q_UINT32 rg = clamp[((g*scale+127)>>8) + add]; + Q_UINT32 rb = clamp[((b*scale+127)>>8) + add]; - *write =tqRgba(rr, rg, rb, alpha); + *write =qRgba(rr, rg, rb, alpha); write++; } } @@ -224,22 +224,22 @@ TQImage* PixmapLoader::getColored(int name, const TQColor& color, const TQColor& { img->setAlphaBuffer(false); - TQ_UINT32* write = reinterpret_cast< TQ_UINT32* >(img->bits() ); + Q_UINT32* write = reinterpret_cast< Q_UINT32* >(img->bits() ); int size = img->width()*img->height() * 2; for (int pos = 0; pos < size; pos+=2) { - TQ_UINT32 scale = edata->data[pos]; - TQ_UINT32 add = edata->data[pos+1]; + Q_UINT32 scale = edata->data[pos]; + Q_UINT32 add = edata->data[pos+1]; if (scale != 0) add = add*5/4; - TQ_UINT32 rr = clamp[((r*scale+127)>>8) + add]; - TQ_UINT32 rg = clamp[((g*scale+127)>>8) + add]; - TQ_UINT32 rb = clamp[((b*scale+127)>>8) + add]; + Q_UINT32 rr = clamp[((r*scale+127)>>8) + add]; + Q_UINT32 rg = clamp[((g*scale+127)>>8) + add]; + Q_UINT32 rb = clamp[((b*scale+127)>>8) + add]; - *write =tqRgb(rr, rg, rb); + *write =qRgb(rr, rg, rb); write++; } } @@ -260,7 +260,7 @@ TQPixmap PixmapLoader::scale( int name, int width, int height, const TQColor& co int key = entry.key(); - if ((cacheEntry = m_pixmapCache.tqfind(key, true))) + if ((cacheEntry = m_pixmapCache.find(key, true))) { if (entry == *cacheEntry) //True match! return *cacheEntry->m_pixmap; @@ -422,12 +422,12 @@ void TilePainter::draw( TQPainter *p, int x, int y, int width, int height, const } else { - const TQBitmap* tqmask = scale( col, row, w, h, color, bg, disabled, false ).tqmask(); - if (tqmask) + const TQBitmap* mask = scale( col, row, w, h, color, bg, disabled, false ).mask(); + if (mask) { p->setBackgroundColor(Qt::color0); p->setPen(Qt::color1); - p->drawTiledPixmap( xpos, ypos, realW, realH, *tqmask); + p->drawTiledPixmap( xpos, ypos, realW, realH, *mask); } else p->fillRect ( xpos, ypos, realW, realH, Qt::color1); @@ -442,12 +442,12 @@ void TilePainter::draw( TQPainter *p, int x, int y, int width, int height, const } else { - const TQBitmap* tqmask = tile( col, row, color, bg, disabled, false ).tqmask(); - if (tqmask) + const TQBitmap* mask = tile( col, row, color, bg, disabled, false ).mask(); + if (mask) { p->setBackgroundColor(Qt::color0); p->setPen(Qt::color1); - p->drawTiledPixmap( xpos, ypos, realW, realH, *tqmask); + p->drawTiledPixmap( xpos, ypos, realW, realH, *mask); } else p->fillRect ( xpos, ypos, realW, realH, Qt::color1); @@ -626,4 +626,4 @@ int SpinBoxPainter::tileName( unsigned int column, unsigned int ) const } // vim: ts=4 sw=4 noet -// kate: indent-width 4; tqreplace-tabs off; tab-width 4; space-indent off; +// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off; |