summaryrefslogtreecommitdiffstats
path: root/kdefx
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-13 08:32:36 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-13 08:32:36 +0000
commitf7e71d47719ab6094cf4a9fafffa5ea351973522 (patch)
tree30834aa632d442019e14f88685001d94657d060b /kdefx
parentb31cfd9a1ee986fe2ae9a693f3afd7f171dd897c (diff)
downloadtdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.tar.gz
tdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.zip
Initial conversion for TQt for Qt4 3.4.0 TP2
This will also compile with TQt for Qt3, and should not cause any problems with dependent modules such as kdebase. If it does then it needs to be fixed! git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1214149 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdefx')
-rw-r--r--kdefx/kdrawutil.cpp10
-rw-r--r--kdefx/kdrawutil.h2
-rw-r--r--kdefx/kimageeffect.cpp592
-rw-r--r--kdefx/kpixmap.cpp48
-rw-r--r--kdefx/kpixmap.h2
-rw-r--r--kdefx/kpixmapeffect.cpp4
-rw-r--r--kdefx/kstyle.cpp185
-rw-r--r--kdefx/kstyle.h51
8 files changed, 447 insertions, 447 deletions
diff --git a/kdefx/kdrawutil.cpp b/kdefx/kdrawutil.cpp
index 0fccb94f1..83fe7d300 100644
--- a/kdefx/kdrawutil.cpp
+++ b/kdefx/kdrawutil.cpp
@@ -143,21 +143,21 @@ KDEFX_EXPORT void kDrawRoundButton(TQPainter *p, int x, int y, int w, int h,
kDrawRoundButton(p, r, g, sunken);
}
-#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2)
+#define QCOORDARRLEN(x) sizeof(x)/(sizeof(TQCOORD)*2)
KDEFX_EXPORT void kDrawRoundMask(TQPainter *p, int x, int y, int w, int h, bool clear)
{
// round edge fills
- static const QCOORD btm_left_fill[]={ 0,0,1,0,2,0,3,0,4,0,0,1,1,1,2,1,3,1,4,1,
+ static const TQCOORD btm_left_fill[]={ 0,0,1,0,2,0,3,0,4,0,0,1,1,1,2,1,3,1,4,1,
1,2,2,2,3,2,4,2,2,3,3,3,4,3,3,4,4,4 };
- static const QCOORD btm_right_fill[]={ 0,0,1,0,2,0,3,0,4,0,0,1,1,1,2,1,3,1,4,
+ static const TQCOORD btm_right_fill[]={ 0,0,1,0,2,0,3,0,4,0,0,1,1,1,2,1,3,1,4,
1,0,2,1,2,2,2,3,2,0,3,1,3,2,3,0,4,1,4 };
- static const QCOORD top_left_fill[]={ 3,0,4,0,2,1,3,1,4,1,1,2,2,2,3,2,4,2,0,3,
+ static const TQCOORD top_left_fill[]={ 3,0,4,0,2,1,3,1,4,1,1,2,2,2,3,2,4,2,0,3,
1,3,2,3,3,3,4,3,0,4,1,4,2,4,3,4,4,4 };
- static const QCOORD top_right_fill[]={ 0,0,1,0,0,1,1,1,2,1,0,2,1,2,2,2,3,2,0,
+ static const TQCOORD top_right_fill[]={ 0,0,1,0,0,1,1,1,2,1,0,2,1,2,2,2,3,2,0,
3,1,3,2,3,3,3,4,3,0,4,1,4,2,4,3,4,4,4 };
if(clear)
diff --git a/kdefx/kdrawutil.h b/kdefx/kdrawutil.h
index 27be8ac58..6aa0f3c44 100644
--- a/kdefx/kdrawutil.h
+++ b/kdefx/kdrawutil.h
@@ -125,7 +125,7 @@ KDEFX_EXPORT void kRoundMaskRegion(TQRegion &r, int x, int y, int w, int h);
* @c \#include @c <kdrawutil.h>
*
* Paints the pixels covered by a round button of the given size with
- * Qt::color1. This function is useful in TQStyle::drawControlMask().
+ * Qt::color1. This function is useful in TQStyle::tqdrawControlMask().
*
* @param p The painter to use for drawing the button.
* @param x The X coordinate of the button.
diff --git a/kdefx/kimageeffect.cpp b/kdefx/kimageeffect.cpp
index eee05b497..80b3c3e68 100644
--- a/kdefx/kimageeffect.cpp
+++ b/kdefx/kimageeffect.cpp
@@ -84,9 +84,9 @@ inline const T& fxClamp( const T& x, const T& low, const T& high )
static inline unsigned int intensityValue(unsigned int color)
{
- return((unsigned int)((0.299*qRed(color) +
- 0.587*qGreen(color) +
- 0.1140000000000001*qBlue(color))));
+ return((unsigned int)((0.299*tqRed(color) +
+ 0.587*tqGreen(color) +
+ 0.1140000000000001*tqBlue(color))));
}
template<typename T>
@@ -164,7 +164,7 @@ TQImage KImageEffect::gradient(const TQSize &size, const TQColor &ca,
gl += gcdelta;
bl += bcdelta;
- rgb = qRgb( (rl>>16), (gl>>16), (bl>>16) );
+ rgb = tqRgb( (rl>>16), (gl>>16), (bl>>16) );
for( x = 0; x < size.width(); x++ ) {
*p = rgb;
@@ -188,7 +188,7 @@ TQImage KImageEffect::gradient(const TQSize &size, const TQColor &ca,
gl += gcdelta;
bl += bcdelta;
- *src++ = qRgb( (rl>>16), (gl>>16), (bl>>16));
+ *src++ = tqRgb( (rl>>16), (gl>>16), (bl>>16));
}
src = o_src;
@@ -253,7 +253,7 @@ TQImage KImageEffect::gradient(const TQSize &size, const TQColor &ca,
for (y = 0; y < size.height(); y++) {
unsigned int *scanline = (unsigned int *)image.scanLine(y);
for (x = 0; x < size.width(); x++) {
- scanline[x] = qRgb(xtable[0][x] + ytable[0][y],
+ scanline[x] = tqRgb(xtable[0][x] + ytable[0][y],
xtable[1][x] + ytable[1][y],
xtable[2][x] + ytable[2][y]);
}
@@ -310,12 +310,12 @@ TQImage KImageEffect::gradient(const TQSize &size, const TQColor &ca,
for (x = 0; x < w; x++, x2--) {
unsigned int rgb = 0;
if (eff == PyramidGradient) {
- rgb = qRgb(rcb-rSign*(xtable[0][x]+ytable[0][y]),
+ rgb = tqRgb(rcb-rSign*(xtable[0][x]+ytable[0][y]),
gcb-gSign*(xtable[1][x]+ytable[1][y]),
bcb-bSign*(xtable[2][x]+ytable[2][y]));
}
if (eff == RectangleGradient) {
- rgb = qRgb(rcb - rSign *
+ rgb = tqRgb(rcb - rSign *
QMAX(xtable[0][x], ytable[0][y]) * 2,
gcb - gSign *
QMAX(xtable[1][x], ytable[1][y]) * 2,
@@ -323,7 +323,7 @@ TQImage KImageEffect::gradient(const TQSize &size, const TQColor &ca,
QMAX(xtable[2][x], ytable[2][y]) * 2);
}
if (eff == PipeCrossGradient) {
- rgb = qRgb(rcb - rSign *
+ rgb = tqRgb(rcb - rSign *
QMIN(xtable[0][x], ytable[0][y]) * 2,
gcb - gSign *
QMIN(xtable[1][x], ytable[1][y]) * 2,
@@ -331,7 +331,7 @@ TQImage KImageEffect::gradient(const TQSize &size, const TQColor &ca,
QMIN(xtable[2][x], ytable[2][y]) * 2);
}
if (eff == EllipticGradient) {
- rgb = qRgb(rcb - rSign *
+ rgb = tqRgb(rcb - rSign *
(int)sqrt((xtable[0][x]*xtable[0][x] +
ytable[0][y]*ytable[0][y])*2.0),
gcb - gSign *
@@ -360,7 +360,7 @@ TQImage KImageEffect::gradient(const TQSize &size, const TQColor &ca,
if (ncols && (TQPixmap::defaultDepth() < 15 )) {
if ( ncols < 2 || ncols > 256 )
ncols = 3;
- TQColor *dPal = new QColor[ncols];
+ TQColor *dPal = new TQColor[ncols];
for (int i=0; i<ncols; i++) {
dPal[i].setRgb ( rca + rDiff * i / ( ncols - 1 ),
gca + gDiff * i / ( ncols - 1 ),
@@ -463,7 +463,7 @@ TQImage KImageEffect::unbalancedGradient(const TQSize &size, const TQColor &ca,
dir = _xanti ? x : size.width() - 1 - x;
rat = 1 - exp( - (float)x * xbal );
- src[dir] = qRgb(rcb - (int) ( rDiff * rat ),
+ src[dir] = tqRgb(rcb - (int) ( rDiff * rat ),
gcb - (int) ( gDiff * rat ),
bcb - (int) ( bDiff * rat ));
}
@@ -516,7 +516,7 @@ TQImage KImageEffect::unbalancedGradient(const TQSize &size, const TQColor &ca,
for (y = 0; y < h; y++) {
unsigned int *scanline = (unsigned int *)image.scanLine(y);
for (x = 0; x < w; x++) {
- scanline[x] = qRgb(rcb - (xtable[0][x] + ytable[0][y]),
+ scanline[x] = tqRgb(rcb - (xtable[0][x] + ytable[0][y]),
gcb - (xtable[1][x] + ytable[1][y]),
bcb - (xtable[2][x] + ytable[2][y]));
}
@@ -558,13 +558,13 @@ TQImage KImageEffect::unbalancedGradient(const TQSize &size, const TQColor &ca,
for (x = 0; x < w; x++) {
if (eff == PyramidGradient)
{
- scanline[x] = qRgb(rcb-rSign*(xtable[0][x]+ytable[0][y]),
+ scanline[x] = tqRgb(rcb-rSign*(xtable[0][x]+ytable[0][y]),
gcb-gSign*(xtable[1][x]+ytable[1][y]),
bcb-bSign*(xtable[2][x]+ytable[2][y]));
}
else if (eff == RectangleGradient)
{
- scanline[x] = qRgb(rcb - rSign *
+ scanline[x] = tqRgb(rcb - rSign *
QMAX(xtable[0][x], ytable[0][y]) * 2,
gcb - gSign *
QMAX(xtable[1][x], ytable[1][y]) * 2,
@@ -573,7 +573,7 @@ TQImage KImageEffect::unbalancedGradient(const TQSize &size, const TQColor &ca,
}
else if (eff == PipeCrossGradient)
{
- scanline[x] = qRgb(rcb - rSign *
+ scanline[x] = tqRgb(rcb - rSign *
QMIN(xtable[0][x], ytable[0][y]) * 2,
gcb - gSign *
QMIN(xtable[1][x], ytable[1][y]) * 2,
@@ -582,7 +582,7 @@ TQImage KImageEffect::unbalancedGradient(const TQSize &size, const TQColor &ca,
}
else if (eff == EllipticGradient)
{
- scanline[x] = qRgb(rcb - rSign *
+ scanline[x] = tqRgb(rcb - rSign *
(int)sqrt((xtable[0][x]*xtable[0][x] +
ytable[0][y]*ytable[0][y])*2.0),
gcb - gSign *
@@ -599,7 +599,7 @@ TQImage KImageEffect::unbalancedGradient(const TQSize &size, const TQColor &ca,
if (ncols && (TQPixmap::defaultDepth() < 15 )) {
if ( ncols < 2 || ncols > 256 )
ncols = 3;
- TQColor *dPal = new QColor[ncols];
+ TQColor *dPal = new TQColor[ncols];
for (int i=0; i<ncols; i++) {
dPal[i].setRgb ( rca + rDiff * i / ( ncols - 1 ),
gca + gDiff * i / ( ncols - 1 ),
@@ -628,12 +628,12 @@ namespace {
struct KIE4Pack
{
- Q_UINT16 data[4];
+ TQ_UINT16 data[4];
};
struct KIE8Pack
{
- Q_UINT16 data[8];
+ TQ_UINT16 data[8];
};
}
@@ -675,7 +675,7 @@ TQImage& KImageEffect::intensity(TQImage &image, float percent)
if(haveMMX)
{
- Q_UINT16 p = Q_UINT16(256.0f*(percent));
+ TQ_UINT16 p = TQ_UINT16(256.0f*(percent));
KIE4Pack mult = {{p,p,p,0}};
__asm__ __volatile__(
@@ -685,7 +685,7 @@ TQImage& KImageEffect::intensity(TQImage &image, float percent)
unsigned int rem = pixels % 4;
pixels -= rem;
- Q_UINT32 *end = ( data + pixels );
+ TQ_UINT32 *end = ( data + pixels );
if (brighten)
{
@@ -815,26 +815,26 @@ TQImage& KImageEffect::intensity(TQImage &image, float percent)
if(brighten){ // same here
for(int i=0; i < pixels; ++i){
- int r = qRed(data[i]);
- int g = qGreen(data[i]);
- int b = qBlue(data[i]);
- int a = qAlpha(data[i]);
+ int r = tqRed(data[i]);
+ int g = tqGreen(data[i]);
+ int b = tqBlue(data[i]);
+ int a = tqAlpha(data[i]);
r = r + segTbl[r] > 255 ? 255 : r + segTbl[r];
g = g + segTbl[g] > 255 ? 255 : g + segTbl[g];
b = b + segTbl[b] > 255 ? 255 : b + segTbl[b];
- data[i] = qRgba(r, g, b,a);
+ data[i] = tqRgba(r, g, b,a);
}
}
else{
for(int i=0; i < pixels; ++i){
- int r = qRed(data[i]);
- int g = qGreen(data[i]);
- int b = qBlue(data[i]);
- int a = qAlpha(data[i]);
+ int r = tqRed(data[i]);
+ int g = tqGreen(data[i]);
+ int b = tqBlue(data[i]);
+ int a = tqAlpha(data[i]);
r = r - segTbl[r] < 0 ? 0 : r - segTbl[r];
g = g - segTbl[g] < 0 ? 0 : g - segTbl[g];
b = b - segTbl[b] < 0 ? 0 : b - segTbl[b];
- data[i] = qRgba(r, g, b, a);
+ data[i] = tqRgba(r, g, b, a);
}
}
delete [] segTbl;
@@ -883,23 +883,23 @@ TQImage& KImageEffect::channelIntensity(TQImage &image, float percent,
if(brighten){ // same here
if(channel == Red){ // and here ;-)
for(int i=0; i < pixels; ++i){
- int c = qRed(data[i]);
+ int c = tqRed(data[i]);
c = c + segTbl[c] > 255 ? 255 : c + segTbl[c];
- data[i] = qRgba(c, qGreen(data[i]), qBlue(data[i]), qAlpha(data[i]));
+ data[i] = tqRgba(c, tqGreen(data[i]), tqBlue(data[i]), tqAlpha(data[i]));
}
}
else if(channel == Green){
for(int i=0; i < pixels; ++i){
- int c = qGreen(data[i]);
+ int c = tqGreen(data[i]);
c = c + segTbl[c] > 255 ? 255 : c + segTbl[c];
- data[i] = qRgba(qRed(data[i]), c, qBlue(data[i]), qAlpha(data[i]));
+ data[i] = tqRgba(tqRed(data[i]), c, tqBlue(data[i]), tqAlpha(data[i]));
}
}
else{
for(int i=0; i < pixels; ++i){
- int c = qBlue(data[i]);
+ int c = tqBlue(data[i]);
c = c + segTbl[c] > 255 ? 255 : c + segTbl[c];
- data[i] = qRgba(qRed(data[i]), qGreen(data[i]), c, qAlpha(data[i]));
+ data[i] = tqRgba(tqRed(data[i]), tqGreen(data[i]), c, tqAlpha(data[i]));
}
}
@@ -907,23 +907,23 @@ TQImage& KImageEffect::channelIntensity(TQImage &image, float percent,
else{
if(channel == Red){
for(int i=0; i < pixels; ++i){
- int c = qRed(data[i]);
+ int c = tqRed(data[i]);
c = c - segTbl[c] < 0 ? 0 : c - segTbl[c];
- data[i] = qRgba(c, qGreen(data[i]), qBlue(data[i]), qAlpha(data[i]));
+ data[i] = tqRgba(c, tqGreen(data[i]), tqBlue(data[i]), tqAlpha(data[i]));
}
}
else if(channel == Green){
for(int i=0; i < pixels; ++i){
- int c = qGreen(data[i]);
+ int c = tqGreen(data[i]);
c = c - segTbl[c] < 0 ? 0 : c - segTbl[c];
- data[i] = qRgba(qRed(data[i]), c, qBlue(data[i]), qAlpha(data[i]));
+ data[i] = tqRgba(tqRed(data[i]), c, tqBlue(data[i]), tqAlpha(data[i]));
}
}
else{
for(int i=0; i < pixels; ++i){
- int c = qBlue(data[i]);
+ int c = tqBlue(data[i]);
c = c - segTbl[c] < 0 ? 0 : c - segTbl[c];
- data[i] = qRgba(qRed(data[i]), qGreen(data[i]), c, qAlpha(data[i]));
+ data[i] = tqRgba(tqRed(data[i]), tqGreen(data[i]), c, tqAlpha(data[i]));
}
}
}
@@ -982,22 +982,22 @@ TQImage& KImageEffect::modulate(TQImage &image, TQImage &modImage, bool reverse,
color1 = *data1;
if (type == Intensity || type == Contrast) {
- r = qRed(color1);
- g = qGreen(color1);
- b = qBlue(color1);
+ r = tqRed(color1);
+ g = tqGreen(color1);
+ b = tqBlue(color1);
if (channel != All) {
- mod = (channel == Red) ? qRed(color2) :
- (channel == Green) ? qGreen(color2) :
- (channel == Blue) ? qBlue(color2) :
- (channel == Gray) ? qGray(color2) : 0;
+ mod = (channel == Red) ? tqRed(color2) :
+ (channel == Green) ? tqGreen(color2) :
+ (channel == Blue) ? tqBlue(color2) :
+ (channel == Gray) ? tqGray(color2) : 0;
mod = mod*factor/50;
}
if (type == Intensity) {
if (channel == All) {
- r += r * factor/50 * qRed(color2)/256;
- g += g * factor/50 * qGreen(color2)/256;
- b += b * factor/50 * qBlue(color2)/256;
+ r += r * factor/50 * tqRed(color2)/256;
+ g += g * factor/50 * tqGreen(color2)/256;
+ b += b * factor/50 * tqBlue(color2)/256;
}
else {
r += r * mod/256;
@@ -1007,9 +1007,9 @@ TQImage& KImageEffect::modulate(TQImage &image, TQImage &modImage, bool reverse,
}
else { // Contrast
if (channel == All) {
- r += (r-128) * factor/50 * qRed(color2)/128;
- g += (g-128) * factor/50 * qGreen(color2)/128;
- b += (b-128) * factor/50 * qBlue(color2)/128;
+ r += (r-128) * factor/50 * tqRed(color2)/128;
+ g += (g-128) * factor/50 * tqGreen(color2)/128;
+ b += (b-128) * factor/50 * tqBlue(color2)/128;
}
else {
r += (r-128) * mod/128;
@@ -1021,16 +1021,16 @@ TQImage& KImageEffect::modulate(TQImage &image, TQImage &modImage, bool reverse,
if (r<0) r=0; if (r>255) r=255;
if (g<0) g=0; if (g>255) g=255;
if (b<0) b=0; if (b>255) b=255;
- a = qAlpha(*data1);
- *data1 = qRgba(r, g, b, a);
+ a = tqAlpha(*data1);
+ *data1 = tqRgba(r, g, b, a);
}
else if (type == Saturation || type == HueShift) {
clr.setRgb(color1);
clr.hsv(&h, &s, &v);
- mod = (channel == Red) ? qRed(color2) :
- (channel == Green) ? qGreen(color2) :
- (channel == Blue) ? qBlue(color2) :
- (channel == Gray) ? qGray(color2) : 0;
+ mod = (channel == Red) ? tqRed(color2) :
+ (channel == Green) ? tqGreen(color2) :
+ (channel == Blue) ? tqBlue(color2) :
+ (channel == Gray) ? tqGray(color2) : 0;
mod = mod*factor/50;
if (type == Saturation) {
@@ -1044,7 +1044,7 @@ TQImage& KImageEffect::modulate(TQImage &image, TQImage &modImage, bool reverse,
}
clr.setHsv(h, s, v);
- a = qAlpha(*data1);
+ a = tqAlpha(*data1);
*data1 = clr.rgb() | ((uint)(a & 0xff) << 24);
}
data1++; data2++; data2b++; x++;
@@ -1083,14 +1083,14 @@ TQImage& KImageEffect::blend(const TQColor& clr, TQImage& dst, float opacity)
#ifdef USE_SSE2_INLINE_ASM
if ( KCPUInfo::haveExtension( KCPUInfo::IntelSSE2 ) && pixels > 16 ) {
- Q_UINT16 alpha = Q_UINT16( ( 1.0 - opacity ) * 256.0 );
+ TQ_UINT16 alpha = TQ_UINT16( ( 1.0 - opacity ) * 256.0 );
KIE8Pack packedalpha = { { alpha, alpha, alpha, 256,
alpha, alpha, alpha, 256 } };
- Q_UINT16 red = Q_UINT16( clr.red() * 256 * opacity );
- Q_UINT16 green = Q_UINT16( clr.green() * 256 * opacity );
- Q_UINT16 blue = Q_UINT16( clr.blue() * 256 * opacity );
+ TQ_UINT16 red = TQ_UINT16( clr.red() * 256 * opacity );
+ TQ_UINT16 green = TQ_UINT16( clr.green() * 256 * opacity );
+ TQ_UINT16 blue = TQ_UINT16( clr.blue() * 256 * opacity );
KIE8Pack packedcolor = { { blue, green, red, 0,
blue, green, red, 0 } };
@@ -1103,10 +1103,10 @@ TQImage& KImageEffect::blend(const TQColor& clr, TQImage& dst, float opacity)
: : "r"(&packedalpha), "r"(&packedcolor),
"m"(packedcolor), "m"(packedalpha) );
- Q_UINT32 *data = reinterpret_cast<Q_UINT32*>( dst.bits() );
+ TQ_UINT32 *data = reinterpret_cast<TQ_UINT32*>( dst.bits() );
- // Check how many pixels we need to process to achieve 16 byte alignment
- int offset = (16 - (Q_UINT32( data ) & 0x0f)) / 4;
+ // Check how many pixels we need to process to achieve 16 byte tqalignment
+ int offset = (16 - (TQ_UINT32( data ) & 0x0f)) / 4;
// The main loop processes 8 pixels / iteration
int remainder = (pixels - offset) % 8;
@@ -1188,12 +1188,12 @@ TQImage& KImageEffect::blend(const TQColor& clr, TQImage& dst, float opacity)
#ifdef USE_MMX_INLINE_ASM
if ( KCPUInfo::haveExtension( KCPUInfo::IntelMMX ) && pixels > 1 ) {
- Q_UINT16 alpha = Q_UINT16( ( 1.0 - opacity ) * 256.0 );
+ TQ_UINT16 alpha = TQ_UINT16( ( 1.0 - opacity ) * 256.0 );
KIE4Pack packedalpha = { { alpha, alpha, alpha, 256 } };
- Q_UINT16 red = Q_UINT16( clr.red() * 256 * opacity );
- Q_UINT16 green = Q_UINT16( clr.green() * 256 * opacity );
- Q_UINT16 blue = Q_UINT16( clr.blue() * 256 * opacity );
+ TQ_UINT16 red = TQ_UINT16( clr.red() * 256 * opacity );
+ TQ_UINT16 green = TQ_UINT16( clr.green() * 256 * opacity );
+ TQ_UINT16 blue = TQ_UINT16( clr.blue() * 256 * opacity );
KIE4Pack packedcolor = { { blue, green, red, 0 } };
@@ -1203,7 +1203,7 @@ TQImage& KImageEffect::blend(const TQColor& clr, TQImage& dst, float opacity)
"movq (%1), %%mm5\n\t" // Set up color * alpha * 256 in MM5
: : "r"(&packedalpha), "r"(&packedcolor), "m"(packedcolor), "m"(packedalpha) );
- Q_UINT32 *data = reinterpret_cast<Q_UINT32*>( dst.bits() );
+ TQ_UINT32 *data = reinterpret_cast<TQ_UINT32*>( dst.bits() );
// The main loop processes 4 pixels / iteration
int remainder = pixels % 4;
@@ -1333,7 +1333,7 @@ TQImage& KImageEffect::blend(TQImage& src, TQImage& dst, float opacity)
#ifdef USE_SSE2_INLINE_ASM
if ( KCPUInfo::haveExtension( KCPUInfo::IntelSSE2 ) && pixels > 16 ) {
- Q_UINT16 alpha = Q_UINT16( opacity * 256.0 );
+ TQ_UINT16 alpha = TQ_UINT16( opacity * 256.0 );
KIE8Pack packedalpha = { { alpha, alpha, alpha, 0,
alpha, alpha, alpha, 0 } };
@@ -1343,11 +1343,11 @@ TQImage& KImageEffect::blend(TQImage& src, TQImage& dst, float opacity)
"movdqu (%0), %%xmm6\n\t" // Set up alpha * 256 in XMM6
: : "r"(&packedalpha), "m"(packedalpha) );
- Q_UINT32 *data1 = reinterpret_cast<Q_UINT32*>( src.bits() );
- Q_UINT32 *data2 = reinterpret_cast<Q_UINT32*>( dst.bits() );
+ TQ_UINT32 *data1 = reinterpret_cast<TQ_UINT32*>( src.bits() );
+ TQ_UINT32 *data2 = reinterpret_cast<TQ_UINT32*>( dst.bits() );
- // Check how many pixels we need to process to achieve 16 byte alignment
- int offset = (16 - (Q_UINT32( data2 ) & 0x0f)) / 4;
+ // Check how many pixels we need to process to achieve 16 byte tqalignment
+ int offset = (16 - (TQ_UINT32( data2 ) & 0x0f)) / 4;
// The main loop processes 4 pixels / iteration
int remainder = (pixels - offset) % 4;
@@ -1428,7 +1428,7 @@ TQImage& KImageEffect::blend(TQImage& src, TQImage& dst, float opacity)
#ifdef USE_MMX_INLINE_ASM
if ( KCPUInfo::haveExtension( KCPUInfo::IntelMMX ) && pixels > 1 ) {
- Q_UINT16 alpha = Q_UINT16( opacity * 256.0 );
+ TQ_UINT16 alpha = TQ_UINT16( opacity * 256.0 );
KIE4Pack packedalpha = { { alpha, alpha, alpha, 0 } };
// Prepare the MM6 and MM7 registers for blending and unpacking
@@ -1437,8 +1437,8 @@ TQImage& KImageEffect::blend(TQImage& src, TQImage& dst, float opacity)
"movq (%0), %%mm6\n\t" // Set up alpha * 256 in MM6
: : "r"(&packedalpha), "m"(packedalpha) );
- Q_UINT32 *data1 = reinterpret_cast<Q_UINT32*>( src.bits() );
- Q_UINT32 *data2 = reinterpret_cast<Q_UINT32*>( dst.bits() );
+ TQ_UINT32 *data1 = reinterpret_cast<TQ_UINT32*>( src.bits() );
+ TQ_UINT32 *data2 = reinterpret_cast<TQ_UINT32*>( dst.bits() );
// The main loop processes 2 pixels / iteration
int remainder = pixels % 2;
@@ -1602,17 +1602,17 @@ TQImage& KImageEffect::blend(TQImage &image, float initial_intensity,
for (x = xi; x < (int)xf ; x++) {
if (eff == HorizontalGradient) intensity += var;
ind = x + ind_base;
- r = qRed (data[ind]) + (int)(intensity *
- (r_bgnd - qRed (data[ind])));
- g = qGreen(data[ind]) + (int)(intensity *
- (g_bgnd - qGreen(data[ind])));
- b = qBlue (data[ind]) + (int)(intensity *
- (b_bgnd - qBlue (data[ind])));
+ r = tqRed (data[ind]) + (int)(intensity *
+ (r_bgnd - tqRed (data[ind])));
+ g = tqGreen(data[ind]) + (int)(intensity *
+ (g_bgnd - tqGreen(data[ind])));
+ b = tqBlue (data[ind]) + (int)(intensity *
+ (b_bgnd - tqBlue (data[ind])));
if (r > 255) r = 255; if (r < 0 ) r = 0;
if (g > 255) g = 255; if (g < 0 ) g = 0;
if (b > 255) b = 255; if (b < 0 ) b = 0;
- a = qAlpha(data[ind]);
- data[ind] = qRgba(r, g, b, a);
+ a = tqAlpha(data[ind]);
+ data[ind] = tqRgba(r, g, b, a);
}
}
}
@@ -1627,17 +1627,17 @@ TQImage& KImageEffect::blend(TQImage &image, float initial_intensity,
for (y = 0; y < image_height ; y++) {
intensity = initial_intensity + tmp + yvar * y;
- r = qRed (data[ind]) + (int)(intensity *
- (r_bgnd - qRed (data[ind])));
- g = qGreen(data[ind]) + (int)(intensity *
- (g_bgnd - qGreen(data[ind])));
- b = qBlue (data[ind]) + (int)(intensity *
- (b_bgnd - qBlue (data[ind])));
+ r = tqRed (data[ind]) + (int)(intensity *
+ (r_bgnd - tqRed (data[ind])));
+ g = tqGreen(data[ind]) + (int)(intensity *
+ (g_bgnd - tqGreen(data[ind])));
+ b = tqBlue (data[ind]) + (int)(intensity *
+ (b_bgnd - tqBlue (data[ind])));
if (r > 255) r = 255; if (r < 0 ) r = 0;
if (g > 255) g = 255; if (g < 0 ) g = 0;
if (b > 255) b = 255; if (b < 0 ) b = 0;
- a = qAlpha(data[ind]);
- data[ind] = qRgba(r, g, b, a);
+ a = tqAlpha(data[ind]);
+ data[ind] = tqRgba(r, g, b, a);
ind += image_width;
}
@@ -1662,31 +1662,31 @@ TQImage& KImageEffect::blend(TQImage &image, float initial_intensity,
//NW
ind = x + image_width * y ;
- r = qRed (data[ind]) + (int)(intensity *
- (r_bgnd - qRed (data[ind])));
- g = qGreen(data[ind]) + (int)(intensity *
- (g_bgnd - qGreen(data[ind])));
- b = qBlue (data[ind]) + (int)(intensity *
- (b_bgnd - qBlue (data[ind])));
+ r = tqRed (data[ind]) + (int)(intensity *
+ (r_bgnd - tqRed (data[ind])));
+ g = tqGreen(data[ind]) + (int)(intensity *
+ (g_bgnd - tqGreen(data[ind])));
+ b = tqBlue (data[ind]) + (int)(intensity *
+ (b_bgnd - tqBlue (data[ind])));
if (r > 255) r = 255; if (r < 0 ) r = 0;
if (g > 255) g = 255; if (g < 0 ) g = 0;
if (b > 255) b = 255; if (b < 0 ) b = 0;
- a = qAlpha(data[ind]);
- data[ind] = qRgba(r, g, b, a);
+ a = tqAlpha(data[ind]);
+ data[ind] = tqRgba(r, g, b, a);
//NE
ind = image_width - x - 1 + image_width * y ;
- r = qRed (data[ind]) + (int)(intensity *
- (r_bgnd - qRed (data[ind])));
- g = qGreen(data[ind]) + (int)(intensity *
- (g_bgnd - qGreen(data[ind])));
- b = qBlue (data[ind]) + (int)(intensity *
- (b_bgnd - qBlue (data[ind])));
+ r = tqRed (data[ind]) + (int)(intensity *
+ (r_bgnd - tqRed (data[ind])));
+ g = tqGreen(data[ind]) + (int)(intensity *
+ (g_bgnd - tqGreen(data[ind])));
+ b = tqBlue (data[ind]) + (int)(intensity *
+ (b_bgnd - tqBlue (data[ind])));
if (r > 255) r = 255; if (r < 0 ) r = 0;
if (g > 255) g = 255; if (g < 0 ) g = 0;
if (b > 255) b = 255; if (b < 0 ) b = 0;
- a = qAlpha(data[ind]);
- data[ind] = qRgba(r, g, b, a);
+ a = tqAlpha(data[ind]);
+ data[ind] = tqRgba(r, g, b, a);
}
}
@@ -1706,31 +1706,31 @@ TQImage& KImageEffect::blend(TQImage &image, float initial_intensity,
//SW
ind = x + image_width * (image_height - y -1) ;
- r = qRed (data[ind]) + (int)(intensity *
- (r_bgnd - qRed (data[ind])));
- g = qGreen(data[ind]) + (int)(intensity *
- (g_bgnd - qGreen(data[ind])));
- b = qBlue (data[ind]) + (int)(intensity *
- (b_bgnd - qBlue (data[ind])));
+ r = tqRed (data[ind]) + (int)(intensity *
+ (r_bgnd - tqRed (data[ind])));
+ g = tqGreen(data[ind]) + (int)(intensity *
+ (g_bgnd - tqGreen(data[ind])));
+ b = tqBlue (data[ind]) + (int)(intensity *
+ (b_bgnd - tqBlue (data[ind])));
if (r > 255) r = 255; if (r < 0 ) r = 0;
if (g > 255) g = 255; if (g < 0 ) g = 0;
if (b > 255) b = 255; if (b < 0 ) b = 0;
- a = qAlpha(data[ind]);
- data[ind] = qRgba(r, g, b, a);
+ a = tqAlpha(data[ind]);
+ data[ind] = tqRgba(r, g, b, a);
//SE
ind = image_width-x-1 + image_width * (image_height - y - 1) ;
- r = qRed (data[ind]) + (int)(intensity *
- (r_bgnd - qRed (data[ind])));
- g = qGreen(data[ind]) + (int)(intensity *
- (g_bgnd - qGreen(data[ind])));
- b = qBlue (data[ind]) + (int)(intensity *
- (b_bgnd - qBlue (data[ind])));
+ r = tqRed (data[ind]) + (int)(intensity *
+ (r_bgnd - tqRed (data[ind])));
+ g = tqGreen(data[ind]) + (int)(intensity *
+ (g_bgnd - tqGreen(data[ind])));
+ b = tqBlue (data[ind]) + (int)(intensity *
+ (b_bgnd - tqBlue (data[ind])));
if (r > 255) r = 255; if (r < 0 ) r = 0;
if (g > 255) g = 255; if (g < 0 ) g = 0;
if (b > 255) b = 255; if (b < 0 ) b = 0;
- a = qAlpha(data[ind]);
- data[ind] = qRgba(r, g, b, a);
+ a = tqAlpha(data[ind]);
+ data[ind] = tqRgba(r, g, b, a);
}
}
}
@@ -1809,16 +1809,16 @@ TQImage& KImageEffect::blend(TQImage &image1, TQImage &image2,
while(x < (int)x1) {
color3 = (colorTable3) ? colorTable3[data3b[ind3]] : data3[ind3];
- a = (channel == Red) ? qRed(color3) :
- (channel == Green) ? qGreen(color3) :
- (channel == Blue) ? qBlue(color3) : qGray(color3);
+ a = (channel == Red) ? tqRed(color3) :
+ (channel == Green) ? tqGreen(color3) :
+ (channel == Blue) ? tqBlue(color3) : tqGray(color3);
- r = (a*qRed(data1[ind1]) + (256-a)*qRed(data2[ind2]))/256;
- g = (a*qGreen(data1[ind1]) + (256-a)*qGreen(data2[ind2]))/256;
- b = (a*qBlue(data1[ind1]) + (256-a)*qBlue(data2[ind2]))/256;
+ r = (a*tqRed(data1[ind1]) + (256-a)*tqRed(data2[ind2]))/256;
+ g = (a*tqGreen(data1[ind1]) + (256-a)*tqGreen(data2[ind2]))/256;
+ b = (a*tqBlue(data1[ind1]) + (256-a)*tqBlue(data2[ind2]))/256;
- a = qAlpha(data1[ind1]);
- data1[ind1] = qRgba(r, g, b, a);
+ a = tqAlpha(data1[ind1]);
+ data1[ind1] = tqRgba(r, g, b, a);
ind1++; ind2++; ind3++; x++;
if ( (x%x2) ==0) ind2 -= x2;
@@ -1837,13 +1837,13 @@ TQImage& KImageEffect::blend(TQImage &image1, TQImage &image2,
unsigned int KImageEffect::lHash(unsigned int c)
{
- unsigned char r = qRed(c), g = qGreen(c), b = qBlue(c), a = qAlpha(c);
+ unsigned char r = tqRed(c), g = tqGreen(c), b = tqBlue(c), a = tqAlpha(c);
unsigned char nr, ng, nb;
nr =(r >> 1) + (r >> 2); nr = nr > r ? 0 : nr;
ng =(g >> 1) + (g >> 2); ng = ng > g ? 0 : ng;
nb =(b >> 1) + (b >> 2); nb = nb > b ? 0 : nb;
- return qRgba(nr, ng, nb, a);
+ return tqRgba(nr, ng, nb, a);
}
@@ -1851,13 +1851,13 @@ unsigned int KImageEffect::lHash(unsigned int c)
unsigned int KImageEffect::uHash(unsigned int c)
{
- unsigned char r = qRed(c), g = qGreen(c), b = qBlue(c), a = qAlpha(c);
+ unsigned char r = tqRed(c), g = tqGreen(c), b = tqBlue(c), a = tqAlpha(c);
unsigned char nr, ng, nb;
nr = r + (r >> 3); nr = nr < r ? ~0 : nr;
ng = g + (g >> 3); ng = ng < g ? ~0 : ng;
nb = b + (b >> 3); nb = nb < b ? ~0 : nb;
- return qRgba(nr, ng, nb, a);
+ return tqRgba(nr, ng, nb, a);
}
@@ -1969,7 +1969,7 @@ TQImage& KImageEffect::flatten(TQImage &img, const TQColor &ca,
// pseudocolor
for (int i = 0; i < img.numColors(); i++) {
col = img.color(i);
- int mean = (qRed(col) + qGreen(col) + qBlue(col)) / 3;
+ int mean = (tqRed(col) + tqGreen(col) + tqBlue(col)) / 3;
min = QMIN(min, mean);
max = QMAX(max, mean);
}
@@ -1978,7 +1978,7 @@ TQImage& KImageEffect::flatten(TQImage &img, const TQColor &ca,
for (int y=0; y < img.height(); y++)
for (int x=0; x < img.width(); x++) {
col = img.pixel(x, y);
- int mean = (qRed(col) + qGreen(col) + qBlue(col)) / 3;
+ int mean = (tqRed(col) + tqGreen(col) + tqBlue(col)) / 3;
min = QMIN(min, mean);
max = QMAX(max, mean);
}
@@ -1994,21 +1994,21 @@ TQImage& KImageEffect::flatten(TQImage &img, const TQColor &ca,
if (img.numColors()) {
for (int i=0; i < img.numColors(); i++) {
col = img.color(i);
- int mean = (qRed(col) + qGreen(col) + qBlue(col)) / 3;
+ int mean = (tqRed(col) + tqGreen(col) + tqBlue(col)) / 3;
int r = (int) (sr * (mean - min) + r1 + 0.5);
int g = (int) (sg * (mean - min) + g1 + 0.5);
int b = (int) (sb * (mean - min) + b1 + 0.5);
- img.setColor(i, qRgba(r, g, b, qAlpha(col)));
+ img.setColor(i, tqRgba(r, g, b, tqAlpha(col)));
}
} else {
for (int y=0; y < img.height(); y++)
for (int x=0; x < img.width(); x++) {
col = img.pixel(x, y);
- int mean = (qRed(col) + qGreen(col) + qBlue(col)) / 3;
+ int mean = (tqRed(col) + tqGreen(col) + tqBlue(col)) / 3;
int r = (int) (sr * (mean - min) + r1 + 0.5);
int g = (int) (sg * (mean - min) + g1 + 0.5);
int b = (int) (sb * (mean - min) + b1 + 0.5);
- img.setPixel(x, y, qRgba(r, g, b, qAlpha(col)));
+ img.setPixel(x, y, tqRgba(r, g, b, tqAlpha(col)));
}
}
@@ -2020,7 +2020,7 @@ TQImage& KImageEffect::flatten(TQImage &img, const TQColor &ca,
if (ncols == 1) ncols++;
if (ncols > 256) ncols = 256;
- TQColor *pal = new QColor[ncols];
+ TQColor *pal = new TQColor[ncols];
sr = ((float) r2 - r1) / (ncols - 1);
sg = ((float) g2 - g1) / (ncols - 1);
sb = ((float) b2 - b1) / (ncols - 1);
@@ -2065,7 +2065,7 @@ TQImage& KImageEffect::fade(TQImage &img, float val, const TQColor &color)
// pseudo color
for (int i=0; i<img.numColors(); i++) {
col = img.color(i);
- cr = qRed(col); cg = qGreen(col); cb = qBlue(col);
+ cr = tqRed(col); cg = tqGreen(col); cb = tqBlue(col);
if (cr > red)
r = cr - tbl[cr - red];
else
@@ -2078,7 +2078,7 @@ TQImage& KImageEffect::fade(TQImage &img, float val, const TQColor &color)
b = cb - tbl[cb - blue];
else
b = cb + tbl[blue - cb];
- img.setColor(i, qRgba(r, g, b, qAlpha(col)));
+ img.setColor(i, tqRgba(r, g, b, tqAlpha(col)));
}
} else {
@@ -2087,7 +2087,7 @@ TQImage& KImageEffect::fade(TQImage &img, float val, const TQColor &color)
QRgb *data = (QRgb *) img.scanLine(y);
for (int x=0; x<img.width(); x++) {
col = *data;
- cr = qRed(col); cg = qGreen(col); cb = qBlue(col);
+ cr = tqRed(col); cg = tqGreen(col); cb = tqBlue(col);
if (cr > red)
r = cr - tbl[cr - red];
else
@@ -2100,7 +2100,7 @@ TQImage& KImageEffect::fade(TQImage &img, float val, const TQColor &color)
b = cb - tbl[cb - blue];
else
b = cb + tbl[blue - cb];
- *data++ = qRgba(r, g, b, qAlpha(col));
+ *data++ = tqRgba(r, g, b, tqAlpha(col));
}
}
}
@@ -2116,7 +2116,7 @@ TQImage& KImageEffect::fade(TQImage &img, float val, const TQColor &color)
// This code is adapted from code (C) Rik Hemsley <rik@kde.org>
//
-// The formula used (r + b + g) /3 is different from the qGray formula
+// The formula used (r + b + g) /3 is different from the tqGray formula
// used by Qt. This is because our formula is much much faster. If,
// however, it turns out that this is producing sub-optimal images,
// then it will have to change (kurt)
@@ -2149,12 +2149,12 @@ TQImage& KImageEffect::toGray(TQImage &img, bool fast)
{
for (int i = 0; i < img.numColors(); i++)
{
- register uint r = qRed(img.color(i));
- register uint g = qGreen(img.color(i));
- register uint b = qBlue(img.color(i));
+ register uint r = tqRed(img.color(i));
+ register uint g = tqGreen(img.color(i));
+ register uint b = tqBlue(img.color(i));
register uint gray = (((r + g) >> 1) + b) >> 1;
- img.setColor(i, qRgba(gray, gray, gray, qAlpha(img.color(i))));
+ img.setColor(i, tqRgba(gray, gray, gray, tqAlpha(img.color(i))));
}
}
}
@@ -2165,8 +2165,8 @@ TQImage& KImageEffect::toGray(TQImage &img, bool fast)
(unsigned int *)img.tqcolorTable();
int val, i;
for(i=0; i < pixels; ++i){
- val = qGray(data[i]);
- data[i] = qRgba(val, val, val, qAlpha(data[i]));
+ val = tqGray(data[i]);
+ data[i] = tqRgba(val, val, val, tqAlpha(data[i]));
}
}
return img;
@@ -2211,10 +2211,10 @@ TQImage& KImageEffect::contrast(TQImage &img, int c)
(unsigned int *)img.tqcolorTable();
int i, r, g, b;
for(i=0; i < pixels; ++i){
- r = qRed(data[i]);
- g = qGreen(data[i]);
- b = qBlue(data[i]);
- if(qGray(data[i]) <= 127){
+ r = tqRed(data[i]);
+ g = tqGreen(data[i]);
+ b = tqBlue(data[i]);
+ if(tqGray(data[i]) <= 127){
if(r - c > 0)
r -= c;
else
@@ -2242,7 +2242,7 @@ TQImage& KImageEffect::contrast(TQImage &img, int c)
else
b = 255;
}
- data[i] = qRgba(r, g, b, qAlpha(data[i]));
+ data[i] = tqRgba(r, g, b, tqAlpha(data[i]));
}
return(img);
}
@@ -2290,11 +2290,11 @@ TQImage& KImageEffect::dither(TQImage &img, const TQColor *palette, int size)
for ( i = 0; i < img.width(); i++ )
{
- rerr1[i] = rerr2[i] + qRed( *ip );
+ rerr1[i] = rerr2[i] + tqRed( *ip );
rerr2[i] = 0;
- gerr1[i] = gerr2[i] + qGreen( *ip );
+ gerr1[i] = gerr2[i] + tqGreen( *ip );
gerr2[i] = 0;
- berr1[i] = berr2[i] + qBlue( *ip );
+ berr1[i] = berr2[i] + tqBlue( *ip );
berr2[i] = 0;
ip++;
}
@@ -2404,8 +2404,8 @@ bool KImageEffect::blend(
do {
- i = upper.scanLine(row);
- o = output.scanLine(row);
+ i = const_cast<TQImage&>(upper).scanLine(row);
+ o = const_cast<TQImage&>(output).scanLine(row);
col = w << 2;
--col;
@@ -2484,15 +2484,15 @@ bool KImageEffect::blend(
register int j,k;
for (j=0; j<ch; j++)
{
- b=reinterpret_cast<QRgb *>(&lower.scanLine(y+j) [ (x+cw) << 2 ]);
- i=reinterpret_cast<QRgb *>(&upper.scanLine(cy+j)[ (cx+cw) << 2 ]);
- o=reinterpret_cast<QRgb *>(&output.scanLine(j) [ cw << 2 ]);
+ b=reinterpret_cast<QRgb *>(&const_cast<TQImage&>(lower).scanLine(y+j) [ (x+cw) << 2 ]);
+ i=reinterpret_cast<QRgb *>(&const_cast<TQImage&>(upper).scanLine(cy+j)[ (cx+cw) << 2 ]);
+ o=reinterpret_cast<QRgb *>(&const_cast<TQImage&>(output).scanLine(j) [ cw << 2 ]);
k=cw-1;
--b; --i; --o;
do
{
- while ( !(a=qAlpha(*i)) && k>0 )
+ while ( !(a=tqAlpha(*i)) && k>0 )
{
i--;
// *o=0;
@@ -2501,9 +2501,9 @@ bool KImageEffect::blend(
k--;
};
// *o=0xFF;
- *o = qRgb(qRed(*b) + (((qRed(*i) - qRed(*b)) * a) >> 8),
- qGreen(*b) + (((qGreen(*i) - qGreen(*b)) * a) >> 8),
- qBlue(*b) + (((qBlue(*i) - qBlue(*b)) * a) >> 8));
+ *o = tqRgb(tqRed(*b) + (((tqRed(*i) - tqRed(*b)) * a) >> 8),
+ tqGreen(*b) + (((tqGreen(*i) - tqGreen(*b)) * a) >> 8),
+ tqBlue(*b) + (((tqBlue(*i) - tqBlue(*b)) * a) >> 8));
--i; --o; --b;
} while (k--);
}
@@ -2543,8 +2543,8 @@ bool KImageEffect::blendOnLower(
for (int j=0; j<ch; j++)
{
- b=&lower.scanLine(y+j) [ (x+cw) << 2 ];
- i=&upper.scanLine(cy+j)[ (cx+cw) << 2 ];
+ b=&const_cast<TQImage&>(lower).scanLine(y+j) [ (x+cw) << 2 ];
+ i=&const_cast<TQImage&>(upper).scanLine(cy+j)[ (cx+cw) << 2 ];
k=cw-1;
--b; --i;
@@ -2593,12 +2593,12 @@ void KImageEffect::blendOnLower(const TQImage &upper, const TQPoint &upperOffset
// blend
for (int y = 0; y < lr.height(); y++) {
for (int x = 0; x < lr.width(); x++) {
- QRgb *b = reinterpret_cast<QRgb*>(lower.scanLine(lr.y() + y)+ (lr.x() + x) * sizeof(QRgb));
- QRgb *d = reinterpret_cast<QRgb*>(upper.scanLine(upperOffset.y() + y) + (upperOffset.x() + x) * sizeof(QRgb));
- int a = qAlpha(*d);
- *b = qRgb(qRed(*b) - (((qRed(*b) - qRed(*d)) * a) >> 8),
- qGreen(*b) - (((qGreen(*b) - qGreen(*d)) * a) >> 8),
- qBlue(*b) - (((qBlue(*b) - qBlue(*d)) * a) >> 8));
+ QRgb *b = reinterpret_cast<QRgb*>(const_cast<TQImage&>(lower).scanLine(lr.y() + y)+ (lr.x() + x) * sizeof(QRgb));
+ QRgb *d = reinterpret_cast<QRgb*>(const_cast<TQImage&>(upper).scanLine(upperOffset.y() + y) + (upperOffset.x() + x) * sizeof(QRgb));
+ int a = tqAlpha(*d);
+ *b = tqRgb(tqRed(*b) - (((tqRed(*b) - tqRed(*d)) * a) >> 8),
+ tqGreen(*b) - (((tqGreen(*b) - tqGreen(*d)) * a) >> 8),
+ tqBlue(*b) - (((tqBlue(*b) - tqBlue(*d)) * a) >> 8));
}
}
}
@@ -2615,12 +2615,12 @@ void KImageEffect::blendOnLower(const TQImage &upper, const TQPoint &upperOffset
// blend
for (int y = 0; y < lr.height(); y++) {
for (int x = 0; x < lr.width(); x++) {
- QRgb *b = reinterpret_cast<QRgb*>(lower.scanLine(lr.y() + y)+ (lr.x() + x) * sizeof(QRgb));
- QRgb *d = reinterpret_cast<QRgb*>(upper.scanLine(upperOffset.y() + y) + (upperOffset.x() + x) * sizeof(QRgb));
- int a = qRound(opacity * qAlpha(*d));
- *b = qRgb(qRed(*b) - (((qRed(*b) - qRed(*d)) * a) >> 8),
- qGreen(*b) - (((qGreen(*b) - qGreen(*d)) * a) >> 8),
- qBlue(*b) - (((qBlue(*b) - qBlue(*d)) * a) >> 8));
+ QRgb *b = reinterpret_cast<QRgb*>(const_cast<TQImage&>(lower).scanLine(lr.y() + y)+ (lr.x() + x) * sizeof(QRgb));
+ QRgb *d = reinterpret_cast<QRgb*>(const_cast<TQImage&>(upper).scanLine(upperOffset.y() + y) + (upperOffset.x() + x) * sizeof(QRgb));
+ int a = tqRound(opacity * tqAlpha(*d));
+ *b = tqRgb(tqRed(*b) - (((tqRed(*b) - tqRed(*d)) * a) >> 8),
+ tqGreen(*b) - (((tqGreen(*b) - tqGreen(*d)) * a) >> 8),
+ tqBlue(*b) - (((tqBlue(*b) - tqBlue(*d)) * a) >> 8));
}
}
}
@@ -2940,10 +2940,10 @@ TQImage KImageEffect::despeckle(TQImage &src)
srcData = (unsigned int *)src.scanLine(y);
++j;
for(x=0; x < src.width(); ++x){
- red_channel[j] = qRed(srcData[x]);
- green_channel[j] = qGreen(srcData[x]);
- blue_channel[j] = qBlue(srcData[x]);
- alpha_channel[j] = qAlpha(srcData[x]);
+ red_channel[j] = tqRed(srcData[x]);
+ green_channel[j] = tqGreen(srcData[x]);
+ blue_channel[j] = tqBlue(srcData[x]);
+ alpha_channel[j] = tqAlpha(srcData[x]);
++j;
}
++j;
@@ -2958,10 +2958,10 @@ TQImage KImageEffect::despeckle(TQImage &src)
++j;
for(x=0; x < src.width(); ++x){
pixel = *(cTable+srcData[x]);
- red_channel[j] = qRed(pixel);
- green_channel[j] = qGreen(pixel);
- blue_channel[j] = qBlue(pixel);
- alpha_channel[j] = qAlpha(pixel);
+ red_channel[j] = tqRed(pixel);
+ green_channel[j] = tqGreen(pixel);
+ blue_channel[j] = tqBlue(pixel);
+ alpha_channel[j] = tqAlpha(pixel);
++j;
}
++j;
@@ -3000,7 +3000,7 @@ TQImage KImageEffect::despeckle(TQImage &src)
++j;
for (x=0; x < dest.width(); ++x)
{
- destData[x] = qRgba(red_channel[j], green_channel[j],
+ destData[x] = tqRgba(red_channel[j], green_channel[j],
blue_channel[j], alpha_channel[j]);
++j;
}
@@ -3121,10 +3121,10 @@ TQImage KImageEffect::addNoise(TQImage &src, NoiseType noise_type)
srcData = (unsigned int *)src.scanLine(y);
destData = (unsigned int *)dest.scanLine(y);
for(x=0; x < src.width(); ++x){
- destData[x] = qRgba(generateNoise(qRed(srcData[x]), noise_type),
- generateNoise(qGreen(srcData[x]), noise_type),
- generateNoise(qBlue(srcData[x]), noise_type),
- qAlpha(srcData[x]));
+ destData[x] = tqRgba(generateNoise(tqRed(srcData[x]), noise_type),
+ generateNoise(tqGreen(srcData[x]), noise_type),
+ generateNoise(tqBlue(srcData[x]), noise_type),
+ tqAlpha(srcData[x]));
}
}
}
@@ -3137,10 +3137,10 @@ TQImage KImageEffect::addNoise(TQImage &src, NoiseType noise_type)
destData = (unsigned int *)dest.scanLine(y);
for(x=0; x < src.width(); ++x){
pixel = *(cTable+srcData[x]);
- destData[x] = qRgba(generateNoise(qRed(pixel), noise_type),
- generateNoise(qGreen(pixel), noise_type),
- generateNoise(qBlue(pixel), noise_type),
- qAlpha(pixel));
+ destData[x] = tqRgba(generateNoise(tqRed(pixel), noise_type),
+ generateNoise(tqGreen(pixel), noise_type),
+ generateNoise(tqBlue(pixel), noise_type),
+ tqAlpha(pixel));
}
}
@@ -3233,10 +3233,10 @@ unsigned int KImageEffect::interpolateColor(TQImage *image, double x_offset,
alpha = 1.0-x_offset;
beta = 1.0-y_offset;
- return(qRgba((unsigned char)(beta*(alpha*qRed(p)+x_offset*qRed(q))+y_offset*(alpha*qRed(r)+x_offset*qRed(s))),
- (unsigned char)(beta*(alpha*qGreen(p)+x_offset*qGreen(q))+y_offset*(alpha*qGreen(r)+x_offset*qGreen(s))),
- (unsigned char)(beta*(alpha*qBlue(p)+x_offset*qBlue(q))+y_offset*(alpha*qBlue(r)+x_offset*qBlue(s))),
- (unsigned char)(beta*(alpha*qAlpha(p)+x_offset*qAlpha(q))+y_offset*(alpha*qAlpha(r)+x_offset*qAlpha(s)))));
+ return(tqRgba((unsigned char)(beta*(alpha*tqRed(p)+x_offset*tqRed(q))+y_offset*(alpha*tqRed(r)+x_offset*tqRed(s))),
+ (unsigned char)(beta*(alpha*tqGreen(p)+x_offset*tqGreen(q))+y_offset*(alpha*tqGreen(r)+x_offset*tqGreen(s))),
+ (unsigned char)(beta*(alpha*tqBlue(p)+x_offset*tqBlue(q))+y_offset*(alpha*tqBlue(r)+x_offset*tqBlue(s))),
+ (unsigned char)(beta*(alpha*tqAlpha(p)+x_offset*tqAlpha(q))+y_offset*(alpha*tqAlpha(r)+x_offset*tqAlpha(s)))));
}
TQImage KImageEffect::implode(TQImage &src, double factor,
@@ -3434,10 +3434,10 @@ void KImageEffect::solarize(TQImage &img, double factor)
count = img.width()*img.height();
}
for(i=0; i < count; ++i){
- data[i] = qRgba(qRed(data[i]) > threshold ? MaxRGB-qRed(data[i]) : qRed(data[i]),
- qGreen(data[i]) > threshold ? MaxRGB-qGreen(data[i]) : qGreen(data[i]),
- qBlue(data[i]) > threshold ? MaxRGB-qBlue(data[i]) : qBlue(data[i]),
- qAlpha(data[i]));
+ data[i] = tqRgba(tqRed(data[i]) > threshold ? MaxRGB-tqRed(data[i]) : tqRed(data[i]),
+ tqGreen(data[i]) > threshold ? MaxRGB-tqGreen(data[i]) : tqGreen(data[i]),
+ tqBlue(data[i]) > threshold ? MaxRGB-tqBlue(data[i]) : tqBlue(data[i]),
+ tqAlpha(data[i]));
}
}
@@ -3685,7 +3685,7 @@ TQImage KImageEffect::charcoal(TQImage &src, double radius, double sigma)
TQImage img(edge(src, radius));
img = blur(img, radius, sigma);
normalize(img);
- img.invertPixels(false);
+ img.tqinvertPixels(false);
KImageEffect::toGray(img);
return(img);
}
@@ -3694,7 +3694,7 @@ void KImageEffect::normalize(TQImage &image)
{
struct double_packet high, low, intensity, *histogram;
struct short_packet *normalize_map;
- Q_INT64 number_pixels;
+ TQ_INT64 number_pixels;
int x, y;
unsigned int *p, *q;
register long i;
@@ -3725,10 +3725,10 @@ void KImageEffect::normalize(TQImage &image)
for(y=0; y < image.height(); ++y){
p = (unsigned int *)image.scanLine(y);
for(x=0; x < image.width(); ++x){
- histogram[(unsigned char)(qRed(*p))].red++;
- histogram[(unsigned char)(qGreen(*p))].green++;
- histogram[(unsigned char)(qBlue(*p))].blue++;
- histogram[(unsigned char)(qAlpha(*p))].alpha++;
+ histogram[(unsigned char)(tqRed(*p))].red++;
+ histogram[(unsigned char)(tqGreen(*p))].green++;
+ histogram[(unsigned char)(tqBlue(*p))].blue++;
+ histogram[(unsigned char)(tqAlpha(*p))].alpha++;
p++;
}
}
@@ -3736,7 +3736,7 @@ void KImageEffect::normalize(TQImage &image)
/*
Find the histogram boundaries by locating the 0.1 percent levels.
*/
- number_pixels = (Q_INT64)image.width()*image.height();
+ number_pixels = (TQ_INT64)image.width()*image.height();
threshold_intensity = number_pixels/1000;
/* red */
@@ -3879,22 +3879,22 @@ void KImageEffect::normalize(TQImage &image)
q = (unsigned int *)image.scanLine(y);
for(x=0; x < image.width(); ++x){
if(low.red != high.red)
- r = (normalize_map[(unsigned short)(qRed(q[x]))].red)/257;
+ r = (normalize_map[(unsigned short)(tqRed(q[x]))].red)/257;
else
- r = qRed(q[x]);
+ r = tqRed(q[x]);
if(low.green != high.green)
- g = (normalize_map[(unsigned short)(qGreen(q[x]))].green)/257;
+ g = (normalize_map[(unsigned short)(tqGreen(q[x]))].green)/257;
else
- g = qGreen(q[x]);
+ g = tqGreen(q[x]);
if(low.blue != high.blue)
- b = (normalize_map[(unsigned short)(qBlue(q[x]))].blue)/257;
+ b = (normalize_map[(unsigned short)(tqBlue(q[x]))].blue)/257;
else
- b = qBlue(q[x]);
+ b = tqBlue(q[x]);
if(low.alpha != high.alpha)
- a = (normalize_map[(unsigned short)(qAlpha(q[x]))].alpha)/257;
+ a = (normalize_map[(unsigned short)(tqAlpha(q[x]))].alpha)/257;
else
- a = qAlpha(q[x]);
- q[x] = qRgba(r, g, b, a);
+ a = tqAlpha(q[x]);
+ q[x] = tqRgba(r, g, b, a);
}
}
liberateMemory(&normalize_map);
@@ -3933,10 +3933,10 @@ void KImageEffect::equalize(TQImage &image)
for(y=0; y < image.height(); ++y){
p = (unsigned int *)image.scanLine(y);
for(x=0; x < image.width(); ++x){
- histogram[(unsigned char)(qRed(*p))].red++;
- histogram[(unsigned char)(qGreen(*p))].green++;
- histogram[(unsigned char)(qBlue(*p))].blue++;
- histogram[(unsigned char)(qAlpha(*p))].alpha++;
+ histogram[(unsigned char)(tqRed(*p))].red++;
+ histogram[(unsigned char)(tqGreen(*p))].green++;
+ histogram[(unsigned char)(tqBlue(*p))].blue++;
+ histogram[(unsigned char)(tqAlpha(*p))].alpha++;
p++;
}
}
@@ -3978,22 +3978,22 @@ void KImageEffect::equalize(TQImage &image)
q = (unsigned int *)image.scanLine(y);
for(x=0; x < image.width(); ++x){
if(low.red != high.red)
- r = (equalize_map[(unsigned short)(qRed(q[x]))].red/257);
+ r = (equalize_map[(unsigned short)(tqRed(q[x]))].red/257);
else
- r = qRed(q[x]);
+ r = tqRed(q[x]);
if(low.green != high.green)
- g = (equalize_map[(unsigned short)(qGreen(q[x]))].green/257);
+ g = (equalize_map[(unsigned short)(tqGreen(q[x]))].green/257);
else
- g = qGreen(q[x]);
+ g = tqGreen(q[x]);
if(low.blue != high.blue)
- b = (equalize_map[(unsigned short)(qBlue(q[x]))].blue/257);
+ b = (equalize_map[(unsigned short)(tqBlue(q[x]))].blue/257);
else
- b = qBlue(q[x]);
+ b = tqBlue(q[x]);
if(low.alpha != high.alpha)
- a = (equalize_map[(unsigned short)(qAlpha(q[x]))].alpha/257);
+ a = (equalize_map[(unsigned short)(tqAlpha(q[x]))].alpha/257);
else
- a = qAlpha(q[x]);
- q[x] = qRgba(r, g, b, a);
+ a = tqAlpha(q[x]);
+ q[x] = tqRgba(r, g, b, a);
}
}
liberateMemory(&equalize_map);
@@ -4102,10 +4102,10 @@ void KImageEffect::blurScanLine(double *kernel, int width,
q = src;
for(i=0; i < columns; ++i){
if((i >= (x-width/2)) && (i <= (x+width/2))){
- red += (*p)*(qRed(*q)*257);
- green += (*p)*(qGreen(*q)*257);
- blue += (*p)*(qBlue(*q)*257);
- alpha += (*p)*(qAlpha(*q)*257);
+ red += (*p)*(tqRed(*q)*257);
+ green += (*p)*(tqGreen(*q)*257);
+ blue += (*p)*(tqBlue(*q)*257);
+ alpha += (*p)*(tqAlpha(*q)*257);
}
if(((i+width/2-x) >= 0) && ((i+width/2-x) < width))
scale+=kernel[i+width/2-x];
@@ -4123,7 +4123,7 @@ void KImageEffect::blurScanLine(double *kernel, int width,
blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue;
alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha;
- dest[x] = qRgba((unsigned char)(red/257UL),
+ dest[x] = tqRgba((unsigned char)(red/257UL),
(unsigned char)(green/257UL),
(unsigned char)(blue/257UL),
(unsigned char)(alpha/257UL));
@@ -4137,10 +4137,10 @@ void KImageEffect::blurScanLine(double *kernel, int width,
p = kernel+width/2-x;
q = src;
for(i=width/2-x; i < width; ++i){
- red += (*p)*(qRed(*q)*257);
- green += (*p)*(qGreen(*q)*257);
- blue += (*p)*(qBlue(*q)*257);
- alpha += (*p)*(qAlpha(*q)*257);
+ red += (*p)*(tqRed(*q)*257);
+ green += (*p)*(tqGreen(*q)*257);
+ blue += (*p)*(tqBlue(*q)*257);
+ alpha += (*p)*(tqAlpha(*q)*257);
scale += (*p);
p++;
q++;
@@ -4157,7 +4157,7 @@ void KImageEffect::blurScanLine(double *kernel, int width,
blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue;
alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha;
- dest[x] = qRgba((unsigned char)(red/257UL),
+ dest[x] = tqRgba((unsigned char)(red/257UL),
(unsigned char)(green/257UL),
(unsigned char)(blue/257UL),
(unsigned char)(alpha/257UL));
@@ -4168,10 +4168,10 @@ void KImageEffect::blurScanLine(double *kernel, int width,
p = kernel;
q = src+(x-width/2);
for (i=0; i < (long) width; ++i){
- red += (*p)*(qRed(*q)*257);
- green += (*p)*(qGreen(*q)*257);
- blue += (*p)*(qBlue(*q)*257);
- alpha += (*p)*(qAlpha(*q)*257);
+ red += (*p)*(tqRed(*q)*257);
+ green += (*p)*(tqGreen(*q)*257);
+ blue += (*p)*(tqBlue(*q)*257);
+ alpha += (*p)*(tqAlpha(*q)*257);
p++;
q++;
}
@@ -4185,7 +4185,7 @@ void KImageEffect::blurScanLine(double *kernel, int width,
blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue;
alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha;
- dest[x] = qRgba((unsigned char)(red/257UL),
+ dest[x] = tqRgba((unsigned char)(red/257UL),
(unsigned char)(green/257UL),
(unsigned char)(blue/257UL),
(unsigned char)(alpha/257UL));
@@ -4197,10 +4197,10 @@ void KImageEffect::blurScanLine(double *kernel, int width,
p = kernel;
q = src+(x-width/2);
for(i=0; i < columns-x+width/2; ++i){
- red += (*p)*(qRed(*q)*257);
- green += (*p)*(qGreen(*q)*257);
- blue += (*p)*(qBlue(*q)*257);
- alpha += (*p)*(qAlpha(*q)*257);
+ red += (*p)*(tqRed(*q)*257);
+ green += (*p)*(tqGreen(*q)*257);
+ blue += (*p)*(tqBlue(*q)*257);
+ alpha += (*p)*(tqAlpha(*q)*257);
scale += (*p);
p++;
q++;
@@ -4216,7 +4216,7 @@ void KImageEffect::blurScanLine(double *kernel, int width,
blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue;
alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha;
- dest[x] = qRgba((unsigned char)(red/257UL),
+ dest[x] = tqRgba((unsigned char)(red/257UL),
(unsigned char)(green/257UL),
(unsigned char)(blue/257UL),
(unsigned char)(alpha/257UL));
@@ -4381,10 +4381,10 @@ bool KImageEffect::convolveImage(TQImage *image, TQImage *dest,
for(mcx=0; mcx < width; ++mcx, ++sx){
mx = sx < 0 ? 0 : sx > image->width()-1 ?
image->width()-1 : sx;
- red += (*k)*(qRed(jumpTable[my][mx])*257);
- green += (*k)*(qGreen(jumpTable[my][mx])*257);
- blue += (*k)*(qBlue(jumpTable[my][mx])*257);
- alpha += (*k)*(qAlpha(jumpTable[my][mx])*257);
+ red += (*k)*(tqRed(jumpTable[my][mx])*257);
+ green += (*k)*(tqGreen(jumpTable[my][mx])*257);
+ blue += (*k)*(tqBlue(jumpTable[my][mx])*257);
+ alpha += (*k)*(tqAlpha(jumpTable[my][mx])*257);
++k;
}
}
@@ -4394,7 +4394,7 @@ bool KImageEffect::convolveImage(TQImage *image, TQImage *dest,
blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue+0.5;
alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha+0.5;
- *q++ = qRgba((unsigned char)(red/257UL),
+ *q++ = tqRgba((unsigned char)(red/257UL),
(unsigned char)(green/257UL),
(unsigned char)(blue/257UL),
(unsigned char)(alpha/257UL));
@@ -4528,16 +4528,16 @@ TQImage KImageEffect::shade(TQImage &src, bool color_shading, double azimuth,
}
}
if(!color_shading){
- *q = qRgba((unsigned char)(shade),
+ *q = tqRgba((unsigned char)(shade),
(unsigned char)(shade),
(unsigned char)(shade),
- qAlpha(*s1));
+ tqAlpha(*s1));
}
else{
- *q = qRgba((unsigned char)((shade*qRed(*s1))/(MaxRGB+1)),
- (unsigned char)((shade*qGreen(*s1))/(MaxRGB+1)),
- (unsigned char)((shade*qBlue(*s1))/(MaxRGB+1)),
- qAlpha(*s1));
+ *q = tqRgba((unsigned char)((shade*tqRed(*s1))/(MaxRGB+1)),
+ (unsigned char)((shade*tqGreen(*s1))/(MaxRGB+1)),
+ (unsigned char)((shade*tqBlue(*s1))/(MaxRGB+1)),
+ tqAlpha(*s1));
}
++s0;
++s1;
@@ -4585,16 +4585,16 @@ TQImage KImageEffect::shade(TQImage &src, bool color_shading, double azimuth,
}
}
if(!color_shading){
- *q = qRgba((unsigned char)(shade),
+ *q = tqRgba((unsigned char)(shade),
(unsigned char)(shade),
(unsigned char)(shade),
- qAlpha(*(cTable+(*s1))));
+ tqAlpha(*(cTable+(*s1))));
}
else{
- *q = qRgba((unsigned char)((shade*qRed(*(cTable+(*s1))))/(MaxRGB+1)),
- (unsigned char)((shade*qGreen(*(cTable+(*s1))))/(MaxRGB+1)),
- (unsigned char)((shade*qBlue(*(cTable+(*s1))))/(MaxRGB+1)),
- qAlpha(*s1));
+ *q = tqRgba((unsigned char)((shade*tqRed(*(cTable+(*s1))))/(MaxRGB+1)),
+ (unsigned char)((shade*tqGreen(*(cTable+(*s1))))/(MaxRGB+1)),
+ (unsigned char)((shade*tqBlue(*(cTable+(*s1))))/(MaxRGB+1)),
+ tqAlpha(*s1));
}
++s0;
++s1;
@@ -4643,7 +4643,7 @@ void KImageEffect::contrastHSV(TQImage &img, bool sharpen)
brightness=0.0;
v = (int)(brightness*255);
c.setHsv(h, s, v);
- data[i] = qRgba(c.red(), c.green(), c.blue(), qAlpha(data[i]));
+ data[i] = tqRgba(c.red(), c.green(), c.blue(), tqAlpha(data[i]));
}
}
@@ -4726,7 +4726,7 @@ static void bumpmap_convert_row( uint *row,
unsigned int idx = (unsigned int)(intensityValue( *row ) + 0.5);
*p++ = lut[(unsigned int) ( waterlevel +
( ( idx -
- waterlevel) * qBlue( *row )) / 255.0 )];
+ waterlevel) * tqBlue( *row )) / 255.0 )];
} else {
unsigned int idx = (unsigned int)(intensityValue( *row ) + 0.5);
*p++ = lut[idx];
@@ -4807,19 +4807,19 @@ static void bumpmap_row( uint *src,
* also change
*/
if (compensate) {
- int red = (int)((qRed( *src ) * shade) / (params->compensation * 255));
- int green = (int)((qGreen( *src ) * shade) / (params->compensation * 255));
- int blue = (int)((qBlue( *src ) * shade) / (params->compensation * 255));
- int alpha = (int)((qAlpha( *src ) * shade) / (params->compensation * 255));
+ int red = (int)((tqRed( *src ) * shade) / (params->compensation * 255));
+ int green = (int)((tqGreen( *src ) * shade) / (params->compensation * 255));
+ int blue = (int)((tqBlue( *src ) * shade) / (params->compensation * 255));
+ int alpha = (int)((tqAlpha( *src ) * shade) / (params->compensation * 255));
++src;
- *dest++ = qRgba( red, green, blue, alpha );
+ *dest++ = tqRgba( red, green, blue, alpha );
} else {
- int red = qRed( *src ) * shade / 255;
- int green = qGreen( *src ) * shade / 255;
- int blue = qBlue( *src ) * shade / 255;
- int alpha = qAlpha( *src ) * shade / 255;
+ int red = tqRed( *src ) * shade / 255;
+ int green = tqGreen( *src ) * shade / 255;
+ int blue = tqBlue( *src ) * shade / 255;
+ int alpha = tqAlpha( *src ) * shade / 255;
++src;
- *dest++ = qRgba( red, green, blue, alpha );
+ *dest++ = tqRgba( red, green, blue, alpha );
}
/* Next pixel */
diff --git a/kdefx/kpixmap.cpp b/kdefx/kpixmap.cpp
index eeccb6213..152ae6e83 100644
--- a/kdefx/kpixmap.cpp
+++ b/kdefx/kpixmap.cpp
@@ -56,7 +56,7 @@ static bool kdither_32_to_8( const TQImage *src, TQImage *dst )
for ( gc=0; gc<=MAX_G; gc++ )
for ( bc=0; bc<=MAX_B; bc++ ) {
dst->setColor( INDEXOF(rc,gc,bc),
- qRgb( rc*255/MAX_R, gc*255/MAX_G, bc*255/MAX_B ) );
+ tqRgb( rc*255/MAX_R, gc*255/MAX_G, bc*255/MAX_B ) );
}
int sw = src->width();
@@ -79,8 +79,8 @@ static bool kdither_32_to_8( const TQImage *src, TQImage *dst )
b = dst->scanLine(y);
int endian = (TQImage::systemBitOrder() == TQImage::BigEndian);
int x;
- uchar* q = src->scanLine(y);
- uchar* q2 = src->scanLine(y+1 < src->height() ? y + 1 : 0);
+ uchar* q = const_cast<TQImage*>(src)->scanLine(y);
+ uchar* q2 = const_cast<TQImage*>(src)->scanLine(y+1 < src->height() ? y + 1 : 0);
for (int chan = 0; chan < 3; chan++) {
b = dst->scanLine(y);
@@ -293,26 +293,26 @@ bool KPixmap::checkColorTable( const TQImage &image )
int i = 0;
if (kpixmap_iconPalette == 0) {
- kpixmap_iconPalette = new QColor[40];
+ kpixmap_iconPalette = new TQColor[40];
// Standard palette
- kpixmap_iconPalette[i++] = tqred;
- kpixmap_iconPalette[i++] = tqgreen;
- kpixmap_iconPalette[i++] = tqblue;
- kpixmap_iconPalette[i++] = tqcyan;
- kpixmap_iconPalette[i++] = tqmagenta;
- kpixmap_iconPalette[i++] = tqyellow;
- kpixmap_iconPalette[i++] = tqdarkRed;
- kpixmap_iconPalette[i++] = tqdarkGreen;
- kpixmap_iconPalette[i++] = tqdarkBlue;
- kpixmap_iconPalette[i++] = tqdarkCyan;
- kpixmap_iconPalette[i++] = tqdarkMagenta;
- kpixmap_iconPalette[i++] = tqdarkYellow;
- kpixmap_iconPalette[i++] = tqwhite;
- kpixmap_iconPalette[i++] = tqlightGray;
- kpixmap_iconPalette[i++] = tqgray;
- kpixmap_iconPalette[i++] = tqdarkGray;
- kpixmap_iconPalette[i++] = tqblack;
+ kpixmap_iconPalette[i++] = red;
+ kpixmap_iconPalette[i++] = green;
+ kpixmap_iconPalette[i++] = blue;
+ kpixmap_iconPalette[i++] = cyan;
+ kpixmap_iconPalette[i++] = magenta;
+ kpixmap_iconPalette[i++] = yellow;
+ kpixmap_iconPalette[i++] = darkRed;
+ kpixmap_iconPalette[i++] = darkGreen;
+ kpixmap_iconPalette[i++] = darkBlue;
+ kpixmap_iconPalette[i++] = darkCyan;
+ kpixmap_iconPalette[i++] = darkMagenta;
+ kpixmap_iconPalette[i++] = darkYellow;
+ kpixmap_iconPalette[i++] = white;
+ kpixmap_iconPalette[i++] = lightGray;
+ kpixmap_iconPalette[i++] = gray;
+ kpixmap_iconPalette[i++] = darkGray;
+ kpixmap_iconPalette[i++] = black;
// Pastels
kpixmap_iconPalette[i++] = TQColor( 255, 192, 192 );
@@ -367,9 +367,9 @@ bool KPixmap::checkColorTable( const TQImage &image )
for ( i=0; i<ncols; i++ ) {
for ( j=0; j<40; j++ ) {
- if ( kpixmap_iconPalette[j].red() == qRed( ctable[i] ) &&
- kpixmap_iconPalette[j].green() == qGreen( ctable[i] ) &&
- kpixmap_iconPalette[j].blue() == qBlue( ctable[i] ) ) {
+ if ( kpixmap_iconPalette[j].red() == tqRed( ctable[i] ) &&
+ kpixmap_iconPalette[j].green() == tqGreen( ctable[i] ) &&
+ kpixmap_iconPalette[j].blue() == tqBlue( ctable[i] ) ) {
break;
}
}
diff --git a/kdefx/kpixmap.h b/kdefx/kpixmap.h
index 8b76e87af..34397791e 100644
--- a/kdefx/kpixmap.h
+++ b/kdefx/kpixmap.h
@@ -54,7 +54,7 @@ class KPixmapPrivate;
* @author Mark Donohoe (donohoe@kde.org)
* @version $Id$
*/
-class KDEFX_EXPORT KPixmap : public QPixmap
+class KDEFX_EXPORT KPixmap : public TQPixmap
{
public:
/**
diff --git a/kdefx/kpixmapeffect.cpp b/kdefx/kpixmapeffect.cpp
index 91f85eac2..c4bf04dae 100644
--- a/kdefx/kpixmapeffect.cpp
+++ b/kdefx/kpixmapeffect.cpp
@@ -154,7 +154,7 @@ KPixmap& KPixmapEffect::blend(KPixmap &pixmap, float initial_intensity,
if(pixmap.depth() <= 8 ) {
if ( ncols < 2 || ncols > 256 )
ncols = 3;
- TQColor *dPal = new QColor[ncols];
+ TQColor *dPal = new TQColor[ncols];
for (int i=0; i<ncols; i++) {
tmp = 0 + 255 * i / ( ncols - 1 );
dPal[i].setRgb ( tmp, tmp, tmp );
@@ -187,7 +187,7 @@ KPixmap& KPixmapEffect::hash(KPixmap &pixmap, Lighting lite,
if(pixmap.depth() <= 8 ) {
if ( ncols < 2 || ncols > 256 )
ncols = 3;
- TQColor *dPal = new QColor[ncols];
+ TQColor *dPal = new TQColor[ncols];
for (int i=0; i<ncols; i++) {
tmp = 0 + 255 * i / ( ncols - 1 );
dPal[i].setRgb ( tmp, tmp, tmp );
diff --git a/kdefx/kstyle.cpp b/kdefx/kstyle.cpp
index 6ebabf681..e6398add8 100644
--- a/kdefx/kstyle.cpp
+++ b/kdefx/kstyle.cpp
@@ -47,6 +47,7 @@
#include <tqstylefactory.h>
#include <tqtabbar.h>
#include <tqtoolbar.h>
+#include <tqframe.h>
#include <kpixmap.h>
#include <kpixmapeffect.h>
@@ -62,7 +63,6 @@
#undef HAVE_XRENDER
#endif
-
#include <limits.h>
namespace
@@ -117,14 +117,14 @@ namespace
static bool useDropShadow(TQWidget* w)
{
- return w && w->metaObject() &&
- w->metaObject()->findProperty("KStyleMenuDropShadow") != -1;
+ return w && w->tqmetaObject() &&
+ w->tqmetaObject()->tqfindProperty("KStyleMenuDropShadow") != -1;
}
}
namespace
{
-class TransparencyHandler : public QObject
+class TransparencyHandler : public TQObject
{
public:
TransparencyHandler(KStyle* style, TransparencyEngine tEngine,
@@ -251,14 +251,13 @@ TQString KStyle::defaultStyle()
return TQString("light, 3rd revision");
}
-
void KStyle::polish( TQWidget* widget )
{
if ( d->useFilledFrameWorkaround )
{
- if ( TQFrame *frame = tqqt_cast< TQFrame* >( widget ) ) {
- TQFrame::Shape shape = frame->frameShape();
- if (shape == TQFrame::ToolBarPanel || shape == TQFrame::MenuBarPanel)
+ if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) {
+ TQFrame::Shape tqshape = frame->frameShape();
+ if (tqshape == TQFrame::ToolBarPanel || tqshape == TQFrame::MenuBarPanel)
widget->installEventFilter(this);
}
}
@@ -277,9 +276,9 @@ void KStyle::unPolish( TQWidget* widget )
{
if ( d->useFilledFrameWorkaround )
{
- if ( TQFrame *frame = tqqt_cast< TQFrame* >( widget ) ) {
- TQFrame::Shape shape = frame->frameShape();
- if (shape == TQFrame::ToolBarPanel || shape == TQFrame::MenuBarPanel)
+ if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) {
+ TQFrame::Shape tqshape = frame->frameShape();
+ if (tqshape == TQFrame::ToolBarPanel || tqshape == TQFrame::MenuBarPanel)
widget->removeEventFilter(this);
}
}
@@ -365,13 +364,13 @@ void KStyle::drawKStylePrimitive( KStylePrimitive kpe,
else
pix.resize( w-2, h-2 );
- TQString title = wid->parentWidget()->caption();
+ TQString title = wid->tqparentWidget()->caption();
TQPainter p2;
p2.begin(&pix);
p2.fillRect(pix.rect(), cg.brush(TQColorGroup::Highlight));
p2.setPen(cg.highlightedText());
p2.setFont(fnt);
- p2.drawText(pix.rect(), TQAlignCenter, title);
+ p2.drawText(pix.rect(), AlignCenter, title);
p2.end();
// Draw a sunken bevel
@@ -435,7 +434,7 @@ void KStyle::drawKStylePrimitive( KStylePrimitive kpe,
int i;
for( i=0; i < 64; i++ )
a.setPoint( i, 0, i*2+1 );
- p2.setPen( tqcolor1 );
+ p2.setPen( color1 );
p2.drawPoints( a );
p2.end();
TQApplication::flushX();
@@ -444,7 +443,7 @@ void KStyle::drawKStylePrimitive( KStylePrimitive kpe,
p2.begin( d->horizontalLine );
for( i=0; i < 64; i++ )
a.setPoint( i, i*2+1, 0 );
- p2.setPen( tqcolor1 );
+ p2.setPen( color1 );
p2.drawPoints( a );
p2.end();
TQApplication::flushX();
@@ -536,25 +535,25 @@ int KStyle::kPixelMetric( KStylePixelMetric kpm, const TQWidget* /* widget */) c
// #ifdef USE_QT4 // kdebindings / smoke needs this function declaration available at all times. Furthermore I don't think it would hurt to have the declaration available at all times...so leave these commented out for now
-void KStyle::drawPrimitive( ControlElement pe,
- TQPainter* p,
- const TQRect &r,
- const TQColorGroup &cg,
- SFlags flags,
- const TQStyleOption& opt ) const
-{
- // FIXME:
- // What should "widget" be in actuality? How should I get it? From where?
- // Almost certainly it should not be null!
- TQWidget *widget = 0;
- drawControl(pe, p, widget, r, cg, flags, opt);
-}
+//void KStyle::tqdrawPrimitive( ControlElement pe,
+// TQPainter* p,
+// const TQRect &r,
+// const TQColorGroup &cg,
+// SFlags flags,
+// const TQStyleOption& opt ) const
+//{
+// // FIXME:
+// // What should "widget" be in actuality? How should I get it? From where?
+// // Almost certainly it should not be null!
+// TQWidget *widget = 0;
+// tqdrawControl(pe, p, widget, r, cg, flags, opt);
+//}
// #endif // USE_QT4
// -----------------------------------------------------------------------------
-void KStyle::drawPrimitive( PrimitiveElement pe,
+void KStyle::tqdrawPrimitive( TQ_PrimitiveElement pe,
TQPainter* p,
const TQRect &r,
const TQColorGroup &cg,
@@ -570,7 +569,7 @@ void KStyle::drawPrimitive( PrimitiveElement pe,
if (p && p->device()->devType() == TQInternal::Widget) {
widget = static_cast<TQWidget*>(p->device());
- parent = widget->parentWidget();
+ parent = widget->tqparentWidget();
} else
return; // Don't paint on non-widgets
@@ -620,9 +619,9 @@ void KStyle::drawPrimitive( PrimitiveElement pe,
}
XRenderFillRectangle(
- p->device()->x11Display(),
+ p->tqdevice()->x11Display(),
PictOpOver,
- p->device()->x11RenderHandle(),
+ p->tqdevice()->x11RenderHandle(),
&clr,
rect.x() + point.x(),
rect.y() + point.y(),
@@ -630,9 +629,9 @@ void KStyle::drawPrimitive( PrimitiveElement pe,
rect.height() );
p->save();
- p->setRasterOp( Qt::CopyROP );
+ p->setRasterOp( TQt::CopyROP );
p->setPen( TQPen( cg.highlight().dark( 160 ), 1 ) );
- p->setBrush( TQNoBrush );
+ p->setBrush( NoBrush );
p->drawRect(
rect.x() + point.x(),
rect.y() + point.y(),
@@ -642,12 +641,12 @@ void KStyle::drawPrimitive( PrimitiveElement pe,
#endif
#endif
} else
- TQCommonStyle::drawPrimitive( pe, p, r, cg, flags, opt );
+ TQCommonStyle::tqdrawPrimitive( pe, p, r, cg, flags, opt );
}
-void KStyle::drawControl( ControlElement element,
+void KStyle::tqdrawControl( ControlElement element,
TQPainter* p,
const TQWidget* widget,
const TQRect &r,
@@ -661,7 +660,7 @@ void KStyle::drawControl( ControlElement element,
// ------------------------------------------------------------------------
case CE_TabBarTab: {
const TQTabBar* tb = (const TQTabBar*) widget;
- TQTabBar::Shape tbs = tb->shape();
+ TQTabBar::Shape tbs = tb->tqshape();
bool selected = flags & Style_Selected;
int x = r.x(), y=r.y(), bottom=r.bottom(), right=r.right();
@@ -765,7 +764,7 @@ void KStyle::drawControl( ControlElement element,
p->setPen (selected ? cg.background() : cg.mid());
p->setBrush(selected ? cg.background() : cg.mid());
p->drawPolygon(a);
- p->setBrush(TQNoBrush);
+ p->setBrush(NoBrush);
if (!selected) {
p->translate(0,-1);
p->setPen(cg.light());
@@ -808,7 +807,7 @@ void KStyle::drawControl( ControlElement element,
p->setPen (selected ? cg.background() : cg.mid());
p->setBrush(selected ? cg.background() : cg.mid());
p->drawPolygon(a);
- p->setBrush(TQNoBrush);
+ p->setBrush(NoBrush);
if (!selected) {
p->translate(0,1);
p->setPen(cg.dark());
@@ -825,8 +824,8 @@ void KStyle::drawControl( ControlElement element,
// ------------------------------------------------------------------------
case CE_PopupMenuScroller: {
p->fillRect(r, cg.background());
- drawPrimitive(PE_ButtonTool, p, r, cg, Style_Enabled);
- drawPrimitive((flags & Style_Up) ? PE_ArrowUp : PE_ArrowDown, p, r, cg, Style_Enabled);
+ tqdrawPrimitive(PE_ButtonTool, p, r, cg, Style_Enabled);
+ tqdrawPrimitive((flags & Style_Up) ? PE_ArrowUp : PE_ArrowDown, p, r, cg, Style_Enabled);
break;
}
@@ -835,7 +834,7 @@ void KStyle::drawControl( ControlElement element,
// ------------------------------------------------------------------------
case CE_ProgressBarGroove: {
TQRect fr = subRect(SR_ProgressBarGroove, widget);
- drawPrimitive(PE_Panel, p, fr, cg, Style_Sunken, TQStyleOption::TQSO_Default);
+ tqdrawPrimitive(PE_Panel, p, fr, cg, Style_Sunken, TQStyleOption::SO_Default);
break;
}
@@ -930,22 +929,22 @@ void KStyle::drawControl( ControlElement element,
p->save();
p->setPen(pb->isEnabled() ? (reverse ? cg.text() : cg.highlightedText()) : cg.text());
- p->drawText(r, TQAlignCenter, pb->progressString());
+ p->drawText(r, AlignCenter, pb->progressString());
p->setClipRect(crect);
p->setPen(reverse ? cg.highlightedText() : cg.text());
- p->drawText(r, TQAlignCenter, pb->progressString());
+ p->drawText(r, AlignCenter, pb->progressString());
p->restore();
} else {
p->setPen(cg.text());
- p->drawText(r, TQAlignCenter, pb->progressString());
+ p->drawText(r, AlignCenter, pb->progressString());
}
break;
}
default:
- TQCommonStyle::drawControl(element, p, widget, r, cg, flags, opt);
+ TQCommonStyle::tqdrawControl(element, p, widget, r, cg, flags, opt);
}
}
@@ -972,7 +971,7 @@ TQRect KStyle::subRect(SubRect r, const TQWidget* widget) const
}
-int KStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const
+int KStyle::tqpixelMetric(PixelMetric m, const TQWidget* widget) const
{
switch(m)
{
@@ -987,13 +986,13 @@ int KStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const
TQWidget* parent = 0;
// Check that we are not a normal toolbar or a hidden dockwidget,
// in which case we need to adjust the height for font size
- if (widget && (parent = widget->parentWidget() )
+ if (widget && (parent = widget->tqparentWidget() )
&& !parent->inherits("QToolBar")
&& !parent->inherits("QMainWindow")
&& widget->inherits("QDockWindowHandle") )
return widget->fontMetrics().lineSpacing();
else
- return TQCommonStyle::pixelMetric(m, widget);
+ return TQCommonStyle::tqpixelMetric(m, widget);
}
// TABS
@@ -1003,8 +1002,8 @@ int KStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const
case PM_TabBarTabVSpace: {
const TQTabBar * tb = (const TQTabBar *) widget;
- if ( tb->shape() == TQTabBar::RoundedAbove ||
- tb->shape() == TQTabBar::RoundedBelow )
+ if ( tb->tqshape() == TQTabBar::RoundedAbove ||
+ tb->tqshape() == TQTabBar::RoundedBelow )
return 10;
else
return 4;
@@ -1012,7 +1011,7 @@ int KStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const
case PM_TabBarTabOverlap: {
const TQTabBar* tb = (const TQTabBar*)widget;
- TQTabBar::Shape tbs = tb->shape();
+ TQTabBar::Shape tbs = tb->tqshape();
if ( (tbs == TQTabBar::RoundedAbove) ||
(tbs == TQTabBar::RoundedBelow) )
@@ -1034,7 +1033,7 @@ int KStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const
case PM_SliderControlThickness: {
const TQSlider* slider = (const TQSlider*)widget;
TQSlider::TickSetting ts = slider->tickmarks();
- int thickness = (slider->orientation() == TQ_Horizontal) ?
+ int thickness = (slider->orientation() == Qt::Horizontal) ?
slider->height() : slider->width();
switch (ts) {
case TQSlider::NoMarks: // Use total area.
@@ -1077,10 +1076,10 @@ int KStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const
return 0;
case PM_PopupMenuScrollerHeight:
- return pixelMetric( PM_ScrollBarExtent, 0);
+ return tqpixelMetric( PM_ScrollBarExtent, 0);
default:
- return TQCommonStyle::pixelMetric( m, widget );
+ return TQCommonStyle::tqpixelMetric( m, widget );
}
}
@@ -1097,7 +1096,7 @@ static TQListViewItem* nextVisibleSibling(TQListViewItem* item)
return sibling;
}
-void KStyle::drawComplexControl( ComplexControl control,
+void KStyle::tqdrawComplexControl( ComplexControl control,
TQPainter* p,
const TQWidget* widget,
const TQRect &r,
@@ -1139,50 +1138,50 @@ void KStyle::drawComplexControl( ComplexControl control,
// Draw the up/left button set
if ((controls & SC_ScrollBarSubLine) && subline.isValid()) {
- drawPrimitive(PE_ScrollBarSubLine, p, subline, cg,
+ tqdrawPrimitive(PE_ScrollBarSubLine, p, subline, cg,
sflags | (active == SC_ScrollBarSubLine ?
Style_Down : Style_Default));
if (useThreeButtonScrollBar && subline2.isValid())
- drawPrimitive(PE_ScrollBarSubLine, p, subline2, cg,
+ tqdrawPrimitive(PE_ScrollBarSubLine, p, subline2, cg,
sflags | (active == SC_ScrollBarSubLine ?
Style_Down : Style_Default));
}
if ((controls & SC_ScrollBarAddLine) && addline.isValid())
- drawPrimitive(PE_ScrollBarAddLine, p, addline, cg,
+ tqdrawPrimitive(PE_ScrollBarAddLine, p, addline, cg,
sflags | ((active == SC_ScrollBarAddLine) ?
Style_Down : Style_Default));
if ((controls & SC_ScrollBarSubPage) && subpage.isValid())
- drawPrimitive(PE_ScrollBarSubPage, p, subpage, cg,
+ tqdrawPrimitive(PE_ScrollBarSubPage, p, subpage, cg,
sflags | ((active == SC_ScrollBarSubPage) ?
Style_Down : Style_Default));
if ((controls & SC_ScrollBarAddPage) && addpage.isValid())
- drawPrimitive(PE_ScrollBarAddPage, p, addpage, cg,
+ tqdrawPrimitive(PE_ScrollBarAddPage, p, addpage, cg,
sflags | ((active == SC_ScrollBarAddPage) ?
Style_Down : Style_Default));
if ((controls & SC_ScrollBarFirst) && first.isValid())
- drawPrimitive(PE_ScrollBarFirst, p, first, cg,
+ tqdrawPrimitive(PE_ScrollBarFirst, p, first, cg,
sflags | ((active == SC_ScrollBarFirst) ?
Style_Down : Style_Default));
if ((controls & SC_ScrollBarLast) && last.isValid())
- drawPrimitive(PE_ScrollBarLast, p, last, cg,
+ tqdrawPrimitive(PE_ScrollBarLast, p, last, cg,
sflags | ((active == SC_ScrollBarLast) ?
Style_Down : Style_Default));
if ((controls & SC_ScrollBarSlider) && slider.isValid()) {
- drawPrimitive(PE_ScrollBarSlider, p, slider, cg,
+ tqdrawPrimitive(PE_ScrollBarSlider, p, slider, cg,
sflags | ((active == SC_ScrollBarSlider) ?
Style_Down : Style_Default));
// Draw focus rect
if (sb->hasFocus()) {
TQRect fr(slider.x() + 2, slider.y() + 2,
slider.width() - 5, slider.height() - 5);
- drawPrimitive(PE_FocusRect, p, fr, cg, Style_Default);
+ tqdrawPrimitive(PE_FocusRect, p, fr, cg, Style_Default);
}
}
break;
@@ -1201,10 +1200,10 @@ void KStyle::drawComplexControl( ComplexControl control,
TQPainter p2;
p2.begin(&pix);
- if ( slider->parentWidget() &&
- slider->parentWidget()->backgroundPixmap() &&
- !slider->parentWidget()->backgroundPixmap()->isNull() ) {
- TQPixmap pixmap = *(slider->parentWidget()->backgroundPixmap());
+ if ( slider->tqparentWidget() &&
+ slider->tqparentWidget()->backgroundPixmap() &&
+ !slider->tqparentWidget()->backgroundPixmap()->isNull() ) {
+ TQPixmap pixmap = *(slider->tqparentWidget()->backgroundPixmap());
p2.drawTiledPixmap(r, pixmap, slider->pos());
} else
pix.fill(cg.background());
@@ -1215,12 +1214,12 @@ void KStyle::drawComplexControl( ComplexControl control,
// Draw the focus rect around the groove
if (slider->hasFocus())
- drawPrimitive(PE_FocusRect, &p2, groove, cg);
+ tqdrawPrimitive(PE_FocusRect, &p2, groove, cg);
}
// Draw the tickmarks
if (controls & SC_SliderTickmarks)
- TQCommonStyle::drawComplexControl(control, &p2, widget,
+ TQCommonStyle::tqdrawComplexControl(control, &p2, widget,
r, cg, flags, SC_SliderTickmarks, active, opt);
// Draw the slider handle
@@ -1246,7 +1245,7 @@ void KStyle::drawComplexControl( ComplexControl control,
// Paint the icon and text.
if ( controls & SC_ListView )
- TQCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt );
+ TQCommonStyle::tqdrawComplexControl( control, p, widget, r, cg, flags, controls, active, opt );
// If we're have a branch or are expanded...
if ( controls & (SC_ListViewBranch | SC_ListViewExpand) )
@@ -1386,7 +1385,7 @@ void KStyle::drawComplexControl( ComplexControl control,
}
default:
- TQCommonStyle::drawComplexControl( control, p, widget, r, cg,
+ TQCommonStyle::tqdrawComplexControl( control, p, widget, r, cg,
flags, controls, active, opt );
break;
}
@@ -1425,7 +1424,7 @@ TQRect KStyle::querySubControlMetrics( ComplexControl control,
const TQScrollBar *sb = (const TQScrollBar*)widget;
bool horizontal = sb->orientation() == Qt::Horizontal;
int sliderstart = sb->sliderStart();
- int sbextent = pixelMetric(PM_ScrollBarExtent, widget);
+ int sbextent = tqpixelMetric(PM_ScrollBarExtent, widget);
int maxlen = (horizontal ? sb->width() : sb->height())
- (sbextent * (threeButtonScrollBar ? 3 : 2));
int sliderlen;
@@ -1436,7 +1435,7 @@ TQRect KStyle::querySubControlMetrics( ComplexControl control,
uint range = sb->maxValue() - sb->minValue();
sliderlen = (sb->pageStep() * maxlen) / (range + sb->pageStep());
- int slidermin = pixelMetric( PM_ScrollBarSliderMin, widget );
+ int slidermin = tqpixelMetric( PM_ScrollBarSliderMin, widget );
if ( sliderlen < slidermin || range > INT_MAX / 2 )
sliderlen = slidermin;
if ( sliderlen > maxlen )
@@ -1826,7 +1825,7 @@ TQPixmap KStyle::stylePixmap( StylePixmap stylepixmap,
}
-int KStyle::styleHint( StyleHint sh, const TQWidget* w,
+int KStyle::tqstyleHint( StyleHint sh, const TQWidget* w,
const TQStyleOption &opt, QStyleHintReturn* shr) const
{
switch (sh)
@@ -1841,7 +1840,7 @@ int KStyle::styleHint( StyleHint sh, const TQWidget* w,
return d->menuAltKeyNavigation ? 1 : 0;
case SH_PopupMenu_SubMenuPopupDelay:
- if ( styleHint( SH_PopupMenu_SloppySubMenus, w ) )
+ if ( tqstyleHint( SH_PopupMenu_SloppySubMenus, w ) )
return QMIN( 100, d->popupMenuDelay );
else
return d->popupMenuDelay;
@@ -1877,7 +1876,7 @@ int KStyle::styleHint( StyleHint sh, const TQWidget* w,
}
default:
- return TQCommonStyle::styleHint(sh, w, opt, shr);
+ return TQCommonStyle::tqstyleHint(sh, w, opt, shr);
}
}
@@ -1890,19 +1889,19 @@ bool KStyle::eventFilter( TQObject* object, TQEvent* event )
// ensure that the filled frame contents are properly painted.
// We essentially modify the paintEvent's rect to include the
// panel border, which also paints the widget's interior.
- // This is nasty, but I see no other way to properly repaint
+ // This is nasty, but I see no other way to properly tqrepaint
// filled frames in all QMenuBars and QToolBars.
// -- Karol.
TQFrame *frame = 0;
if ( event->type() == TQEvent::Paint
- && (frame = tqqt_cast<TQFrame*>(object)) )
+ && (frame = ::tqqt_cast<TQFrame*>(object)) )
{
if (frame->frameShape() != TQFrame::ToolBarPanel && frame->frameShape() != TQFrame::MenuBarPanel)
return false;
bool horizontal = true;
TQPaintEvent* pe = (TQPaintEvent*)event;
- TQToolBar *toolbar = tqqt_cast< TQToolBar *>( frame );
+ TQToolBar *toolbar = ::tqqt_cast< TQToolBar *>( frame );
TQRect r = pe->rect();
if (toolbar && toolbar->orientation() == Qt::Vertical)
@@ -2042,8 +2041,8 @@ void TransparencyHandler::createShadowWindows(const TQWidget* p)
// Create a fake drop-down shadow effect via blended Xwindows
ShadowElements se;
- se.w1 = new TQWidget(0, 0, WStyle_Customize | WType_Popup | WX11BypassWM );
- se.w2 = new TQWidget(0, 0, WStyle_Customize | WType_Popup | WX11BypassWM );
+ se.w1 = new TQWidget(0, 0, (WFlags)(WStyle_Customize | WType_Popup | WX11BypassWM) );
+ se.w2 = new TQWidget(0, 0, (WFlags)(WStyle_Customize | WType_Popup | WX11BypassWM) );
se.w1->setGeometry(shadow1);
se.w2->setGeometry(shadow2);
XSelectInput(qt_xdisplay(), se.w1->winId(), StructureNotifyMask );
@@ -2082,7 +2081,7 @@ void TransparencyHandler::createShadowWindows(const TQWidget* p)
void TransparencyHandler::removeShadowWindows(const TQWidget* p)
{
#ifdef Q_WS_X11
- ShadowMap::iterator it = shadowMap().find(p);
+ ShadowMap::iterator it = shadowMap().tqfind(p);
if (it != shadowMap().end())
{
ShadowElements se = it.data();
@@ -2128,12 +2127,12 @@ bool TransparencyHandler::eventFilter( TQObject* object, TQEvent* event )
case XRender:
#endif
case SoftwareBlend:
- blendToPixmap(p->colorGroup(), p);
+ blendToPixmap(p->tqcolorGroup(), p);
break;
case SoftwareTint:
default:
- blendToColor(p->colorGroup().button());
+ blendToColor(p->tqcolorGroup().button());
};
p->setErasePixmap(pix);
@@ -2145,7 +2144,7 @@ bool TransparencyHandler::eventFilter( TQObject* object, TQEvent* event )
// * TODO : determine real cause for duplicate events
// * till 20021005
if ((dropShadow || useDropShadow(p))
- && p->width() > 16 && p->height() > 16 && !shadowMap().contains( p ))
+ && p->width() > 16 && p->height() > 16 && !shadowMap().tqcontains( p ))
createShadowWindows(p);
}
else if (et == TQEvent::Resize && p->isShown() && p->isTopLevel())
@@ -2198,8 +2197,8 @@ void TransparencyHandler::blendToPixmap(const TQColorGroup &cg, const TQWidget*
return;
// Allow styles to define the blend pixmap - allows for some interesting effects.
- if (::qt_cast<TQPopupMenu*>(p))
- kstyle->renderMenuBlendPixmap( blendPix, cg, ::qt_cast<TQPopupMenu*>(p) );
+ if (::tqqt_cast<TQPopupMenu*>(p))
+ kstyle->renderMenuBlendPixmap( blendPix, cg, ::tqqt_cast<TQPopupMenu*>(p) );
else
blendPix.fill(cg.button()); // Just tint as the default behavior
@@ -2220,11 +2219,11 @@ void TransparencyHandler::XRenderBlendToPixmap(const TQWidget* p)
renderPix.resize( pix.width(), pix.height() );
// Allow styles to define the blend pixmap - allows for some interesting effects.
- if (::qt_cast<TQPopupMenu*>(p))
- kstyle->renderMenuBlendPixmap( renderPix, p->colorGroup(),
- ::qt_cast<TQPopupMenu*>(p) );
+ if (::tqqt_cast<TQPopupMenu*>(p))
+ kstyle->renderMenuBlendPixmap( renderPix, p->tqcolorGroup(),
+ ::tqqt_cast<TQPopupMenu*>(p) );
else
- renderPix.fill(p->colorGroup().button()); // Just tint as the default behavior
+ renderPix.fill(p->tqcolorGroup().button()); // Just tint as the default behavior
Display* dpy = qt_xdisplay();
Pixmap alphaPixmap;
diff --git a/kdefx/kstyle.h b/kdefx/kstyle.h
index 1e8b0df2c..a50ab721e 100644
--- a/kdefx/kstyle.h
+++ b/kdefx/kstyle.h
@@ -54,9 +54,10 @@ struct KStylePrivate;
* @author Karol Szwed (gallium@kde.org)
* @version $Id$
*/
-class KDEFX_EXPORT KStyle: public QCommonStyle
+class KDEFX_EXPORT KStyle: public TQCommonStyle
{
Q_OBJECT
+ TQ_OBJECT
public:
@@ -70,7 +71,7 @@ class KDEFX_EXPORT KStyle: public QCommonStyle
* internal menu transparency engine.
*
* @li FilledFrameWorkaround - Enable this flag to facilitate
- * proper repaints of QMenuBars and QToolBars when the style chooses
+ * proper tqrepaints of QMenuBars and QToolBars when the style chooses
* to paint the interior of a TQFrame. The style primitives in question
* are PE_PanelMenuBar and PE_PanelDockWindow. The HighColor style uses
* this workaround to enable painting of gradients in menubars and
@@ -171,7 +172,7 @@ class KDEFX_EXPORT KStyle: public QCommonStyle
* This virtual function defines the pixmap used to blend between the popup
* menu and the background to create different menu transparency effects.
* For example, you can fill the pixmap "pix" with a gradient based on the
- * popup's colorGroup, a texture, or some other fancy painting routine.
+ * popup's tqcolorGroup, a texture, or some other fancy painting routine.
* KStyle will then internally blend this pixmap with a snapshot of the
* background behind the popupMenu to create the illusion of transparency.
*
@@ -237,13 +238,13 @@ class KDEFX_EXPORT KStyle: public QCommonStyle
};
/**
- * This function is identical to Qt's TQStyle::drawPrimitive(), except that
+ * This function is identical to Qt's TQStyle::tqdrawPrimitive(), except that
* it adds one further parameter, 'widget', that can be used to determine
* the widget state of the KStylePrimitive in question.
*
* @see KStyle::KStylePrimitive
- * @see TQStyle::drawPrimitive
- * @see TQStyle::drawComplexControl
+ * @see TQStyle::tqdrawPrimitive
+ * @see TQStyle::tqdrawComplexControl
*/
virtual void drawKStylePrimitive( KStylePrimitive kpe,
TQPainter* p,
@@ -251,7 +252,7 @@ class KDEFX_EXPORT KStyle: public QCommonStyle
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
- const TQStyleOption& = TQStyleOption::TQSO_Default ) const;
+ const TQStyleOption& = TQStyleOption::SO_Default ) const;
enum KStylePixelMetric {
@@ -274,33 +275,33 @@ class KDEFX_EXPORT KStyle: public QCommonStyle
void unPolish( TQWidget* widget );
void polishPopupMenu( TQPopupMenu* );
- void drawPrimitive( PrimitiveElement pe,
+ void tqdrawPrimitive( TQ_PrimitiveElement pe,
TQPainter* p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
- const TQStyleOption& = TQStyleOption::TQSO_Default ) const;
+ const TQStyleOption& = TQStyleOption::SO_Default ) const;
// #ifdef USE_QT4 // kdebindings / smoke needs this function declaration available at all times. Furthermore I don't think it would hurt to have the declaration available at all times...so leave these commented out for now
- void drawPrimitive( ControlElement pe,
- TQPainter* p,
- const TQRect &r,
- const TQColorGroup &cg,
- SFlags flags = Style_Default,
- const TQStyleOption& = TQStyleOption::TQSO_Default ) const;
+// void tqdrawPrimitive( ControlElement pe,
+// TQPainter* p,
+// const TQRect &r,
+// const TQColorGroup &cg,
+// SFlags flags = Style_Default,
+// const TQStyleOption& = TQStyleOption::SO_Default ) const;
// #endif // USE_QT4
- void drawControl( ControlElement element,
+ void tqdrawControl( ControlElement element,
TQPainter* p,
const TQWidget* widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
- const TQStyleOption& = TQStyleOption::TQSO_Default ) const;
+ const TQStyleOption& = TQStyleOption::SO_Default ) const;
- void drawComplexControl( ComplexControl control,
+ void tqdrawComplexControl( ComplexControl control,
TQPainter *p,
const TQWidget* widget,
const TQRect &r,
@@ -308,19 +309,19 @@ class KDEFX_EXPORT KStyle: public QCommonStyle
SFlags flags = Style_Default,
SCFlags controls = SC_All,
SCFlags active = SC_None,
- const TQStyleOption& = TQStyleOption::TQSO_Default ) const;
+ const TQStyleOption& = TQStyleOption::SO_Default ) const;
SubControl querySubControl( ComplexControl control,
const TQWidget* widget,
const TQPoint &pos,
- const TQStyleOption& = TQStyleOption::TQSO_Default ) const;
+ const TQStyleOption& = TQStyleOption::SO_Default ) const;
TQRect querySubControlMetrics( ComplexControl control,
const TQWidget* widget,
SubControl sc,
- const TQStyleOption& = TQStyleOption::TQSO_Default ) const;
+ const TQStyleOption& = TQStyleOption::SO_Default ) const;
- int pixelMetric( PixelMetric m,
+ int tqpixelMetric( PixelMetric m,
const TQWidget* widget = 0 ) const;
TQRect subRect( SubRect r,
@@ -328,11 +329,11 @@ class KDEFX_EXPORT KStyle: public QCommonStyle
TQPixmap stylePixmap( StylePixmap stylepixmap,
const TQWidget* widget = 0,
- const TQStyleOption& = TQStyleOption::TQSO_Default ) const;
+ const TQStyleOption& = TQStyleOption::SO_Default ) const;
- int styleHint( StyleHint sh,
+ int tqstyleHint( StyleHint sh,
const TQWidget* w = 0,
- const TQStyleOption &opt = TQStyleOption::TQSO_Default,
+ const TQStyleOption &opt = TQStyleOption::SO_Default,
QStyleHintReturn* shr = 0 ) const;
protected: