diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kdefx | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdefx')
-rw-r--r-- | kdefx/kdrawutil.cpp | 96 | ||||
-rw-r--r-- | kdefx/kdrawutil.h | 52 | ||||
-rw-r--r-- | kdefx/kimageeffect.cpp | 222 | ||||
-rw-r--r-- | kdefx/kimageeffect.h | 196 | ||||
-rw-r--r-- | kdefx/kpixmap.cpp | 98 | ||||
-rw-r--r-- | kdefx/kpixmap.h | 20 | ||||
-rw-r--r-- | kdefx/kpixmapeffect.cpp | 70 | ||||
-rw-r--r-- | kdefx/kpixmapeffect.h | 24 | ||||
-rw-r--r-- | kdefx/kpixmapsplitter.cpp | 14 | ||||
-rw-r--r-- | kdefx/kpixmapsplitter.h | 34 | ||||
-rw-r--r-- | kdefx/kstyle.cpp | 516 | ||||
-rw-r--r-- | kdefx/kstyle.h | 112 |
12 files changed, 727 insertions, 727 deletions
diff --git a/kdefx/kdrawutil.cpp b/kdefx/kdrawutil.cpp index 7ba703886..0fccb94f1 100644 --- a/kdefx/kdrawutil.cpp +++ b/kdefx/kdrawutil.cpp @@ -16,17 +16,17 @@ Boston, MA 02110-1301, USA. */ #include "kdrawutil.h" -#include <qdrawutil.h> +#include <tqdrawutil.h> -KDEFX_EXPORT void kDrawNextButton(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, - const QBrush *fill) +KDEFX_EXPORT void kDrawNextButton(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, + const TQBrush *fill) { - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); int x2 = x+w-1; int y2 = y+h-1; p->fillRect(x+1, y+1, w-2, h-2, - fill ? *fill : g.brush(QColorGroup::Button)); + fill ? *fill : g.brush(TQColorGroup::Button)); p->setPen(sunken ? Qt::black : g.light()); p->drawLine(x, y, x2-1, y); p->drawLine(x, y, x, y2-1); @@ -40,16 +40,16 @@ KDEFX_EXPORT void kDrawNextButton(QPainter *p, int x, int y, int w, int h, } -KDEFX_EXPORT void kDrawNextButton(QPainter *p, const QRect &r, const QColorGroup &g, - bool sunken, const QBrush *fill) +KDEFX_EXPORT void kDrawNextButton(TQPainter *p, const TQRect &r, const TQColorGroup &g, + bool sunken, const TQBrush *fill) { kDrawNextButton(p, r.x(), r.y(), r.width(), r.height(), g, sunken, fill); } -KDEFX_EXPORT void kDrawBeButton(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, const QBrush *fill) +KDEFX_EXPORT void kDrawBeButton(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, const TQBrush *fill) { - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); int x2 = x+w-1; int y2 = y+h-1; p->setPen(g.dark()); @@ -90,20 +90,20 @@ KDEFX_EXPORT void kDrawBeButton(QPainter *p, int x, int y, int w, int h, p->setPen(oldPen); } -KDEFX_EXPORT void kDrawBeButton(QPainter *p, QRect &r, const QColorGroup &g, bool sunken, - const QBrush *fill) +KDEFX_EXPORT void kDrawBeButton(TQPainter *p, TQRect &r, const TQColorGroup &g, bool sunken, + const TQBrush *fill) { kDrawBeButton(p, r.x(), r.y(), r.width(), r.height(), g, sunken, fill); } -KDEFX_EXPORT void kDrawRoundButton(QPainter *p, const QRect &r, const QColorGroup &g, +KDEFX_EXPORT void kDrawRoundButton(TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken) { int x, y, x2, y2; r.coords(&x, &y, &x2, &y2); if(r.width() > 16 && r.height() > 16){ - QPen oldPen = p->pen(); - QPointArray hPntArray, lPntArray; + TQPen oldPen = p->pen(); + TQPointArray hPntArray, lPntArray; hPntArray.putPoints(0, 12, x+4,y+1, x+5,y+1, // top left x+3,y+2, x+2,y+3, x+1,y+4, x+1,y+5, x+1,y2-5, x+1,y2-4, x+2,y2-3, // half corners @@ -136,16 +136,16 @@ KDEFX_EXPORT void kDrawRoundButton(QPainter *p, const QRect &r, const QColorGrou qDrawWinPanel(p, x, y, r.width(), r.height(), g, sunken); } -KDEFX_EXPORT void kDrawRoundButton(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken) +KDEFX_EXPORT void kDrawRoundButton(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken) { - QRect r(x, y, w, h); + TQRect r(x, y, w, h); kDrawRoundButton(p, r, g, sunken); } #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) -KDEFX_EXPORT void kDrawRoundMask(QPainter *p, int x, int y, int w, int h, bool clear) +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, @@ -161,14 +161,14 @@ KDEFX_EXPORT void kDrawRoundMask(QPainter *p, int x, int y, int w, int h, bool c 3,1,3,2,3,3,3,4,3,0,4,1,4,2,4,3,4,4,4 }; if(clear) - p->fillRect(x, y, w, h, QBrush(Qt::color0, Qt::SolidPattern)); + p->fillRect(x, y, w, h, TQBrush(Qt::color0, Qt::SolidPattern)); - QBrush fillBrush(Qt::color1, Qt::SolidPattern); + TQBrush fillBrush(Qt::color1, Qt::SolidPattern); p->setPen(Qt::color1); if(w > 16 && h > 16){ int x2 = x+w-1; int y2 = y+h-1; - QPointArray a(QCOORDARRLEN(top_left_fill), top_left_fill); + TQPointArray a(QCOORDARRLEN(top_left_fill), top_left_fill); a.translate(1, 1); p->drawPoints(a); a.setPoints(QCOORDARRLEN(btm_left_fill), btm_left_fill); @@ -194,35 +194,35 @@ KDEFX_EXPORT void kDrawRoundMask(QPainter *p, int x, int y, int w, int h, bool c p->fillRect(x, y, w, h, fillBrush); } -KDEFX_EXPORT void kRoundMaskRegion(QRegion &r, int x, int y, int w, int h) +KDEFX_EXPORT void kRoundMaskRegion(TQRegion &r, int x, int y, int w, int h) { - // using a bunch of QRect lines seems much more efficient than bitmaps or + // using a bunch of TQRect lines seems much more efficient than bitmaps or // point arrays, even tho it uses more statements - r += QRect(x+6, y+0, w-12, h); - r += QRect(x+5, y+1, 1, h-2); // left - r += QRect(x+4, y+1, 1, h-2); - r += QRect(x+3, y+2, 1, h-4); - r += QRect(x+2, y+3, 1, h-6); - r += QRect(x+1, y+4, 1, h-8); - r += QRect(x, y+6, 1, h-12); + r += TQRect(x+6, y+0, w-12, h); + r += TQRect(x+5, y+1, 1, h-2); // left + r += TQRect(x+4, y+1, 1, h-2); + r += TQRect(x+3, y+2, 1, h-4); + r += TQRect(x+2, y+3, 1, h-6); + r += TQRect(x+1, y+4, 1, h-8); + r += TQRect(x, y+6, 1, h-12); int x2 = x+w-1; - r += QRect(x2-5, y+1, 1, h-2); // right - r += QRect(x2-4, y+1, 1, h-2); - r += QRect(x2-3, y+2, 1, h-4); - r += QRect(x2-2, y+3, 1, h-6); - r += QRect(x2-1, y+4, 1, h-8); - r += QRect(x2, y+6, 1, h-12); + r += TQRect(x2-5, y+1, 1, h-2); // right + r += TQRect(x2-4, y+1, 1, h-2); + r += TQRect(x2-3, y+2, 1, h-4); + r += TQRect(x2-2, y+3, 1, h-6); + r += TQRect(x2-1, y+4, 1, h-8); + r += TQRect(x2, y+6, 1, h-12); } -KDEFX_EXPORT void kColorBitmaps(QPainter *p, const QColorGroup &g, int x, int y, - QBitmap *lightColor, QBitmap *midColor, - QBitmap *midlightColor, QBitmap *darkColor, - QBitmap *blackColor, QBitmap *whiteColor) +KDEFX_EXPORT void kColorBitmaps(TQPainter *p, const TQColorGroup &g, int x, int y, + TQBitmap *lightColor, TQBitmap *midColor, + TQBitmap *midlightColor, TQBitmap *darkColor, + TQBitmap *blackColor, TQBitmap *whiteColor) { - QBitmap *bitmaps[]={lightColor, midColor, midlightColor, darkColor, + TQBitmap *bitmaps[]={lightColor, midColor, midlightColor, darkColor, blackColor, whiteColor}; - QColor colors[]={g.light(), g.mid(), g.midlight(), g.dark(), + TQColor colors[]={g.light(), g.mid(), g.midlight(), g.dark(), Qt::black, Qt::white}; int i; @@ -236,7 +236,7 @@ KDEFX_EXPORT void kColorBitmaps(QPainter *p, const QColorGroup &g, int x, int y, } } -KDEFX_EXPORT void kColorBitmaps(QPainter *p, const QColorGroup &g, int x, int y, int w, +KDEFX_EXPORT void kColorBitmaps(TQPainter *p, const TQColorGroup &g, int x, int y, int w, int h, bool isXBitmaps, const uchar *lightColor, const uchar *midColor, const uchar *midlightColor, const uchar *darkColor, const uchar *blackColor, @@ -245,14 +245,14 @@ KDEFX_EXPORT void kColorBitmaps(QPainter *p, const QColorGroup &g, int x, int y, const uchar *data[]={lightColor, midColor, midlightColor, darkColor, blackColor, whiteColor}; - QColor colors[]={g.light(), g.mid(), g.midlight(), g.dark(), + TQColor colors[]={g.light(), g.mid(), g.midlight(), g.dark(), Qt::black, Qt::white}; int i; - QBitmap b; + TQBitmap b; for(i=0; i < 6; ++i){ if(data[i]){ - b = QBitmap(w, h, data[i], isXBitmaps); + b = TQBitmap(w, h, data[i], isXBitmaps); b.setMask(b); p->setPen(colors[i]); p->drawPixmap(x, y, b); diff --git a/kdefx/kdrawutil.h b/kdefx/kdrawutil.h index f16a7ab02..27be8ac58 100644 --- a/kdefx/kdrawutil.h +++ b/kdefx/kdrawutil.h @@ -18,15 +18,15 @@ #ifndef __KDRAWUTIL_H #define __KDRAWUTIL_H -#include <qnamespace.h> -#include <qpainter.h> -#include <qbitmap.h> -#include <qpalette.h> +#include <tqnamespace.h> +#include <tqpainter.h> +#include <tqbitmap.h> +#include <tqpalette.h> #include <kdelibs_export.h> /* - * Various drawing routines. Also see Qt's qdrawutil.h for some more routines + * Various drawing routines. Also see Qt's tqdrawutil.h for some more routines * contained in Qt. * * (C) Daniel M. Duley <mosfet@kde.org> @@ -45,16 +45,16 @@ * @param fill The brush to use for filling the interior of the button. * Pass @a null to prevent the button from being filled. */ -KDEFX_EXPORT void kDrawNextButton(QPainter *p, const QRect &r, const QColorGroup &g, - bool sunken=false, const QBrush *fill=0); +KDEFX_EXPORT void kDrawNextButton(TQPainter *p, const TQRect &r, const TQColorGroup &g, + bool sunken=false, const TQBrush *fill=0); /** * @relates KStyle * @overload */ -KDEFX_EXPORT void kDrawNextButton(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken=false, - const QBrush *fill=0); +KDEFX_EXPORT void kDrawNextButton(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken=false, + const TQBrush *fill=0); /** * @relates KStyle @@ -69,17 +69,17 @@ KDEFX_EXPORT void kDrawNextButton(QPainter *p, int x, int y, int w, int h, * @param fill The brush to use for filling the interior of the button. * Pass @a null to prevent the button from being filled. */ -KDEFX_EXPORT void kDrawBeButton(QPainter *p, QRect &r, const QColorGroup &g, - bool sunken=false, const QBrush *fill=0); +KDEFX_EXPORT void kDrawBeButton(TQPainter *p, TQRect &r, const TQColorGroup &g, + bool sunken=false, const TQBrush *fill=0); /** * @relates KStyle * @c \#include @c <kdrawutil.h> * @overload */ -KDEFX_EXPORT void kDrawBeButton(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken=false, - const QBrush *fill=0); +KDEFX_EXPORT void kDrawBeButton(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken=false, + const TQBrush *fill=0); /** * @relates KStyle @@ -93,15 +93,15 @@ KDEFX_EXPORT void kDrawBeButton(QPainter *p, int x, int y, int w, int h, * @param g Specifies the shading colors. * @param sunken Whether to draw the button as sunken (pressed) or not. */ -KDEFX_EXPORT void kDrawRoundButton(QPainter *p, const QRect &r, const QColorGroup &g, +KDEFX_EXPORT void kDrawRoundButton(TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken=false); /** * @relates KStyle * @overload */ -KDEFX_EXPORT void kDrawRoundButton(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken=false); +KDEFX_EXPORT void kDrawRoundButton(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken=false); /** * @relates KStyle @@ -118,14 +118,14 @@ KDEFX_EXPORT void kDrawRoundButton(QPainter *p, int x, int y, int w, int h, * * @see kDrawRoundButton() and kDrawRoundMask() */ -KDEFX_EXPORT void kRoundMaskRegion(QRegion &r, int x, int y, int w, int h); +KDEFX_EXPORT void kRoundMaskRegion(TQRegion &r, int x, int y, int w, int h); /** * @relates KStyle * @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 QStyle::drawControlMask(). + * Qt::color1. This function is useful in TQStyle::drawControlMask(). * * @param p The painter to use for drawing the button. * @param x The X coordinate of the button. @@ -135,7 +135,7 @@ KDEFX_EXPORT void kRoundMaskRegion(QRegion &r, int x, int y, int w, int h); * @param clear Whether to clear the rectangle specified by @p (x, y, w, h) to * Qt::color0 before drawing the mask. */ -KDEFX_EXPORT void kDrawRoundMask(QPainter *p, int x, int y, int w, int h, bool clear=false); +KDEFX_EXPORT void kDrawRoundMask(TQPainter *p, int x, int y, int w, int h, bool clear=false); /** * @relates KStyle @@ -161,17 +161,17 @@ KDEFX_EXPORT void kDrawRoundMask(QPainter *p, int x, int y, int w, int h, bool c * * @see QColorGroup */ -KDEFX_EXPORT void kColorBitmaps(QPainter *p, const QColorGroup &g, int x, int y, - QBitmap *lightColor=0, QBitmap *midColor=0, - QBitmap *midlightColor=0, QBitmap *darkColor=0, - QBitmap *blackColor=0, QBitmap *whiteColor=0); +KDEFX_EXPORT void kColorBitmaps(TQPainter *p, const TQColorGroup &g, int x, int y, + TQBitmap *lightColor=0, TQBitmap *midColor=0, + TQBitmap *midlightColor=0, TQBitmap *darkColor=0, + TQBitmap *blackColor=0, TQBitmap *whiteColor=0); /** * @relates KStyle * @c \#include @c <kdrawutil.h> * @overload */ - KDEFX_EXPORT void kColorBitmaps(QPainter *p, const QColorGroup &g, int x, int y, int w, + KDEFX_EXPORT void kColorBitmaps(TQPainter *p, const TQColorGroup &g, int x, int y, int w, int h, bool isXBitmaps=true, const uchar *lightColor = 0, const uchar *midColor=0, const uchar *midlightColor=0, const uchar *darkColor=0, const uchar *blackColor=0, diff --git a/kdefx/kimageeffect.cpp b/kdefx/kimageeffect.cpp index b2a859563..ca72e37c1 100644 --- a/kdefx/kimageeffect.cpp +++ b/kdefx/kimageeffect.cpp @@ -34,7 +34,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <math.h> #include <assert.h> -#include <qimage.h> +#include <tqimage.h> #include <stdlib.h> #include <iostream> @@ -121,13 +121,13 @@ struct short_packet // //====================================================================== -QImage KImageEffect::gradient(const QSize &size, const QColor &ca, - const QColor &cb, GradientType eff, int ncols) +TQImage KImageEffect::gradient(const TQSize &size, const TQColor &ca, + const TQColor &cb, GradientType eff, int ncols) { int rDiff, gDiff, bDiff; int rca, gca, bca, rcb, gcb, bcb; - QImage image(size, 32); + TQImage image(size, 32); if (size.width() == 0 || size.height() == 0) { #ifndef NDEBUG @@ -357,10 +357,10 @@ QImage KImageEffect::gradient(const QSize &size, const QColor &ca, } // dither if necessary - if (ncols && (QPixmap::defaultDepth() < 15 )) { + if (ncols && (TQPixmap::defaultDepth() < 15 )) { if ( ncols < 2 || ncols > 256 ) ncols = 3; - QColor *dPal = new QColor[ncols]; + TQColor *dPal = new QColor[ncols]; for (int i=0; i<ncols; i++) { dPal[i].setRgb ( rca + rDiff * i / ( ncols - 1 ), gca + gDiff * i / ( ncols - 1 ), @@ -385,8 +385,8 @@ QImage KImageEffect::gradient(const QSize &size, const QColor &ca, // the balanced code would suffer with no other gain than a mere // source code and byte code size economy. -QImage KImageEffect::unbalancedGradient(const QSize &size, const QColor &ca, - const QColor &cb, GradientType eff, int xfactor, int yfactor, +TQImage KImageEffect::unbalancedGradient(const TQSize &size, const TQColor &ca, + const TQColor &cb, GradientType eff, int xfactor, int yfactor, int ncols) { int dir; // general parameter used for direction switches @@ -415,7 +415,7 @@ QImage KImageEffect::unbalancedGradient(const QSize &size, const QColor &ca, int rDiff, gDiff, bDiff; int rca, gca, bca, rcb, gcb, bcb; - QImage image(size, 32); + TQImage image(size, 32); if (size.width() == 0 || size.height() == 0) { #ifndef NDEBUG @@ -432,7 +432,7 @@ QImage KImageEffect::unbalancedGradient(const QSize &size, const QColor &ca, bDiff = (bcb = cb.blue()) - (bca = ca.blue()); if( eff == VerticalGradient || eff == HorizontalGradient){ - QColor cRow; + TQColor cRow; uint *p; uint rgbRow; @@ -596,10 +596,10 @@ QImage KImageEffect::unbalancedGradient(const QSize &size, const QColor &ca, } } - if (ncols && (QPixmap::defaultDepth() < 15 )) { + if (ncols && (TQPixmap::defaultDepth() < 15 )) { if ( ncols < 2 || ncols > 256 ) ncols = 3; - QColor *dPal = new QColor[ncols]; + TQColor *dPal = new QColor[ncols]; for (int i=0; i<ncols; i++) { dPal[i].setRgb ( rca + rDiff * i / ( ncols - 1 ), gca + gDiff * i / ( ncols - 1 ), @@ -651,7 +651,7 @@ struct KIE8Pack * less expensive than doing a float operation on the 3 color components of * each pixel. (mosfet) */ -QImage& KImageEffect::intensity(QImage &image, float percent) +TQImage& KImageEffect::intensity(TQImage &image, float percent) { if (image.width() == 0 || image.height() == 0) { #ifndef NDEBUG @@ -843,7 +843,7 @@ QImage& KImageEffect::intensity(QImage &image, float percent) return image; } -QImage& KImageEffect::channelIntensity(QImage &image, float percent, +TQImage& KImageEffect::channelIntensity(TQImage &image, float percent, RGBComponent channel) { if (image.width() == 0 || image.height() == 0) { @@ -934,7 +934,7 @@ QImage& KImageEffect::channelIntensity(QImage &image, float percent, // Modulate an image with an RBG channel of another image // -QImage& KImageEffect::modulate(QImage &image, QImage &modImage, bool reverse, +TQImage& KImageEffect::modulate(TQImage &image, TQImage &modImage, bool reverse, ModulationType type, int factor, RGBComponent channel) { if (image.width() == 0 || image.height() == 0 || @@ -946,7 +946,7 @@ QImage& KImageEffect::modulate(QImage &image, QImage &modImage, bool reverse, } int r, g, b, h, s, v, a; - QColor clr; + TQColor clr; int mod=0; unsigned int x1, x2, y1, y2; register int x, y; @@ -1064,7 +1064,7 @@ QImage& KImageEffect::modulate(QImage &image, QImage &modImage, bool reverse, // Nice and fast direct pixel manipulation -QImage& KImageEffect::blend(const QColor& clr, QImage& dst, float opacity) +TQImage& KImageEffect::blend(const TQColor& clr, TQImage& dst, float opacity) { if (dst.width() <= 0 || dst.height() <= 0) return dst; @@ -1305,7 +1305,7 @@ QImage& KImageEffect::blend(const QColor& clr, QImage& dst, float opacity) } // Nice and fast direct pixel manipulation -QImage& KImageEffect::blend(QImage& src, QImage& dst, float opacity) +TQImage& KImageEffect::blend(TQImage& src, TQImage& dst, float opacity) { if (src.width() <= 0 || src.height() <= 0) return dst; @@ -1534,8 +1534,8 @@ QImage& KImageEffect::blend(QImage& src, QImage& dst, float opacity) } -QImage& KImageEffect::blend(QImage &image, float initial_intensity, - const QColor &bgnd, GradientType eff, +TQImage& KImageEffect::blend(TQImage &image, float initial_intensity, + const TQColor &bgnd, GradientType eff, bool anti_dir) { if (image.width() == 0 || image.height() == 0 || image.depth()!=32 ) { @@ -1742,17 +1742,17 @@ QImage& KImageEffect::blend(QImage &image, float initial_intensity, // Not very efficient as we create a third big image... // -QImage& KImageEffect::blend(QImage &image1, QImage &image2, +TQImage& KImageEffect::blend(TQImage &image1, TQImage &image2, GradientType gt, int xf, int yf) { if (image1.width() == 0 || image1.height() == 0 || image2.width() == 0 || image2.height() == 0) return image1; - QImage image3; + TQImage image3; image3 = KImageEffect::unbalancedGradient(image1.size(), - QColor(0,0,0), QColor(255,255,255), + TQColor(0,0,0), TQColor(255,255,255), gt, xf, yf, 0); return blend(image1,image2,image3, Red); // Channel to use is arbitrary @@ -1760,8 +1760,8 @@ QImage& KImageEffect::blend(QImage &image1, QImage &image2, // Blend image2 into image1, using an RBG channel of blendImage // -QImage& KImageEffect::blend(QImage &image1, QImage &image2, - QImage &blendImage, RGBComponent channel) +TQImage& KImageEffect::blend(TQImage &image1, TQImage &image2, + TQImage &blendImage, RGBComponent channel) { if (image1.width() == 0 || image1.height() == 0 || image2.width() == 0 || image2.height() == 0 || @@ -1863,7 +1863,7 @@ unsigned int KImageEffect::uHash(unsigned int c) // ----------------------------------------------------------------------------- -QImage& KImageEffect::hash(QImage &image, Lighting lite, unsigned int spacing) +TQImage& KImageEffect::hash(TQImage &image, Lighting lite, unsigned int spacing) { if (image.width() == 0 || image.height() == 0) { #ifndef NDEBUG @@ -1944,8 +1944,8 @@ QImage& KImageEffect::hash(QImage &image, Lighting lite, unsigned int spacing) // //====================================================================== -QImage& KImageEffect::flatten(QImage &img, const QColor &ca, - const QColor &cb, int ncols) +TQImage& KImageEffect::flatten(TQImage &img, const TQColor &ca, + const TQColor &cb, int ncols) { if (img.width() == 0 || img.height() == 0) return img; @@ -2020,13 +2020,13 @@ QImage& KImageEffect::flatten(QImage &img, const QColor &ca, if (ncols == 1) ncols++; if (ncols > 256) ncols = 256; - QColor *pal = new QColor[ncols]; + TQColor *pal = new QColor[ncols]; sr = ((float) r2 - r1) / (ncols - 1); sg = ((float) g2 - g1) / (ncols - 1); sb = ((float) b2 - b1) / (ncols - 1); for (int i=0; i<ncols; i++) - pal[i] = QColor(r1 + int(sr*i), g1 + int(sg*i), b1 + int(sb*i)); + pal[i] = TQColor(r1 + int(sr*i), g1 + int(sg*i), b1 + int(sb*i)); dither(img, pal, ncols); @@ -2041,7 +2041,7 @@ QImage& KImageEffect::flatten(QImage &img, const QColor &ca, // //====================================================================== -QImage& KImageEffect::fade(QImage &img, float val, const QColor &color) +TQImage& KImageEffect::fade(TQImage &img, float val, const TQColor &color) { if (img.width() == 0 || img.height() == 0) return img; @@ -2123,7 +2123,7 @@ QImage& KImageEffect::fade(QImage &img, float val, const QColor &color) // // It does produce lower quality grayscale ;-) Use fast == true for the fast // algorithm, false for the higher quality one (mosfet). -QImage& KImageEffect::toGray(QImage &img, bool fast) +TQImage& KImageEffect::toGray(TQImage &img, bool fast) { if (img.width() == 0 || img.height() == 0) return img; @@ -2173,7 +2173,7 @@ QImage& KImageEffect::toGray(QImage &img, bool fast) } // CT 29Jan2000 - desaturation algorithms -QImage& KImageEffect::desaturate(QImage &img, float desat) +TQImage& KImageEffect::desaturate(TQImage &img, float desat) { if (img.width() == 0 || img.height() == 0) return img; @@ -2185,7 +2185,7 @@ QImage& KImageEffect::desaturate(QImage &img, float desat) unsigned int *data = img.depth() > 8 ? (unsigned int *)img.bits() : (unsigned int *)img.colorTable(); int h, s, v, i; - QColor clr; // keep constructor out of loop (mosfet) + TQColor clr; // keep constructor out of loop (mosfet) for(i=0; i < pixels; ++i){ clr.setRgb(data[i]); clr.hsv(&h, &s, &v); @@ -2196,7 +2196,7 @@ QImage& KImageEffect::desaturate(QImage &img, float desat) } // Contrast stuff (mosfet) -QImage& KImageEffect::contrast(QImage &img, int c) +TQImage& KImageEffect::contrast(TQImage &img, int c) { if (img.width() == 0 || img.height() == 0) return img; @@ -2258,13 +2258,13 @@ QImage& KImageEffect::contrast(QImage &img, int c) // Floyd-Steinberg dithering // Ref: Bitmapped Graphics Programming in C++ // Marv Luse, Addison-Wesley Publishing, 1993. -QImage& KImageEffect::dither(QImage &img, const QColor *palette, int size) +TQImage& KImageEffect::dither(TQImage &img, const TQColor *palette, int size) { if (img.width() == 0 || img.height() == 0 || palette == 0 || img.depth() <= 8) return img; - QImage dImage( img.width(), img.height(), 8, size ); + TQImage dImage( img.width(), img.height(), 8, size ); int i; dImage.setNumColors( size ); @@ -2345,7 +2345,7 @@ QImage& KImageEffect::dither(QImage &img, const QColor *palette, int size) return img; } -int KImageEffect::nearestColor( int r, int g, int b, const QColor *palette, int size ) +int KImageEffect::nearestColor( int r, int g, int b, const TQColor *palette, int size ) { if (palette == 0) return 0; @@ -2376,9 +2376,9 @@ int KImageEffect::nearestColor( int r, int g, int b, const QColor *palette, int } bool KImageEffect::blend( - const QImage & upper, - const QImage & lower, - QImage & output + const TQImage & upper, + const TQImage & lower, + TQImage & output ) { if ( @@ -2435,10 +2435,10 @@ bool KImageEffect::blend( #if 0 // Not yet... bool KImageEffect::blend( - const QImage & upper, - const QImage & lower, - QImage & output, - const QRect & destRect + const TQImage & upper, + const TQImage & lower, + TQImage & output, + const TQRect & destRect ) { output = lower.copy(); @@ -2449,9 +2449,9 @@ bool KImageEffect::blend( bool KImageEffect::blend( int &x, int &y, - const QImage & upper, - const QImage & lower, - QImage & output + const TQImage & upper, + const TQImage & lower, + TQImage & output ) { int cx=0, cy=0, cw=upper.width(), ch=upper.height(); @@ -2513,8 +2513,8 @@ bool KImageEffect::blend( bool KImageEffect::blendOnLower( int x, int y, - const QImage & upper, - const QImage & lower + const TQImage & upper, + const TQImage & lower ) { int cx=0, cy=0, cw=upper.width(), ch=upper.height(); @@ -2581,11 +2581,11 @@ bool KImageEffect::blendOnLower( return true; } -void KImageEffect::blendOnLower(const QImage &upper, const QPoint &upperOffset, - QImage &lower, const QRect &lowerRect) +void KImageEffect::blendOnLower(const TQImage &upper, const TQPoint &upperOffset, + TQImage &lower, const TQRect &lowerRect) { // clip rect - QRect lr = lowerRect & lower.rect(); + TQRect lr = lowerRect & lower.rect(); lr.setWidth( QMIN(lr.width(), upper.width()-upperOffset.x()) ); lr.setHeight( QMIN(lr.height(), upper.height()-upperOffset.y()) ); if ( !lr.isValid() ) return; @@ -2603,11 +2603,11 @@ void KImageEffect::blendOnLower(const QImage &upper, const QPoint &upperOffset, } } -void KImageEffect::blendOnLower(const QImage &upper, const QPoint &upperOffset, - QImage &lower, const QRect &lowerRect, float opacity) +void KImageEffect::blendOnLower(const TQImage &upper, const TQPoint &upperOffset, + TQImage &lower, const TQRect &lowerRect, float opacity) { // clip rect - QRect lr = lowerRect & lower.rect(); + TQRect lr = lowerRect & lower.rect(); lr.setWidth( QMIN(lr.width(), upper.width()-upperOffset.x()) ); lr.setHeight( QMIN(lr.height(), upper.height()-upperOffset.y()) ); if ( !lr.isValid() ) return; @@ -2625,14 +2625,14 @@ void KImageEffect::blendOnLower(const QImage &upper, const QPoint &upperOffset, } } -QRect KImageEffect::computeDestinationRect(const QSize &lowerSize, - Disposition disposition, QImage &upper) +TQRect KImageEffect::computeDestinationRect(const TQSize &lowerSize, + Disposition disposition, TQImage &upper) { int w = lowerSize.width(); int h = lowerSize.height(); int ww = upper.width(); int wh = upper.height(); - QRect d; + TQRect d; switch (disposition) { case NoImage: @@ -2690,19 +2690,19 @@ QRect KImageEffect::computeDestinationRect(const QSize &lowerSize, return d; } -void KImageEffect::blendOnLower(QImage &upper, QImage &lower, +void KImageEffect::blendOnLower(TQImage &upper, TQImage &lower, Disposition disposition, float opacity) { - QRect r = computeDestinationRect(lower.size(), disposition, upper); + TQRect r = computeDestinationRect(lower.size(), disposition, upper); for (int y = r.top(); y<r.bottom(); y += upper.height()) for (int x = r.left(); x<r.right(); x += upper.width()) - blendOnLower(upper, QPoint(-QMIN(x, 0), -QMIN(y, 0)), - lower, QRect(x, y, upper.width(), upper.height()), opacity); + blendOnLower(upper, TQPoint(-QMIN(x, 0), -QMIN(y, 0)), + lower, TQRect(x, y, upper.width(), upper.height()), opacity); } // For selected icons -QImage& KImageEffect::selectedImage( QImage &img, const QColor &col ) +TQImage& KImageEffect::selectedImage( TQImage &img, const TQColor &col ) { return blend( col, img, 0.5); } @@ -2744,14 +2744,14 @@ dealings in ImageMagick without prior written authorization from the ImageMagick Studio. */ -QImage KImageEffect::sample(QImage &src, int w, int h) +TQImage KImageEffect::sample(TQImage &src, int w, int h) { if(w == src.width() && h == src.height()) return(src); int depth = src.depth(); - QImage dest(w, h, depth, depth <= 8 ? src.numColors() : 0, - depth == 1 ? QImage::LittleEndian : QImage::IgnoreEndian); + TQImage dest(w, h, depth, depth <= 8 ? src.numColors() : 0, + depth == 1 ? TQImage::LittleEndian : TQImage::IgnoreEndian); int *x_offset = (int *)malloc(w*sizeof(int)); int *y_offset = (int *)malloc(h*sizeof(int)); if(!x_offset || !y_offset){ @@ -2778,7 +2778,7 @@ QImage KImageEffect::sample(QImage &src, int w, int h) } } else if(depth == 1) { - int r = src.bitOrder() == QImage::LittleEndian; + int r = src.bitOrder() == TQImage::LittleEndian; memcpy(dest.colorTable(), src.colorTable(), src.numColors()*sizeof(QRgb)); for(int y=0; y < h; ++y){ unsigned char *destData = dest.scanLine(y); @@ -2807,7 +2807,7 @@ QImage KImageEffect::sample(QImage &src, int w, int h) return(dest); } -void KImageEffect::threshold(QImage &img, unsigned int threshold) +void KImageEffect::threshold(TQImage &img, unsigned int threshold) { int i, count; unsigned int *data; @@ -2903,7 +2903,7 @@ void KImageEffect::hull(const int x_offset, const int y_offset, } } -QImage KImageEffect::despeckle(QImage &src) +TQImage KImageEffect::despeckle(TQImage &src) { int i, j, x, y; unsigned int *blue_channel, *red_channel, *green_channel, *buffer, @@ -2914,7 +2914,7 @@ QImage KImageEffect::despeckle(QImage &src) Y[4]= {1, 0, 1, 1}; unsigned int *destData; - QImage dest(src.width(), src.height(), 32); + TQImage dest(src.width(), src.height(), 32); packets = (src.width()+2)*(src.height()+2); red_channel = (unsigned int *)calloc(packets, sizeof(unsigned int)); @@ -3109,10 +3109,10 @@ unsigned int KImageEffect::generateNoise(unsigned int pixel, return((unsigned int) (value+0.5)); } -QImage KImageEffect::addNoise(QImage &src, NoiseType noise_type) +TQImage KImageEffect::addNoise(TQImage &src, NoiseType noise_type) { int x, y; - QImage dest(src.width(), src.height(), 32); + TQImage dest(src.width(), src.height(), 32); unsigned int *destData; if(src.depth() > 8){ // DirectClass source image @@ -3148,7 +3148,7 @@ QImage KImageEffect::addNoise(QImage &src, NoiseType noise_type) return(dest); } -unsigned int KImageEffect::interpolateColor(QImage *image, double x_offset, +unsigned int KImageEffect::interpolateColor(TQImage *image, double x_offset, double y_offset, unsigned int background) { @@ -3239,7 +3239,7 @@ unsigned int KImageEffect::interpolateColor(QImage *image, double x_offset, (unsigned char)(beta*(alpha*qAlpha(p)+x_offset*qAlpha(q))+y_offset*(alpha*qAlpha(r)+x_offset*qAlpha(s))))); } -QImage KImageEffect::implode(QImage &src, double factor, +TQImage KImageEffect::implode(TQImage &src, double factor, unsigned int background) { double amount, distance, radius; @@ -3248,7 +3248,7 @@ QImage KImageEffect::implode(QImage &src, double factor, unsigned int *destData; int x, y; - QImage dest(src.width(), src.height(), 32); + TQImage dest(src.width(), src.height(), 32); // compute scaling factor x_scale = 1.0; @@ -3320,9 +3320,9 @@ QImage KImageEffect::implode(QImage &src, double factor, return(dest); } -QImage KImageEffect::rotate(QImage &img, RotateDirection r) +TQImage KImageEffect::rotate(TQImage &img, RotateDirection r) { - QImage dest; + TQImage dest; int x, y; if(img.depth() > 8){ unsigned int *srcData, *destData; @@ -3418,7 +3418,7 @@ QImage KImageEffect::rotate(QImage &img, RotateDirection r) return(dest); } -void KImageEffect::solarize(QImage &img, double factor) +void KImageEffect::solarize(TQImage &img, double factor) { int i, count; int threshold; @@ -3441,13 +3441,13 @@ void KImageEffect::solarize(QImage &img, double factor) } } -QImage KImageEffect::spread(QImage &src, unsigned int amount) +TQImage KImageEffect::spread(TQImage &src, unsigned int amount) { int quantum, x, y; int x_distance, y_distance; if(src.width() < 3 || src.height() < 3) return(src); - QImage dest(src); + TQImage dest(src); dest.detach(); quantum=(amount+1) >> 1; if(src.depth() > 8){ // DirectClass source image @@ -3492,14 +3492,14 @@ QImage KImageEffect::spread(QImage &src, unsigned int amount) return(dest); } -QImage KImageEffect::swirl(QImage &src, double degrees, +TQImage KImageEffect::swirl(TQImage &src, double degrees, unsigned int background) { double cosine, distance, factor, radius, sine, x_center, x_distance, x_scale, y_center, y_distance, y_scale; int x, y; unsigned int *q; - QImage dest(src.width(), src.height(), 32); + TQImage dest(src.width(), src.height(), 32); // compute scaling factor x_center = src.width()/2.0; @@ -3570,14 +3570,14 @@ QImage KImageEffect::swirl(QImage &src, double degrees, return(dest); } -QImage KImageEffect::wave(QImage &src, double amplitude, double wavelength, +TQImage KImageEffect::wave(TQImage &src, double amplitude, double wavelength, unsigned int background) { double *sine_map; int x, y; unsigned int *q; - QImage dest(src.width(), src.height() + (int)(2*fabs(amplitude)), 32); + TQImage dest(src.width(), src.height() + (int)(2*fabs(amplitude)), 32); // allocate sine map sine_map = (double *)malloc(dest.width()*sizeof(double)); if(!sine_map) @@ -3603,13 +3603,13 @@ QImage KImageEffect::wave(QImage &src, double amplitude, double wavelength, // New algorithms based on ImageMagick 5.5.6 (05/26/03) -QImage KImageEffect::oilPaint(QImage &src, int /*radius*/) +TQImage KImageEffect::oilPaint(TQImage &src, int /*radius*/) { /* binary compat method - remove me when possible! */ return(oilPaintConvolve(src, 0)); } -QImage KImageEffect::oilPaintConvolve(QImage &src, double radius) +TQImage KImageEffect::oilPaintConvolve(TQImage &src, double radius) { unsigned long count /*,*histogram*/; unsigned long histogram[256]; @@ -3621,7 +3621,7 @@ QImage KImageEffect::oilPaintConvolve(QImage &src, double radius) if(src.depth() < 32) src.convertDepth(32); - QImage dest(src); + TQImage dest(src); dest.detach(); width = getOptimalKernelWidth(radius, 0.5); @@ -3674,15 +3674,15 @@ QImage KImageEffect::oilPaintConvolve(QImage &src, double radius) return(dest); } -QImage KImageEffect::charcoal(QImage &src, double /*factor*/) +TQImage KImageEffect::charcoal(TQImage &src, double /*factor*/) { /* binary compat method - remove me when possible! */ return(charcoal(src, 0, 1)); } -QImage KImageEffect::charcoal(QImage &src, double radius, double sigma) +TQImage KImageEffect::charcoal(TQImage &src, double radius, double sigma) { - QImage img(edge(src, radius)); + TQImage img(edge(src, radius)); img = blur(img, radius, sigma); normalize(img); img.invertPixels(false); @@ -3690,7 +3690,7 @@ QImage KImageEffect::charcoal(QImage &src, double radius, double sigma) return(img); } -void KImageEffect::normalize(QImage &image) +void KImageEffect::normalize(TQImage &image) { struct double_packet high, low, intensity, *histogram; struct short_packet *normalize_map; @@ -3900,7 +3900,7 @@ void KImageEffect::normalize(QImage &image) liberateMemory(&normalize_map); } -void KImageEffect::equalize(QImage &image) +void KImageEffect::equalize(TQImage &image) { struct double_packet high, low, intensity, *map, *histogram; struct short_packet *equalize_map; @@ -4000,12 +4000,12 @@ void KImageEffect::equalize(QImage &image) } -QImage KImageEffect::edge(QImage &image, double radius) +TQImage KImageEffect::edge(TQImage &image, double radius) { double *kernel; int width; register long i; - QImage dest; + TQImage dest; if(radius == 50.0){ /* For binary compatability! Remove me when possible! This used to @@ -4032,18 +4032,18 @@ QImage KImageEffect::edge(QImage &image, double radius) return(dest); } -QImage KImageEffect::emboss(QImage &src) +TQImage KImageEffect::emboss(TQImage &src) { /* binary compat method - remove me when possible! */ return(emboss(src, 0, 1)); } -QImage KImageEffect::emboss(QImage &image, double radius, double sigma) +TQImage KImageEffect::emboss(TQImage &image, double radius, double sigma) { double alpha, *kernel; int j, width; register long i, u, v; - QImage dest; + TQImage dest; if(sigma == 0.0){ qWarning("KImageEffect::emboss(): Zero sigma is not permitted!"); @@ -4251,16 +4251,16 @@ int KImageEffect::getBlurKernel(int width, double sigma, double **kernel) return(width); } -QImage KImageEffect::blur(QImage &src, double /*factor*/) +TQImage KImageEffect::blur(TQImage &src, double /*factor*/) { /* binary compat method - remove me when possible! */ return(blur(src, 0, 1)); } -QImage KImageEffect::blur(QImage &src, double radius, double sigma) +TQImage KImageEffect::blur(TQImage &src, double radius, double sigma) { double *kernel; - QImage dest; + TQImage dest; int width; int x, y; unsigned int *scanline, *temp; @@ -4329,7 +4329,7 @@ QImage KImageEffect::blur(QImage &src, double radius, double sigma) return(dest); } -bool KImageEffect::convolveImage(QImage *image, QImage *dest, +bool KImageEffect::convolveImage(TQImage *image, TQImage *dest, const unsigned int order, const double *kernel) { @@ -4427,18 +4427,18 @@ int KImageEffect::getOptimalKernelWidth(double radius, double sigma) return((int)width-2); } -QImage KImageEffect::sharpen(QImage &src, double /*factor*/) +TQImage KImageEffect::sharpen(TQImage &src, double /*factor*/) { /* binary compat method - remove me when possible! */ return(sharpen(src, 0, 1)); } -QImage KImageEffect::sharpen(QImage &image, double radius, double sigma) +TQImage KImageEffect::sharpen(TQImage &image, double radius, double sigma) { double alpha, normalize, *kernel; int width; register long i, u, v; - QImage dest; + TQImage dest; if(sigma == 0.0){ qWarning("KImageEffect::sharpen(): Zero sigma is not permitted!"); @@ -4473,7 +4473,7 @@ QImage KImageEffect::sharpen(QImage &image, double radius, double sigma) // End of new algorithms -QImage KImageEffect::shade(QImage &src, bool color_shading, double azimuth, +TQImage KImageEffect::shade(TQImage &src, bool color_shading, double azimuth, double elevation) { struct PointInfo{ @@ -4487,7 +4487,7 @@ QImage KImageEffect::shade(QImage &src, bool color_shading, double azimuth, unsigned int *q; - QImage dest(src.width(), src.height(), 32); + TQImage dest(src.width(), src.height(), 32); azimuth = DegreesToRadians(azimuth); elevation = DegreesToRadians(elevation); @@ -4611,13 +4611,13 @@ QImage KImageEffect::shade(QImage &src, bool color_shading, double azimuth, // taking a grayscale threshold (ie: 128) and incrementing RGB color // channels above it and decrementing those below it, but this gives much // better results. (mosfet 12/28/01) -void KImageEffect::contrastHSV(QImage &img, bool sharpen) +void KImageEffect::contrastHSV(TQImage &img, bool sharpen) { int i, sign; unsigned int *data; int count; double brightness, scale, theta; - QColor c; + TQColor c; int h, s, v; sign = sharpen ? 1 : -1; @@ -4848,12 +4848,12 @@ static void bumpmap_row( uint *src, * @return The destination image (dst) containing the result. * @author Zack Rusin <zack@kde.org> */ -QImage KImageEffect::bumpmap(QImage &img, QImage &map, double azimuth, double elevation, +TQImage KImageEffect::bumpmap(TQImage &img, TQImage &map, double azimuth, double elevation, int depth, int xofs, int yofs, int waterlevel, int ambient, bool compensate, bool invert, BumpmapType type, bool tiled) { - QImage dst; + TQImage dst; if ( img.depth() != 32 || img.depth() != 32 ) { qWarning( "Bump-mapping effect works only with 32 bit images"); diff --git a/kdefx/kimageeffect.h b/kdefx/kimageeffect.h index 7bca73820..4a4c68dd4 100644 --- a/kdefx/kimageeffect.h +++ b/kdefx/kimageeffect.h @@ -40,7 +40,7 @@ class QPoint; class QRect; /** - * This class includes various QImage based graphical effects. + * This class includes various TQImage based graphical effects. * * Everything is * static, so there is no need to create an instance of this class. You can @@ -143,8 +143,8 @@ public: * truecolor display. The gradient will be dithered to this number of * colors. Pass 0 to prevent dithering. */ - static QImage gradient(const QSize &size, const QColor &ca, - const QColor &cb, GradientType type, int ncols=3); + static TQImage gradient(const TQSize &size, const TQColor &ca, + const TQColor &cb, GradientType type, int ncols=3); /** * Create an unbalanced gradient. @@ -160,8 +160,8 @@ public: * @param yfactor The y decay length. * @param ncols The number of colors. See KImageEffect:gradient. */ - static QImage unbalancedGradient(const QSize &size, const QColor &ca, - const QColor &cb, GradientType type, int xfactor = 100, + static TQImage unbalancedGradient(const TQSize &size, const TQColor &ca, + const TQColor &cb, GradientType type, int xfactor = 100, int yfactor = 100, int ncols = 3); /** @@ -180,7 +180,7 @@ public: * @author Karol Szwed (gallium@kde.org) * @author Fredrik Höglund (fredrik@kde.org) */ - static QImage& blend(const QColor& clr, QImage& dst, float opacity); + static TQImage& blend(const TQColor& clr, TQImage& dst, float opacity); /** * Blend the src image into the destination image, using an opacity @@ -198,7 +198,7 @@ public: * @author Karol Szwed (gallium@kde.org) * @author Fredrik Höglund (fredrik@kde.org) */ - static QImage& blend(QImage& src, QImage& dst, float opacity); + static TQImage& blend(TQImage& src, TQImage& dst, float opacity); /** * Blend the provided image into a background of the indicated color. @@ -214,8 +214,8 @@ public: * with concentric blending effects) * @param image must be 32bpp */ - static QImage& blend(QImage &image, float initial_intensity, - const QColor &bgnd, GradientType eff, + static TQImage& blend(TQImage &image, float initial_intensity, + const TQColor &bgnd, GradientType eff, bool anti_dir=false); /** @@ -228,7 +228,7 @@ public: * @param xf x decay length for unbalanced gradient tpye * @param yf y decay length for unbalanced gradient tpye */ - static QImage& blend(QImage &image1,QImage &image2, + static TQImage& blend(TQImage &image1,TQImage &image2, GradientType gt, int xf=100, int yf=100); /** @@ -243,8 +243,8 @@ public: * in between, a corresponding blending is used. * @param channel The RBG channel to use for the blending decision. */ - static QImage& blend(QImage &image1, QImage &image2, - QImage &blendImage, RGBComponent channel); + static TQImage& blend(TQImage &image1, TQImage &image2, + TQImage &blendImage, RGBComponent channel); /** * Blend an image into another one, using alpha in the expected way. @@ -253,13 +253,13 @@ public: * @param output the target image * @author Rik Hemsley (rikkus) <rik@kde.org> */ - static bool blend(const QImage & upper, const QImage & lower, QImage & output); -// Not yet... static bool blend(const QImage & image1, const QImage & image2, QImage & output, const QRect & destRect); + static bool blend(const TQImage & upper, const TQImage & lower, TQImage & output); +// Not yet... static bool blend(const TQImage & image1, const TQImage & image2, TQImage & output, const TQRect & destRect); /** * Blend an image into another one, using alpha in the expected way and * over coordinates @p x and @p y with respect to the lower image. - * The output is a QImage which is the @p upper image already blended + * The output is a TQImage which is the @p upper image already blended * with the @p lower one, so its size will be (in general) the same than * @p upper instead of the same size than @p lower like the method above. * In fact, the size of @p output is like upper's one only when it can be @@ -272,7 +272,7 @@ public: * @param lower the "lower" image * @param output the target image */ - static bool blend(int &x, int &y, const QImage & upper, const QImage & lower, QImage & output); + static bool blend(int &x, int &y, const TQImage & upper, const TQImage & lower, TQImage & output); /** * Blend an image into another one, using alpha in the expected way and @@ -284,7 +284,7 @@ public: * @param upper the "upper" image * @param lower the "lower" image, which becomes the output image */ - static bool blendOnLower(int x, int y, const QImage & upper, const QImage & lower); + static bool blendOnLower(int x, int y, const TQImage & upper, const TQImage & lower); /** * Blend part of an image into part of another, using the alpha channel in @@ -298,8 +298,8 @@ public: * blending will occur. * @since 3.2 */ - static void blendOnLower(const QImage &upper, const QPoint &upperOffset, - QImage &lower, const QRect &lowerRect); + static void blendOnLower(const TQImage &upper, const TQPoint &upperOffset, + TQImage &lower, const TQRect &lowerRect); /** * Blend part of an image into part of another, using the opacity value @@ -315,8 +315,8 @@ public: * the source image will be blended into the destination image. * @since 3.2 */ - static void blendOnLower(const QImage &upper, const QPoint &upperOffset, - QImage &lower, const QRect &lowerRect, float opacity); + static void blendOnLower(const TQImage &upper, const TQPoint &upperOffset, + TQImage &lower, const TQRect &lowerRect, float opacity); /** * Disposition of a source image on top of a destination image. @@ -347,8 +347,8 @@ public: * @return the computed rectangle. Its size may exceed @e lowerSize. * @since 3.2 */ - static QRect computeDestinationRect(const QSize &lowerSize, - Disposition disposition, QImage &upper); + static TQRect computeDestinationRect(const TQSize &lowerSize, + Disposition disposition, TQImage &upper); /** * Blend an image on top of another using a given disposition and a given @@ -356,19 +356,19 @@ public: * way. Beware the upper image may be modified. * @since 3.2 */ - static void blendOnLower(QImage &upper, QImage &lower, + static void blendOnLower(TQImage &upper, TQImage &lower, Disposition disposition, float opacity); /** * Modifies the intensity of a pixmap's RGB channel component. * - * @param image The QImage to process. + * @param image The TQImage to process. * @param percent Percent value. Use a negative value to dim. * @param channel Which channel(s) should be modified * @return The @p image, provided for convenience. * @author Daniel M. Duley (mosfet) */ - static QImage& channelIntensity(QImage &image, float percent, + static TQImage& channelIntensity(TQImage &image, float percent, RGBComponent channel); /** @@ -376,36 +376,36 @@ public: * * The number of colors will not be changed. * - * @param image The QImage to process. + * @param image The TQImage to process. * @param val The strength of the effect. 0 <= val <= 1. * @param color The background color. * @return Returns the image(), provided for convenience. */ - static QImage& fade(QImage &image, float val, const QColor &color); + static TQImage& fade(TQImage &image, float val, const TQColor &color); /** * This recolors a pixmap. The most dark color will become color a, * the most bright one color b, and in between. * - * @param image A QImage to process. + * @param image A TQImage to process. * @param ca Color a * @param cb Color b * @param ncols The number of colors to dither the image to. * Pass 0 to prevent dithering. */ - static QImage& flatten(QImage &image, const QColor &ca, - const QColor &cb, int ncols=0); + static TQImage& flatten(TQImage &image, const TQColor &ca, + const TQColor &cb, int ncols=0); /** * Build a hash on any given QImage * - * @param image The QImage to process + * @param image The TQImage to process * @param lite The hash faces the indicated lighting (cardinal poles). * @param spacing How many unmodified pixels in between hashes. * @return Returns the image(), provided for convenience. */ - static QImage& hash(QImage &image, Lighting lite=NorthLite, + static TQImage& hash(TQImage &image, Lighting lite=NorthLite, unsigned int spacing=0); /** @@ -415,77 +415,77 @@ public: * This function uses MMX instructions to process the image * on processors that support it. * - * @param image The QImage to process. + * @param image The TQImage to process. * @param percent The percent value. Use a negative value to dim. * @return Returns The image(), provided for convenience. * @author Daniel M. Duley (mosfet) * @author Benjamin Roe (ben@benroe.com) */ - static QImage& intensity(QImage &image, float percent); + static TQImage& intensity(TQImage &image, float percent); /** * Modulate the image with a color channel of another image. * - * @param image The QImage to modulate and result. - * @param modImage The QImage to use for modulation. + * @param image The TQImage to modulate and result. + * @param modImage The TQImage to use for modulation. * @param reverse Invert the meaning of image/modImage; result is image! * @param type The modulation Type to use. * @param factor The modulation amplitude; with 0 no effect [-200;200]. * @param channel The RBG channel of image2 to use for modulation. * @return Returns the image(), provided for convenience. */ - static QImage& modulate(QImage &image, QImage &modImage, bool reverse, + static TQImage& modulate(TQImage &image, TQImage &modImage, bool reverse, ModulationType type, int factor, RGBComponent channel); /** * Convert an image to grayscale. * - * @param image The QImage to process. + * @param image The TQImage to process. * @param fast Set to @p true in order to use a faster but non-photographic * quality algorithm. Appropriate for things such as toolbar icons. * @return Returns the image(), provided for convenience. * @author Daniel M. Duley (mosfet) */ - static QImage& toGray(QImage &image, bool fast = false); + static TQImage& toGray(TQImage &image, bool fast = false); /** * Desaturate an image evenly. * - * @param image The QImage to process. + * @param image The TQImage to process. * @param desat A value between 0 and 1 setting the degree of desaturation * @return Returns the image(), provided for convenience. */ - static QImage& desaturate(QImage &image, float desat = 0.3); + static TQImage& desaturate(TQImage &image, float desat = 0.3); /** * Fast, but low quality contrast of an image. Also see contrastHSV. * - * @param image The QImage to process. + * @param image The TQImage to process. * @param c A contrast value between -255 to 255. * @return The image(), provided for convenience. * @author Daniel M. Duley (mosfet) * ### KDE 4: remove */ - static QImage& contrast(QImage &image, int c); + static TQImage& contrast(TQImage &image, int c); /** * Dither an image using Floyd-Steinberg dithering for low-color * situations. * - * @param image The QImage to process. + * @param image The TQImage to process. * @param palette The color palette to use * @param size The size of the palette * @return Returns the image(), provided for convenience. */ - static QImage& dither(QImage &image, const QColor *palette, int size); + static TQImage& dither(TQImage &image, const TQColor *palette, int size); /** * Calculate the image for a selected image, for instance a selected icon * on the desktop. - * @param img the QImage to select - * @param col the selected color, usually from QColorGroup::highlight(). + * @param img the TQImage to select + * @param col the selected color, usually from TQColorGroup::highlight(). */ - static QImage& selectedImage( QImage &img, const QColor &col ); + static TQImage& selectedImage( TQImage &img, const TQColor &col ); /** * High quality, expensive HSV contrast. You can do a faster one by just @@ -493,12 +493,12 @@ public: * channels above it and decrementing those below it, but this gives much * better results. * - * @param img The QImage to process. + * @param img The TQImage to process. * @param sharpen If true sharpness is increase, (spiffed). Otherwise * it is decreased, (dulled). * @author Daniel M. Duley (mosfet) */ - static void contrastHSV(QImage &img, bool sharpen=true); + static void contrastHSV(TQImage &img, bool sharpen=true); /** * Normalises the pixel values to span the full range of color values. @@ -506,7 +506,7 @@ public: * @param img the image that is normalised * @author Daniel M. Duley (mosfet) */ - static void normalize(QImage &img); + static void normalize(TQImage &img); /** * Performs histogram equalisation on the reference @@ -514,35 +514,35 @@ public: * @param img the image that is equalised * @author Daniel M. Duley (mosfet) */ - static void equalize(QImage &img); + static void equalize(TQImage &img); /** * Thresholds the reference image. You can also threshold images by using - * ThresholdDither in the various QPixmap/QImage convert methods, but this + * ThresholdDither in the various QPixmap/TQImage convert methods, but this * lets you specify a threshold value. * - * @param img The QImage to process. + * @param img The TQImage to process. * @param value The threshold value. * @author Daniel M. Duley (mosfet) */ - static void threshold(QImage &img, unsigned int value=128); + static void threshold(TQImage &img, unsigned int value=128); /** * Produces a 'solarization' effect seen when exposing a photographic * film to light during the development process. * - * @param img The QImage to process. + * @param img The TQImage to process. * @param factor The extent of the solarization (0-99.9) * @author Daniel M. Duley (mosfet) */ - static void solarize(QImage &img, double factor=50.0); + static void solarize(TQImage &img, double factor=50.0); /** * Embosses the source image. This involves highlighting the edges * and applying various other enhancements in order to get a metal * effect. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param radius The radius of the gaussian not counting the * center pixel. Use 0 and a suitable radius will be automatically used. * @param sigma The standard deviation of the gaussian. Use 1 if you're not @@ -550,27 +550,27 @@ public: * @return The embossed image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage emboss(QImage &src, double radius, double sigma); + static TQImage emboss(TQImage &src, double radius, double sigma); /** * Convenience method. */ - static QImage emboss(QImage &src); + static TQImage emboss(TQImage &src); /** * Minimizes speckle noise in the source image using the 8 hull * algorithm. * - * @param src The QImage to process. + * @param src The TQImage to process. * @return The despeckled image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage despeckle(QImage &src); + static TQImage despeckle(TQImage &src); /** * Produces a neat little "charcoal" effect. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param radius The radius of the gaussian not counting the * center pixel. Use 0 and a suitable radius will be automatically used. * @param sigma The standard deviation of the gaussian. Use 1 if you're not @@ -578,51 +578,51 @@ public: * @return The charcoal image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage charcoal(QImage &src, double radius, double sigma); + static TQImage charcoal(TQImage &src, double radius, double sigma); /** * This is provided for binary compatability only! Use the above method * with a radius and sigma instead! */ - static QImage charcoal(QImage &src, double factor=50.0); + static TQImage charcoal(TQImage &src, double factor=50.0); /** * Rotates the image by the specified amount * - * @param src The QImage to process. + * @param src The TQImage to process. * @param r The rotate direction. * @return The rotated image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage rotate(QImage &src, RotateDirection r); + static TQImage rotate(TQImage &src, RotateDirection r); /** * Scales an image using simple pixel sampling. This does not produce - * nearly as nice a result as QImage::smoothScale(), but has the + * nearly as nice a result as TQImage::smoothScale(), but has the * advantage of being much faster - only a few milliseconds. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param w The new width. * @param h The new height. * @return The scaled image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage sample(QImage &src, int w, int h); + static TQImage sample(TQImage &src, int w, int h); /** * Adds noise to an image. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param type The algorithm used to generate the noise. * @return The image with noise added. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage addNoise(QImage &src, NoiseType type = GaussianNoise); + static TQImage addNoise(TQImage &src, NoiseType type = GaussianNoise); /** * Blurs an image by convolving pixel neighborhoods. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param radius The radius of the gaussian not counting the * center pixel. Use 0 and a suitable radius will be automatically used. * @param sigma The standard deviation of the gaussian. Use 1 if you're not @@ -630,60 +630,60 @@ public: * @return The blurred image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage blur(QImage &src, double radius, double sigma); + static TQImage blur(TQImage &src, double radius, double sigma); /** * This is provided for binary compatability only! Use the above method * with a radius and sigma instead! */ - static QImage blur(QImage &src, double factor=50.0); + static TQImage blur(TQImage &src, double factor=50.0); /** * Detects edges in an image using pixel neighborhoods and an edge * detection mask. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param radius The radius of the gaussian not counting the * center pixel. Use 0 and a suitable radius will be automatically used. * @return The image with edges detected. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage edge(QImage &src, double radius); + static TQImage edge(TQImage &src, double radius); /** * Implodes an image by a specified percent. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param factor The extent of the implosion. * @param background An RGBA value to use for the background. After the * effect some pixels may be "empty". This value is used for those pixels. * @return The imploded image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage implode(QImage &src, double factor=30.0, + static TQImage implode(TQImage &src, double factor=30.0, unsigned int background = 0xFFFFFFFF); /** * Produces an oil painting effect. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param radius The radius of the gaussian not counting the * center pixel. Use 0 and a suitable radius will be automatically used. * @return The new image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage oilPaintConvolve(QImage &src, double radius); + static TQImage oilPaintConvolve(TQImage &src, double radius); /** * This is provided for binary compatability only! Use the above method * instead! */ - static QImage oilPaint(QImage &src, int radius=3); + static TQImage oilPaint(TQImage &src, int radius=3); /** * Sharpens the pixels in the image using pixel neighborhoods. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param radius The radius of the gaussian not counting the * center pixel. Use 0 and a suitable radius will be automatically used. * @param sigma The standard deviation of the gaussian. Use 1 if you're not @@ -691,53 +691,53 @@ public: * @return The sharpened image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage sharpen(QImage &src, double radius, double sigma); + static TQImage sharpen(TQImage &src, double radius, double sigma); /** * This is provided for binary compatability only! Use the above method * instead! */ - static QImage sharpen(QImage &src, double factor=30.0); + static TQImage sharpen(TQImage &src, double factor=30.0); /** * Randomly displaces pixels. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param amount The vicinity for choosing a random pixel to swap. * @return The image with pixels displaced. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage spread(QImage &src, unsigned int amount=3); + static TQImage spread(TQImage &src, unsigned int amount=3); /** * Shades the image using a distance light source. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param color_shading If true do color shading, otherwise do grayscale. * @param azimuth Determines the light source and direction. * @param elevation Determines the light source and direction. * @return The shaded image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage shade(QImage &src, bool color_shading=true, double azimuth=30.0, + static TQImage shade(TQImage &src, bool color_shading=true, double azimuth=30.0, double elevation=30.0); /** * Swirls the image by a specified amount * - * @param src The QImage to process. + * @param src The TQImage to process. * @param degrees The tightness of the swirl. * @param background An RGBA value to use for the background. After the * effect some pixels may be "empty". This value is used for those pixels. * @return The swirled image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage swirl(QImage &src, double degrees=50.0, unsigned int background = + static TQImage swirl(TQImage &src, double degrees=50.0, unsigned int background = 0xFFFFFFFF); /** * Modifies the pixels along a sine wave. * - * @param src The QImage to process. + * @param src The TQImage to process. * @param amplitude The amplitude of the sine wave. * @param frequency The frequency of the sine wave. * @param background An RGBA value to use for the background. After the @@ -745,7 +745,7 @@ public: * @return The new image. The original is not changed. * @author Daniel M. Duley (mosfet) */ - static QImage wave(QImage &src, double amplitude=25.0, double frequency=150.0, + static TQImage wave(TQImage &src, double amplitude=25.0, double frequency=150.0, unsigned int background = 0xFFFFFFFF); /** @@ -768,7 +768,7 @@ public: * @return The destination image (dst) containing the result. * @author Zack Rusin <zack@kde.org> */ - static QImage bumpmap(QImage &img, QImage &map, double azimuth, double elevation, + static TQImage bumpmap(TQImage &img, TQImage &map, double azimuth, double elevation, int depth, int xofs, int yofs, int waterlevel, int ambient, bool compensate, bool invert, BumpmapType type, bool tiled); @@ -785,17 +785,17 @@ private: /** * Helper function to find the nearest color to the RBG triplet */ - static int nearestColor( int r, int g, int b, const QColor *pal, int size ); + static int nearestColor( int r, int g, int b, const TQColor *pal, int size ); static void hull(const int x_offset, const int y_offset, const int polarity, const int width, const int height, unsigned int *f, unsigned int *g); static unsigned int generateNoise(unsigned int pixel, NoiseType type); - static unsigned int interpolateColor(QImage *image, double x, double y, + static unsigned int interpolateColor(TQImage *image, double x, double y, unsigned int background); /* Various convolve routines */ static int getOptimalKernelWidth(double radius, double sigma); - static bool convolveImage(QImage *image, QImage *dest, + static bool convolveImage(TQImage *image, TQImage *dest, const unsigned int order, const double *kernel); static void blurScanLine(double *kernel, int width, diff --git a/kdefx/kpixmap.cpp b/kdefx/kpixmap.cpp index 9d7b186bd..ac8cd6d4e 100644 --- a/kdefx/kpixmap.cpp +++ b/kdefx/kpixmap.cpp @@ -21,18 +21,18 @@ * Boston, MA 02110-1301, USA. */ -#include <qpixmap.h> -#include <qpainter.h> -#include <qimage.h> -#include <qbitmap.h> -#include <qcolor.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqbitmap.h> +#include <tqcolor.h> #include <stdlib.h> #include "kpixmap.h" // Fast diffuse dither to 3x3x3 color cube // Based on Qt's image conversion functions -static bool kdither_32_to_8( const QImage *src, QImage *dst ) +static bool kdither_32_to_8( const TQImage *src, TQImage *dst ) { // register QRgb *p; uchar *b; @@ -77,7 +77,7 @@ static bool kdither_32_to_8( const QImage *src, QImage *dst ) for ( y=0; y < src->height(); y++ ) { // p = (QRgb *)src->scanLine(y); b = dst->scanLine(y); - int endian = (QImage::systemBitOrder() == QImage::BigEndian); + int endian = (TQImage::systemBitOrder() == TQImage::BigEndian); int x; uchar* q = src->scanLine(y); uchar* q2 = src->scanLine(y+1 < src->height() ? y + 1 : 0); @@ -161,10 +161,10 @@ KPixmap::~KPixmap() { } -bool KPixmap::load( const QString& fileName, const char *format, +bool KPixmap::load( const TQString& fileName, const char *format, int conversion_flags ) { - QImageIO io( fileName, format ); + TQImageIO io( fileName, format ); bool result = io.read(); @@ -175,7 +175,7 @@ bool KPixmap::load( const QString& fileName, const char *format, return result; } -bool KPixmap::load( const QString& fileName, const char *format, +bool KPixmap::load( const TQString& fileName, const char *format, ColorMode mode ) { int conversion_flags = 0; @@ -198,7 +198,7 @@ bool KPixmap::load( const QString& fileName, const char *format, return load( fileName, format, conversion_flags ); } -bool KPixmap::convertFromImage( const QImage &img, ColorMode mode ) +bool KPixmap::convertFromImage( const TQImage &img, ColorMode mode ) { int conversion_flags = 0; switch (mode) { @@ -220,7 +220,7 @@ bool KPixmap::convertFromImage( const QImage &img, ColorMode mode ) return convertFromImage( img, conversion_flags ); } -bool KPixmap::convertFromImage( const QImage &img, int conversion_flags ) +bool KPixmap::convertFromImage( const TQImage &img, int conversion_flags ) { if ( img.isNull() ) { #if defined(CHECK_NULL) @@ -235,7 +235,7 @@ bool KPixmap::convertFromImage( const QImage &img, int conversion_flags ) // If color mode not one of KPixmaps extra modes nothing to do if ( ( conversion_flags & KColorMode_Mask ) != LowOnly && ( conversion_flags & KColorMode_Mask ) != WebOnly ) { - return QPixmap::convertFromImage ( img, conversion_flags ); + return TQPixmap::convertFromImage ( img, conversion_flags ); } // If the default pixmap depth is not 8bpp, KPixmap color modes have no @@ -244,7 +244,7 @@ bool KPixmap::convertFromImage( const QImage &img, int conversion_flags ) if ( ( conversion_flags & KColorMode_Mask ) == LowOnly || ( conversion_flags & KColorMode_Mask ) == WebOnly ) conversion_flags = (conversion_flags & ~KColorMode_Mask) | Auto; - return QPixmap::convertFromImage ( img, conversion_flags ); + return TQPixmap::convertFromImage ( img, conversion_flags ); } if ( ( conversion_flags & KColorMode_Mask ) == LowOnly ) { @@ -256,14 +256,14 @@ bool KPixmap::convertFromImage( const QImage &img, int conversion_flags ) // If image uses icon palette don't dither it. if( img.numColors() > 0 && img.numColors() <=40 ) { if ( checkColorTable( img ) ) - return QPixmap::convertFromImage( img, QPixmap::Auto ); + return TQPixmap::convertFromImage( img, TQPixmap::Auto ); } - QBitmap mask; + TQBitmap mask; bool isMask = false; - QImage image = img.convertDepth(32); - QImage tImage( image.width(), image.height(), 8, 256 ); + TQImage image = img.convertDepth(32); + TQImage tImage( image.width(), image.height(), 8, 256 ); if( img.hasAlphaBuffer() ) { image.setAlphaBuffer( true ); @@ -273,22 +273,22 @@ bool KPixmap::convertFromImage( const QImage &img, int conversion_flags ) kdither_32_to_8( &image, &tImage ); - if( QPixmap::convertFromImage( tImage ) ) { - if ( isMask ) QPixmap::setMask( mask ); + if( TQPixmap::convertFromImage( tImage ) ) { + if ( isMask ) TQPixmap::setMask( mask ); return true; } else return false; } else { - QImage image = img.convertDepth( 32 ); + TQImage image = img.convertDepth( 32 ); image.setAlphaBuffer( img.hasAlphaBuffer() ); conversion_flags = (conversion_flags & ~ColorMode_Mask) | Auto; - return QPixmap::convertFromImage ( image, conversion_flags ); + return TQPixmap::convertFromImage ( image, conversion_flags ); } } -static QColor* kpixmap_iconPalette = 0; +static TQColor* kpixmap_iconPalette = 0; -bool KPixmap::checkColorTable( const QImage &image ) +bool KPixmap::checkColorTable( const TQImage &image ) { int i = 0; @@ -315,45 +315,45 @@ bool KPixmap::checkColorTable( const QImage &image ) kpixmap_iconPalette[i++] = black; // Pastels - kpixmap_iconPalette[i++] = QColor( 255, 192, 192 ); - kpixmap_iconPalette[i++] = QColor( 192, 255, 192 ); - kpixmap_iconPalette[i++] = QColor( 192, 192, 255 ); - kpixmap_iconPalette[i++] = QColor( 255, 255, 192 ); - kpixmap_iconPalette[i++] = QColor( 255, 192, 255 ); - kpixmap_iconPalette[i++] = QColor( 192, 255, 255 ); + kpixmap_iconPalette[i++] = TQColor( 255, 192, 192 ); + kpixmap_iconPalette[i++] = TQColor( 192, 255, 192 ); + kpixmap_iconPalette[i++] = TQColor( 192, 192, 255 ); + kpixmap_iconPalette[i++] = TQColor( 255, 255, 192 ); + kpixmap_iconPalette[i++] = TQColor( 255, 192, 255 ); + kpixmap_iconPalette[i++] = TQColor( 192, 255, 255 ); // Reds - kpixmap_iconPalette[i++] = QColor( 64, 0, 0 ); - kpixmap_iconPalette[i++] = QColor( 192, 0, 0 ); + kpixmap_iconPalette[i++] = TQColor( 64, 0, 0 ); + kpixmap_iconPalette[i++] = TQColor( 192, 0, 0 ); // Oranges - kpixmap_iconPalette[i++] = QColor( 255, 128, 0 ); - kpixmap_iconPalette[i++] = QColor( 192, 88, 0 ); - kpixmap_iconPalette[i++] = QColor( 255, 168, 88 ); - kpixmap_iconPalette[i++] = QColor( 255, 220, 168 ); + kpixmap_iconPalette[i++] = TQColor( 255, 128, 0 ); + kpixmap_iconPalette[i++] = TQColor( 192, 88, 0 ); + kpixmap_iconPalette[i++] = TQColor( 255, 168, 88 ); + kpixmap_iconPalette[i++] = TQColor( 255, 220, 168 ); // Blues - kpixmap_iconPalette[i++] = QColor( 0, 0, 192 ); + kpixmap_iconPalette[i++] = TQColor( 0, 0, 192 ); // Turquoise - kpixmap_iconPalette[i++] = QColor( 0, 64, 64 ); - kpixmap_iconPalette[i++] = QColor( 0, 192, 192 ); + kpixmap_iconPalette[i++] = TQColor( 0, 64, 64 ); + kpixmap_iconPalette[i++] = TQColor( 0, 192, 192 ); // Yellows - kpixmap_iconPalette[i++] = QColor( 64, 64, 0 ); - kpixmap_iconPalette[i++] = QColor( 192, 192, 0 ); + kpixmap_iconPalette[i++] = TQColor( 64, 64, 0 ); + kpixmap_iconPalette[i++] = TQColor( 192, 192, 0 ); // Greens - kpixmap_iconPalette[i++] = QColor( 0, 64, 0 ); - kpixmap_iconPalette[i++] = QColor( 0, 192, 0 ); + kpixmap_iconPalette[i++] = TQColor( 0, 64, 0 ); + kpixmap_iconPalette[i++] = TQColor( 0, 192, 0 ); // Purples - kpixmap_iconPalette[i++] = QColor( 192, 0, 192 ); + kpixmap_iconPalette[i++] = TQColor( 192, 0, 192 ); // Greys - kpixmap_iconPalette[i++] = QColor( 88, 88, 88 ); - kpixmap_iconPalette[i++] = QColor( 48, 48, 48 ); - kpixmap_iconPalette[i++] = QColor( 220, 220, 220 ); + kpixmap_iconPalette[i++] = TQColor( 88, 88, 88 ); + kpixmap_iconPalette[i++] = TQColor( 48, 48, 48 ); + kpixmap_iconPalette[i++] = TQColor( 220, 220, 220 ); } @@ -383,7 +383,7 @@ bool KPixmap::checkColorTable( const QImage &image ) } -KPixmap::KPixmap(const QPixmap& p) - : QPixmap(p) +KPixmap::KPixmap(const TQPixmap& p) + : TQPixmap(p) { } diff --git a/kdefx/kpixmap.h b/kdefx/kpixmap.h index 9a1af03bb..8b76e87af 100644 --- a/kdefx/kpixmap.h +++ b/kdefx/kpixmap.h @@ -24,7 +24,7 @@ #ifndef __KPIXMAP_H__ #define __KPIXMAP_H__ -#include <qpixmap.h> +#include <tqpixmap.h> #include <kdelibs_export.h> @@ -79,7 +79,7 @@ public: /** * Constructs a null pixmap. */ - KPixmap() : QPixmap() {}; + KPixmap() : TQPixmap() {}; /** * Destructs the pixmap. @@ -88,9 +88,9 @@ public: ~KPixmap(); /** - * Copies the QPixmap @p pix. + * Copies the TQPixmap @p pix. */ - KPixmap(const QPixmap& pix); + KPixmap(const TQPixmap& pix); /** * Converts an image and sets this pixmap. @@ -148,7 +148,7 @@ public: * @param conversion_flags bitmask, described above * @return @p true if successful. **/ - bool convertFromImage( const QImage &img, int conversion_flags ); + bool convertFromImage( const TQImage &img, int conversion_flags ); /** * This is an overloaded member function, provided for @@ -158,7 +158,7 @@ public: * @param mode a ColorMode to apply * @return @p true if successful. **/ - bool convertFromImage( const QImage &img, ColorMode mode = WebColor ); + bool convertFromImage( const TQImage &img, ColorMode mode = WebColor ); /** * Loads a pixmap from the file @p fileName. @@ -168,7 +168,7 @@ public: * specified (default), the loader reads a few bytes from the * header to guess the file format. * - * The QImageIO documentation lists the supported image + * The TQImageIO documentation lists the supported image * formats and explains how to add extra formats. * * @param fileName the name of the file to load the image from @@ -178,7 +178,7 @@ public: * @return @p true if successful, or false if the pixmap * could not be loaded. **/ - bool load( const QString& fileName, const char *format, + bool load( const TQString& fileName, const char *format, int conversion_flags ); /** @@ -191,7 +191,7 @@ public: * @return @p true if successful, or false if the pixmap * could not be loaded. **/ - bool load( const QString& fileName, + bool load( const TQString& fileName, const char *format = 0, ColorMode mode = WebColor ); @@ -204,7 +204,7 @@ public: * transparent background. * @param image the image to test **/ - bool checkColorTable(const QImage &image); + bool checkColorTable(const TQImage &image); private: KPixmapPrivate *d; diff --git a/kdefx/kpixmapeffect.cpp b/kdefx/kpixmapeffect.cpp index 5184c323e..91f85eac2 100644 --- a/kdefx/kpixmapeffect.cpp +++ b/kdefx/kpixmapeffect.cpp @@ -7,8 +7,8 @@ // $Id$ -#include <qimage.h> -#include <qpainter.h> +#include <tqimage.h> +#include <tqpainter.h> #include "kpixmapeffect.h" #include "kpixmap.h" @@ -21,8 +21,8 @@ //====================================================================== -KPixmap& KPixmapEffect::gradient(KPixmap &pixmap, const QColor &ca, - const QColor &cb, GradientType eff, int ncols) +KPixmap& KPixmapEffect::gradient(KPixmap &pixmap, const TQColor &ca, + const TQColor &cb, GradientType eff, int ncols) { if(pixmap.depth() > 8 && (eff == VerticalGradient || eff == HorizontalGradient)) { @@ -44,7 +44,7 @@ KPixmap& KPixmapEffect::gradient(KPixmap &pixmap, const QColor &ca, int gcdelta = ((1<<16) / (eff == VerticalGradient ? pixmap.height() : pixmap.width())) * gDiff; int bcdelta = ((1<<16) / (eff == VerticalGradient ? pixmap.height() : pixmap.width())) * bDiff; - QPainter p(&pixmap); + TQPainter p(&pixmap); // these for-loops could be merged, but the if's in the inner loop // would make it slow @@ -55,7 +55,7 @@ KPixmap& KPixmapEffect::gradient(KPixmap &pixmap, const QColor &ca, gl += gcdelta; bl += bcdelta; - p.setPen(QColor(rl>>16, gl>>16, bl>>16)); + p.setPen(TQColor(rl>>16, gl>>16, bl>>16)); p.drawLine(0, y, pixmap.width()-1, y); } break; @@ -65,7 +65,7 @@ KPixmap& KPixmapEffect::gradient(KPixmap &pixmap, const QColor &ca, gl += gcdelta; bl += bcdelta; - p.setPen(QColor(rl>>16, gl>>16, bl>>16)); + p.setPen(TQColor(rl>>16, gl>>16, bl>>16)); p.drawLine(x, 0, x, pixmap.height()-1); } break; @@ -74,7 +74,7 @@ KPixmap& KPixmapEffect::gradient(KPixmap &pixmap, const QColor &ca, } } else { - QImage image = KImageEffect::gradient(pixmap.size(), ca, cb, + TQImage image = KImageEffect::gradient(pixmap.size(), ca, cb, (KImageEffect::GradientType) eff, ncols); pixmap.convertFromImage(image); } @@ -85,11 +85,11 @@ KPixmap& KPixmapEffect::gradient(KPixmap &pixmap, const QColor &ca, // ----------------------------------------------------------------------------- -KPixmap& KPixmapEffect::unbalancedGradient(KPixmap &pixmap, const QColor &ca, - const QColor &cb, GradientType eff, int xfactor, int yfactor, +KPixmap& KPixmapEffect::unbalancedGradient(KPixmap &pixmap, const TQColor &ca, + const TQColor &cb, GradientType eff, int xfactor, int yfactor, int ncols) { - QImage image = KImageEffect::unbalancedGradient(pixmap.size(), ca, cb, + TQImage image = KImageEffect::unbalancedGradient(pixmap.size(), ca, cb, (KImageEffect::GradientType) eff, xfactor, yfactor, ncols); pixmap.convertFromImage(image); @@ -108,7 +108,7 @@ KPixmap& KPixmapEffect::unbalancedGradient(KPixmap &pixmap, const QColor &ca, KPixmap& KPixmapEffect::intensity(KPixmap &pixmap, float percent) { - QImage image = pixmap.convertToImage(); + TQImage image = pixmap.convertToImage(); KImageEffect::intensity(image, percent); pixmap.convertFromImage(image); @@ -121,7 +121,7 @@ KPixmap& KPixmapEffect::intensity(KPixmap &pixmap, float percent) KPixmap& KPixmapEffect::channelIntensity(KPixmap &pixmap, float percent, RGBComponent channel) { - QImage image = pixmap.convertToImage(); + TQImage image = pixmap.convertToImage(); KImageEffect::channelIntensity(image, percent, (KImageEffect::RGBComponent) channel); pixmap.convertFromImage(image); @@ -138,11 +138,11 @@ KPixmap& KPixmapEffect::channelIntensity(KPixmap &pixmap, float percent, KPixmap& KPixmapEffect::blend(KPixmap &pixmap, float initial_intensity, - const QColor &bgnd, GradientType eff, + const TQColor &bgnd, GradientType eff, bool anti_dir, int ncols) { - QImage image = pixmap.convertToImage(); + TQImage image = pixmap.convertToImage(); if (image.depth() <=8) image = image.convertDepth(32); //Sloww.. @@ -154,7 +154,7 @@ KPixmap& KPixmapEffect::blend(KPixmap &pixmap, float initial_intensity, if(pixmap.depth() <= 8 ) { if ( ncols < 2 || ncols > 256 ) ncols = 3; - QColor *dPal = new QColor[ncols]; + TQColor *dPal = new QColor[ncols]; for (int i=0; i<ncols; i++) { tmp = 0 + 255 * i / ( ncols - 1 ); dPal[i].setRgb ( tmp, tmp, tmp ); @@ -179,7 +179,7 @@ KPixmap& KPixmapEffect::blend(KPixmap &pixmap, float initial_intensity, KPixmap& KPixmapEffect::hash(KPixmap &pixmap, Lighting lite, unsigned int spacing, int ncols) { - QImage image = pixmap.convertToImage(); + TQImage image = pixmap.convertToImage(); KImageEffect::hash(image, (KImageEffect::Lighting) lite, spacing); unsigned int tmp; @@ -187,7 +187,7 @@ KPixmap& KPixmapEffect::hash(KPixmap &pixmap, Lighting lite, if(pixmap.depth() <= 8 ) { if ( ncols < 2 || ncols > 256 ) ncols = 3; - QColor *dPal = new QColor[ncols]; + TQColor *dPal = new QColor[ncols]; for (int i=0; i<ncols; i++) { tmp = 0 + 255 * i / ( ncols - 1 ); dPal[i].setRgb ( tmp, tmp, tmp ); @@ -210,23 +210,23 @@ KPixmap& KPixmapEffect::hash(KPixmap &pixmap, Lighting lite, //====================================================================== #if 0 -void KPixmapEffect::pattern(KPixmap &pixmap, const QColor &ca, - const QColor &cb, unsigned pat[8]) +void KPixmapEffect::pattern(KPixmap &pixmap, const TQColor &ca, + const TQColor &cb, unsigned pat[8]) { - QImage img = pattern(pixmap.size(), ca, cb, pat); + TQImage img = pattern(pixmap.size(), ca, cb, pat); pixmap.convertFromImage(img); } #endif // ----------------------------------------------------------------------------- -KPixmap KPixmapEffect::pattern(const KPixmap& pmtile, QSize size, - const QColor &ca, const QColor &cb, int ncols) +KPixmap KPixmapEffect::pattern(const KPixmap& pmtile, TQSize size, + const TQColor &ca, const TQColor &cb, int ncols) { if (pmtile.depth() > 8) ncols = 0; - QImage img = pmtile.convertToImage(); + TQImage img = pmtile.convertToImage(); KImageEffect::flatten(img, ca, cb, ncols); KPixmap pixmap; pixmap.convertFromImage(img); @@ -237,11 +237,11 @@ KPixmap KPixmapEffect::pattern(const KPixmap& pmtile, QSize size, // ----------------------------------------------------------------------------- -KPixmap KPixmapEffect::createTiled(const KPixmap& pixmap, QSize size) +KPixmap KPixmapEffect::createTiled(const KPixmap& pixmap, TQSize size) { KPixmap pix(size); - QPainter p(&pix); + TQPainter p(&pix); p.drawTiledPixmap(0, 0, size.width(), size.height(), pixmap); return pix; @@ -254,9 +254,9 @@ KPixmap KPixmapEffect::createTiled(const KPixmap& pixmap, QSize size) // //====================================================================== -KPixmap& KPixmapEffect::fade(KPixmap &pixmap, double val, const QColor &color) +KPixmap& KPixmapEffect::fade(KPixmap &pixmap, double val, const TQColor &color) { - QImage img = pixmap.convertToImage(); + TQImage img = pixmap.convertToImage(); KImageEffect::fade(img, val, color); pixmap.convertFromImage(img); @@ -267,7 +267,7 @@ KPixmap& KPixmapEffect::fade(KPixmap &pixmap, double val, const QColor &color) // ----------------------------------------------------------------------------- KPixmap& KPixmapEffect::toGray(KPixmap &pixmap, bool fast) { - QImage img = pixmap.convertToImage(); + TQImage img = pixmap.convertToImage(); KImageEffect::toGray(img, fast); pixmap.convertFromImage(img); @@ -277,7 +277,7 @@ KPixmap& KPixmapEffect::toGray(KPixmap &pixmap, bool fast) // ----------------------------------------------------------------------------- KPixmap& KPixmapEffect::desaturate(KPixmap &pixmap, float desat) { - QImage img = pixmap.convertToImage(); + TQImage img = pixmap.convertToImage(); KImageEffect::desaturate(img, desat); pixmap.convertFromImage(img); @@ -286,7 +286,7 @@ KPixmap& KPixmapEffect::desaturate(KPixmap &pixmap, float desat) // ----------------------------------------------------------------------------- KPixmap& KPixmapEffect::contrast(KPixmap &pixmap, int c) { - QImage img = pixmap.convertToImage(); + TQImage img = pixmap.convertToImage(); KImageEffect::contrast(img, c); pixmap.convertFromImage(img); @@ -300,9 +300,9 @@ KPixmap& KPixmapEffect::contrast(KPixmap &pixmap, int c) //====================================================================== // ----------------------------------------------------------------------------- -KPixmap& KPixmapEffect::dither(KPixmap &pixmap, const QColor *palette, int size) +KPixmap& KPixmapEffect::dither(KPixmap &pixmap, const TQColor *palette, int size) { - QImage img = pixmap.convertToImage(); + TQImage img = pixmap.convertToImage(); KImageEffect::dither(img, palette, size); pixmap.convertFromImage(img); @@ -315,9 +315,9 @@ KPixmap& KPixmapEffect::dither(KPixmap &pixmap, const QColor *palette, int size) // //====================================================================== -KPixmap KPixmapEffect::selectedPixmap( const KPixmap &pix, const QColor &col ) +KPixmap KPixmapEffect::selectedPixmap( const KPixmap &pix, const TQColor &col ) { - QImage img = pix.convertToImage(); + TQImage img = pix.convertToImage(); KImageEffect::selectedImage(img, col); KPixmap outPix; outPix.convertFromImage(img); diff --git a/kdefx/kpixmapeffect.h b/kdefx/kpixmapeffect.h index a4776f0e6..d3199c083 100644 --- a/kdefx/kpixmapeffect.h +++ b/kdefx/kpixmapeffect.h @@ -12,7 +12,7 @@ #include <kdelibs_export.h> -#include <qsize.h> +#include <tqsize.h> class KPixmap; class QColor; @@ -48,7 +48,7 @@ public: * colors. Pass 0 to prevent dithering. * @return Returns the generated pixmap, for convenience. */ - static KPixmap& gradient(KPixmap& pixmap, const QColor &ca, const QColor &cb, + static KPixmap& gradient(KPixmap& pixmap, const TQColor &ca, const TQColor &cb, GradientType type, int ncols=3); /** @@ -66,8 +66,8 @@ public: * @param ncols The number of colors. See #gradient. * @return The generated pixmap, for convencience. */ - static KPixmap& unbalancedGradient(KPixmap& pixmap, const QColor &ca, - const QColor &cb, GradientType type, int xfactor = 100, + static KPixmap& unbalancedGradient(KPixmap& pixmap, const TQColor &ca, + const TQColor &cb, GradientType type, int xfactor = 100, int yfactor = 100, int ncols=3); /** @@ -81,7 +81,7 @@ public: * @param size The size the new pixmap should have. * @return The generated, tiled pixmap. */ - static KPixmap createTiled(const KPixmap& pixmap, QSize size); + static KPixmap createTiled(const KPixmap& pixmap, TQSize size); /** * Either brightens or dims a pixmap by a specified ratio. @@ -121,7 +121,7 @@ public: * @return Returns the pixmap(), provided for convenience. */ static KPixmap& blend(KPixmap& pixmap, float initial_intensity, - const QColor &bgnd, GradientType eff, + const TQColor &bgnd, GradientType eff, bool anti_dir=false, int ncols=3); /** @@ -153,8 +153,8 @@ public: * dithered to this depth. Pass zero to prevent dithering. * @return The resulting pixmap. */ - static KPixmap pattern(const KPixmap& pixmap, QSize size, - const QColor &ca, const QColor &cb, int ncols=8); + static KPixmap pattern(const KPixmap& pixmap, TQSize size, + const TQColor &ca, const TQColor &cb, int ncols=8); /** * Fades a pixmap to a certain color. @@ -164,7 +164,7 @@ public: * @param color The color to blend to. * @return Returns the pixmap(), provided for convenience. */ - static KPixmap& fade(KPixmap& pixmap, double val, const QColor &color); + static KPixmap& fade(KPixmap& pixmap, double val, const TQColor &color); /** * Converts a pixmap to grayscale. @@ -203,15 +203,15 @@ public: * @param size The size of the palette. * @return Returns the pixmap(), provided for convenience. */ - static KPixmap& dither(KPixmap &pixmap, const QColor *palette, int size); + static KPixmap& dither(KPixmap &pixmap, const TQColor *palette, int size); /** * Calculate a 'selected' pixmap, for instance a selected icon * on the desktop. * @param pixmap the pixmap to select - * @param col the selected color, usually from QColorGroup::highlight(). + * @param col the selected color, usually from TQColorGroup::highlight(). */ - static KPixmap selectedPixmap( const KPixmap &pixmap, const QColor &col ); + static KPixmap selectedPixmap( const KPixmap &pixmap, const TQColor &col ); }; diff --git a/kdefx/kpixmapsplitter.cpp b/kdefx/kpixmapsplitter.cpp index 83fc3de5b..44b8f01fa 100644 --- a/kdefx/kpixmapsplitter.cpp +++ b/kdefx/kpixmapsplitter.cpp @@ -33,13 +33,13 @@ KPixmapSplitter::~KPixmapSplitter() { } -void KPixmapSplitter::setPixmap( const QPixmap& pixmap ) +void KPixmapSplitter::setPixmap( const TQPixmap& pixmap ) { m_pixmap = pixmap; m_dirty = true; } -void KPixmapSplitter::setItemSize( const QSize& size ) +void KPixmapSplitter::setItemSize( const TQSize& size ) { if ( size != m_itemSize ) { m_itemSize = size; @@ -64,10 +64,10 @@ void KPixmapSplitter::setHSpacing( int spacing ) } -QRect KPixmapSplitter::coordinates( int pos ) +TQRect KPixmapSplitter::coordinates( int pos ) { if ( pos < 0 || m_pixmap.isNull() ) - return QRect(); + return TQRect(); if ( m_dirty ) { m_numCols = m_pixmap.width() / ( m_itemSize.width() + m_hSpacing ); @@ -77,18 +77,18 @@ QRect KPixmapSplitter::coordinates( int pos ) } if ( m_numCols == 0 || m_numRows == 0 ) - return QRect(); + return TQRect(); int row = pos / m_numCols; int col = pos - (row * m_numCols); - return QRect( col * (m_itemSize.width() + m_hSpacing), + return TQRect( col * (m_itemSize.width() + m_hSpacing), row * (m_itemSize.height() + m_vSpacing), m_itemSize.width(), m_itemSize.height() ); } -QRect KPixmapSplitter::coordinates( const QChar& ch ) +TQRect KPixmapSplitter::coordinates( const TQChar& ch ) { return coordinates( (unsigned char) ch.latin1() ); } diff --git a/kdefx/kpixmapsplitter.h b/kdefx/kpixmapsplitter.h index 6c525c172..84b5a8647 100644 --- a/kdefx/kpixmapsplitter.h +++ b/kdefx/kpixmapsplitter.h @@ -20,10 +20,10 @@ #ifndef KPIXMAPSPLITTER_H #define KPIXMAPSPLITTER_H -#include <qpixmap.h> -#include <qrect.h> -#include <qsize.h> -#include <qstring.h> +#include <tqpixmap.h> +#include <tqrect.h> +#include <tqsize.h> +#include <tqstring.h> #include <kdelibs_export.h> @@ -39,13 +39,13 @@ class KPixmapSplitterPrivate; * \code * KPixmapSplitter splitter; * splitter.setPixmap( somePixmap ); - * splitter.setItemSize( QSize( 20, 10 )); + * splitter.setItemSize( TQSize( 20, 10 )); * - * QPixmap item( 20, 10 ); + * TQPixmap item( 20, 10 ); * item.fill( Qt::white ); - * QRect rect = splitter.coordinates( 4 ); + * TQRect rect = splitter.coordinates( 4 ); * if ( !rect.isEmpty() ) - * bitBlt( &item, QPoint(0,0), &somePixmap, rect, CopyROP ); + * bitBlt( &item, TQPoint(0,0), &somePixmap, rect, CopyROP ); * \endcode * * @author Carsten Pfeiffer <pfeiffer@kde.org> @@ -62,25 +62,25 @@ public: /** * Sets the pixmap to be split. */ - void setPixmap( const QPixmap& pixmap ); + void setPixmap( const TQPixmap& pixmap ); /** * @returns the pixmap that has been set via setPixmap(). */ - const QPixmap& pixmap() const { return m_pixmap; } + const TQPixmap& pixmap() const { return m_pixmap; } /** * Sets the size of the items you want to get out of the given pixmap. - * The QRect of #coordinates(int) will have the width and height of exactly + * The TQRect of #coordinates(int) will have the width and height of exactly * this @p size. */ - void setItemSize( const QSize& size ); + void setItemSize( const TQSize& size ); /** * @returns the set size of the items (coordinates) you want to get * out of the given pixmap. */ - QSize itemSize() const { return m_itemSize; } + TQSize itemSize() const { return m_itemSize; } /** * If there is space between rows in the given pixmap, you have to specify @@ -98,17 +98,17 @@ public: * @returns the coordinates of the item at position pos in the given * pixmap. */ - QRect coordinates( int pos ); + TQRect coordinates( int pos ); /** * Overloaded for convenience. Returns the item at the position of the * given character (when using a latin1 font-pixmap) */ - QRect coordinates( const QChar& ch ); + TQRect coordinates( const TQChar& ch ); private: - QPixmap m_pixmap; - QSize m_itemSize; + TQPixmap m_pixmap; + TQSize m_itemSize; int m_vSpacing; int m_hSpacing; diff --git a/kdefx/kstyle.cpp b/kdefx/kstyle.cpp index 08fe94995..526d0e467 100644 --- a/kdefx/kstyle.cpp +++ b/kdefx/kstyle.cpp @@ -3,7 +3,7 @@ * KStyle * Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org> * - * QWindowsStyle CC_ListView and style images were kindly donated by TrollTech, + * TQWindowsStyle CC_ListView and style images were kindly donated by TrollTech, * Copyright (C) 1998-2000 TrollTech AS. * * Many thanks to Bradley T. Hughes for the 3 button scrollbar code. @@ -29,23 +29,23 @@ #include "kstyle.h" -#include <qapplication.h> -#include <qbitmap.h> -#include <qcleanuphandler.h> -#include <qmap.h> -#include <qimage.h> -#include <qlistview.h> -#include <qmenubar.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpopupmenu.h> -#include <qprogressbar.h> -#include <qscrollbar.h> -#include <qsettings.h> -#include <qslider.h> -#include <qstylefactory.h> -#include <qtabbar.h> -#include <qtoolbar.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqcleanuphandler.h> +#include <tqmap.h> +#include <tqimage.h> +#include <tqlistview.h> +#include <tqmenubar.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpopupmenu.h> +#include <tqprogressbar.h> +#include <tqscrollbar.h> +#include <tqsettings.h> +#include <tqslider.h> +#include <tqstylefactory.h> +#include <tqtabbar.h> +#include <tqtoolbar.h> #include <kpixmap.h> #include <kpixmapeffect.h> @@ -76,12 +76,12 @@ namespace // Drop Shadow struct ShadowElements { - QWidget* w1; - QWidget* w2; + TQWidget* w1; + TQWidget* w2; }; - typedef QMap<const QPopupMenu*,ShadowElements> ShadowMap; + typedef TQMap<const TQPopupMenu*,ShadowElements> ShadowMap; static ShadowMap *_shadowMap = 0; - QSingleCleanupHandler<ShadowMap> cleanupShadowMap; + TQSingleCleanupHandler<ShadowMap> cleanupShadowMap; ShadowMap &shadowMap() { if ( !_shadowMap ) { _shadowMap = new ShadowMap; @@ -124,22 +124,22 @@ class TransparencyHandler : public QObject TransparencyHandler(KStyle* style, TransparencyEngine tEngine, float menuOpacity, bool useDropShadow); ~TransparencyHandler(); - bool eventFilter(QObject* object, QEvent* event); + bool eventFilter(TQObject* object, TQEvent* event); protected: - void blendToColor(const QColor &col); - void blendToPixmap(const QColorGroup &cg, const QPopupMenu* p); + void blendToColor(const TQColor &col); + void blendToPixmap(const TQColorGroup &cg, const TQPopupMenu* p); #ifdef HAVE_XRENDER - void XRenderBlendToPixmap(const QPopupMenu* p); + void XRenderBlendToPixmap(const TQPopupMenu* p); #endif - void createShadowWindows(const QPopupMenu* p); - void removeShadowWindows(const QPopupMenu* p); - void rightShadow(QImage& dst); - void bottomShadow(QImage& dst); + void createShadowWindows(const TQPopupMenu* p); + void removeShadowWindows(const TQPopupMenu* p); + void rightShadow(TQImage& dst); + void bottomShadow(TQImage& dst); private: bool dropShadow; float opacity; - QPixmap pix; + TQPixmap pix; KStyle* kstyle; TransparencyEngine te; }; @@ -164,24 +164,24 @@ struct KStylePrivate KStyle::KStyleFlags flags; //For KPE_ListViewBranch - QBitmap *verticalLine; - QBitmap *horizontalLine; + TQBitmap *verticalLine; + TQBitmap *horizontalLine; }; // ----------------------------------------------------------------------------- KStyle::KStyle( KStyleFlags flags, KStyleScrollBarType sbtype ) - : QCommonStyle(), d(new KStylePrivate) + : TQCommonStyle(), d(new KStylePrivate) { d->flags = flags; bool useMenuTransparency = (flags & AllowMenuTransparency); d->useFilledFrameWorkaround = (flags & FilledFrameWorkaround); d->scrollbarType = sbtype; - d->highcolor = QPixmap::defaultDepth() > 8; + d->highcolor = TQPixmap::defaultDepth() > 8; // Read style settings - QSettings settings; + TQSettings settings; d->popupMenuDelay = settings.readNumEntry ("/KStyle/Settings/PopupMenuDelay", 256); d->sloppySubMenus = settings.readBoolEntry("/KStyle/Settings/SloppySubMenus", false); d->etchDisabledText = settings.readBoolEntry("/KStyle/Settings/EtchDisabledText", true); @@ -192,7 +192,7 @@ KStyle::KStyle( KStyleFlags flags, KStyleScrollBarType sbtype ) d->menuHandler = NULL; if (useMenuTransparency) { - QString effectEngine = settings.readEntry("/KStyle/Settings/MenuTransparencyEngine", "Disabled"); + TQString effectEngine = settings.readEntry("/KStyle/Settings/MenuTransparencyEngine", "Disabled"); #ifdef HAVE_XRENDER if (effectEngine == "XRender") @@ -237,35 +237,35 @@ KStyle::~KStyle() } -QString KStyle::defaultStyle() +TQString KStyle::defaultStyle() { - if (QPixmap::defaultDepth() > 8) - return QString("plastik"); + if (TQPixmap::defaultDepth() > 8) + return TQString("plastik"); else - return QString("light, 3rd revision"); + return TQString("light, 3rd revision"); } -void KStyle::polish( QWidget* widget ) +void KStyle::polish( TQWidget* widget ) { if ( d->useFilledFrameWorkaround ) { - if ( QFrame *frame = ::qt_cast< QFrame* >( widget ) ) { - QFrame::Shape shape = frame->frameShape(); - if (shape == QFrame::ToolBarPanel || shape == QFrame::MenuBarPanel) + if ( TQFrame *frame = ::qt_cast< TQFrame* >( widget ) ) { + TQFrame::Shape shape = frame->frameShape(); + if (shape == TQFrame::ToolBarPanel || shape == TQFrame::MenuBarPanel) widget->installEventFilter(this); } } } -void KStyle::unPolish( QWidget* widget ) +void KStyle::unPolish( TQWidget* widget ) { if ( d->useFilledFrameWorkaround ) { - if ( QFrame *frame = ::qt_cast< QFrame* >( widget ) ) { - QFrame::Shape shape = frame->frameShape(); - if (shape == QFrame::ToolBarPanel || shape == QFrame::MenuBarPanel) + if ( TQFrame *frame = ::qt_cast< TQFrame* >( widget ) ) { + TQFrame::Shape shape = frame->frameShape(); + if (shape == TQFrame::ToolBarPanel || shape == TQFrame::MenuBarPanel) widget->removeEventFilter(this); } } @@ -273,7 +273,7 @@ void KStyle::unPolish( QWidget* widget ) // Style changes (should) always re-polish popups. -void KStyle::polishPopupMenu( QPopupMenu* p ) +void KStyle::polishPopupMenu( TQPopupMenu* p ) { if (!p->testWState( WState_Polished )) p->setCheckable(true); @@ -299,20 +299,20 @@ KStyle::KStyleFlags KStyle::styleFlags() const return d->flags; } -void KStyle::renderMenuBlendPixmap( KPixmap &pix, const QColorGroup &cg, - const QPopupMenu* /* popup */ ) const +void KStyle::renderMenuBlendPixmap( KPixmap &pix, const TQColorGroup &cg, + const TQPopupMenu* /* popup */ ) const { pix.fill(cg.button()); // Just tint as the default behavior } void KStyle::drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& /* opt */ ) const + const TQStyleOption& /* opt */ ) const { switch( kpe ) { @@ -322,7 +322,7 @@ void KStyle::drawKStylePrimitive( KStylePrimitive kpe, case KPE_DockWindowHandle: { // Draws a nice DockWindow handle including the dock title. - QWidget* wid = const_cast<QWidget*>(widget); + TQWidget* wid = const_cast<TQWidget*>(widget); bool horizontal = flags & Style_Horizontal; int x,y,w,h,x2,y2; @@ -336,23 +336,23 @@ void KStyle::drawKStylePrimitive( KStylePrimitive kpe, x2 = x + w - 1; y2 = y + h - 1; - QFont fnt; - fnt = QApplication::font(wid); + TQFont fnt; + fnt = TQApplication::font(wid); fnt.setPointSize( fnt.pointSize()-2 ); // Draw the item on an off-screen pixmap // to preserve Xft antialiasing for // vertically oriented handles. - QPixmap pix; + TQPixmap pix; if (horizontal) pix.resize( h-2, w-2 ); else pix.resize( w-2, h-2 ); - QString title = wid->parentWidget()->caption(); - QPainter p2; + TQString title = wid->parentWidget()->caption(); + TQPainter p2; p2.begin(&pix); - p2.fillRect(pix.rect(), cg.brush(QColorGroup::Highlight)); + p2.fillRect(pix.rect(), cg.brush(TQColorGroup::Highlight)); p2.setPen(cg.highlightedText()); p2.setFont(fnt); p2.drawText(pix.rect(), AlignCenter, title); @@ -367,9 +367,9 @@ void KStyle::drawKStylePrimitive( KStylePrimitive kpe, p->drawLine(x2, y+1, x2, y2); if (horizontal) { - QWMatrix m; + TQWMatrix m; m.rotate(-90.0); - QPixmap vpix = pix.xForm(m); + TQPixmap vpix = pix.xForm(m); bitBlt(wid, r.x()+1, r.y()+1, &vpix); } else bitBlt(wid, r.x()+1, r.y()+1, &pix); @@ -410,10 +410,10 @@ void KStyle::drawKStylePrimitive( KStylePrimitive kpe, { // make 128*1 and 1*128 bitmaps that can be used for // drawing the right sort of lines. - d->verticalLine = new QBitmap( 1, 129, true ); - d->horizontalLine = new QBitmap( 128, 1, true ); - QPointArray a( 64 ); - QPainter p2; + d->verticalLine = new TQBitmap( 1, 129, true ); + d->horizontalLine = new TQBitmap( 128, 1, true ); + TQPointArray a( 64 ); + TQPainter p2; p2.begin( d->verticalLine ); int i; @@ -422,7 +422,7 @@ void KStyle::drawKStylePrimitive( KStylePrimitive kpe, p2.setPen( color1 ); p2.drawPoints( a ); p2.end(); - QApplication::flushX(); + TQApplication::flushX(); d->verticalLine->setMask( *d->verticalLine ); p2.begin( d->horizontalLine ); @@ -431,7 +431,7 @@ void KStyle::drawKStylePrimitive( KStylePrimitive kpe, p2.setPen( color1 ); p2.drawPoints( a ); p2.end(); - QApplication::flushX(); + TQApplication::flushX(); d->horizontalLine->setMask( *d->horizontalLine ); } @@ -492,7 +492,7 @@ void KStyle::drawKStylePrimitive( KStylePrimitive kpe, } -int KStyle::kPixelMetric( KStylePixelMetric kpm, const QWidget* /* widget */) const +int KStyle::kPixelMetric( KStylePixelMetric kpm, const TQWidget* /* widget */) const { int value; switch(kpm) @@ -520,29 +520,29 @@ int KStyle::kPixelMetric( KStylePixelMetric kpm, const QWidget* /* widget */) co // ----------------------------------------------------------------------------- void KStyle::drawPrimitive( PrimitiveElement pe, - QPainter* p, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { // TOOLBAR/DOCK WINDOW HANDLE // ------------------------------------------------------------------------ if (pe == PE_DockWindowHandle) { // Wild workarounds are here. Beware. - QWidget *widget, *parent; + TQWidget *widget, *parent; - if (p && p->device()->devType() == QInternal::Widget) { - widget = static_cast<QWidget*>(p->device()); + if (p && p->device()->devType() == TQInternal::Widget) { + widget = static_cast<TQWidget*>(p->device()); parent = widget->parentWidget(); } else return; // Don't paint on non-widgets // Check if we are a normal toolbar or a hidden dockwidget. if ( parent && - (parent->inherits("QToolBar") || // Normal toolbar - (parent->inherits("QMainWindow")) )) // Collapsed dock + (parent->inherits("TQToolBar") || // Normal toolbar + (parent->inherits("TQMainWindow")) )) // Collapsed dock // Draw a toolbar handle drawKStylePrimitive( KPE_ToolBarHandle, p, widget, r, cg, flags, opt ); @@ -557,9 +557,9 @@ void KStyle::drawPrimitive( PrimitiveElement pe, drawKStylePrimitive( KPE_GeneralHandle, p, widget, r, cg, flags, opt ); #if QT_VERSION >= 0x030300 #ifdef HAVE_XRENDER - } else if ( d->semiTransparentRubberband && pe == QStyle::PE_RubberBand ) { - QRect rect = r.normalize(); - QPoint point; + } else if ( d->semiTransparentRubberband && pe == TQStyle::PE_RubberBand ) { + TQRect rect = r.normalize(); + TQPoint point; point = p->xForm( point ); static XRenderColor clr = { 0, 0, 0, 0 }; @@ -596,7 +596,7 @@ void KStyle::drawPrimitive( PrimitiveElement pe, p->save(); p->setRasterOp( Qt::CopyROP ); - p->setPen( QPen( cg.highlight().dark( 160 ), 1 ) ); + p->setPen( TQPen( cg.highlight().dark( 160 ), 1 ) ); p->setBrush( NoBrush ); p->drawRect( rect.x() + point.x(), @@ -607,32 +607,32 @@ void KStyle::drawPrimitive( PrimitiveElement pe, #endif #endif } else - QCommonStyle::drawPrimitive( pe, p, r, cg, flags, opt ); + TQCommonStyle::drawPrimitive( pe, p, r, cg, flags, opt ); } void KStyle::drawControl( ControlElement element, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &opt ) const + const TQStyleOption &opt ) const { switch (element) { // TABS // ------------------------------------------------------------------------ case CE_TabBarTab: { - const QTabBar* tb = (const QTabBar*) widget; - QTabBar::Shape tbs = tb->shape(); + const TQTabBar* tb = (const TQTabBar*) widget; + TQTabBar::Shape tbs = tb->shape(); bool selected = flags & Style_Selected; int x = r.x(), y=r.y(), bottom=r.bottom(), right=r.right(); switch (tbs) { - case QTabBar::RoundedAbove: { + case TQTabBar::RoundedAbove: { if (!selected) p->translate(0,1); p->setPen(selected ? cg.light() : cg.shadow()); @@ -665,7 +665,7 @@ void KStyle::drawControl( ControlElement element, break; } - case QTabBar::RoundedBelow: { + case TQTabBar::RoundedBelow: { if (!selected) p->translate(0,-1); p->setPen(selected ? cg.light() : cg.shadow()); @@ -699,7 +699,7 @@ void KStyle::drawControl( ControlElement element, break; } - case QTabBar::TriangularAbove: { + case TQTabBar::TriangularAbove: { if (!selected) p->translate(0,1); p->setPen(selected ? cg.light() : cg.shadow()); @@ -720,7 +720,7 @@ void KStyle::drawControl( ControlElement element, p->setPen(cg.mid()); p->drawLine(right-1, y+6, right-1, bottom); - QPointArray a(6); + TQPointArray a(6); a.setPoint(0, x+2, bottom); a.setPoint(1, x+2, y+7); a.setPoint(2, x+7, y+2); @@ -739,7 +739,7 @@ void KStyle::drawControl( ControlElement element, break; } - default: { // QTabBar::TriangularBelow + default: { // TQTabBar::TriangularBelow if (!selected) p->translate(0,-1); p->setPen(selected ? cg.light() : cg.shadow()); @@ -763,7 +763,7 @@ void KStyle::drawControl( ControlElement element, p->setPen(cg.mid()); p->drawLine(right-1, bottom-6, right-1, y); - QPointArray a(6); + TQPointArray a(6); a.setPoint(0, x+2, y); a.setPoint(1, x+2, bottom-7); a.setPoint(2, x+7, bottom-2); @@ -799,17 +799,17 @@ void KStyle::drawControl( ControlElement element, // PROGRESSBAR // ------------------------------------------------------------------------ case CE_ProgressBarGroove: { - QRect fr = subRect(SR_ProgressBarGroove, widget); - drawPrimitive(PE_Panel, p, fr, cg, Style_Sunken, QStyleOption::Default); + TQRect fr = subRect(SR_ProgressBarGroove, widget); + drawPrimitive(PE_Panel, p, fr, cg, Style_Sunken, TQStyleOption::Default); break; } case CE_ProgressBarContents: { // ### Take into account totalSteps() for busy indicator - const QProgressBar* pb = (const QProgressBar*)widget; - QRect cr = subRect(SR_ProgressBarContents, widget); + const TQProgressBar* pb = (const TQProgressBar*)widget; + TQRect cr = subRect(SR_ProgressBarContents, widget); double progress = pb->progress(); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int steps = pb->totalSteps(); if (!cr.isValid()) @@ -836,10 +836,10 @@ void KStyle::drawControl( ControlElement element, if (reverse) p->fillRect(cr.x() + cr.width() - width - pstep, cr.y(), width, cr.height(), - cg.brush(QColorGroup::Highlight)); + cg.brush(TQColorGroup::Highlight)); else p->fillRect(cr.x() + pstep, cr.y(), width, cr.height(), - cg.brush(QColorGroup::Highlight)); + cg.brush(TQColorGroup::Highlight)); return; } @@ -847,7 +847,7 @@ void KStyle::drawControl( ControlElement element, // Do fancy gradient for highcolor displays if (d->highcolor) { - QColor c(cg.highlight()); + TQColor c(cg.highlight()); KPixmap pix; pix.resize(cr.width(), cr.height()); KPixmapEffect::gradient(pix, reverse ? c.light(150) : c.dark(150), @@ -861,25 +861,25 @@ void KStyle::drawControl( ControlElement element, } else if (reverse) p->fillRect(cr.x()+(cr.width()-width), cr.y(), width, cr.height(), - cg.brush(QColorGroup::Highlight)); + cg.brush(TQColorGroup::Highlight)); else p->fillRect(cr.x(), cr.y(), width, cr.height(), - cg.brush(QColorGroup::Highlight)); + cg.brush(TQColorGroup::Highlight)); } break; } case CE_ProgressBarLabel: { - const QProgressBar* pb = (const QProgressBar*)widget; - QRect cr = subRect(SR_ProgressBarContents, widget); + const TQProgressBar* pb = (const TQProgressBar*)widget; + TQRect cr = subRect(SR_ProgressBarContents, widget); double progress = pb->progress(); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int steps = pb->totalSteps(); if (!cr.isValid()) return; - QFont font = p->font(); + TQFont font = p->font(); font.setBold(true); p->setFont(font); @@ -887,7 +887,7 @@ void KStyle::drawControl( ControlElement element, if (progress > 0 || steps == 0) { double pg = (steps == 0) ? 1.0 : progress / steps; int width = QMIN(cr.width(), (int)(pg * cr.width())); - QRect crect; + TQRect crect; if (reverse) crect.setRect(cr.x()+(cr.width()-width), cr.y(), cr.width(), cr.height()); else @@ -910,12 +910,12 @@ void KStyle::drawControl( ControlElement element, } default: - QCommonStyle::drawControl(element, p, widget, r, cg, flags, opt); + TQCommonStyle::drawControl(element, p, widget, r, cg, flags, opt); } } -QRect KStyle::subRect(SubRect r, const QWidget* widget) const +TQRect KStyle::subRect(SubRect r, const TQWidget* widget) const { switch(r) { @@ -927,17 +927,17 @@ QRect KStyle::subRect(SubRect r, const QWidget* widget) const case SR_ProgressBarContents: case SR_ProgressBarLabel: { // ### take into account indicatorFollowsStyle() - QRect rt = widget->rect(); - return QRect(rt.x()+2, rt.y()+2, rt.width()-4, rt.height()-4); + TQRect rt = widget->rect(); + return TQRect(rt.x()+2, rt.y()+2, rt.width()-4, rt.height()-4); } default: - return QCommonStyle::subRect(r, widget); + return TQCommonStyle::subRect(r, widget); } } -int KStyle::pixelMetric(PixelMetric m, const QWidget* widget) const +int KStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const { switch(m) { @@ -949,16 +949,16 @@ int KStyle::pixelMetric(PixelMetric m, const QWidget* widget) const case PM_DockWindowHandleExtent: { - QWidget* parent = 0; + 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() ) - && !parent->inherits("QToolBar") - && !parent->inherits("QMainWindow") + && !parent->inherits("TQToolBar") + && !parent->inherits("TQMainWindow") && widget->inherits("QDockWindowHandle") ) return widget->fontMetrics().lineSpacing(); else - return QCommonStyle::pixelMetric(m, widget); + return TQCommonStyle::pixelMetric(m, widget); } // TABS @@ -967,20 +967,20 @@ int KStyle::pixelMetric(PixelMetric m, const QWidget* widget) const return 24; case PM_TabBarTabVSpace: { - const QTabBar * tb = (const QTabBar *) widget; - if ( tb->shape() == QTabBar::RoundedAbove || - tb->shape() == QTabBar::RoundedBelow ) + const TQTabBar * tb = (const TQTabBar *) widget; + if ( tb->shape() == TQTabBar::RoundedAbove || + tb->shape() == TQTabBar::RoundedBelow ) return 10; else return 4; } case PM_TabBarTabOverlap: { - const QTabBar* tb = (const QTabBar*)widget; - QTabBar::Shape tbs = tb->shape(); + const TQTabBar* tb = (const TQTabBar*)widget; + TQTabBar::Shape tbs = tb->shape(); - if ( (tbs == QTabBar::RoundedAbove) || - (tbs == QTabBar::RoundedBelow) ) + if ( (tbs == TQTabBar::RoundedAbove) || + (tbs == TQTabBar::RoundedBelow) ) return 0; else return 2; @@ -997,14 +997,14 @@ int KStyle::pixelMetric(PixelMetric m, const QWidget* widget) const // Determines how much space to leave for the actual non-tickmark // portion of the slider. case PM_SliderControlThickness: { - const QSlider* slider = (const QSlider*)widget; - QSlider::TickSetting ts = slider->tickmarks(); + const TQSlider* slider = (const TQSlider*)widget; + TQSlider::TickSetting ts = slider->tickmarks(); int thickness = (slider->orientation() == Horizontal) ? slider->height() : slider->width(); switch (ts) { - case QSlider::NoMarks: // Use total area. + case TQSlider::NoMarks: // Use total area. break; - case QSlider::Both: + case TQSlider::Both: thickness = (thickness/2) + 3; // Use approx. 1/2 of area. break; default: // Use approx. 2/3 of area @@ -1045,14 +1045,14 @@ int KStyle::pixelMetric(PixelMetric m, const QWidget* widget) const return pixelMetric( PM_ScrollBarExtent, 0); default: - return QCommonStyle::pixelMetric( m, widget ); + return TQCommonStyle::pixelMetric( m, widget ); } } //Helper to find the next sibling that's not hidden -static QListViewItem* nextVisibleSibling(QListViewItem* item) +static TQListViewItem* nextVisibleSibling(TQListViewItem* item) { - QListViewItem* sibling = item; + TQListViewItem* sibling = item; do { sibling = sibling->nextSibling(); @@ -1063,14 +1063,14 @@ static QListViewItem* nextVisibleSibling(QListViewItem* item) } void KStyle::drawComplexControl( ComplexControl control, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption &opt ) const + const TQStyleOption &opt ) const { switch(control) { @@ -1080,13 +1080,13 @@ void KStyle::drawComplexControl( ComplexControl control, // Many thanks to Brad Hughes for contributing this code. bool useThreeButtonScrollBar = (d->scrollbarType & ThreeButtonScrollBar); - const QScrollBar *sb = (const QScrollBar*)widget; + const TQScrollBar *sb = (const TQScrollBar*)widget; bool maxedOut = (sb->minValue() == sb->maxValue()); bool horizontal = (sb->orientation() == Qt::Horizontal); SFlags sflags = ((horizontal ? Style_Horizontal : Style_Default) | (maxedOut ? Style_Default : Style_Enabled)); - QRect addline, subline, subline2, addpage, subpage, slider, first, last; + TQRect addline, subline, subline2, addpage, subpage, slider, first, last; subline = querySubControlMetrics(control, widget, SC_ScrollBarSubLine, opt); addline = querySubControlMetrics(control, widget, SC_ScrollBarAddLine, opt); subpage = querySubControlMetrics(control, widget, SC_ScrollBarSubPage, opt); @@ -1145,7 +1145,7 @@ void KStyle::drawComplexControl( ComplexControl control, Style_Down : Style_Default)); // Draw focus rect if (sb->hasFocus()) { - QRect fr(slider.x() + 2, slider.y() + 2, + TQRect fr(slider.x() + 2, slider.y() + 2, slider.width() - 5, slider.height() - 5); drawPrimitive(PE_FocusRect, p, fr, cg, Style_Default); } @@ -1157,19 +1157,19 @@ void KStyle::drawComplexControl( ComplexControl control, // SLIDER // ------------------------------------------------------------------- case CC_Slider: { - const QSlider* slider = (const QSlider*)widget; - QRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, opt); - QRect handle = querySubControlMetrics(CC_Slider, widget, SC_SliderHandle, opt); + const TQSlider* slider = (const TQSlider*)widget; + TQRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, opt); + TQRect handle = querySubControlMetrics(CC_Slider, widget, SC_SliderHandle, opt); // Double-buffer slider for no flicker - QPixmap pix(widget->size()); - QPainter p2; + TQPixmap pix(widget->size()); + TQPainter p2; p2.begin(&pix); if ( slider->parentWidget() && slider->parentWidget()->backgroundPixmap() && !slider->parentWidget()->backgroundPixmap()->isNull() ) { - QPixmap pixmap = *(slider->parentWidget()->backgroundPixmap()); + TQPixmap pixmap = *(slider->parentWidget()->backgroundPixmap()); p2.drawTiledPixmap(r, pixmap, slider->pos()); } else pix.fill(cg.background()); @@ -1185,7 +1185,7 @@ void KStyle::drawComplexControl( ComplexControl control, // Draw the tickmarks if (controls & SC_SliderTickmarks) - QCommonStyle::drawComplexControl(control, &p2, widget, + TQCommonStyle::drawComplexControl(control, &p2, widget, r, cg, flags, SC_SliderTickmarks, active, opt); // Draw the slider handle @@ -1196,7 +1196,7 @@ void KStyle::drawComplexControl( ComplexControl control, } p2.end(); - bitBlt((QWidget*)widget, r.x(), r.y(), &pix); + bitBlt((TQWidget*)widget, r.x(), r.y(), &pix); break; } @@ -1205,13 +1205,13 @@ void KStyle::drawComplexControl( ComplexControl control, case CC_ListView: { /* - * Many thanks to TrollTech AS for donating CC_ListView from QWindowsStyle. + * Many thanks to TrollTech AS for donating CC_ListView from TQWindowsStyle. * CC_ListView code is Copyright (C) 1998-2000 TrollTech AS. */ // Paint the icon and text. if ( controls & SC_ListView ) - QCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); + TQCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); // If we're have a branch or are expanded... if ( controls & (SC_ListViewBranch | SC_ListViewExpand) ) @@ -1220,20 +1220,20 @@ void KStyle::drawComplexControl( ComplexControl control, if (opt.isDefault()) break; - QListViewItem *item = opt.listViewItem(); - QListViewItem *child = item->firstChild(); + TQListViewItem *item = opt.listViewItem(); + TQListViewItem *child = item->firstChild(); int y = r.y(); int c; // dotline vertice count int dotoffset = 0; - QPointArray dotlines; + TQPointArray dotlines; if ( active == SC_All && controls == SC_ListViewExpand ) { // We only need to draw a vertical line c = 2; dotlines.resize(2); - dotlines[0] = QPoint( r.right(), r.top() ); - dotlines[1] = QPoint( r.right(), r.bottom() ); + dotlines[0] = TQPoint( r.right(), r.top() ); + dotlines[1] = TQPoint( r.right(), r.bottom() ); } else { @@ -1253,15 +1253,15 @@ void KStyle::drawComplexControl( ComplexControl control, int bx = r.width() / 2; // paint stuff in the magical area - QListView* v = item->listView(); + TQListView* v = item->listView(); int lh = QMAX( p->fontMetrics().height() + 2 * v->itemMargin(), - QApplication::globalStrut().height() ); + TQApplication::globalStrut().height() ); if ( lh % 2 > 0 ) lh++; // Draw all the expand/close boxes... - QRect boxrect; - QStyle::StyleFlags boxflags; + TQRect boxrect; + TQStyle::StyleFlags boxflags; while ( child && y < r.height() ) { linebot = y + lh/2; @@ -1269,23 +1269,23 @@ void KStyle::drawComplexControl( ComplexControl control, (child->height() > 0) ) { // The primitive requires a rect. - boxrect = QRect( bx-4, linebot-4, 9, 9 ); - boxflags = child->isOpen() ? QStyle::Style_Off : QStyle::Style_On; + boxrect = TQRect( bx-4, linebot-4, 9, 9 ); + boxflags = child->isOpen() ? TQStyle::Style_Off : TQStyle::Style_On; // KStyle extension: Draw the box and expand/collapse indicator drawKStylePrimitive( KPE_ListViewExpander, p, NULL, boxrect, cg, boxflags, opt ); // dotlinery p->setPen( cg.mid() ); - dotlines[c++] = QPoint( bx, linetop ); - dotlines[c++] = QPoint( bx, linebot - 5 ); - dotlines[c++] = QPoint( bx + 5, linebot ); - dotlines[c++] = QPoint( r.width(), linebot ); + dotlines[c++] = TQPoint( bx, linetop ); + dotlines[c++] = TQPoint( bx, linebot - 5 ); + dotlines[c++] = TQPoint( bx + 5, linebot ); + dotlines[c++] = TQPoint( r.width(), linebot ); linetop = linebot + 5; } else { // just dotlinery - dotlines[c++] = QPoint( bx+1, linebot ); - dotlines[c++] = QPoint( r.width(), linebot ); + dotlines[c++] = TQPoint( bx+1, linebot ); + dotlines[c++] = TQPoint( r.width(), linebot ); } y += child->totalHeight(); @@ -1297,16 +1297,16 @@ void KStyle::drawComplexControl( ComplexControl control, if ( linetop < linebot ) { - dotlines[c++] = QPoint( bx, linetop ); - dotlines[c++] = QPoint( bx, linebot ); + dotlines[c++] = TQPoint( bx, linetop ); + dotlines[c++] = TQPoint( bx, linebot ); } } // Draw all the branches... static int thickness = kPixelMetric( KPM_ListViewBranchThickness ); int line; // index into dotlines - QRect branchrect; - QStyle::StyleFlags branchflags; + TQRect branchrect; + TQStyle::StyleFlags branchflags; for( line = 0; line < c; line += 2 ) { // assumptions here: lines are horizontal or vertical. @@ -1323,8 +1323,8 @@ void KStyle::drawComplexControl( ComplexControl control, int point = dotlines[line].x(); int other = dotlines[line].y(); - branchrect = QRect( point, other-(thickness/2), end-point, thickness ); - branchflags = QStyle::Style_Horizontal; + branchrect = TQRect( point, other-(thickness/2), end-point, thickness ); + branchflags = TQStyle::Style_Horizontal; // KStyle extension: Draw the horizontal branch drawKStylePrimitive( KPE_ListViewBranch, p, NULL, branchrect, cg, branchflags, opt ); @@ -1336,11 +1336,11 @@ void KStyle::drawComplexControl( ComplexControl control, int other = dotlines[line].x(); int pixmapoffset = ((point & 1) != dotoffset ) ? 1 : 0; - branchrect = QRect( other-(thickness/2), point, thickness, end-point ); + branchrect = TQRect( other-(thickness/2), point, thickness, end-point ); if (!pixmapoffset) // ### Hackish - used to hint the offset - branchflags = QStyle::Style_NoChange; + branchflags = TQStyle::Style_NoChange; else - branchflags = QStyle::Style_Default; + branchflags = TQStyle::Style_Default; // KStyle extension: Draw the vertical branch drawKStylePrimitive( KPE_ListViewBranch, p, NULL, branchrect, cg, branchflags, opt ); @@ -1351,19 +1351,19 @@ void KStyle::drawComplexControl( ComplexControl control, } default: - QCommonStyle::drawComplexControl( control, p, widget, r, cg, + TQCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); break; } } -QStyle::SubControl KStyle::querySubControl( ComplexControl control, - const QWidget* widget, - const QPoint &pos, - const QStyleOption &opt ) const +TQStyle::SubControl KStyle::querySubControl( ComplexControl control, + const TQWidget* widget, + const TQPoint &pos, + const TQStyleOption &opt ) const { - QStyle::SubControl ret = QCommonStyle::querySubControl(control, widget, pos, opt); + TQStyle::SubControl ret = TQCommonStyle::querySubControl(control, widget, pos, opt); if (d->scrollbarType == ThreeButtonScrollBar) { // Enable third button @@ -1374,12 +1374,12 @@ QStyle::SubControl KStyle::querySubControl( ComplexControl control, } -QRect KStyle::querySubControlMetrics( ComplexControl control, - const QWidget* widget, +TQRect KStyle::querySubControlMetrics( ComplexControl control, + const TQWidget* widget, SubControl sc, - const QStyleOption &opt ) const + const TQStyleOption &opt ) const { - QRect ret; + TQRect ret; if (control == CC_ScrollBar) { @@ -1387,7 +1387,7 @@ QRect KStyle::querySubControlMetrics( ComplexControl control, bool platinumScrollBar = d->scrollbarType & PlatinumStyleScrollBar; bool nextScrollBar = d->scrollbarType & NextStyleScrollBar; - const QScrollBar *sb = (const QScrollBar*)widget; + const TQScrollBar *sb = (const TQScrollBar*)widget; bool horizontal = sb->orientation() == Qt::Horizontal; int sliderstart = sb->sliderStart(); int sbextent = pixelMetric(PM_ScrollBarExtent, widget); @@ -1508,11 +1508,11 @@ QRect KStyle::querySubControlMetrics( ComplexControl control, } default: - ret = QCommonStyle::querySubControlMetrics(control, widget, sc, opt); + ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, opt); break; } } else - ret = QCommonStyle::querySubControlMetrics(control, widget, sc, opt); + ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, opt); return ret; } @@ -1759,40 +1759,40 @@ static const char* const critical_xpm[]={ "...........aaaaaaaaaaa..........", ".............aaaaaaa............"}; -QPixmap KStyle::stylePixmap( StylePixmap stylepixmap, - const QWidget* widget, - const QStyleOption& opt) const +TQPixmap KStyle::stylePixmap( StylePixmap stylepixmap, + const TQWidget* widget, + const TQStyleOption& opt) const { switch (stylepixmap) { case SP_TitleBarShadeButton: - return QPixmap(const_cast<const char**>(kstyle_shade_xpm)); + return TQPixmap(const_cast<const char**>(kstyle_shade_xpm)); case SP_TitleBarUnshadeButton: - return QPixmap(const_cast<const char**>(kstyle_unshade_xpm)); + return TQPixmap(const_cast<const char**>(kstyle_unshade_xpm)); case SP_TitleBarNormalButton: - return QPixmap(const_cast<const char**>(kstyle_normalizeup_xpm)); + return TQPixmap(const_cast<const char**>(kstyle_normalizeup_xpm)); case SP_TitleBarMinButton: - return QPixmap(const_cast<const char**>(kstyle_minimize_xpm)); + return TQPixmap(const_cast<const char**>(kstyle_minimize_xpm)); case SP_TitleBarMaxButton: - return QPixmap(const_cast<const char**>(kstyle_maximize_xpm)); + return TQPixmap(const_cast<const char**>(kstyle_maximize_xpm)); case SP_TitleBarCloseButton: - return QPixmap(const_cast<const char**>(kstyle_close_xpm)); + return TQPixmap(const_cast<const char**>(kstyle_close_xpm)); case SP_DockWindowCloseButton: - return QPixmap(const_cast<const char**>(dock_window_close_xpm )); + return TQPixmap(const_cast<const char**>(dock_window_close_xpm )); case SP_MessageBoxInformation: - return QPixmap(const_cast<const char**>(information_xpm)); + return TQPixmap(const_cast<const char**>(information_xpm)); case SP_MessageBoxWarning: - return QPixmap(const_cast<const char**>(warning_xpm)); + return TQPixmap(const_cast<const char**>(warning_xpm)); case SP_MessageBoxCritical: - return QPixmap(const_cast<const char**>(critical_xpm)); + return TQPixmap(const_cast<const char**>(critical_xpm)); default: break; } - return QCommonStyle::stylePixmap(stylepixmap, widget, opt); + return TQCommonStyle::stylePixmap(stylepixmap, widget, opt); } -int KStyle::styleHint( StyleHint sh, const QWidget* w, - const QStyleOption &opt, QStyleHintReturn* shr) const +int KStyle::styleHint( StyleHint sh, const TQWidget* w, + const TQStyleOption &opt, QStyleHintReturn* shr) const { switch (sh) { @@ -1831,10 +1831,10 @@ int KStyle::styleHint( StyleHint sh, const QWidget* w, case SH_LineEdit_PasswordCharacter: { if (w) { - const QFontMetrics &fm = w->fontMetrics(); - if (fm.inFont(QChar(0x25CF))) { + const TQFontMetrics &fm = w->fontMetrics(); + if (fm.inFont(TQChar(0x25CF))) { return 0x25CF; - } else if (fm.inFont(QChar(0x2022))) { + } else if (fm.inFont(TQChar(0x2022))) { return 0x2022; } } @@ -1842,51 +1842,51 @@ int KStyle::styleHint( StyleHint sh, const QWidget* w, } default: - return QCommonStyle::styleHint(sh, w, opt, shr); + return TQCommonStyle::styleHint(sh, w, opt, shr); } } -bool KStyle::eventFilter( QObject* object, QEvent* event ) +bool KStyle::eventFilter( TQObject* object, TQEvent* event ) { if ( d->useFilledFrameWorkaround ) { - // Make the QMenuBar/QToolBar paintEvent() cover a larger area to + // Make the QMenuBar/TQToolBar paintEvent() cover a larger area to // 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 // filled frames in all QMenuBars and QToolBars. // -- Karol. - QFrame *frame = 0; - if ( event->type() == QEvent::Paint - && (frame = ::qt_cast<QFrame*>(object)) ) + TQFrame *frame = 0; + if ( event->type() == TQEvent::Paint + && (frame = ::qt_cast<TQFrame*>(object)) ) { - if (frame->frameShape() != QFrame::ToolBarPanel && frame->frameShape() != QFrame::MenuBarPanel) + if (frame->frameShape() != TQFrame::ToolBarPanel && frame->frameShape() != TQFrame::MenuBarPanel) return false; bool horizontal = true; - QPaintEvent* pe = (QPaintEvent*)event; - QToolBar *toolbar = ::qt_cast< QToolBar *>( frame ); - QRect r = pe->rect(); + TQPaintEvent* pe = (TQPaintEvent*)event; + TQToolBar *toolbar = ::qt_cast< TQToolBar *>( frame ); + TQRect r = pe->rect(); if (toolbar && toolbar->orientation() == Qt::Vertical) horizontal = false; if (horizontal) { if ( r.height() == frame->height() ) - return false; // Let QFrame handle the painting now. + return false; // Let TQFrame handle the painting now. // Else, send a new paint event with an updated paint rect. - QPaintEvent dummyPE( QRect( r.x(), 0, r.width(), frame->height()) ); - QApplication::sendEvent( frame, &dummyPE ); + TQPaintEvent dummyPE( TQRect( r.x(), 0, r.width(), frame->height()) ); + TQApplication::sendEvent( frame, &dummyPE ); } else { // Vertical if ( r.width() == frame->width() ) return false; - QPaintEvent dummyPE( QRect( 0, r.y(), frame->width(), r.height()) ); - QApplication::sendEvent( frame, &dummyPE ); + TQPaintEvent dummyPE( TQRect( 0, r.y(), frame->width(), r.height()) ); + TQApplication::sendEvent( frame, &dummyPE ); } // Discard this event as we sent a new paintEvent. @@ -1904,13 +1904,13 @@ bool KStyle::eventFilter( QObject* object, QEvent* event ) TransparencyHandler::TransparencyHandler( KStyle* style, TransparencyEngine tEngine, float menuOpacity, bool useDropShadow ) - : QObject() + : TQObject() { te = tEngine; kstyle = style; opacity = menuOpacity; dropShadow = useDropShadow; - pix.setOptimization(QPixmap::BestOptim); + pix.setOptimization(TQPixmap::BestOptim); } TransparencyHandler::~TransparencyHandler() @@ -1918,7 +1918,7 @@ TransparencyHandler::~TransparencyHandler() } // This is meant to be ugly but fast. -void TransparencyHandler::rightShadow(QImage& dst) +void TransparencyHandler::rightShadow(TQImage& dst) { if (dst.depth() != 32) dst = dst.convertDepth(32); @@ -1957,7 +1957,7 @@ void TransparencyHandler::rightShadow(QImage& dst) } } -void TransparencyHandler::bottomShadow(QImage& dst) +void TransparencyHandler::bottomShadow(TQImage& dst) { if (dst.depth() != 32) dst = dst.convertDepth(32); @@ -1997,18 +1997,18 @@ void TransparencyHandler::bottomShadow(QImage& dst) } // Create a shadow of thickness 4. -void TransparencyHandler::createShadowWindows(const QPopupMenu* p) +void TransparencyHandler::createShadowWindows(const TQPopupMenu* p) { #ifdef Q_WS_X11 int x2 = p->x()+p->width(); int y2 = p->y()+p->height(); - QRect shadow1(x2, p->y() + 4, 4, p->height()); - QRect shadow2(p->x() + 4, y2, p->width() - 4, 4); + TQRect shadow1(x2, p->y() + 4, 4, p->height()); + TQRect shadow2(p->x() + 4, y2, p->width() - 4, 4); // Create a fake drop-down shadow effect via blended Xwindows ShadowElements se; - se.w1 = new QWidget(0, 0, WStyle_Customize | WType_Popup | WX11BypassWM ); - se.w2 = new QWidget(0, 0, WStyle_Customize | WType_Popup | WX11BypassWM ); + se.w1 = new TQWidget(0, 0, WStyle_Customize | WType_Popup | WX11BypassWM ); + se.w2 = new TQWidget(0, 0, WStyle_Customize | WType_Popup | WX11BypassWM ); se.w1->setGeometry(shadow1); se.w2->setGeometry(shadow2); XSelectInput(qt_xdisplay(), se.w1->winId(), StructureNotifyMask ); @@ -2018,12 +2018,12 @@ void TransparencyHandler::createShadowWindows(const QPopupMenu* p) shadowMap()[p] = se; // Some hocus-pocus here to create the drop-shadow. - QPixmap pix_shadow1 = QPixmap::grabWindow(qt_xrootwin(), + TQPixmap pix_shadow1 = TQPixmap::grabWindow(qt_xrootwin(), shadow1.x(), shadow1.y(), shadow1.width(), shadow1.height()); - QPixmap pix_shadow2 = QPixmap::grabWindow(qt_xrootwin(), + TQPixmap pix_shadow2 = TQPixmap::grabWindow(qt_xrootwin(), shadow2.x(), shadow2.y(), shadow2.width(), shadow2.height()); - QImage img; + TQImage img; img = pix_shadow1.convertToImage(); rightShadow(img); pix_shadow1.convertFromImage(img); @@ -2036,7 +2036,7 @@ void TransparencyHandler::createShadowWindows(const QPopupMenu* p) se.w2->setErasePixmap(pix_shadow2); // Show the 'shadow' just before showing the popup menu window - // Don't use QWidget::show() so we don't confuse QEffects, thus causing broken focus. + // Don't use TQWidget::show() so we don't confuse QEffects, thus causing broken focus. XMapWindow(qt_xdisplay(), se.w1->winId()); XMapWindow(qt_xdisplay(), se.w2->winId()); #else @@ -2044,7 +2044,7 @@ void TransparencyHandler::createShadowWindows(const QPopupMenu* p) #endif } -void TransparencyHandler::removeShadowWindows(const QPopupMenu* p) +void TransparencyHandler::removeShadowWindows(const TQPopupMenu* p) { #ifdef Q_WS_X11 ShadowMap::iterator it = shadowMap().find(p); @@ -2063,22 +2063,22 @@ void TransparencyHandler::removeShadowWindows(const QPopupMenu* p) #endif } -bool TransparencyHandler::eventFilter( QObject* object, QEvent* event ) +bool TransparencyHandler::eventFilter( TQObject* object, TQEvent* event ) { #if !defined Q_WS_MAC && !defined Q_WS_WIN // Transparency idea was borrowed from KDE2's "MegaGradient" Style, // Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org> // Added 'fake' menu shadows <04-Jul-2002> -- Karol - QPopupMenu* p = (QPopupMenu*)object; - QEvent::Type et = event->type(); + TQPopupMenu* p = (TQPopupMenu*)object; + TQEvent::Type et = event->type(); - if (et == QEvent::Show) + if (et == TQEvent::Show) { // Handle translucency if (te != Disabled) { - pix = QPixmap::grabWindow(qt_xrootwin(), + pix = TQPixmap::grabWindow(qt_xrootwin(), p->x(), p->y(), p->width(), p->height()); switch (te) { @@ -2112,7 +2112,7 @@ bool TransparencyHandler::eventFilter( QObject* object, QEvent* event ) if (dropShadow && p->width() > 16 && p->height() > 16 && !shadowMap().contains( p )) createShadowWindows(p); } - else if (et == QEvent::Hide) + else if (et == TQEvent::Hide) { // Handle drop shadow if (dropShadow) @@ -2120,7 +2120,7 @@ bool TransparencyHandler::eventFilter( QObject* object, QEvent* event ) // Handle translucency if (te != Disabled) - p->setErasePixmap(QPixmap()); + p->setErasePixmap(TQPixmap()); } #endif @@ -2128,19 +2128,19 @@ bool TransparencyHandler::eventFilter( QObject* object, QEvent* event ) } -// Blends a QImage to a predefined color, with a given opacity. -void TransparencyHandler::blendToColor(const QColor &col) +// Blends a TQImage to a predefined color, with a given opacity. +void TransparencyHandler::blendToColor(const TQColor &col) { if (opacity < 0.0 || opacity > 1.0) return; - QImage img = pix.convertToImage(); + TQImage img = pix.convertToImage(); KImageEffect::blend(col, img, opacity); pix.convertFromImage(img); } -void TransparencyHandler::blendToPixmap(const QColorGroup &cg, const QPopupMenu* p) +void TransparencyHandler::blendToPixmap(const TQColorGroup &cg, const TQPopupMenu* p) { if (opacity < 0.0 || opacity > 1.0) return; @@ -2155,8 +2155,8 @@ void TransparencyHandler::blendToPixmap(const QColorGroup &cg, const QPopupMenu* // Allow styles to define the blend pixmap - allows for some interesting effects. kstyle->renderMenuBlendPixmap( blendPix, cg, p ); - QImage blendImg = blendPix.convertToImage(); - QImage backImg = pix.convertToImage(); + TQImage blendImg = blendPix.convertToImage(); + TQImage backImg = pix.convertToImage(); KImageEffect::blend(blendImg, backImg, opacity); pix.convertFromImage(backImg); } @@ -2166,7 +2166,7 @@ void TransparencyHandler::blendToPixmap(const QColorGroup &cg, const QPopupMenu* // Here we go, use XRender in all its glory. // NOTE: This is actually a bit slower than the above routines // on non-accelerated displays. -- Karol. -void TransparencyHandler::XRenderBlendToPixmap(const QPopupMenu* p) +void TransparencyHandler::XRenderBlendToPixmap(const TQPopupMenu* p) { KPixmap renderPix; renderPix.resize( pix.width(), pix.height() ); diff --git a/kdefx/kstyle.h b/kdefx/kstyle.h index 91d581ac7..fc332bd50 100644 --- a/kdefx/kstyle.h +++ b/kdefx/kstyle.h @@ -4,7 +4,7 @@ * KStyle * Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org> * - * QWindowsStyle CC_ListView and style images were kindly donated by TrollTech, + * TQWindowsStyle CC_ListView and style images were kindly donated by TrollTech, * Copyright (C) 1998-2000 TrollTech AS. * * Many thanks to Bradley T. Hughes for the 3 button scrollbar code. @@ -32,7 +32,7 @@ // This API is still subject to change. // I will remove this warning when I feel the API is sufficiently flexible. -#include <qcommonstyle.h> +#include <tqcommonstyle.h> #include <kdelibs_export.h> @@ -40,17 +40,17 @@ class KPixmap; struct KStylePrivate; /** - * Simplifies and extends the QStyle API to make style coding easier. + * Simplifies and extends the TQStyle API to make style coding easier. * * The KStyle class provides a simple internal menu transparency engine * which attempts to use XRender for accelerated blending where requested, * or falls back to fast internal software tinting/blending routines. - * It also simplifies more complex portions of the QStyle API, such as + * It also simplifies more complex portions of the TQStyle API, such as * the PopupMenuItems, ScrollBars and Sliders by providing extra "primitive * elements" which are simple to implement by the style writer. * - * @see QStyle::QStyle - * @see QCommonStyle::QCommonStyle + * @see TQStyle::QStyle + * @see TQCommonStyle::QCommonStyle * @author Karol Szwed (gallium@kde.org) * @version $Id$ */ @@ -71,7 +71,7 @@ class KDEFX_EXPORT KStyle: public QCommonStyle * * @li FilledFrameWorkaround - Enable this flag to facilitate * proper repaints of QMenuBars and QToolBars when the style chooses - * to paint the interior of a QFrame. The style primitives in question + * 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 * toolbars. @@ -118,9 +118,9 @@ class KDEFX_EXPORT KStyle: public QCommonStyle * * Select the appropriate KStyle flags and scrollbar type * for your style. The user's style preferences selected in KControl - * are read by using QSettings and are automatically applied to the style. + * are read by using TQSettings and are automatically applied to the style. * As a fallback, KStyle paints progressbars and tabbars. It inherits from - * QCommonStyle for speed, so don't expect much to be implemented. + * TQCommonStyle for speed, so don't expect much to be implemented. * * It is advisable to use a currently implemented style such as the HighColor * style as a foundation for any new KStyle, so the limited number of @@ -143,7 +143,7 @@ class KDEFX_EXPORT KStyle: public QCommonStyle /** * Returns the default widget style depending on color depth. */ - static QString defaultStyle(); + static TQString defaultStyle(); /** * Modifies the scrollbar type used by the style. @@ -178,14 +178,14 @@ class KDEFX_EXPORT KStyle: public QCommonStyle * This virtual is never called if XRender/Software blending is disabled by * the user in KDE's style control module. */ - virtual void renderMenuBlendPixmap( KPixmap& pix, const QColorGroup& cg, - const QPopupMenu* popup ) const; + virtual void renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup& cg, + const TQPopupMenu* popup ) const; /** * KStyle Primitive Elements: * * The KStyle class extends the Qt's Style API by providing certain - * simplifications for parts of QStyle. To do this, the KStylePrimitive + * simplifications for parts of TQStyle. To do this, the KStylePrimitive * elements were defined, which are very similar to Qt's PrimitiveElement. * * The first three Handle primitives simplify and extend PE_DockWindowHandle, @@ -202,10 +202,10 @@ class KDEFX_EXPORT KStyle: public QCommonStyle * * @li KPE_ToolBarHandle - This primitive must be reimplemented. It currently * only paints a filled rectangle as default behavior. This primitive is used - * to render QToolBar handles. + * to render TQToolBar handles. * * @li KPE_GeneralHandle - This primitive must be reimplemented. It is used - * to render general handles that are not part of a QToolBar or QDockWindow, such + * to render general handles that are not part of a TQToolBar or TQDockWindow, such * as the applet handles used in Kicker. The default implementation paints a filled * rect of arbitrary color. * @@ -237,21 +237,21 @@ class KDEFX_EXPORT KStyle: public QCommonStyle }; /** - * This function is identical to Qt's QStyle::drawPrimitive(), except that + * This function is identical to Qt's TQStyle::drawPrimitive(), 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 QStyle::drawPrimitive - * @see QStyle::drawComplexControl + * @see TQStyle::drawPrimitive + * @see TQStyle::drawComplexControl */ virtual void drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; enum KStylePixelMetric { @@ -266,66 +266,66 @@ class KDEFX_EXPORT KStyle: public QCommonStyle KPM_ListViewBranchThickness = 0x00000100 }; - int kPixelMetric( KStylePixelMetric kpm, const QWidget* widget = 0 ) const; + int kPixelMetric( KStylePixelMetric kpm, const TQWidget* widget = 0 ) const; // --------------------------------------------------------------------------- - void polish( QWidget* widget ); - void unPolish( QWidget* widget ); - void polishPopupMenu( QPopupMenu* ); + void polish( TQWidget* widget ); + void unPolish( TQWidget* widget ); + void polishPopupMenu( TQPopupMenu* ); void drawPrimitive( PrimitiveElement pe, - QPainter* p, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawControl( ControlElement element, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; SubControl querySubControl( ComplexControl control, - const QWidget* widget, - const QPoint &pos, - const QStyleOption& = QStyleOption::Default ) const; + const TQWidget* widget, + const TQPoint &pos, + const TQStyleOption& = TQStyleOption::Default ) const; - QRect querySubControlMetrics( ComplexControl control, - const QWidget* widget, + TQRect querySubControlMetrics( ComplexControl control, + const TQWidget* widget, SubControl sc, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; int pixelMetric( PixelMetric m, - const QWidget* widget = 0 ) const; + const TQWidget* widget = 0 ) const; - QRect subRect( SubRect r, - const QWidget* widget ) const; + TQRect subRect( SubRect r, + const TQWidget* widget ) const; - QPixmap stylePixmap( StylePixmap stylepixmap, - const QWidget* widget = 0, - const QStyleOption& = QStyleOption::Default ) const; + TQPixmap stylePixmap( StylePixmap stylepixmap, + const TQWidget* widget = 0, + const TQStyleOption& = TQStyleOption::Default ) const; int styleHint( StyleHint sh, - const QWidget* w = 0, - const QStyleOption &opt = QStyleOption::Default, + const TQWidget* w = 0, + const TQStyleOption &opt = TQStyleOption::Default, QStyleHintReturn* shr = 0 ) const; protected: - bool eventFilter( QObject* object, QEvent* event ); + bool eventFilter( TQObject* object, TQEvent* event ); private: // Disable copy constructor and = operator |