diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /krita/core | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krita/core')
139 files changed, 3159 insertions, 3142 deletions
diff --git a/krita/core/createdcop.py b/krita/core/createdcop.py index b3395ea2..bac48f33 100755 --- a/krita/core/createdcop.py +++ b/krita/core/createdcop.py @@ -34,7 +34,7 @@ class %(classname)sIface : virtual public DCOPObject { K_DCOP public: - %(classname)sIface( %(classname)s * parent ); + %(classname)sIface( %(classname)s * tqparent ); k_dcop: private: @@ -73,10 +73,10 @@ dcopiface_template = """/* #include <dcopclient.h> -%(classname)sIface::%(classname)sIface( %(classname)s * parent ) +%(classname)sIface::%(classname)sIface( %(classname)s * tqparent ) : DCOPObject() { - m_parent = parent; + m_parent = tqparent; } """ @@ -84,10 +84,10 @@ dcopiface_template = """/* def parseHeader(headerfile, classname): # parse the source class header to get a list of functions we're going to wrap functions = [] - if (headerfile.find("private:") > -1): - lines = headerfile[headerfile.find(classname):headerfile.find("private")].splitlines() + if (headerfile.tqfind("private:") > -1): + lines = headerfile[headerfile.tqfind(classname):headerfile.tqfind("private")].splitlines() else: - lines = headerfile[headerfile.find(classname):headerfile.find("#endif")].splitlines() + lines = headerfile[headerfile.tqfind(classname):headerfile.tqfind("#endif")].splitlines() i = 0 while i < len(lines): line = lines[i].strip() @@ -99,8 +99,8 @@ def parseHeader(headerfile, classname): line.startswith("Q_OBJECT") or line.startswith("#") or line.startswith("}") or - line.startswith("public slots:") or - line.find("~") != -1 or + line.startswith("public Q_SLOTS:") or + line.tqfind("~") != -1 or len(line) == 0 ): i+=1 @@ -112,17 +112,17 @@ def parseHeader(headerfile, classname): function = line complete = 0 # strip the inline implementation - if (line.find("{") > -1): - function = line[:line.find("{")] - if function.find("}") > -1: - function += line[line.find("}") + 1:] + if (line.tqfind("{") > -1): + function = line[:line.tqfind("{")] + if function.tqfind("}") > -1: + function += line[line.tqfind("}") + 1:] complete = 1 else: i += 1 # search for the missing } on the next lines while i < len(lines): - if (lines[i].find("}") > -1): - function += lines[i][lines[i].find("}") + 1:] + if (lines[i].tqfind("}") > -1): + function += lines[i][lines[i].tqfind("}") + 1:] complete = 1 i += 1 else: diff --git a/krita/core/kis_adjustment_layer.cc b/krita/core/kis_adjustment_layer.cc index 873b24cf..69e8b939 100644 --- a/krita/core/kis_adjustment_layer.cc +++ b/krita/core/kis_adjustment_layer.cc @@ -18,7 +18,7 @@ */ #include <kdebug.h> -#include <qimage.h> +#include <tqimage.h> #include "kis_debug_areas.h" #include "kis_group_layer.h" @@ -30,7 +30,7 @@ #include "kis_selection.h" #include "kis_fill_painter.h" -KisAdjustmentLayer::KisAdjustmentLayer(KisImageSP img, const QString &name, KisFilterConfiguration * kfc, KisSelectionSP selection) +KisAdjustmentLayer::KisAdjustmentLayer(KisImageSP img, const TQString &name, KisFilterConfiguration * kfc, KisSelectionSP selection) : KisLayer (img, name, OPACITY_OPAQUE) { m_filterConfig = kfc; @@ -38,8 +38,8 @@ KisAdjustmentLayer::KisAdjustmentLayer(KisImageSP img, const QString &name, KisF m_cachedPaintDev = new KisPaintDevice( img->colorSpace(), name.latin1()); m_showSelection = true; Q_ASSERT(m_cachedPaintDev); - connect(img, SIGNAL(sigSelectionChanged(KisImageSP)), - this, SLOT(slotSelectionChanged(KisImageSP))); + connect(img, TQT_SIGNAL(sigSelectionChanged(KisImageSP)), + this, TQT_SLOT(slotSelectionChanged(KisImageSP))); } KisAdjustmentLayer::KisAdjustmentLayer(const KisAdjustmentLayer& rhs) @@ -50,8 +50,8 @@ KisAdjustmentLayer::KisAdjustmentLayer(const KisAdjustmentLayer& rhs) m_selection = new KisSelection( *rhs.m_selection.data() ); m_selection->setParentLayer(this); m_selection->setInterestedInDirtyness(true); - connect(rhs.image(), SIGNAL(sigSelectionChanged(KisImageSP)), - this, SLOT(slotSelectionChanged(KisImageSP))); + connect(rhs.image(), TQT_SIGNAL(sigSelectionChanged(KisImageSP)), + this, TQT_SLOT(slotSelectionChanged(KisImageSP))); } m_cachedPaintDev = new KisPaintDevice( *rhs.m_cachedPaintDev.data() ); m_showSelection = false; @@ -104,7 +104,7 @@ void KisAdjustmentLayer::setSelection(KisSelectionSP selection) gc.bitBlt(0, 0, COMPOSITE_COPY, selection.data(), 0, 0, image()->bounds().width(), image()->bounds().height()); } else { - gc.fillRect(image()->bounds(), KisColor(Qt::white, cs), MAX_SELECTED); + gc.fillRect(image()->bounds(), KisColor(TQt::white, cs), MAX_SELECTED); } gc.end(); @@ -118,14 +118,14 @@ void KisAdjustmentLayer::clearSelection() KisFillPainter gc(m_selection.data()); KisColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8(); - QRect bounds = extent(); + TQRect bounds = extent(); bounds |= image()->bounds(); - gc.fillRect(bounds, KisColor(Qt::white, cs), MIN_SELECTED); + gc.fillRect(bounds, KisColor(TQt::white, cs), MIN_SELECTED); gc.end(); } -Q_INT32 KisAdjustmentLayer::x() const +TQ_INT32 KisAdjustmentLayer::x() const { if (m_selection) return m_selection->getX(); @@ -133,7 +133,7 @@ Q_INT32 KisAdjustmentLayer::x() const return 0; } -void KisAdjustmentLayer::setX(Q_INT32 x) +void KisAdjustmentLayer::setX(TQ_INT32 x) { if (m_selection) { m_selection->setX(x); @@ -142,7 +142,7 @@ void KisAdjustmentLayer::setX(Q_INT32 x) } -Q_INT32 KisAdjustmentLayer::y() const +TQ_INT32 KisAdjustmentLayer::y() const { if (m_selection) return m_selection->getY(); @@ -150,7 +150,7 @@ Q_INT32 KisAdjustmentLayer::y() const return 0; } -void KisAdjustmentLayer::setY(Q_INT32 y) +void KisAdjustmentLayer::setY(TQ_INT32 y) { if (m_selection) { m_selection->setY(y); @@ -158,24 +158,24 @@ void KisAdjustmentLayer::setY(Q_INT32 y) } } -QRect KisAdjustmentLayer::extent() const +TQRect KisAdjustmentLayer::extent() const { if (m_selection) return m_selection->selectedRect(); else if (image()) return image()->bounds(); else - return QRect(); + return TQRect(); } -QRect KisAdjustmentLayer::exactBounds() const +TQRect KisAdjustmentLayer::exactBounds() const { if (m_selection) return m_selection->selectedRect(); else if (image()) return image()->bounds(); else - return QRect(); + return TQRect(); } bool KisAdjustmentLayer::accept(KisLayerVisitor & v) @@ -183,22 +183,22 @@ bool KisAdjustmentLayer::accept(KisLayerVisitor & v) return v.visit( this ); } -void KisAdjustmentLayer::paintSelection(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +void KisAdjustmentLayer::paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { if (showSelection() && selection()) selection()->paintSelection(img, x, y, w, h); } -void KisAdjustmentLayer::paintSelection(QImage &img, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize) +void KisAdjustmentLayer::paintSelection(TQImage &img, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize) { if (showSelection() && selection()) selection()->paintSelection(img, scaledImageRect, scaledImageSize, imageSize); } -QImage KisAdjustmentLayer::createThumbnail(Q_INT32 w, Q_INT32 h) +TQImage KisAdjustmentLayer::createThumbnail(TQ_INT32 w, TQ_INT32 h) { if (!selection()) - return QImage(); + return TQImage(); int srcw, srch; if( image() ) @@ -208,7 +208,7 @@ QImage KisAdjustmentLayer::createThumbnail(Q_INT32 w, Q_INT32 h) } else { - const QRect e = extent(); + const TQRect e = extent(); srcw = e.width(); srch = e.height(); } @@ -216,29 +216,29 @@ QImage KisAdjustmentLayer::createThumbnail(Q_INT32 w, Q_INT32 h) if (w > srcw) { w = srcw; - h = Q_INT32(double(srcw) / w * h); + h = TQ_INT32(double(srcw) / w * h); } if (h > srch) { h = srch; - w = Q_INT32(double(srch) / h * w); + w = TQ_INT32(double(srch) / h * w); } if (srcw > srch) - h = Q_INT32(double(srch) / srcw * w); + h = TQ_INT32(double(srch) / srcw * w); else if (srch > srcw) - w = Q_INT32(double(srcw) / srch * h); + w = TQ_INT32(double(srcw) / srch * h); - QColor c; - Q_UINT8 opacity; - QImage img(w,h,32); + TQColor c; + TQ_UINT8 opacity; + TQImage img(w,h,32); - for (Q_INT32 y=0; y < h; ++y) { - Q_INT32 iY = (y * srch ) / h; - for (Q_INT32 x=0; x < w; ++x) { - Q_INT32 iX = (x * srcw ) / w; + for (TQ_INT32 y=0; y < h; ++y) { + TQ_INT32 iY = (y * srch ) / h; + for (TQ_INT32 x=0; x < w; ++x) { + TQ_INT32 iX = (x * srcw ) / w; m_selection->pixel(iX, iY, &c, &opacity); - img.setPixel(x, y, qRgb(opacity, opacity, opacity)); + img.setPixel(x, y, tqRgb(opacity, opacity, opacity)); } } diff --git a/krita/core/kis_adjustment_layer.h b/krita/core/kis_adjustment_layer.h index 0137bc8f..b8b76437 100644 --- a/krita/core/kis_adjustment_layer.h +++ b/krita/core/kis_adjustment_layer.h @@ -18,14 +18,14 @@ #ifndef KIS_ADJUSTMENT_LAYER_H_ #define KIS_ADJUSTMENT_LAYER_H_ -#include <qobject.h> +#include <tqobject.h> #include "kis_types.h" #include "kis_layer_visitor.h" #include "kis_composite_op.h" #include <koffice_export.h> class KNamedCommand; -class QPainter; +class TQPainter; class KisUndoAdapter; class KisGroupLayer; class KisFilterConfiguration; @@ -38,13 +38,14 @@ class KisFilterConfiguration; class KRITACORE_EXPORT KisAdjustmentLayer : public KisLayer, public KisLayerSupportsIndirectPainting { Q_OBJECT + TQ_OBJECT public: /** * Create a new adjustment layer with the given configuration and selection. * Note that the selection will be _copied_. */ - KisAdjustmentLayer(KisImageSP img, const QString &name, KisFilterConfiguration * kfc, KisSelectionSP selection); + KisAdjustmentLayer(KisImageSP img, const TQString &name, KisFilterConfiguration * kfc, KisSelectionSP selection); KisAdjustmentLayer(const KisAdjustmentLayer& rhs); virtual ~KisAdjustmentLayer(); @@ -64,21 +65,21 @@ public: /// Clears the selection (doesn't call any of the update or dirty methods) void clearSelection(); - virtual void paintSelection(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); - virtual void paintSelection(QImage &img, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize); + virtual void paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); + virtual void paintSelection(TQImage &img, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize); public: - virtual Q_INT32 x() const; - virtual void setX(Q_INT32); + virtual TQ_INT32 x() const; + virtual void setX(TQ_INT32); - virtual Q_INT32 y() const; - virtual void setY(Q_INT32); + virtual TQ_INT32 y() const; + virtual void setY(TQ_INT32); /// Returns an approximation of where the bounds on actual data are in this layer - virtual QRect extent() const; + virtual TQRect extent() const; /// Returns the exact bounds of where the actual data resides in this layer - virtual QRect exactBounds() const; + virtual TQRect exactBounds() const; virtual bool accept(KisLayerVisitor &); @@ -88,7 +89,7 @@ public: bool showSelection() const { return m_showSelection; } void setSelection(bool b) { m_showSelection = b; } - virtual QImage createThumbnail(Q_INT32 w, Q_INT32 h); + virtual TQImage createThumbnail(TQ_INT32 w, TQ_INT32 h); // KisLayerSupportsIndirectPainting virtual KisLayer* layer() { return this; } diff --git a/krita/core/kis_alpha_mask.cc b/krita/core/kis_alpha_mask.cc index 7a0fcd81..6409cfc6 100644 --- a/krita/core/kis_alpha_mask.cc +++ b/krita/core/kis_alpha_mask.cc @@ -17,15 +17,15 @@ */ #include <cfloat> -#include <qimage.h> -#include <qvaluevector.h> +#include <tqimage.h> +#include <tqvaluevector.h> #include <kdebug.h> #include "kis_global.h" -#include "kis_alpha_mask.h" +#include "kis_alpha_tqmask.h" -KisAlphaMask::KisAlphaMask(const QImage& img, bool hasColor) +KisAlphaMask::KisAlphaMask(const TQImage& img, bool hasColor) { m_width = img.width(); m_height = img.height(); @@ -38,7 +38,7 @@ KisAlphaMask::KisAlphaMask(const QImage& img, bool hasColor) } } -KisAlphaMask::KisAlphaMask(const QImage& img) +KisAlphaMask::KisAlphaMask(const TQImage& img) { m_width = img.width(); m_height = img.height(); @@ -51,7 +51,7 @@ KisAlphaMask::KisAlphaMask(const QImage& img) } } -KisAlphaMask::KisAlphaMask(Q_INT32 width, Q_INT32 height) +KisAlphaMask::KisAlphaMask(TQ_INT32 width, TQ_INT32 height) { m_width = width; m_height = height; @@ -63,36 +63,36 @@ KisAlphaMask::~KisAlphaMask() { } -Q_INT32 KisAlphaMask::width() const +TQ_INT32 KisAlphaMask::width() const { return m_width; } -Q_INT32 KisAlphaMask::height() const +TQ_INT32 KisAlphaMask::height() const { return m_height; } -void KisAlphaMask::setAlphaAt(Q_INT32 x, Q_INT32 y, Q_UINT8 alpha) +void KisAlphaMask::setAlphaAt(TQ_INT32 x, TQ_INT32 y, TQ_UINT8 alpha) { if (y >= 0 && y < m_height && x >= 0 && x < m_width) { m_data[(y * m_width) + x] = alpha; } } -void KisAlphaMask::copyAlpha(const QImage& img) +void KisAlphaMask::copyAlpha(const TQImage& img) { for (int y = 0; y < img.height(); y++) { for (int x = 0; x < img.width(); x++) { - QRgb c = img.pixel(x,y); - Q_UINT8 a = (qGray(c) * qAlpha(c)) / 255; + TQRgb c = img.pixel(x,y); + TQ_UINT8 a = (tqGray(c) * tqAlpha(c)) / 255; m_data.push_back(a); } } } -void KisAlphaMask::computeAlpha(const QImage& img) +void KisAlphaMask::computeAlpha(const TQImage& img) { // The brushes are mostly grayscale on a white background, // although some do have a colors. The alpha channel is seldom @@ -104,24 +104,24 @@ void KisAlphaMask::computeAlpha(const QImage& img) for (int y = 0; y < img.height(); y++) { for (int x = 0; x < img.width(); x++) { - m_data.push_back(255 - qRed(img.pixel(x, y))); + m_data.push_back(255 - tqRed(img.pixel(x, y))); } } } -KisAlphaMaskSP KisAlphaMask::interpolate(KisAlphaMaskSP mask1, KisAlphaMaskSP mask2, double t) +KisAlphaMaskSP KisAlphaMask::interpolate(KisAlphaMaskSP tqmask1, KisAlphaMaskSP tqmask2, double t) { - Q_ASSERT((mask1->width() == mask2->width()) && (mask1->height() == mask2->height())); + Q_ASSERT((tqmask1->width() == tqmask2->width()) && (tqmask1->height() == tqmask2->height())); Q_ASSERT(t > -DBL_EPSILON && t < 1 + DBL_EPSILON); - int width = mask1->width(); - int height = mask1->height(); + int width = tqmask1->width(); + int height = tqmask1->height(); KisAlphaMaskSP outputMask = new KisAlphaMask(width, height); Q_CHECK_PTR(outputMask); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { - Q_UINT8 d = static_cast<Q_UINT8>((1 - t) * mask1->alphaAt(x, y) + t * mask2->alphaAt(x, y)); + TQ_UINT8 d = static_cast<TQ_UINT8>((1 - t) * tqmask1->alphaAt(x, y) + t * tqmask2->alphaAt(x, y)); outputMask->setAlphaAt(x, y, d); } } diff --git a/krita/core/kis_alpha_mask.h b/krita/core/kis_alpha_mask.h index 1da3384d..4665857e 100644 --- a/krita/core/kis_alpha_mask.h +++ b/krita/core/kis_alpha_mask.h @@ -18,8 +18,8 @@ #ifndef KIS_ALPHA_MASK_ #define KIS_ALPHA_MASK_ -#include <qimage.h> -#include <qvaluevector.h> +#include <tqimage.h> +#include <tqvaluevector.h> #include <ksharedptr.h> @@ -27,57 +27,57 @@ #include "kis_types.h" /** - * KisAlphaMask is intended to create alpha values from a QImage for use - * in brush creation. It is not a generic alpha mask that can be used with + * KisAlphaMask is intended to create alpha values from a TQImage for use + * in brush creation. It is not a generic alpha tqmask that can be used with * KisPaintDevices: use a KisSelection for that. */ class KisAlphaMask : public KShared { public: /** - Create an alpha mask based on the specified QImage. If the image is - not a grayscale, the mask value is calculated from the effective grey + Create an alpha tqmask based on the specified TQImage. If the image is + not a grayscale, the tqmask value is calculated from the effective grey level and alpha value. */ - KisAlphaMask(const QImage& img); + KisAlphaMask(const TQImage& img); /** As above except quicker as the image does not need to be scanned to see if it has any colour pixels. */ - KisAlphaMask(const QImage& img, bool hasColor); + KisAlphaMask(const TQImage& img, bool hasColor); /** - Create a transparent mask. + Create a transparent tqmask. */ - KisAlphaMask(Q_INT32 width, Q_INT32 height); + KisAlphaMask(TQ_INT32 width, TQ_INT32 height); virtual ~KisAlphaMask(); /** @return the number of alpha values in a scanline. */ - Q_INT32 height() const; + TQ_INT32 height() const; /** - @return the number of lines in the mask. + @return the number of lines in the tqmask. */ - Q_INT32 width() const; + TQ_INT32 width() const; /** @return the alpha value at the specified position. - Returns Q_UINT8 OPACITY_TRANSPARENT if the value is - outside the bounds of the mask. + Returns TQ_UINT8 OPACITY_TRANSPARENT if the value is + outside the bounds of the tqmask. - XXX: this is, of course, not the best way of masking. + XXX: this is, of course, not the best way of tqmasking. Better would be to let KisAlphaMask fill a chunk of memory with the alpha values at the right position, something like - void applyMask(Q_UINT8 *pixeldata, Q_INT32 pixelWidth, - Q_INT32 alphaPos). That would be fastest, or we could - provide an iterator over the mask, that would be nice, too. + void applyMask(TQ_UINT8 *pixeldata, TQ_INT32 pixelWidth, + TQ_INT32 alphaPos). That would be fastest, or we could + provide an iterator over the tqmask, that would be nice, too. */ - inline Q_UINT8 alphaAt(Q_INT32 x, Q_INT32 y) const + inline TQ_UINT8 alphaAt(TQ_INT32 x, TQ_INT32 y) const { if (y >= 0 && y < m_height && x >= 0 && x < m_width) { return m_data[(y * m_width) + x]; @@ -87,19 +87,19 @@ class KisAlphaMask : public KShared { } } - void setAlphaAt(Q_INT32 x, Q_INT32 y, Q_UINT8 alpha); + void setAlphaAt(TQ_INT32 x, TQ_INT32 y, TQ_UINT8 alpha); - // Create a new mask by interpolating between mask1 and mask2 as t + // Create a new tqmask by interpolating between tqmask1 and tqmask2 as t // goes from 0 to 1. - static KisAlphaMaskSP interpolate(KisAlphaMaskSP mask1, KisAlphaMaskSP mask2, double t); + static KisAlphaMaskSP interpolate(KisAlphaMaskSP tqmask1, KisAlphaMaskSP tqmask2, double t); private: - void computeAlpha(const QImage& img); - void copyAlpha(const QImage& img); + void computeAlpha(const TQImage& img); + void copyAlpha(const TQImage& img); - QValueVector<Q_UINT8> m_data; - Q_INT32 m_width; - Q_INT32 m_height; + TQValueVector<TQ_UINT8> m_data; + TQ_INT32 m_width; + TQ_INT32 m_height; }; #endif // KIS_ALPHA_MASK_ diff --git a/krita/core/kis_autobrush_resource.cc b/krita/core/kis_autobrush_resource.cc index 6e45c64a..9a09fe78 100644 --- a/krita/core/kis_autobrush_resource.cc +++ b/krita/core/kis_autobrush_resource.cc @@ -19,20 +19,20 @@ #include "kis_autobrush_resource.h" #include <kdebug.h> -void KisAutobrushShape::createBrush( QImage* img) +void KisAutobrushShape::createBrush( TQImage* img) { img->create(m_w, m_h, 32); for(int j = 0; j < m_h; j++) { for(int i = 0; i < m_w; i++) { - Q_INT8 v = valueAt(i,j); - img->setPixel( i, j, qRgb(v,v,v)); + TQ_INT8 v = valueAt(i,j); + img->setPixel( i, j, tqRgb(v,v,v)); } } } -KisAutobrushCircleShape::KisAutobrushCircleShape(Q_INT32 w, Q_INT32 h, double fh, double fv) +KisAutobrushCircleShape::KisAutobrushCircleShape(TQ_INT32 w, TQ_INT32 h, double fh, double fv) : KisAutobrushShape( w, h, w / 2.0 - fh, h / 2.0 - fv), m_xcentre ( w / 2.0 ), m_ycentre ( h / 2.0 ), @@ -42,7 +42,7 @@ KisAutobrushCircleShape::KisAutobrushCircleShape(Q_INT32 w, Q_INT32 h, double fh m_yfadecoef ( (m_fv == 0) ? 1 : ( 1.0 / m_fv)) { } -Q_INT8 KisAutobrushCircleShape::valueAt(Q_INT32 x, Q_INT32 y) +TQ_INT8 KisAutobrushCircleShape::valueAt(TQ_INT32 x, TQ_INT32 y) { double xr = (x - m_xcentre) + 0.5; double yr = (y - m_ycentre) + 0.5; @@ -80,17 +80,17 @@ Q_INT8 KisAutobrushCircleShape::valueAt(Q_INT32 x, Q_INT32 y) } } -KisAutobrushRectShape::KisAutobrushRectShape(Q_INT32 w, Q_INT32 h, double fh, double fv) +KisAutobrushRectShape::KisAutobrushRectShape(TQ_INT32 w, TQ_INT32 h, double fh, double fv) : KisAutobrushShape( w, h, w / 2.0 - fh, h / 2.0 - fv), m_xcentre ( w / 2.0 ), m_ycentre ( h / 2.0 ), m_c( fv/fh) { } -Q_INT8 KisAutobrushRectShape::valueAt(Q_INT32 x, Q_INT32 y) +TQ_INT8 KisAutobrushRectShape::valueAt(TQ_INT32 x, TQ_INT32 y) { - double xr = QABS(x - m_xcentre); - double yr = QABS(y - m_ycentre); + double xr = TQABS(x - m_xcentre); + double yr = TQABS(y - m_ycentre); if( xr > m_fh || yr > m_fv ) { if( yr <= ((xr - m_fh) * m_c + m_fv ) ) diff --git a/krita/core/kis_autobrush_resource.h b/krita/core/kis_autobrush_resource.h index d0c77767..44708efa 100644 --- a/krita/core/kis_autobrush_resource.h +++ b/krita/core/kis_autobrush_resource.h @@ -23,20 +23,20 @@ class KisAutobrushShape { public: - KisAutobrushShape(Q_INT32 w, Q_INT32 h, double fh, double fv) : m_w(w), m_h(h), m_fh(fh), m_fv(fv) + KisAutobrushShape(TQ_INT32 w, TQ_INT32 h, double fh, double fv) : m_w(w), m_h(h), m_fh(fh), m_fv(fv) { }; - void createBrush( QImage* img); + void createBrush( TQImage* img); protected: - virtual Q_INT8 valueAt(Q_INT32 x, Q_INT32 y) =0; - Q_INT32 m_w, m_h; + virtual TQ_INT8 valueAt(TQ_INT32 x, TQ_INT32 y) =0; + TQ_INT32 m_w, m_h; double m_fh, m_fv; }; class KisAutobrushCircleShape : public KisAutobrushShape { public: - KisAutobrushCircleShape(Q_INT32 w, Q_INT32 h, double fh, double fv); + KisAutobrushCircleShape(TQ_INT32 w, TQ_INT32 h, double fh, double fv); public: - virtual Q_INT8 valueAt(Q_INT32 x, Q_INT32 y); + virtual TQ_INT8 valueAt(TQ_INT32 x, TQ_INT32 y); private: double norme(double a, double b) { @@ -50,9 +50,9 @@ class KisAutobrushCircleShape : public KisAutobrushShape { class KisAutobrushRectShape : public KisAutobrushShape { public: - KisAutobrushRectShape(Q_INT32 w, Q_INT32 h, double fh, double fv); + KisAutobrushRectShape(TQ_INT32 w, TQ_INT32 h, double fh, double fv); protected: - virtual Q_INT8 valueAt(Q_INT32 x, Q_INT32 y); + virtual TQ_INT8 valueAt(TQ_INT32 x, TQ_INT32 y); private: double m_xcentre, m_ycentre, m_c; }; @@ -60,7 +60,7 @@ class KisAutobrushRectShape : public KisAutobrushShape { class KisAutobrushResource : public KisBrush { public: - KisAutobrushResource(QImage& img) : KisBrush("") + KisAutobrushResource(TQImage& img) : KisBrush("") { setImage(img); setBrushType(MASK); diff --git a/krita/core/kis_autogradient_resource.cc b/krita/core/kis_autogradient_resource.cc index f021222d..671e8fc2 100644 --- a/krita/core/kis_autogradient_resource.cc +++ b/krita/core/kis_autogradient_resource.cc @@ -25,15 +25,15 @@ #define PREVIEW_HEIGHT 64 -void KisAutogradientResource::createSegment( int interpolation, int colorInterpolation, double startOffset, double endOffset, double middleOffset, QColor left, QColor right ) +void KisAutogradientResource::createSegment( int interpolation, int colorInterpolation, double startOffset, double endOffset, double middleOffset, TQColor left, TQColor right ) { pushSegment(new KisGradientSegment(interpolation, colorInterpolation, startOffset, middleOffset, endOffset, Color( left, 1 ), Color( right, 1 ))); } -const QValueVector<double> KisAutogradientResource::getHandlePositions() const +const TQValueVector<double> KisAutogradientResource::getHandlePositions() const { - QValueVector<double> handlePositions; + TQValueVector<double> handlePositions; handlePositions.push_back(m_segments[0]->startOffset()); for (uint i = 0; i < m_segments.count(); i++) @@ -43,9 +43,9 @@ const QValueVector<double> KisAutogradientResource::getHandlePositions() const return handlePositions; } -const QValueVector<double> KisAutogradientResource::getMiddleHandlePositions() const +const TQValueVector<double> KisAutogradientResource::getMiddleHandlePositions() const { - QValueVector<double> middleHandlePositions; + TQValueVector<double> middleHandlePositions; for (uint i = 0; i < m_segments.count(); i++) { @@ -56,7 +56,7 @@ const QValueVector<double> KisAutogradientResource::getMiddleHandlePositions() c void KisAutogradientResource::moveSegmentStartOffset( KisGradientSegment* segment, double t) { - QValueVector<KisGradientSegment*>::iterator it = qFind( m_segments.begin(), m_segments.end(), segment ); + TQValueVector<KisGradientSegment*>::iterator it = tqFind( m_segments.begin(), m_segments.end(), segment ); if ( it != m_segments.end() ) { if ( it == m_segments.begin() ) @@ -81,7 +81,7 @@ void KisAutogradientResource::moveSegmentStartOffset( KisGradientSegment* segmen void KisAutogradientResource::moveSegmentEndOffset( KisGradientSegment* segment, double t) { - QValueVector<KisGradientSegment*>::iterator it = qFind( m_segments.begin(), m_segments.end(), segment ); + TQValueVector<KisGradientSegment*>::iterator it = tqFind( m_segments.begin(), m_segments.end(), segment ); if ( it != m_segments.end() ) { if ( it+1 == m_segments.end() ) @@ -120,7 +120,7 @@ void KisAutogradientResource::moveSegmentMiddleOffset( KisGradientSegment* segme void KisAutogradientResource::splitSegment( KisGradientSegment* segment ) { Q_ASSERT(segment != 0); - QValueVector<KisGradientSegment*>::iterator it = qFind( m_segments.begin(), m_segments.end(), segment ); + TQValueVector<KisGradientSegment*>::iterator it = tqFind( m_segments.begin(), m_segments.end(), segment ); if ( it != m_segments.end() ) { KisGradientSegment* newSegment = new KisGradientSegment( @@ -140,7 +140,7 @@ void KisAutogradientResource::splitSegment( KisGradientSegment* segment ) void KisAutogradientResource::duplicateSegment( KisGradientSegment* segment ) { Q_ASSERT(segment != 0); - QValueVector<KisGradientSegment*>::iterator it = qFind( m_segments.begin(), m_segments.end(), segment ); + TQValueVector<KisGradientSegment*>::iterator it = tqFind( m_segments.begin(), m_segments.end(), segment ); if ( it != m_segments.end() ) { double middlePostionPercentage = ( segment->middleOffset() - segment->startOffset() ) / segment->length(); @@ -181,7 +181,7 @@ KisGradientSegment* KisAutogradientResource::removeSegment( KisGradientSegment* Q_ASSERT(segment != 0); if( m_segments.count() < 2 ) return 0; - QValueVector<KisGradientSegment*>::iterator it = qFind( m_segments.begin(), m_segments.end(), segment ); + TQValueVector<KisGradientSegment*>::iterator it = tqFind( m_segments.begin(), m_segments.end(), segment ); if ( it != m_segments.end() ) { double middlePostionPercentage; diff --git a/krita/core/kis_autogradient_resource.h b/krita/core/kis_autogradient_resource.h index 972ec8f6..37546a02 100644 --- a/krita/core/kis_autogradient_resource.h +++ b/krita/core/kis_autogradient_resource.h @@ -30,10 +30,10 @@ public: public: - void createSegment( int interpolation, int colorInterpolation, double startOffset, double endOffset, double middleOffset, QColor left, QColor right ); + void createSegment( int interpolation, int colorInterpolation, double startOffset, double endOffset, double middleOffset, TQColor left, TQColor right ); - const QValueVector<double> getHandlePositions() const; - const QValueVector<double> getMiddleHandlePositions() const; + const TQValueVector<double> getHandlePositions() const; + const TQValueVector<double> getMiddleHandlePositions() const; /** * Moves the StartOffset of the specified segment to the specified value diff --git a/krita/core/kis_background.cc b/krita/core/kis_background.cc index 8fff32ec..6f881d33 100644 --- a/krita/core/kis_background.cc +++ b/krita/core/kis_background.cc @@ -22,15 +22,15 @@ KisBackground::KisBackground() : KShared() { - m_patternTile = QImage(PATTERN_WIDTH, PATTERN_HEIGHT, 32); + m_patternTile = TQImage(PATTERN_WIDTH, PATTERN_HEIGHT, 32); m_patternTile.setAlphaBuffer(false); for (int y = 0; y < PATTERN_HEIGHT; y++) { for (int x = 0; x < PATTERN_WIDTH; x++) { - Q_UINT8 v = 128 + 63 * ((x / 16 + y / 16) % 2); - m_patternTile.setPixel(x, y, qRgb(v, v, v)); + TQ_UINT8 v = 128 + 63 * ((x / 16 + y / 16) % 2); + m_patternTile.setPixel(x, y, tqRgb(v, v, v)); } } } @@ -39,12 +39,12 @@ KisBackground::~KisBackground() { } -const QImage& KisBackground::patternTile() const +const TQImage& KisBackground::patternTile() const { return m_patternTile; } -void KisBackground::paintBackground(QImage image, int imageLeftX, int imageTopY) +void KisBackground::paintBackground(TQImage image, int imageLeftX, int imageTopY) { int patternLeftX; @@ -69,23 +69,23 @@ void KisBackground::paintBackground(QImage image, int imageLeftX, int imageTopY) for (int y = 0; y < imageHeight; y++) { - QRgb *imagePixelPtr = reinterpret_cast<QRgb *>(image.scanLine(y)); - const QRgb *patternScanLine = reinterpret_cast<const QRgb *>(m_patternTile.scanLine(patternY)); + TQRgb *imagePixelPtr = reinterpret_cast<TQRgb *>(image.scanLine(y)); + const TQRgb *patternScanLine = reinterpret_cast<const TQRgb *>(m_patternTile.scanLine(patternY)); int patternX = patternLeftX; for (int x = 0; x < imageWidth; x++) { - QRgb imagePixel = *imagePixelPtr; - Q_UINT8 imagePixelAlpha = qAlpha(imagePixel); + TQRgb imagePixel = *imagePixelPtr; + TQ_UINT8 imagePixelAlpha = tqAlpha(imagePixel); if (imagePixelAlpha != 255) { - QRgb patternPixel = patternScanLine[patternX]; - Q_UINT8 imageRed = UINT8_BLEND(qRed(imagePixel), qRed(patternPixel), imagePixelAlpha); - Q_UINT8 imageGreen = UINT8_BLEND(qGreen(imagePixel), qGreen(patternPixel), imagePixelAlpha); - Q_UINT8 imageBlue = UINT8_BLEND(qBlue(imagePixel), qBlue(patternPixel), imagePixelAlpha); + TQRgb patternPixel = patternScanLine[patternX]; + TQ_UINT8 imageRed = UINT8_BLEND(tqRed(imagePixel), tqRed(patternPixel), imagePixelAlpha); + TQ_UINT8 imageGreen = UINT8_BLEND(tqGreen(imagePixel), tqGreen(patternPixel), imagePixelAlpha); + TQ_UINT8 imageBlue = UINT8_BLEND(tqBlue(imagePixel), tqBlue(patternPixel), imagePixelAlpha); - *imagePixelPtr = qRgba(imageRed, imageGreen, imageBlue, 255); + *imagePixelPtr = tqRgba(imageRed, imageGreen, imageBlue, 255); } ++imagePixelPtr; @@ -104,7 +104,7 @@ void KisBackground::paintBackground(QImage image, int imageLeftX, int imageTopY) } } -void KisBackground::paintBackground(QImage img, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize) +void KisBackground::paintBackground(TQImage img, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize) { if (scaledImageRect.isEmpty() || scaledImageSize.isEmpty() || imageSize.isEmpty()) { return; @@ -116,35 +116,35 @@ void KisBackground::paintBackground(QImage img, const QRect& scaledImageRect, co return; } - Q_INT32 imageWidth = imageSize.width(); - Q_INT32 imageHeight = imageSize.height(); + TQ_INT32 imageWidth = imageSize.width(); + TQ_INT32 imageHeight = imageSize.height(); - for (Q_INT32 y = 0; y < scaledImageRect.height(); ++y) { + for (TQ_INT32 y = 0; y < scaledImageRect.height(); ++y) { - Q_INT32 scaledY = scaledImageRect.y() + y; - Q_INT32 srcY = (scaledY * imageHeight) / scaledImageSize.height(); - Q_INT32 patternY = srcY % PATTERN_HEIGHT; + TQ_INT32 scaledY = scaledImageRect.y() + y; + TQ_INT32 srcY = (scaledY * imageHeight) / scaledImageSize.height(); + TQ_INT32 patternY = srcY % PATTERN_HEIGHT; - QRgb *imagePixelPtr = reinterpret_cast<QRgb *>(img.scanLine(y)); - const QRgb *patternScanLine = reinterpret_cast<const QRgb *>(m_patternTile.scanLine(patternY)); + TQRgb *imagePixelPtr = reinterpret_cast<TQRgb *>(img.scanLine(y)); + const TQRgb *patternScanLine = reinterpret_cast<const TQRgb *>(m_patternTile.scanLine(patternY)); - for (Q_INT32 x = 0; x < scaledImageRect.width(); ++x) { + for (TQ_INT32 x = 0; x < scaledImageRect.width(); ++x) { - QRgb imagePixel = *imagePixelPtr; - Q_UINT8 imagePixelAlpha = qAlpha(imagePixel); + TQRgb imagePixel = *imagePixelPtr; + TQ_UINT8 imagePixelAlpha = tqAlpha(imagePixel); if (imagePixelAlpha != 255) { - Q_INT32 scaledX = scaledImageRect.x() + x; - Q_INT32 srcX = (scaledX * imageWidth) / scaledImageSize.width(); - Q_INT32 patternX = srcX % PATTERN_WIDTH; + TQ_INT32 scaledX = scaledImageRect.x() + x; + TQ_INT32 srcX = (scaledX * imageWidth) / scaledImageSize.width(); + TQ_INT32 patternX = srcX % PATTERN_WIDTH; - QRgb patternPixel = patternScanLine[patternX]; - Q_UINT8 imageRed = UINT8_BLEND(qRed(imagePixel), qRed(patternPixel), imagePixelAlpha); - Q_UINT8 imageGreen = UINT8_BLEND(qGreen(imagePixel), qGreen(patternPixel), imagePixelAlpha); - Q_UINT8 imageBlue = UINT8_BLEND(qBlue(imagePixel), qBlue(patternPixel), imagePixelAlpha); + TQRgb patternPixel = patternScanLine[patternX]; + TQ_UINT8 imageRed = UINT8_BLEND(tqRed(imagePixel), tqRed(patternPixel), imagePixelAlpha); + TQ_UINT8 imageGreen = UINT8_BLEND(tqGreen(imagePixel), tqGreen(patternPixel), imagePixelAlpha); + TQ_UINT8 imageBlue = UINT8_BLEND(tqBlue(imagePixel), tqBlue(patternPixel), imagePixelAlpha); - *imagePixelPtr = qRgba(imageRed, imageGreen, imageBlue, 255); + *imagePixelPtr = tqRgba(imageRed, imageGreen, imageBlue, 255); } ++imagePixelPtr; diff --git a/krita/core/kis_background.h b/krita/core/kis_background.h index 59016ffb..f5b52903 100644 --- a/krita/core/kis_background.h +++ b/krita/core/kis_background.h @@ -18,7 +18,7 @@ #ifndef KIS_BACKGROUND_H_ #define KIS_BACKGROUND_H_ -#include <qimage.h> +#include <tqimage.h> #include <ksharedptr.h> @@ -31,18 +31,18 @@ public: // Paint the background pattern into the image, 'behind' the image // contents. The coordinates are for the image's top-left corner // in image space. - void paintBackground(QImage image, int leftX, int topY); + void paintBackground(TQImage image, int leftX, int topY); - void paintBackground(QImage image, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize); + void paintBackground(TQImage image, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize); // Returns the pattern tile. - const QImage& patternTile() const; + const TQImage& patternTile() const; protected: static const int PATTERN_WIDTH = 32; static const int PATTERN_HEIGHT = 32; - QImage m_patternTile; + TQImage m_patternTile; }; #endif // KIS_BACKGROUND_H_ diff --git a/krita/core/kis_basic_math_toolbox.cpp b/krita/core/kis_basic_math_toolbox.cpp index d20544af..1b397ab5 100644 --- a/krita/core/kis_basic_math_toolbox.cpp +++ b/krita/core/kis_basic_math_toolbox.cpp @@ -112,7 +112,7 @@ void KisBasicMathToolbox::waveuntrans(KisMathToolbox::KisWavelet* wav, KisMathTo } } -KisMathToolbox::KisWavelet* KisBasicMathToolbox::fastWaveletTransformation(KisPaintDeviceSP src, const QRect& rect, KisWavelet* buff) +KisMathToolbox::KisWavelet* KisBasicMathToolbox::fastWaveletTransformation(KisPaintDeviceSP src, const TQRect& rect, KisWavelet* buff) { if(buff == 0) { @@ -125,7 +125,7 @@ KisMathToolbox::KisWavelet* KisBasicMathToolbox::fastWaveletTransformation(KisPa return wav; } -void KisBasicMathToolbox::fastWaveletUntransformation(KisPaintDeviceSP dst, const QRect& rect, KisWavelet* wav, KisWavelet* buff) +void KisBasicMathToolbox::fastWaveletUntransformation(KisPaintDeviceSP dst, const TQRect& rect, KisWavelet* wav, KisWavelet* buff) { if(buff == 0) { diff --git a/krita/core/kis_basic_math_toolbox.h b/krita/core/kis_basic_math_toolbox.h index ce80e55c..e5fa66cd 100644 --- a/krita/core/kis_basic_math_toolbox.h +++ b/krita/core/kis_basic_math_toolbox.h @@ -33,8 +33,8 @@ class KisBasicMathToolbox : public KisMathToolbox KisBasicMathToolbox(); ~KisBasicMathToolbox(); public: - virtual KisWavelet* fastWaveletTransformation(KisPaintDeviceSP src, const QRect&, KisWavelet* buff = 0); - virtual void fastWaveletUntransformation(KisPaintDeviceSP dst, const QRect&, KisWavelet* wav, KisWavelet* buff = 0); + virtual KisWavelet* fastWaveletTransformation(KisPaintDeviceSP src, const TQRect&, KisWavelet* buff = 0); + virtual void fastWaveletUntransformation(KisPaintDeviceSP dst, const TQRect&, KisWavelet* wav, KisWavelet* buff = 0); private: void wavetrans(KisWavelet* wav, KisWavelet* buff, uint halfsize); void waveuntrans(KisWavelet* wav, KisWavelet* buff, uint halfsize); diff --git a/krita/core/kis_boundary.cc b/krita/core/kis_boundary.cc index 24524aeb..0c9681c2 100644 --- a/krita/core/kis_boundary.cc +++ b/krita/core/kis_boundary.cc @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qpixmap.h> -#include <qpainter.h> +#include <tqpixmap.h> +#include <tqpainter.h> #include "kis_colorspace.h" #include "kis_iterators_pixel.h" @@ -28,7 +28,7 @@ KisBoundary::KisBoundary(KisPaintDevice* dev) { m_fuzzyness = 255 / 2; } -bool KisBoundary::isDark(Q_UINT8 val) { +bool KisBoundary::isDark(TQ_UINT8 val) { return val < m_fuzzyness; } @@ -38,42 +38,42 @@ void KisBoundary::generateBoundary(int w, int h) { KisColorSpace* cs = m_device->colorSpace(); - // Horizontal + //Qt::Horizontal for (int currentY = - 1; currentY < h; currentY++) { KisHLineIteratorPixel topIt = m_device->createHLineIterator(0, currentY, w, false); KisHLineIteratorPixel botIt = m_device->createHLineIterator(0, currentY + 1, w, false); bool darkTop; bool darkBot; - m_horSegments.append(QValueList<PointPair>()); + m_horSegments.append(TQValueList<PointPair>()); while (!topIt.isDone()) { darkTop = cs->getAlpha(topIt.rawData()); darkBot = cs->getAlpha(botIt.rawData()); if (darkTop != darkBot) { // detected a change - m_horSegments.back().append(qMakePair(KisPoint(botIt.x(), botIt.y()), 1)); + m_horSegments.back().append(tqMakePair(KisPoint(botIt.x(), botIt.y()), 1)); } ++topIt; ++botIt; } } - // Vertical + //Qt::Vertical for (int currentX = - 1; currentX < w; currentX++) { KisVLineIteratorPixel leftIt = m_device->createVLineIterator(currentX, 0, h, false); KisVLineIteratorPixel rightIt = m_device->createVLineIterator(currentX + 1, 0, h, false); bool darkLeft; bool darkRight; - m_vertSegments.append(QValueList<PointPair>()); + m_vertSegments.append(TQValueList<PointPair>()); while (!leftIt.isDone()) { darkLeft = cs->getAlpha(leftIt.rawData()); darkRight = cs->getAlpha(rightIt.rawData()); if (darkLeft != darkRight) { // detected a change - m_vertSegments.back().append(qMakePair(KisPoint(rightIt.x(), rightIt.y()), 1)); + m_vertSegments.back().append(tqMakePair(KisPoint(rightIt.x(), rightIt.y()), 1)); } ++leftIt; ++rightIt; diff --git a/krita/core/kis_boundary.h b/krita/core/kis_boundary.h index 069d0289..6c5ce8c6 100644 --- a/krita/core/kis_boundary.h +++ b/krita/core/kis_boundary.h @@ -18,8 +18,8 @@ #ifndef _KIS_BOUNDARY_H_ #define _KIS_BOUNDARY_H_ -#include <qvaluelist.h> -#include <qpair.h> +#include <tqvaluelist.h> +#include <tqpair.h> #include <koffice_export.h> #include "kis_point.h" @@ -40,13 +40,13 @@ public: void generateBoundary(int w, int h); private: - typedef QPair<KisPoint, int> PointPair; // int->length - bool isDark(Q_UINT8 val); + typedef TQPair<KisPoint, int> PointPair; // int->length + bool isDark(TQ_UINT8 val); KisPaintDevice* m_device; int m_fuzzyness; - typedef QValueList<PointPair> PointPairList; - typedef QValueList< PointPairList > PointPairListList; + typedef TQValueList<PointPair> PointPairList; + typedef TQValueList< PointPairList > PointPairListList; PointPairListList m_horSegments; PointPairListList m_vertSegments; diff --git a/krita/core/kis_brush.cc b/krita/core/kis_brush.cc index 57ee2584..a590248d 100644 --- a/krita/core/kis_brush.cc +++ b/krita/core/kis_brush.cc @@ -33,10 +33,10 @@ #include <stdlib.h> #include <cfloat> -#include <qfile.h> -#include <qimage.h> -#include <qpoint.h> -#include <qvaluevector.h> +#include <tqfile.h> +#include <tqimage.h> +#include <tqpoint.h> +#include <tqvaluevector.h> #include <kdebug.h> #include <klocale.h> @@ -45,7 +45,7 @@ #include "kis_paint_device.h" #include "kis_global.h" #include "kis_brush.h" -#include "kis_alpha_mask.h" +#include "kis_alpha_tqmask.h" #include "kis_colorspace_factory_registry.h" #include "kis_iterators_pixel.h" #include "kis_image.h" @@ -53,34 +53,34 @@ namespace { struct GimpBrushV1Header { - Q_UINT32 header_size; /* header_size = sizeof (BrushHeader) + brush name */ - Q_UINT32 version; /* brush file version # */ - Q_UINT32 width; /* width of brush */ - Q_UINT32 height; /* height of brush */ - Q_UINT32 bytes; /* depth of brush in bytes */ + TQ_UINT32 header_size; /* header_size = sizeof (BrushHeader) + brush name */ + TQ_UINT32 version; /* brush file version # */ + TQ_UINT32 width; /* width of brush */ + TQ_UINT32 height; /* height of brush */ + TQ_UINT32 bytes; /* depth of brush in bytes */ }; /// All fields are in MSB on disk! struct GimpBrushHeader { - Q_UINT32 header_size; /* header_size = sizeof (BrushHeader) + brush name */ - Q_UINT32 version; /* brush file version # */ - Q_UINT32 width; /* width of brush */ - Q_UINT32 height; /* height of brush */ - Q_UINT32 bytes; /* depth of brush in bytes */ + TQ_UINT32 header_size; /* header_size = sizeof (BrushHeader) + brush name */ + TQ_UINT32 version; /* brush file version # */ + TQ_UINT32 width; /* width of brush */ + TQ_UINT32 height; /* height of brush */ + TQ_UINT32 bytes; /* depth of brush in bytes */ /* The following are only defined in version 2 */ - Q_UINT32 magic_number; /* GIMP brush magic number */ - Q_UINT32 spacing; /* brush spacing as % of width & height, 0 - 1000 */ + TQ_UINT32 magic_number; /* GIMP brush magic number */ + TQ_UINT32 spacing; /* brush spacing as % of width & height, 0 - 1000 */ }; // Needed, or the GIMP won't open it! - Q_UINT32 const GimpV2BrushMagic = ('G' << 24) + ('I' << 16) + ('M' << 8) + ('P' << 0); + TQ_UINT32 const GimpV2BrushMagic = ('G' << 24) + ('I' << 16) + ('M' << 8) + ('P' << 0); } #define DEFAULT_SPACING 0.25 #define MAXIMUM_SCALE 2 -KisBrush::KisBrush(const QString& filename) : super(filename) +KisBrush::KisBrush(const TQString& filename) : super(filename) { m_brushType = INVALID; m_ownData = true; @@ -90,9 +90,9 @@ KisBrush::KisBrush(const QString& filename) : super(filename) m_boundary = 0; } -KisBrush::KisBrush(const QString& filename, - const QByteArray& data, - Q_UINT32 & dataPos) : super(filename) +KisBrush::KisBrush(const TQString& filename, + const TQByteArray& data, + TQ_UINT32 & dataPos) : super(filename) { m_brushType = INVALID; m_ownData = false; @@ -108,7 +108,7 @@ KisBrush::KisBrush(const QString& filename, } KisBrush::KisBrush(KisPaintDevice* image, int x, int y, int w, int h) - : super(QString("")) + : super(TQString("")) { m_brushType = INVALID; m_ownData = true; @@ -120,8 +120,8 @@ KisBrush::KisBrush(KisPaintDevice* image, int x, int y, int w, int h) initFromPaintDev(image, x, y, w, h); } -KisBrush::KisBrush(const QImage& image, const QString& name) - : super(QString("")) +KisBrush::KisBrush(const TQImage& image, const TQString& name) + : super(TQString("")) { m_ownData = false; m_useColorAsMask = false; @@ -144,7 +144,7 @@ KisBrush::~KisBrush() bool KisBrush::load() { if (m_ownData) { - QFile file(filename()); + TQFile file(filename()); file.open(IO_ReadOnly); m_data = file.readAll(); file.close(); @@ -194,17 +194,17 @@ bool KisBrush::init() return false; } - QString name; + TQString name; if (bh.version == 1) { // Version 1 has no magic number or spacing, so the name // is at a different offset. Character encoding is undefined. const char *text = &m_data[sizeof(GimpBrushV1Header)]; - name = QString::fromAscii(text, bh.header_size - sizeof(GimpBrushV1Header)); + name = TQString::fromAscii(text, bh.header_size - sizeof(GimpBrushV1Header)); } else { // ### Version = 3->cinepaint; may be float16 data! // Version >=2: UTF-8 encoding is used - name = QString::fromUtf8(&m_data[sizeof(GimpBrushHeader)], + name = TQString::fromUtf8(&m_data[sizeof(GimpBrushHeader)], bh.header_size - sizeof(GimpBrushHeader)); } @@ -214,28 +214,28 @@ bool KisBrush::init() return false; } - Q_INT32 k = bh.header_size; + TQ_INT32 k = bh.header_size; if (bh.bytes == 1) { // Grayscale - if (static_cast<Q_UINT32>(k + bh.width * bh.height) > m_data.size()) { + if (static_cast<TQ_UINT32>(k + bh.width * bh.height) > m_data.size()) { return false; } m_brushType = MASK; m_hasColor = false; - for (Q_UINT32 y = 0; y < bh.height; y++) { - for (Q_UINT32 x = 0; x < bh.width; x++, k++) { - Q_INT32 val = 255 - static_cast<uchar>(m_data[k]); - m_img.setPixel(x, y, qRgb(val, val, val)); + for (TQ_UINT32 y = 0; y < bh.height; y++) { + for (TQ_UINT32 x = 0; x < bh.width; x++, k++) { + TQ_INT32 val = 255 - static_cast<uchar>(m_data[k]); + m_img.setPixel(x, y, tqRgb(val, val, val)); } } } else if (bh.bytes == 4) { // RGBA - if (static_cast<Q_UINT32>(k + (bh.width * bh.height * 4)) > m_data.size()) { + if (static_cast<TQ_UINT32>(k + (bh.width * bh.height * 4)) > m_data.size()) { return false; } @@ -243,9 +243,9 @@ bool KisBrush::init() m_img.setAlphaBuffer(true); m_hasColor = true; - for (Q_UINT32 y = 0; y < bh.height; y++) { - for (Q_UINT32 x = 0; x < bh.width; x++, k += 4) { - m_img.setPixel(x, y, qRgba(m_data[k], + for (TQ_UINT32 y = 0; y < bh.height; y++) { + for (TQ_UINT32 x = 0; x < bh.width; x++, k += 4) { + m_img.setPixel(x, y, tqRgba(m_data[k], m_data[k+1], m_data[k+2], m_data[k+3])); @@ -274,7 +274,7 @@ bool KisBrush::init() bool KisBrush::initFromPaintDev(KisPaintDevice* image, int x, int y, int w, int h) { // Forcefully convert to RGBA8 // XXX profile and exposure? - setImage(image->convertToQImage(0, x, y, w, h)); + setImage(image->convertToTQImage(0, x, y, w, h)); setName(image->name()); m_brushType = IMAGE; @@ -285,19 +285,19 @@ bool KisBrush::initFromPaintDev(KisPaintDevice* image, int x, int y, int w, int bool KisBrush::save() { - QFile file(filename()); + TQFile file(filename()); file.open(IO_WriteOnly | IO_Truncate); bool ok = saveToDevice(&file); file.close(); return ok; } -bool KisBrush::saveToDevice(QIODevice* dev) const +bool KisBrush::saveToDevice(TQIODevice* dev) const { GimpBrushHeader bh; - QCString utf8Name = name().utf8(); // Names in v2 brushes are in UTF-8 + TQCString utf8Name = name().utf8(); // Names in v2 brushes are in UTF-8 char const* name = utf8Name.data(); - int nameLength = qstrlen(name); + int nameLength = tqstrlen(name); int wrote; bh.header_size = htonl(sizeof(GimpBrushHeader) + nameLength); @@ -310,10 +310,10 @@ bool KisBrush::saveToDevice(QIODevice* dev) const else bh.bytes = htonl(4); bh.magic_number = htonl(GimpV2BrushMagic); - bh.spacing = htonl(static_cast<Q_UINT32>(spacing() * 100.0)); + bh.spacing = htonl(static_cast<TQ_UINT32>(spacing() * 100.0)); // Write header: first bh, then the name - QByteArray bytes; + TQByteArray bytes; bytes.setRawData(reinterpret_cast<char*>(&bh), sizeof(GimpBrushHeader)); wrote = dev->writeBlock(bytes); bytes.resetRawData(reinterpret_cast<char*>(&bh), sizeof(GimpBrushHeader)); @@ -329,22 +329,22 @@ bool KisBrush::saveToDevice(QIODevice* dev) const if (!hasColor()) { bytes.resize(width() * height()); - for (Q_INT32 y = 0; y < height(); y++) { - for (Q_INT32 x = 0; x < width(); x++) { - QRgb c = m_img.pixel(x, y); - bytes[k++] = static_cast<char>(255 - qRed(c)); // red == blue == green + for (TQ_INT32 y = 0; y < height(); y++) { + for (TQ_INT32 x = 0; x < width(); x++) { + TQRgb c = m_img.pixel(x, y); + bytes[k++] = static_cast<char>(255 - tqRed(c)); // red == blue == green } } } else { bytes.resize(width() * height() * 4); - for (Q_INT32 y = 0; y < height(); y++) { - for (Q_INT32 x = 0; x < width(); x++) { + for (TQ_INT32 y = 0; y < height(); y++) { + for (TQ_INT32 x = 0; x < width(); x++) { // order for gimp brushes, v2 is: RGBA - QRgb pixel = m_img.pixel(x,y); - bytes[k++] = static_cast<char>(qRed(pixel)); - bytes[k++] = static_cast<char>(qGreen(pixel)); - bytes[k++] = static_cast<char>(qBlue(pixel)); - bytes[k++] = static_cast<char>(qAlpha(pixel)); + TQRgb pixel = m_img.pixel(x,y); + bytes[k++] = static_cast<char>(tqRed(pixel)); + bytes[k++] = static_cast<char>(tqGreen(pixel)); + bytes[k++] = static_cast<char>(tqBlue(pixel)); + bytes[k++] = static_cast<char>(tqAlpha(pixel)); } } } @@ -356,18 +356,18 @@ bool KisBrush::saveToDevice(QIODevice* dev) const return true; } -QImage KisBrush::img() +TQImage KisBrush::img() { - QImage image = m_img; + TQImage image = m_img; if (hasColor() && useColorAsMask()) { image.detach(); for (int x = 0; x < image.width(); x++) { for (int y = 0; y < image.height(); y++) { - QRgb c = image.pixel(x, y); - int a = (qGray(c) * qAlpha(c)) / 255; - image.setPixel(x, y, qRgba(a, 0, a, a)); + TQRgb c = image.pixel(x, y); + int a = (tqGray(c) * tqAlpha(c)) / 255; + image.setPixel(x, y, tqRgba(a, 0, a, a)); } } } @@ -375,7 +375,7 @@ QImage KisBrush::img() return image; } -KisAlphaMaskSP KisBrush::mask(const KisPaintInformation& info, double subPixelX, double subPixelY) const +KisAlphaMaskSP KisBrush::tqmask(const KisPaintInformation& info, double subPixelX, double subPixelY) const { if (m_scaledBrushes.isEmpty()) { createScaledBrushes(); @@ -392,7 +392,7 @@ KisAlphaMaskSP KisBrush::mask(const KisPaintInformation& info, double subPixelX, KisAlphaMaskSP outputMask = 0; if (belowBrush != 0) { - // We're in between two masks. Interpolate between them. + // We're in between two tqmasks. Interpolate between them. KisAlphaMaskSP scaledAboveMask = scaleMask(aboveBrush, scale, subPixelX, subPixelY); KisAlphaMaskSP scaledBelowMask = scaleMask(belowBrush, scale, subPixelX, subPixelY); @@ -405,9 +405,9 @@ KisAlphaMaskSP KisBrush::mask(const KisPaintInformation& info, double subPixelX, // Exact match. outputMask = scaleMask(aboveBrush, scale, subPixelX, subPixelY); } else { - // We are smaller than the smallest mask, which is always 1x1. + // We are smaller than the smallest tqmask, which is always 1x1. double s = scale / aboveBrush->scale(); - outputMask = scaleSinglePixelMask(s, aboveBrush->mask()->alphaAt(0, 0), subPixelX, subPixelY); + outputMask = scaleSinglePixelMask(s, aboveBrush->tqmask()->alphaAt(0, 0), subPixelX, subPixelY); } } @@ -428,13 +428,13 @@ KisPaintDeviceSP KisBrush::image(KisColorSpace * /*colorSpace*/, const KisPaintI findScaledBrushes(scale, &aboveBrush, &belowBrush); Q_ASSERT(aboveBrush != 0); - QImage outputImage; + TQImage outputImage; if (belowBrush != 0) { // We're in between two brushes. Interpolate between them. - QImage scaledAboveImage = scaleImage(aboveBrush, scale, subPixelX, subPixelY); - QImage scaledBelowImage = scaleImage(belowBrush, scale, subPixelX, subPixelY); + TQImage scaledAboveImage = scaleImage(aboveBrush, scale, subPixelX, subPixelY); + TQImage scaledBelowImage = scaleImage(belowBrush, scale, subPixelX, subPixelY); double t = (scale - belowBrush->scale()) / (aboveBrush->scale() - belowBrush->scale()); @@ -460,13 +460,13 @@ KisPaintDeviceSP KisBrush::image(KisColorSpace * /*colorSpace*/, const KisPaintI for (int y = 0; y < outputHeight; y++) { KisHLineIterator iter = layer->createHLineIterator( 0, y, outputWidth, true); for (int x = 0; x < outputWidth; x++) { - Q_UINT8 * p = iter.rawData(); + TQ_UINT8 * p = iter.rawData(); - QRgb pixel = outputImage.pixel(x, y); - int red = qRed(pixel); - int green = qGreen(pixel); - int blue = qBlue(pixel); - int alpha = qAlpha(pixel); + TQRgb pixel = outputImage.pixel(x, y); + int red = tqRed(pixel); + int green = tqGreen(pixel); + int blue = tqBlue(pixel); + int alpha = tqAlpha(pixel); // Scaled images are in pre-multiplied alpha form so // divide by alpha. @@ -550,7 +550,7 @@ void KisBrush::createScaledBrushes() const int width = m_img.width() * MAXIMUM_SCALE; int height = m_img.height() * MAXIMUM_SCALE; - QImage scaledImage; + TQImage scaledImage; while (true) { @@ -569,7 +569,7 @@ void KisBrush::createScaledBrushes() const double yScale = static_cast<double>(height) / m_img.height(); double scale = xScale; - m_scaledBrushes.append(ScaledBrush(scaledMask, hasColor() ? scaledImage : QImage(), scale, xScale, yScale)); + m_scaledBrushes.append(ScaledBrush(scaledMask, hasColor() ? scaledImage : TQImage(), scale, xScale, yScale)); if (width == 1 && height == 1) { break; @@ -608,16 +608,16 @@ double KisBrush::scaleForPressure(double pressure) return scale; } -Q_INT32 KisBrush::maskWidth(const KisPaintInformation& info) const +TQ_INT32 KisBrush::tqmaskWidth(const KisPaintInformation& info) const { // Add one for sub-pixel shift - return static_cast<Q_INT32>(ceil(width() * scaleForPressure(info.pressure)) + 1); + return static_cast<TQ_INT32>(ceil(width() * scaleForPressure(info.pressure)) + 1); } -Q_INT32 KisBrush::maskHeight(const KisPaintInformation& info) const +TQ_INT32 KisBrush::tqmaskHeight(const KisPaintInformation& info) const { // Add one for sub-pixel shift - return static_cast<Q_INT32>(ceil(height() * scaleForPressure(info.pressure)) + 1); + return static_cast<TQ_INT32>(ceil(height() * scaleForPressure(info.pressure)) + 1); } KisAlphaMaskSP KisBrush::scaleMask(const ScaledBrush *srcBrush, double scale, double subPixelX, double subPixelY) const @@ -629,7 +629,7 @@ KisAlphaMaskSP KisBrush::scaleMask(const ScaledBrush *srcBrush, double scale, do KisAlphaMaskSP dstMask = new KisAlphaMask(dstWidth, dstHeight); Q_CHECK_PTR(dstMask); - KisAlphaMaskSP srcMask = srcBrush->mask(); + KisAlphaMaskSP srcMask = srcBrush->tqmask(); // Compute scales to map the scaled brush onto the required scale. double xScale = srcBrush->xScale() / scale; @@ -663,10 +663,10 @@ KisAlphaMaskSP KisBrush::scaleMask(const ScaledBrush *srcBrush, double scale, do double yInterp = srcY - topY; - Q_UINT8 topLeft = (leftX >= 0 && leftX < srcWidth && topY >= 0 && topY < srcHeight) ? srcMask->alphaAt(leftX, topY) : OPACITY_TRANSPARENT; - Q_UINT8 bottomLeft = (leftX >= 0 && leftX < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcMask->alphaAt(leftX, topY + 1) : OPACITY_TRANSPARENT; - Q_UINT8 topRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY >= 0 && topY < srcHeight) ? srcMask->alphaAt(leftX + 1, topY) : OPACITY_TRANSPARENT; - Q_UINT8 bottomRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcMask->alphaAt(leftX + 1, topY + 1) : OPACITY_TRANSPARENT; + TQ_UINT8 topLeft = (leftX >= 0 && leftX < srcWidth && topY >= 0 && topY < srcHeight) ? srcMask->alphaAt(leftX, topY) : OPACITY_TRANSPARENT; + TQ_UINT8 bottomLeft = (leftX >= 0 && leftX < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcMask->alphaAt(leftX, topY + 1) : OPACITY_TRANSPARENT; + TQ_UINT8 topRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY >= 0 && topY < srcHeight) ? srcMask->alphaAt(leftX + 1, topY) : OPACITY_TRANSPARENT; + TQ_UINT8 bottomRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcMask->alphaAt(leftX + 1, topY + 1) : OPACITY_TRANSPARENT; double a = 1 - xInterp; double b = 1 - yInterp; @@ -685,23 +685,23 @@ KisAlphaMaskSP KisBrush::scaleMask(const ScaledBrush *srcBrush, double scale, do d = OPACITY_OPAQUE; } - dstMask->setAlphaAt(dstX, dstY, static_cast<Q_UINT8>(d)); + dstMask->setAlphaAt(dstX, dstY, static_cast<TQ_UINT8>(d)); } } return dstMask; } -QImage KisBrush::scaleImage(const ScaledBrush *srcBrush, double scale, double subPixelX, double subPixelY) const +TQImage KisBrush::scaleImage(const ScaledBrush *srcBrush, double scale, double subPixelX, double subPixelY) const { // Add one pixel for sub-pixel shifting int dstWidth = static_cast<int>(ceil(scale * width())) + 1; int dstHeight = static_cast<int>(ceil(scale * height())) + 1; - QImage dstImage(dstWidth, dstHeight, 32); + TQImage dstImage(dstWidth, dstHeight, 32); dstImage.setAlphaBuffer(true); - const QImage srcImage = srcBrush->image(); + const TQImage srcImage = srcBrush->image(); // Compute scales to map the scaled brush onto the required scale. double xScale = srcBrush->xScale() / scale; @@ -735,31 +735,31 @@ QImage KisBrush::scaleImage(const ScaledBrush *srcBrush, double scale, double su double yInterp = srcY - topY; - QRgb topLeft = (leftX >= 0 && leftX < srcWidth && topY >= 0 && topY < srcHeight) ? srcImage.pixel(leftX, topY) : qRgba(0, 0, 0, 0); - QRgb bottomLeft = (leftX >= 0 && leftX < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcImage.pixel(leftX, topY + 1) : qRgba(0, 0, 0, 0); - QRgb topRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY >= 0 && topY < srcHeight) ? srcImage.pixel(leftX + 1, topY) : qRgba(0, 0, 0, 0); - QRgb bottomRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcImage.pixel(leftX + 1, topY + 1) : qRgba(0, 0, 0, 0); + TQRgb topLeft = (leftX >= 0 && leftX < srcWidth && topY >= 0 && topY < srcHeight) ? srcImage.pixel(leftX, topY) : tqRgba(0, 0, 0, 0); + TQRgb bottomLeft = (leftX >= 0 && leftX < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcImage.pixel(leftX, topY + 1) : tqRgba(0, 0, 0, 0); + TQRgb topRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY >= 0 && topY < srcHeight) ? srcImage.pixel(leftX + 1, topY) : tqRgba(0, 0, 0, 0); + TQRgb bottomRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcImage.pixel(leftX + 1, topY + 1) : tqRgba(0, 0, 0, 0); double a = 1 - xInterp; double b = 1 - yInterp; // Bi-linear interpolation. Image is pre-multiplied by alpha. - int red = static_cast<int>(a * b * qRed(topLeft) - + a * (1 - b) * qRed(bottomLeft) - + (1 - a) * b * qRed(topRight) - + (1 - a) * (1 - b) * qRed(bottomRight) + 0.5); - int green = static_cast<int>(a * b * qGreen(topLeft) - + a * (1 - b) * qGreen(bottomLeft) - + (1 - a) * b * qGreen(topRight) - + (1 - a) * (1 - b) * qGreen(bottomRight) + 0.5); - int blue = static_cast<int>(a * b * qBlue(topLeft) - + a * (1 - b) * qBlue(bottomLeft) - + (1 - a) * b * qBlue(topRight) - + (1 - a) * (1 - b) * qBlue(bottomRight) + 0.5); - int alpha = static_cast<int>(a * b * qAlpha(topLeft) - + a * (1 - b) * qAlpha(bottomLeft) - + (1 - a) * b * qAlpha(topRight) - + (1 - a) * (1 - b) * qAlpha(bottomRight) + 0.5); + int red = static_cast<int>(a * b * tqRed(topLeft) + + a * (1 - b) * tqRed(bottomLeft) + + (1 - a) * b * tqRed(topRight) + + (1 - a) * (1 - b) * tqRed(bottomRight) + 0.5); + int green = static_cast<int>(a * b * tqGreen(topLeft) + + a * (1 - b) * tqGreen(bottomLeft) + + (1 - a) * b * tqGreen(topRight) + + (1 - a) * (1 - b) * tqGreen(bottomRight) + 0.5); + int blue = static_cast<int>(a * b * tqBlue(topLeft) + + a * (1 - b) * tqBlue(bottomLeft) + + (1 - a) * b * tqBlue(topRight) + + (1 - a) * (1 - b) * tqBlue(bottomRight) + 0.5); + int alpha = static_cast<int>(a * b * tqAlpha(topLeft) + + a * (1 - b) * tqAlpha(bottomLeft) + + (1 - a) * b * tqAlpha(topRight) + + (1 - a) * (1 - b) * tqAlpha(bottomRight) + 0.5); if (red < 0) { red = 0; @@ -793,17 +793,17 @@ QImage KisBrush::scaleImage(const ScaledBrush *srcBrush, double scale, double su alpha = 255; } - dstImage.setPixel(dstX, dstY, qRgba(red, green, blue, alpha)); + dstImage.setPixel(dstX, dstY, tqRgba(red, green, blue, alpha)); } } return dstImage; } -QImage KisBrush::scaleImage(const QImage& srcImage, int width, int height) +TQImage KisBrush::scaleImage(const TQImage& srcImage, int width, int height) { - QImage scaledImage; - //QString filename; + TQImage scaledImage; + //TQString filename; int srcWidth = srcImage.width(); int srcHeight = srcImage.height(); @@ -816,7 +816,7 @@ QImage KisBrush::scaleImage(const QImage& srcImage, int width, int height) // or scaling it to less than half size. scaledImage = srcImage.smoothScale(width, height); - //filename = QString("smoothScale_%1x%2.png").arg(width).arg(height); + //filename = TQString("smoothScale_%1x%2.png").tqarg(width).tqarg(height); } else { scaledImage.create(width, height, 32); @@ -847,10 +847,10 @@ QImage KisBrush::scaleImage(const QImage& srcImage, int width, int height) double yInterp = srcY - topY; - QRgb topLeft = (leftX >= 0 && leftX < srcWidth && topY >= 0 && topY < srcHeight) ? srcImage.pixel(leftX, topY) : qRgba(0, 0, 0, 0); - QRgb bottomLeft = (leftX >= 0 && leftX < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcImage.pixel(leftX, topY + 1) : qRgba(0, 0, 0, 0); - QRgb topRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY >= 0 && topY < srcHeight) ? srcImage.pixel(leftX + 1, topY) : qRgba(0, 0, 0, 0); - QRgb bottomRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcImage.pixel(leftX + 1, topY + 1) : qRgba(0, 0, 0, 0); + TQRgb topLeft = (leftX >= 0 && leftX < srcWidth && topY >= 0 && topY < srcHeight) ? srcImage.pixel(leftX, topY) : tqRgba(0, 0, 0, 0); + TQRgb bottomLeft = (leftX >= 0 && leftX < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcImage.pixel(leftX, topY + 1) : tqRgba(0, 0, 0, 0); + TQRgb topRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY >= 0 && topY < srcHeight) ? srcImage.pixel(leftX + 1, topY) : tqRgba(0, 0, 0, 0); + TQRgb bottomRight = (leftX + 1 >= 0 && leftX + 1 < srcWidth && topY + 1 >= 0 && topY + 1 < srcHeight) ? srcImage.pixel(leftX + 1, topY + 1) : tqRgba(0, 0, 0, 0); double a = 1 - xInterp; double b = 1 - yInterp; @@ -861,22 +861,22 @@ QImage KisBrush::scaleImage(const QImage& srcImage, int width, int height) int alpha; if (srcImage.hasAlphaBuffer()) { - red = static_cast<int>(a * b * qRed(topLeft) * qAlpha(topLeft) - + a * (1 - b) * qRed(bottomLeft) * qAlpha(bottomLeft) - + (1 - a) * b * qRed(topRight) * qAlpha(topRight) - + (1 - a) * (1 - b) * qRed(bottomRight) * qAlpha(bottomRight) + 0.5); - green = static_cast<int>(a * b * qGreen(topLeft) * qAlpha(topLeft) - + a * (1 - b) * qGreen(bottomLeft) * qAlpha(bottomLeft) - + (1 - a) * b * qGreen(topRight) * qAlpha(topRight) - + (1 - a) * (1 - b) * qGreen(bottomRight) * qAlpha(bottomRight) + 0.5); - blue = static_cast<int>(a * b * qBlue(topLeft) * qAlpha(topLeft) - + a * (1 - b) * qBlue(bottomLeft) * qAlpha(bottomLeft) - + (1 - a) * b * qBlue(topRight) * qAlpha(topRight) - + (1 - a) * (1 - b) * qBlue(bottomRight) * qAlpha(bottomRight) + 0.5); - alpha = static_cast<int>(a * b * qAlpha(topLeft) - + a * (1 - b) * qAlpha(bottomLeft) - + (1 - a) * b * qAlpha(topRight) - + (1 - a) * (1 - b) * qAlpha(bottomRight) + 0.5); + red = static_cast<int>(a * b * tqRed(topLeft) * tqAlpha(topLeft) + + a * (1 - b) * tqRed(bottomLeft) * tqAlpha(bottomLeft) + + (1 - a) * b * tqRed(topRight) * tqAlpha(topRight) + + (1 - a) * (1 - b) * tqRed(bottomRight) * tqAlpha(bottomRight) + 0.5); + green = static_cast<int>(a * b * tqGreen(topLeft) * tqAlpha(topLeft) + + a * (1 - b) * tqGreen(bottomLeft) * tqAlpha(bottomLeft) + + (1 - a) * b * tqGreen(topRight) * tqAlpha(topRight) + + (1 - a) * (1 - b) * tqGreen(bottomRight) * tqAlpha(bottomRight) + 0.5); + blue = static_cast<int>(a * b * tqBlue(topLeft) * tqAlpha(topLeft) + + a * (1 - b) * tqBlue(bottomLeft) * tqAlpha(bottomLeft) + + (1 - a) * b * tqBlue(topRight) * tqAlpha(topRight) + + (1 - a) * (1 - b) * tqBlue(bottomRight) * tqAlpha(bottomRight) + 0.5); + alpha = static_cast<int>(a * b * tqAlpha(topLeft) + + a * (1 - b) * tqAlpha(bottomLeft) + + (1 - a) * b * tqAlpha(topRight) + + (1 - a) * (1 - b) * tqAlpha(bottomRight) + 0.5); if (alpha != 0) { red /= alpha; @@ -885,18 +885,18 @@ QImage KisBrush::scaleImage(const QImage& srcImage, int width, int height) } } else { - red = static_cast<int>(a * b * qRed(topLeft) - + a * (1 - b) * qRed(bottomLeft) - + (1 - a) * b * qRed(topRight) - + (1 - a) * (1 - b) * qRed(bottomRight) + 0.5); - green = static_cast<int>(a * b * qGreen(topLeft) - + a * (1 - b) * qGreen(bottomLeft) - + (1 - a) * b * qGreen(topRight) - + (1 - a) * (1 - b) * qGreen(bottomRight) + 0.5); - blue = static_cast<int>(a * b * qBlue(topLeft) - + a * (1 - b) * qBlue(bottomLeft) - + (1 - a) * b * qBlue(topRight) - + (1 - a) * (1 - b) * qBlue(bottomRight) + 0.5); + red = static_cast<int>(a * b * tqRed(topLeft) + + a * (1 - b) * tqRed(bottomLeft) + + (1 - a) * b * tqRed(topRight) + + (1 - a) * (1 - b) * tqRed(bottomRight) + 0.5); + green = static_cast<int>(a * b * tqGreen(topLeft) + + a * (1 - b) * tqGreen(bottomLeft) + + (1 - a) * b * tqGreen(topRight) + + (1 - a) * (1 - b) * tqGreen(bottomRight) + 0.5); + blue = static_cast<int>(a * b * tqBlue(topLeft) + + a * (1 - b) * tqBlue(bottomLeft) + + (1 - a) * b * tqBlue(topRight) + + (1 - a) * (1 - b) * tqBlue(bottomRight) + 0.5); alpha = 255; } @@ -932,11 +932,11 @@ QImage KisBrush::scaleImage(const QImage& srcImage, int width, int height) alpha = 255; } - scaledImage.setPixel(dstX, dstY, qRgba(red, green, blue, alpha)); + scaledImage.setPixel(dstX, dstY, tqRgba(red, green, blue, alpha)); } } - //filename = QString("bilinear_%1x%2.png").arg(width).arg(height); + //filename = TQString("bilinear_%1x%2.png").tqarg(width).tqarg(height); } //scaledImage.save(filename, "PNG"); @@ -971,7 +971,7 @@ void KisBrush::findScaledBrushes(double scale, const ScaledBrush **aboveBrush, c } } -KisAlphaMaskSP KisBrush::scaleSinglePixelMask(double scale, Q_UINT8 maskValue, double subPixelX, double subPixelY) +KisAlphaMaskSP KisBrush::scaleSinglePixelMask(double scale, TQ_UINT8 tqmaskValue, double subPixelX, double subPixelY) { int srcWidth = 1; int srcHeight = 1; @@ -986,10 +986,10 @@ KisAlphaMaskSP KisBrush::scaleSinglePixelMask(double scale, Q_UINT8 maskValue, d for (int y = 0; y < dstHeight; y++) { for (int x = 0; x < dstWidth; x++) { - Q_UINT8 topLeft = (x > 0 && y > 0) ? maskValue : OPACITY_TRANSPARENT; - Q_UINT8 bottomLeft = (x > 0 && y < srcHeight) ? maskValue : OPACITY_TRANSPARENT; - Q_UINT8 topRight = (x < srcWidth && y > 0) ? maskValue : OPACITY_TRANSPARENT; - Q_UINT8 bottomRight = (x < srcWidth && y < srcHeight) ? maskValue : OPACITY_TRANSPARENT; + TQ_UINT8 topLeft = (x > 0 && y > 0) ? tqmaskValue : OPACITY_TRANSPARENT; + TQ_UINT8 bottomLeft = (x > 0 && y < srcHeight) ? tqmaskValue : OPACITY_TRANSPARENT; + TQ_UINT8 topRight = (x < srcWidth && y > 0) ? tqmaskValue : OPACITY_TRANSPARENT; + TQ_UINT8 bottomRight = (x < srcWidth && y < srcHeight) ? tqmaskValue : OPACITY_TRANSPARENT; // Bi-linear interpolation int d = static_cast<int>(a * b * topLeft @@ -1009,21 +1009,21 @@ KisAlphaMaskSP KisBrush::scaleSinglePixelMask(double scale, Q_UINT8 maskValue, d d = OPACITY_OPAQUE; } - outputMask->setAlphaAt(x, y, static_cast<Q_UINT8>(d)); + outputMask->setAlphaAt(x, y, static_cast<TQ_UINT8>(d)); } } return outputMask; } -QImage KisBrush::scaleSinglePixelImage(double scale, QRgb pixel, double subPixelX, double subPixelY) +TQImage KisBrush::scaleSinglePixelImage(double scale, TQRgb pixel, double subPixelX, double subPixelY) { int srcWidth = 1; int srcHeight = 1; int dstWidth = 2; int dstHeight = 2; - QImage outputImage(dstWidth, dstHeight, 32); + TQImage outputImage(dstWidth, dstHeight, 32); outputImage.setAlphaBuffer(true); double a = subPixelX; @@ -1032,28 +1032,28 @@ QImage KisBrush::scaleSinglePixelImage(double scale, QRgb pixel, double subPixel for (int y = 0; y < dstHeight; y++) { for (int x = 0; x < dstWidth; x++) { - QRgb topLeft = (x > 0 && y > 0) ? pixel : qRgba(0, 0, 0, 0); - QRgb bottomLeft = (x > 0 && y < srcHeight) ? pixel : qRgba(0, 0, 0, 0); - QRgb topRight = (x < srcWidth && y > 0) ? pixel : qRgba(0, 0, 0, 0); - QRgb bottomRight = (x < srcWidth && y < srcHeight) ? pixel : qRgba(0, 0, 0, 0); + TQRgb topLeft = (x > 0 && y > 0) ? pixel : tqRgba(0, 0, 0, 0); + TQRgb bottomLeft = (x > 0 && y < srcHeight) ? pixel : tqRgba(0, 0, 0, 0); + TQRgb topRight = (x < srcWidth && y > 0) ? pixel : tqRgba(0, 0, 0, 0); + TQRgb bottomRight = (x < srcWidth && y < srcHeight) ? pixel : tqRgba(0, 0, 0, 0); // Bi-linear interpolation. Images are in pre-multiplied form. - int red = static_cast<int>(a * b * qRed(topLeft) - + a * (1 - b) * qRed(bottomLeft) - + (1 - a) * b * qRed(topRight) - + (1 - a) * (1 - b) * qRed(bottomRight) + 0.5); - int green = static_cast<int>(a * b * qGreen(topLeft) - + a * (1 - b) * qGreen(bottomLeft) - + (1 - a) * b * qGreen(topRight) - + (1 - a) * (1 - b) * qGreen(bottomRight) + 0.5); - int blue = static_cast<int>(a * b * qBlue(topLeft) - + a * (1 - b) * qBlue(bottomLeft) - + (1 - a) * b * qBlue(topRight) - + (1 - a) * (1 - b) * qBlue(bottomRight) + 0.5); - int alpha = static_cast<int>(a * b * qAlpha(topLeft) - + a * (1 - b) * qAlpha(bottomLeft) - + (1 - a) * b * qAlpha(topRight) - + (1 - a) * (1 - b) * qAlpha(bottomRight) + 0.5); + int red = static_cast<int>(a * b * tqRed(topLeft) + + a * (1 - b) * tqRed(bottomLeft) + + (1 - a) * b * tqRed(topRight) + + (1 - a) * (1 - b) * tqRed(bottomRight) + 0.5); + int green = static_cast<int>(a * b * tqGreen(topLeft) + + a * (1 - b) * tqGreen(bottomLeft) + + (1 - a) * b * tqGreen(topRight) + + (1 - a) * (1 - b) * tqGreen(bottomRight) + 0.5); + int blue = static_cast<int>(a * b * tqBlue(topLeft) + + a * (1 - b) * tqBlue(bottomLeft) + + (1 - a) * b * tqBlue(topRight) + + (1 - a) * (1 - b) * tqBlue(bottomRight) + 0.5); + int alpha = static_cast<int>(a * b * tqAlpha(topLeft) + + a * (1 - b) * tqAlpha(bottomLeft) + + (1 - a) * b * tqAlpha(topRight) + + (1 - a) * (1 - b) * tqAlpha(bottomRight) + 0.5); // Multiply by the square of the scale because a 0.5x0.5 pixel // has 0.25 the value of the 1x1. @@ -1097,14 +1097,14 @@ QImage KisBrush::scaleSinglePixelImage(double scale, QRgb pixel, double subPixel alpha = 255; } - outputImage.setPixel(x, y, qRgba(red, green, blue, alpha)); + outputImage.setPixel(x, y, tqRgba(red, green, blue, alpha)); } } return outputImage; } -QImage KisBrush::interpolate(const QImage& image1, const QImage& image2, double t) +TQImage KisBrush::interpolate(const TQImage& image1, const TQImage& image2, double t) { Q_ASSERT((image1.width() == image2.width()) && (image1.height() == image2.height())); Q_ASSERT(t > -DBL_EPSILON && t < 1 + DBL_EPSILON); @@ -1112,19 +1112,19 @@ QImage KisBrush::interpolate(const QImage& image1, const QImage& image2, double int width = image1.width(); int height = image1.height(); - QImage outputImage(width, height, 32); + TQImage outputImage(width, height, 32); outputImage.setAlphaBuffer(true); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { - QRgb image1pixel = image1.pixel(x, y); - QRgb image2pixel = image2.pixel(x, y); + TQRgb image1pixel = image1.pixel(x, y); + TQRgb image2pixel = image2.pixel(x, y); // Images are in pre-multiplied alpha format. - int red = static_cast<int>((1 - t) * qRed(image1pixel) + t * qRed(image2pixel) + 0.5); - int green = static_cast<int>((1 - t) * qGreen(image1pixel) + t * qGreen(image2pixel) + 0.5); - int blue = static_cast<int>((1 - t) * qBlue(image1pixel) + t * qBlue(image2pixel) + 0.5); - int alpha = static_cast<int>((1 - t) * qAlpha(image1pixel) + t * qAlpha(image2pixel) + 0.5); + int red = static_cast<int>((1 - t) * tqRed(image1pixel) + t * tqRed(image2pixel) + 0.5); + int green = static_cast<int>((1 - t) * tqGreen(image1pixel) + t * tqGreen(image2pixel) + 0.5); + int blue = static_cast<int>((1 - t) * tqBlue(image1pixel) + t * tqBlue(image2pixel) + 0.5); + int alpha = static_cast<int>((1 - t) * tqAlpha(image1pixel) + t * tqAlpha(image2pixel) + 0.5); if (red < 0) { red = 0; @@ -1158,7 +1158,7 @@ QImage KisBrush::interpolate(const QImage& image1, const QImage& image2, double alpha = 255; } - outputImage.setPixel(x, y, qRgba(red, green, blue, alpha)); + outputImage.setPixel(x, y, tqRgba(red, green, blue, alpha)); } } @@ -1167,16 +1167,16 @@ QImage KisBrush::interpolate(const QImage& image1, const QImage& image2, double KisBrush::ScaledBrush::ScaledBrush() { - m_mask = 0; - m_image = QImage(); + m_tqmask = 0; + m_image = TQImage(); m_scale = 1; m_xScale = 1; m_yScale = 1; } -KisBrush::ScaledBrush::ScaledBrush(KisAlphaMaskSP scaledMask, const QImage& scaledImage, double scale, double xScale, double yScale) +KisBrush::ScaledBrush::ScaledBrush(KisAlphaMaskSP scaledMask, const TQImage& scaledImage, double scale, double xScale, double yScale) { - m_mask = scaledMask; + m_tqmask = scaledMask; m_image = scaledImage; m_scale = scale; m_xScale = xScale; @@ -1190,24 +1190,24 @@ KisBrush::ScaledBrush::ScaledBrush(KisAlphaMaskSP scaledMask, const QImage& scal for (int y = 0; y < m_image.height(); y++) { for (int x = 0; x < m_image.width(); x++) { - QRgb pixel = m_image.pixel(x, y); + TQRgb pixel = m_image.pixel(x, y); - int red = qRed(pixel); - int green = qGreen(pixel); - int blue = qBlue(pixel); - int alpha = qAlpha(pixel); + int red = tqRed(pixel); + int green = tqGreen(pixel); + int blue = tqBlue(pixel); + int alpha = tqAlpha(pixel); red = (red * alpha) / 255; green = (green * alpha) / 255; blue = (blue * alpha) / 255; - m_image.setPixel(x, y, qRgba(red, green, blue, alpha)); + m_image.setPixel(x, y, tqRgba(red, green, blue, alpha)); } } } } -void KisBrush::setImage(const QImage& img) +void KisBrush::setImage(const TQImage& img) { m_img = img; m_img.detach(); @@ -1220,49 +1220,49 @@ void KisBrush::setImage(const QImage& img) setValid(true); } -Q_INT32 KisBrush::width() const +TQ_INT32 KisBrush::width() const { return m_width; } -void KisBrush::setWidth(Q_INT32 w) +void KisBrush::setWidth(TQ_INT32 w) { m_width = w; } -Q_INT32 KisBrush::height() const +TQ_INT32 KisBrush::height() const { return m_height; } -void KisBrush::setHeight(Q_INT32 h) +void KisBrush::setHeight(TQ_INT32 h) { m_height = h; } -/*QImage KisBrush::outline(double pressure) { +/*TQImage KisBrush::outline(double pressure) { KisLayerSP layer = image(KisMetaRegistry::instance()->csRegistry()->getColorSpace(KisID("RGBA",""),""), KisPaintInformation(pressure)); KisBoundary bounds(layer.data()); - int w = maskWidth(pressure); - int h = maskHeight(pressure); + int w = tqmaskWidth(pressure); + int h = tqmaskHeight(pressure); bounds.generateBoundary(w, h); - QPixmap pix(bounds.pixmap(w, h)); - QImage result; + TQPixmap pix(bounds.pixmap(w, h)); + TQImage result; result = pix; return result; }*/ void KisBrush::generateBoundary() { KisPaintDeviceSP dev; - int w = maskWidth(KisPaintInformation()); - int h = maskHeight(KisPaintInformation()); + int w = tqmaskWidth(KisPaintInformation()); + int h = tqmaskHeight(KisPaintInformation()); if (brushType() == IMAGE || brushType() == PIPE_IMAGE) { dev = image(KisMetaRegistry::instance()->csRegistry() ->getColorSpace(KisID("RGBA",""),""), KisPaintInformation()); } else { - KisAlphaMaskSP amask = mask(KisPaintInformation()); + KisAlphaMaskSP atqmask = tqmask(KisPaintInformation()); KisColorSpace* cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KisID("RGBA",""),""); dev = new KisPaintDevice(cs, "tmp for generateBoundary"); for (int y = 0; y < h; y++) { @@ -1270,7 +1270,7 @@ void KisBrush::generateBoundary() { int x = 0; while(!it.isDone()) { - cs->setAlpha(it.rawData(), amask->alphaAt(x++, y), 1); + cs->setAlpha(it.rawData(), atqmask->alphaAt(x++, y), 1); ++it; } } @@ -1290,15 +1290,15 @@ void KisBrush::makeMaskImage() { if (!hasColor()) return; - QImage img; + TQImage img; img.create(width(), height(), 32); if (m_img.width() == img.width() && m_img.height() == img.height()) { for (int x = 0; x < width(); x++) { for (int y = 0; y < height(); y++) { - QRgb c = m_img.pixel(x, y); - int a = (qGray(c) * qAlpha(c)) / 255; // qGray(black) = 0 - img.setPixel(x, y, qRgba(a, a, a, 255)); + TQRgb c = m_img.pixel(x, y); + int a = (tqGray(c) * tqAlpha(c)) / 255; // tqGray(black) = 0 + img.setPixel(x, y, tqRgba(a, a, a, 255)); } } diff --git a/krita/core/kis_brush.h b/krita/core/kis_brush.h index 7de2c8b7..43fc3259 100644 --- a/krita/core/kis_brush.h +++ b/krita/core/kis_brush.h @@ -20,27 +20,27 @@ #ifndef KIS_BRUSH_ #define KIS_BRUSH_ -#include <qcstring.h> -#include <qstring.h> -#include <qsize.h> -#include <qimage.h> -#include <qvaluevector.h> +#include <tqcstring.h> +#include <tqstring.h> +#include <tqsize.h> +#include <tqimage.h> +#include <tqvaluevector.h> #include <kio/job.h> #include "kis_resource.h" #include "kis_types.h" #include "kis_point.h" -#include "kis_alpha_mask.h" +#include "kis_alpha_tqmask.h" #include "koffice_export.h" #include "kis_boundary.h" #include "kis_paintop.h" -class QPoint; -class QPixmap; +class TQPoint; +class TQPixmap; class KisBoundary; class KisColorSpace; -class QIODevice; +class TQIODevice; enum enumBrushType { INVALID, @@ -54,32 +54,33 @@ enum enumBrushType { class KRITACORE_EXPORT KisBrush : public KisResource { typedef KisResource super; Q_OBJECT + TQ_OBJECT public: /// Construct brush to load filename later as brush - KisBrush(const QString& filename); + KisBrush(const TQString& filename); /// Load brush from the specified data, at position dataPos, and set the filename - KisBrush(const QString& filename, - const QByteArray & data, - Q_UINT32 & dataPos); + KisBrush(const TQString& filename, + const TQByteArray & data, + TQ_UINT32 & dataPos); /// Load brush from the specified paint device, in the specified region KisBrush(KisPaintDevice* image, int x, int y, int w, int h); - /// Load brush as a copy from the specified QImage (handy when you need to copy a brush!) - KisBrush(const QImage& image, const QString& name = QString("")); + /// Load brush as a copy from the specified TQImage (handy when you need to copy a brush!) + KisBrush(const TQImage& image, const TQString& name = TQString("")); virtual ~KisBrush(); virtual bool load(); /// synchronous, doesn't emit any signal (none defined!) virtual bool save(); - virtual QImage img(); - virtual bool saveToDevice(QIODevice* dev) const; + virtual TQImage img(); + virtual bool saveToDevice(TQIODevice* dev) const; /** - @return a mask computed from the grey-level values of the + @return a tqmask computed from the grey-level values of the pixels in the brush. */ - virtual KisAlphaMaskSP mask(const KisPaintInformation& info, + virtual KisAlphaMaskSP tqmask(const KisPaintInformation& info, double subPixelX = 0, double subPixelY = 0) const; // XXX: return non-tiled simple buffer virtual KisPaintDeviceSP image(KisColorSpace * colorSpace, const KisPaintInformation& info, @@ -93,21 +94,21 @@ public: double xSpacing(double pressure = PRESSURE_DEFAULT) const; double ySpacing(double pressure = PRESSURE_DEFAULT) const; - // Dimensions in pixels of the mask/image at a given pressure. - Q_INT32 maskWidth(const KisPaintInformation& info) const; - Q_INT32 maskHeight(const KisPaintInformation& info) const; + // Dimensions in pixels of the tqmask/image at a given pressure. + TQ_INT32 tqmaskWidth(const KisPaintInformation& info) const; + TQ_INT32 tqmaskHeight(const KisPaintInformation& info) const; virtual void setUseColorAsMask(bool useColorAsMask) { m_useColorAsMask = useColorAsMask; } virtual bool useColorAsMask() const { return m_useColorAsMask; } virtual bool hasColor() const; virtual void makeMaskImage(); - Q_INT32 width() const; - Q_INT32 height() const; + TQ_INT32 width() const; + TQ_INT32 height() const; virtual enumBrushType brushType() const; - //QImage outline(double pressure = PRESSURE_DEFAULT); + //TQImage outline(double pressure = PRESSURE_DEFAULT); virtual KisBoundary boundary(); /** @@ -119,9 +120,9 @@ public: virtual KisBrush* clone() const; protected: - void setWidth(Q_INT32 w); - void setHeight(Q_INT32 h); - void setImage(const QImage& img); + void setWidth(TQ_INT32 w); + void setHeight(TQ_INT32 h); + void setImage(const TQImage& img); void setBrushType(enumBrushType type) { m_brushType = type; }; static double scaleForPressure(double pressure); @@ -129,17 +130,17 @@ private: class ScaledBrush { public: ScaledBrush(); - ScaledBrush(KisAlphaMaskSP scaledMask, const QImage& scaledImage, double scale, double xScale, double yScale); + ScaledBrush(KisAlphaMaskSP scaledMask, const TQImage& scaledImage, double scale, double xScale, double yScale); double scale() const { return m_scale; } double xScale() const { return m_xScale; } double yScale() const { return m_yScale; } - KisAlphaMaskSP mask() const { return m_mask; } - QImage image() const { return m_image; } + KisAlphaMaskSP tqmask() const { return m_tqmask; } + TQImage image() const { return m_image; } private: - KisAlphaMaskSP m_mask; - QImage m_image; + KisAlphaMaskSP m_tqmask; + TQImage m_image; double m_scale; double m_xScale; double m_yScale; @@ -151,13 +152,13 @@ private: void createScaledBrushes() const; KisAlphaMaskSP scaleMask(const ScaledBrush *srcBrush, double scale, double subPixelX, double subPixelY) const; - QImage scaleImage(const ScaledBrush *srcBrush, double scale, double subPixelX, double subPixelY) const; + TQImage scaleImage(const ScaledBrush *srcBrush, double scale, double subPixelX, double subPixelY) const; - static QImage scaleImage(const QImage& srcImage, int width, int height); - static QImage interpolate(const QImage& image1, const QImage& image2, double t); + static TQImage scaleImage(const TQImage& srcImage, int width, int height); + static TQImage interpolate(const TQImage& image1, const TQImage& image2, double t); - static KisAlphaMaskSP scaleSinglePixelMask(double scale, Q_UINT8 maskValue, double subPixelX, double subPixelY); - static QImage scaleSinglePixelImage(double scale, QRgb pixel, double subPixelX, double subPixelY); + static KisAlphaMaskSP scaleSinglePixelMask(double scale, TQ_UINT8 tqmaskValue, double subPixelX, double subPixelY); + static TQImage scaleSinglePixelImage(double scale, TQRgb pixel, double subPixelX, double subPixelY); // Find the scaled brush(es) nearest to the given scale. void findScaledBrushes(double scale, const ScaledBrush **aboveBrush, const ScaledBrush **belowBrush) const; @@ -165,22 +166,22 @@ private: // Initialize our boundary void generateBoundary(); - QByteArray m_data; + TQByteArray m_data; bool m_ownData; KisPoint m_hotSpot; double m_spacing; bool m_useColorAsMask; bool m_hasColor; - QImage m_img; - mutable QValueVector<ScaledBrush> m_scaledBrushes; + TQImage m_img; + mutable TQValueVector<ScaledBrush> m_scaledBrushes; - Q_INT32 m_width; - Q_INT32 m_height; + TQ_INT32 m_width; + TQ_INT32 m_height; - Q_UINT32 m_header_size; /* header_size = sizeof (BrushHeader) + brush name */ - Q_UINT32 m_version; /* brush file version # */ - Q_UINT32 m_bytes; /* depth of brush in bytes */ - Q_UINT32 m_magic_number; /* GIMP brush magic number */ + TQ_UINT32 m_header_size; /* header_size = sizeof (BrushHeader) + brush name */ + TQ_UINT32 m_version; /* brush file version # */ + TQ_UINT32 m_bytes; /* depth of brush in bytes */ + TQ_UINT32 m_magic_number; /* GIMP brush magic number */ enumBrushType m_brushType; diff --git a/krita/core/kis_colorspace_convert_visitor.h b/krita/core/kis_colorspace_convert_visitor.h index ce4ee787..e42c0893 100644 --- a/krita/core/kis_colorspace_convert_visitor.h +++ b/krita/core/kis_colorspace_convert_visitor.h @@ -28,7 +28,7 @@ class KisColorSpaceConvertVisitor :public KisLayerVisitor { public: - KisColorSpaceConvertVisitor(KisColorSpace *dstColorSpace, Q_INT32 renderingIntent); + KisColorSpaceConvertVisitor(KisColorSpace *dstColorSpace, TQ_INT32 renderingIntent); virtual ~KisColorSpaceConvertVisitor(); public: @@ -39,10 +39,10 @@ public: private: KisColorSpace *m_dstColorSpace; - Q_INT32 m_renderingIntent; + TQ_INT32 m_renderingIntent; }; -KisColorSpaceConvertVisitor::KisColorSpaceConvertVisitor(KisColorSpace *dstColorSpace, Q_INT32 renderingIntent) : +KisColorSpaceConvertVisitor::KisColorSpaceConvertVisitor(KisColorSpace *dstColorSpace, TQ_INT32 renderingIntent) : KisLayerVisitor(), m_dstColorSpace(dstColorSpace), m_renderingIntent(renderingIntent) diff --git a/krita/core/kis_command.cc b/krita/core/kis_command.cc index bcc997ea..11da634b 100644 --- a/krita/core/kis_command.cc +++ b/krita/core/kis_command.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qstring.h> +#include <tqstring.h> #include "kis_command.h" KisCommand::KisCommand(KisUndoAdapter *adapter) @@ -26,7 +26,7 @@ KisCommand::KisCommand(KisUndoAdapter *adapter) m_undoAdapter = adapter; } -KisCommand::KisCommand(const QString& name, KisUndoAdapter *adapter) +KisCommand::KisCommand(const TQString& name, KisUndoAdapter *adapter) { m_name = name; m_undoAdapter = adapter; @@ -36,7 +36,7 @@ KisCommand::~KisCommand() { } -QString KisCommand::name() const +TQString KisCommand::name() const { return m_name; } diff --git a/krita/core/kis_command.h b/krita/core/kis_command.h index f391c087..bc87bc5d 100644 --- a/krita/core/kis_command.h +++ b/krita/core/kis_command.h @@ -20,7 +20,7 @@ #ifndef KIS_COMMAND_H_ #define KIS_COMMAND_H_ -#include <qstring.h> +#include <tqstring.h> #include <kcommand.h> class KisUndoAdapter; @@ -30,19 +30,19 @@ class KisCommand : public KCommand { public: KisCommand(KisUndoAdapter *undoAdapter); - KisCommand(const QString& name, KisUndoAdapter *undoAdapter); + KisCommand(const TQString& name, KisUndoAdapter *undoAdapter); virtual ~KisCommand(); virtual void execute() = 0; virtual void unexecute() = 0; - virtual QString name() const; + virtual TQString name() const; protected: KisUndoAdapter *adapter() const; private: KisUndoAdapter *m_undoAdapter; - QString m_name; + TQString m_name; }; inline diff --git a/krita/core/kis_convolution_painter.cc b/krita/core/kis_convolution_painter.cc index cb51480c..c9146527 100644 --- a/krita/core/kis_convolution_painter.cc +++ b/krita/core/kis_convolution_painter.cc @@ -20,25 +20,25 @@ #include <string.h> #include <cfloat> -#include "qbrush.h" -#include "qcolor.h" -#include "qfontinfo.h" -#include "qfontmetrics.h" -#include "qpen.h" -#include "qregion.h" -#include "qwmatrix.h" -#include <qimage.h> -#include <qmap.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpointarray.h> -#include <qrect.h> -#include <qstring.h> +#include "tqbrush.h" +#include "tqcolor.h" +#include "tqfontinfo.h" +#include "tqfontmetrics.h" +#include "tqpen.h" +#include "tqregion.h" +#include "tqwmatrix.h" +#include <tqimage.h> +#include <tqmap.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpointarray.h> +#include <tqrect.h> +#include <tqstring.h> #include <kdebug.h> #include <klocale.h> -#include <qcolor.h> +#include <tqcolor.h> #include "kis_brush.h" #include "kis_global.h" @@ -56,16 +56,16 @@ #include "kis_convolution_painter.h" -KisKernelSP KisKernel::fromQImage(const QImage& img) +KisKernelSP KisKernel::fromTQImage(const TQImage& img) { KisKernelSP k = new KisKernel; k->width = img.width(); k->height = img.height(); k->offset = 0; uint count = k->width * k->height; - k->data = new Q_INT32[count]; - Q_INT32* itData = k->data; - Q_UINT8* itImg = img.bits(); + k->data = new TQ_INT32[count]; + TQ_INT32* itData = k->data; + TQ_UINT8* itImg = img.bits(); k->factor = 0; for(uint i = 0; i < count; ++i , ++itData, itImg+=4) { @@ -85,14 +85,14 @@ KisConvolutionPainter::KisConvolutionPainter(KisPaintDeviceSP device) : super(de { } -void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, +void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, KisConvolutionBorderOp borderOp, KisChannelInfo::enumChannelFlags channelFlags ) { // Make the area we cover as small as possible if (m_device->hasSelection()) { - QRect r = m_device->selection()->selectedRect().intersect(QRect(x, y, w, h)); + TQRect r = m_device->selection()->selectedRect().intersect(TQRect(x, y, w, h)); x = r.x(); y = r.y(); w = r.width(); @@ -103,7 +103,7 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y if ( w == 0 && h == 0 ) return; // Determine the kernel's extent from the center pixel - Q_INT32 kw, kh, khalfWidth, khalfHeight, xLastMinuskhw, yLastMinuskhh; + TQ_INT32 kw, kh, khalfWidth, khalfHeight, xLastMinuskhw, yLastMinuskhh; kw = kernel->width; kh = kernel->height; khalfWidth = (kw - 1) / 2; @@ -141,9 +141,9 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y int cacheSize = kw * kh; int cdepth = cs -> pixelSize(); - Q_UINT8** pixelPtrCache = new Q_UINT8*[cacheSize]; + TQ_UINT8** pixelPtrCache = new TQ_UINT8*[cacheSize]; for (int i = 0; i < cacheSize; i++) - pixelPtrCache[i] = new Q_UINT8[cdepth]; + pixelPtrCache[i] = new TQ_UINT8[cdepth]; // pixelPtrCache.fill(0); // row == the y position of the pixel we want to change in the paint device @@ -162,8 +162,8 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y // krow = the y position in the kernel matrix if(needFull) { - Q_INT32 i = 0; - for (Q_INT32 krow = 0; krow < kh; ++krow) { + TQ_INT32 i = 0; + for (TQ_INT32 krow = 0; krow < kh; ++krow) { // col - khalfWidth = the left starting point of the kernel as centered on our pixel // krow - khalfHeight = the offset for the top of the kernel as centered on our pixel @@ -180,14 +180,14 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y needFull = false; Q_ASSERT (i==kw*kh); } else { - for (Q_INT32 krow = 0; krow < kh; ++krow) { // shift the cache to the left - Q_UINT8** d = pixelPtrCache + krow * kw; - //memmove( d, d + 1, (kw-1)*sizeof(Q_UINT8*)); + for (TQ_INT32 krow = 0; krow < kh; ++krow) { // shift the cache to the left + TQ_UINT8** d = pixelPtrCache + krow * kw; + //memmove( d, d + 1, (kw-1)*sizeof(TQ_UINT8*)); for (int i = 0; i < (kw-1); i++) { memcpy(d[i], d[i+1], cdepth); } } - Q_INT32 i = kw - 1; + TQ_INT32 i = kw - 1; KisVLineIteratorPixel kit = m_device->createVLineIterator(col + khalfWidth, row - khalfHeight, kh, false); while (!kit.isDone()) { memcpy(pixelPtrCache[i], kit.oldRawData(), cdepth); @@ -220,7 +220,7 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y } - addDirtyRect(QRect(x, y, w, h)); + addDirtyRect(TQRect(x, y, w, h)); emit notifyProgressDone(); @@ -229,12 +229,12 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y delete[] pixelPtrCache; } -void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, +void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, KisChannelInfo::enumChannelFlags channelFlags) { int lastProgressPercent = 0; // Determine the kernel's extent from the center pixel - Q_INT32 kw, kh, khalfWidth, khalfHeight, xLastMinuskhw, yLastMinuskhh; + TQ_INT32 kw, kh, khalfWidth, khalfHeight, xLastMinuskhw, yLastMinuskhh; kw = kernel->width; kh = kernel->height; khalfWidth = (kw - 1) / 2; @@ -249,9 +249,9 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I int cacheSize = kw * kh; int cdepth = cs -> pixelSize(); - Q_UINT8** pixelPtrCache = new Q_UINT8*[cacheSize]; + TQ_UINT8** pixelPtrCache = new TQ_UINT8*[cacheSize]; for (int i = 0; i < cacheSize; i++) - pixelPtrCache[i] = new Q_UINT8[cdepth]; + pixelPtrCache[i] = new TQ_UINT8[cdepth]; // row == the y position of the pixel we want to change in the paint device int row = y; @@ -264,8 +264,8 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I KisHLineIteratorPixel hit = m_device->createHLineIterator(x, row, w, true); bool needFull = true; - Q_INT32 itStart = row - khalfHeight; - Q_INT32 itH = kh; + TQ_INT32 itStart = row - khalfHeight; + TQ_INT32 itH = kh; if(itStart < 0) { itH += itStart; @@ -281,15 +281,15 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I // krow = the y position in the kernel matrix if(needFull) // The cache has not been fill, so we need to fill it { - Q_INT32 i = 0; - Q_INT32 krow = 0; + TQ_INT32 i = 0; + TQ_INT32 krow = 0; if( row < khalfHeight ) { // We are just outside the layer, all the row in the cache will be identical // so we need to create them only once, and then to copy them if( x < khalfWidth) { // the left pixels are outside of the layer, in the corner - Q_INT32 kcol = 0; + TQ_INT32 kcol = 0; KisHLineIteratorPixel kit = m_device->createHLineIterator(0, 0, kw, false); for(; kcol < (khalfWidth - x) + 1; ++kcol) { // First copy the address of the topleft pixel @@ -318,7 +318,7 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I } i = krow * kw; } - Q_INT32 itH = kh; + TQ_INT32 itH = kh; if(row + khalfHeight > yLastMinuskhh) { itH += yLastMinuskhh - row - khalfHeight; @@ -330,8 +330,8 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I // kw = the width of the kernel // Fill the cache with pointers to the pixels under the kernel - Q_INT32 itHStart = col - khalfWidth; - Q_INT32 itW = kw; + TQ_INT32 itHStart = col - khalfWidth; + TQ_INT32 itW = kw; if(itHStart < 0) { itW += itHStart; @@ -351,7 +351,7 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I ++i; } } - Q_INT32 lastvalid = i - kw; + TQ_INT32 lastvalid = i - kw; for(; krow < kh; ++krow) { // Copy the last valid line in the current line for (int i = 0; i < kw; i++) @@ -360,19 +360,19 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I } needFull = false; } else { -/* for (Q_INT32 krow = 0; krow < kh; ++krow) { // shift the cache to the left - Q_UINT8** d = pixelPtrCache + krow * kw; -// memmove( d, d + 1, (kw-1)*sizeof(Q_UINT8*)); +/* for (TQ_INT32 krow = 0; krow < kh; ++krow) { // shift the cache to the left + TQ_UINT8** d = pixelPtrCache + krow * kw; +// memmove( d, d + 1, (kw-1)*sizeof(TQ_UINT8*)); for (int i = 0; i < (kw-1); i++) { memcpy(d[i], d[i+1], cdepth); } }*/ - Q_UINT8* firstincache = pixelPtrCache[0]; - memmove(pixelPtrCache, pixelPtrCache + 1, (cacheSize - 1) * sizeof(Q_UINT8*) ); + TQ_UINT8* firstincache = pixelPtrCache[0]; + memmove(pixelPtrCache, pixelPtrCache + 1, (cacheSize - 1) * sizeof(TQ_UINT8*) ); pixelPtrCache[cacheSize - 1] = firstincache; if(col < xLastMinuskhw) { - Q_INT32 i = kw - 1; + TQ_INT32 i = kw - 1; // KisVLineIteratorPixel kit = m_device->createVLineIterator(col + khalfWidth, itStart, itH, false); kit.nextCol(); if( row < khalfHeight ) @@ -387,7 +387,7 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I ++kit; i += kw; } - Q_INT32 lastvalid = i - kw; + TQ_INT32 lastvalid = i - kw; for(;i < kw*kh; i+=kw) { memcpy(pixelPtrCache[i], pixelPtrCache[lastvalid], cdepth); @@ -417,7 +417,7 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I } - addDirtyRect(QRect(x, y, w, h)); + addDirtyRect(TQRect(x, y, w, h)); emit notifyProgressDone(); for (int i = 0; i < cacheSize; i++) diff --git a/krita/core/kis_convolution_painter.h b/krita/core/kis_convolution_painter.h index d4aa8efb..8c0b2bba 100644 --- a/krita/core/kis_convolution_painter.h +++ b/krita/core/kis_convolution_painter.h @@ -18,7 +18,7 @@ #ifndef KIS_CONVOLUTION_PAINTER_H_ #define KIS_CONVOLUTION_PAINTER_H_ -#include <qimage.h> +#include <tqimage.h> #include "ksharedptr.h" #include "kis_types.h" @@ -42,17 +42,17 @@ class KisKernel : public KShared public: - Q_UINT32 width; - Q_UINT32 height; - Q_INT32 offset; - Q_INT32 factor; - Q_INT32 * data; + TQ_UINT32 width; + TQ_UINT32 height; + TQ_INT32 offset; + TQ_INT32 factor; + TQ_INT32 * data; KisKernel() : width(0), height(0), offset(0), factor(0), data(0) {}; virtual ~KisKernel() { delete [] data; }; - static KisKernelSP fromQImage(const QImage& img); + static KisKernelSP fromTQImage(const TQImage& img); }; @@ -80,14 +80,14 @@ public: * * Note that we do not (currently) support different kernels for different channels _or_ channel types. */ - void applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, + void applyMatrix(KisKernelSP kernel, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, KisConvolutionBorderOp borderOp = BORDER_AVOID, KisChannelInfo::enumChannelFlags channelFlags = KisChannelInfo::FLAG_COLOR); private: /** * This function is called by applyMatrix when borderOp == BORDER_REPEAT */ - void applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, + void applyMatrixRepeat(KisKernelSP kernel, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, KisChannelInfo::enumChannelFlags channelFlags); diff --git a/krita/core/kis_crop_visitor.h b/krita/core/kis_crop_visitor.h index 6e5c826c..0988a920 100644 --- a/krita/core/kis_crop_visitor.h +++ b/krita/core/kis_crop_visitor.h @@ -18,7 +18,7 @@ #ifndef KIS_CROP_VISITOR_H_ #define KIS_CROP_VISITOR_H_ -#include "qrect.h" +#include "tqrect.h" #include "klocale.h" @@ -38,7 +38,7 @@ class KisCropVisitor : public KisLayerVisitor { public: - KisCropVisitor( const QRect & rc, bool movelayers = true) + KisCropVisitor( const TQRect & rc, bool movelayers = true) : KisLayerVisitor() , m_rect(rc), m_movelayers(movelayers) { @@ -101,7 +101,7 @@ public: private: - QRect m_rect; + TQRect m_rect; bool m_movelayers; }; diff --git a/krita/core/kis_datamanager.h b/krita/core/kis_datamanager.h index 2c450004..79f7ddb8 100644 --- a/krita/core/kis_datamanager.h +++ b/krita/core/kis_datamanager.h @@ -18,9 +18,9 @@ #ifndef KIS_DATAMANAGER_H_ #define KIS_DATAMANAGER_H_ -#include <qglobal.h> -#include <qvaluevector.h> -#include <qrect.h> +#include <tqglobal.h> +#include <tqvaluevector.h> +#include <tqrect.h> class KoStore; @@ -40,12 +40,12 @@ class KoStore; * that may allow deferred loading. * * A datamanager knows nothing about the type of pixel data except - * how many Q_UINT8's a single pixel takes. + * how many TQ_UINT8's a single pixel takes. */ class KisDataManager : public ACTUAL_DATAMGR { public: - KisDataManager(Q_UINT32 pixelSize, const Q_UINT8 *defPixel) : ACTUAL_DATAMGR(pixelSize, defPixel) {} + KisDataManager(TQ_UINT32 pixelSize, const TQ_UINT8 *defPixel) : ACTUAL_DATAMGR(pixelSize, defPixel) {} KisDataManager(const KisDataManager& dm) : ACTUAL_DATAMGR(dm) { } public: @@ -53,12 +53,12 @@ public: * Sets the default pixel. Note that this might change every occurrance, and it might not, but new data * well be initialised with this pixel */ - inline void setDefaultPixel(const Q_UINT8 *defPixel) { return ACTUAL_DATAMGR::setDefaultPixel(defPixel); } + inline void setDefaultPixel(const TQ_UINT8 *defPixel) { return ACTUAL_DATAMGR::setDefaultPixel(defPixel); } /** * Gets the default pixel. */ - inline const Q_UINT8 *defaultPixel() const { return ACTUAL_DATAMGR::defaultPixel(); } + inline const TQ_UINT8 *defaultPixel() const { return ACTUAL_DATAMGR::defaultPixel(); } /** * Reguests a memento from the data manager. There is only one memento active @@ -98,15 +98,15 @@ public: /** * Returns the number of bytes a pixel takes */ - inline Q_UINT32 pixelSize() { return ACTUAL_DATAMGR::pixelSize(); } + inline TQ_UINT32 pixelSize() { return ACTUAL_DATAMGR::pixelSize(); } /** * Return the extent of the data in x,y,w,h. */ - inline void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const + inline void extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const { return ACTUAL_DATAMGR::extent(x, y, w, h); } - QRect extent() const { return ACTUAL_DATAMGR::extent(); } + TQRect extent() const { return ACTUAL_DATAMGR::extent(); } public: @@ -114,26 +114,26 @@ public: /** * Crop or extend the data to x, y, w, h. */ - inline void setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) + inline void setExtent(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { return ACTUAL_DATAMGR::setExtent(x, y, w, h); } - inline void setExtent(const QRect & rect) { setExtent(rect.x(), rect.y(), rect.width(), rect.height()); } + inline void setExtent(const TQRect & rect) { setExtent(rect.x(), rect.y(), rect.width(), rect.height()); } public: /** * Clear the specified rect to the specified value. */ - inline void clear(Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h, - Q_UINT8 def) { ACTUAL_DATAMGR::clear(x, y, w, h, def); } + inline void clear(TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h, + TQ_UINT8 def) { ACTUAL_DATAMGR::clear(x, y, w, h, def); } /** * Clear the specified rect to the specified pixel value. */ - inline void clear(Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h, - const Q_UINT8 * def) { ACTUAL_DATAMGR::clear(x, y, w, h, def); } + inline void clear(TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h, + const TQ_UINT8 * def) { ACTUAL_DATAMGR::clear(x, y, w, h, def); } /** * Clear all back to default values. @@ -147,63 +147,63 @@ public: * Copy the specified rect from the specified data into this * data. */ - inline void paste(KisDataManagerSP data, Q_INT32 sx, Q_INT32 sy, Q_INT32 dx, Q_INT32 dy, - Q_INT32 w, Q_INT32 h) { ACTUAL_DATAMGR::paste(data, sx, sy, dx, dy, w, h); } + inline void paste(KisDataManagerSP data, TQ_INT32 sx, TQ_INT32 sy, TQ_INT32 dx, TQ_INT32 dy, + TQ_INT32 w, TQ_INT32 h) { ACTUAL_DATAMGR::paste(data, sx, sy, dx, dy, w, h); } public: /** * Get a read-only pointer to the specified pixel. */ - inline KDE_DEPRECATED const Q_UINT8* pixel(Q_INT32 x, Q_INT32 y) + inline KDE_DEPRECATED const TQ_UINT8* pixel(TQ_INT32 x, TQ_INT32 y) { return ACTUAL_DATAMGR::pixel(x, y); } /** * Get a read-write pointer to the specified pixel. */ - inline KDE_DEPRECATED Q_UINT8* writablePixel(Q_INT32 x, Q_INT32 y) + inline KDE_DEPRECATED TQ_UINT8* writablePixel(TQ_INT32 x, TQ_INT32 y) { return ACTUAL_DATAMGR::writablePixel(x, y); } /** * Write the specified data to x, y. There is no checking on pixelSize! */ - inline void setPixel(Q_INT32 x, Q_INT32 y, const Q_UINT8 * data) + inline void setPixel(TQ_INT32 x, TQ_INT32 y, const TQ_UINT8 * data) { ACTUAL_DATAMGR::setPixel(x, y, data);} /** * Copy the bytes in the specified rect to a chunk of memory. * The pixelSize in bytes is w * h * pixelSize. XXX: Better - * use QValueVector? + * use TQValueVector? */ - inline void readBytes(Q_UINT8 * data, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h) + inline void readBytes(TQ_UINT8 * data, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h) { ACTUAL_DATAMGR::readBytes(data, x, y, w, h);} /** * Copy the bytes to the specified rect. w * h * pixelSize bytes will be read, whether - * the caller prepared them or not. XXX: Better use QValueVector? + * the caller prepared them or not. XXX: Better use TQValueVector? */ - inline void writeBytes(const Q_UINT8 * data, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h) + inline void writeBytes(const TQ_UINT8 * data, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h) {ACTUAL_DATAMGR::writeBytes( data, x, y, w, h); } // Get the number of contiguous columns starting at x, valid for all values // of y between minY and maxY. - inline Q_INT32 numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT32 maxY) + inline TQ_INT32 numContiguousColumns(TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY) { return ACTUAL_DATAMGR::numContiguousColumns(x, minY, maxY); } // Get the number of contiguous rows starting at y, valid for all values // of x between minX and maxX. - inline Q_INT32 numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 maxX) + inline TQ_INT32 numContiguousRows(TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX) { return ACTUAL_DATAMGR::numContiguousRows(y, minX, maxX); } // Get the row stride at pixel (x, y). This is the number of bytes to add to a // pointer to pixel (x, y) to access (x, y + 1). - inline Q_INT32 rowStride(Q_INT32 x, Q_INT32 y) + inline TQ_INT32 rowStride(TQ_INT32 x, TQ_INT32 y) { return ACTUAL_DATAMGR::rowStride(x, y); } protected: diff --git a/krita/core/kis_exif_info.cc b/krita/core/kis_exif_info.cc index f81a1566..c389c7ba 100644 --- a/krita/core/kis_exif_info.cc +++ b/krita/core/kis_exif_info.cc @@ -31,18 +31,18 @@ KisExifInfo::~KisExifInfo() {} -bool KisExifInfo::load(const QDomElement& elmt) +bool KisExifInfo::load(const TQDomElement& elmt) { if(elmt.tagName() != "ExifInfo") return false; - for( QDomNode node = elmt.firstChild(); !node.isNull(); node = node.nextSibling() ) + for( TQDomNode node = elmt.firstChild(); !node.isNull(); node = node.nextSibling() ) { - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if ( !e.isNull() ) { if(e.tagName() == "ExifValue") { - QString key = e.attribute("name"); + TQString key = e.attribute("name"); ExifValue eV; eV.load(e); setValue(key, eV); @@ -52,13 +52,13 @@ bool KisExifInfo::load(const QDomElement& elmt) return true; } -QDomElement KisExifInfo::save(QDomDocument& doc) +TQDomElement KisExifInfo::save(TQDomDocument& doc) { - QDomElement elmt = doc.createElement("ExifInfo"); + TQDomElement elmt = doc.createElement("ExifInfo"); for( KisExifInfo::evMap::const_iterator it = begin(); it != end(); ++it) { ExifValue ev = it.data(); - QDomElement evD = ev.save( doc); + TQDomElement evD = ev.save( doc); evD.setAttribute("name", it.key()); elmt.appendChild(evD); } diff --git a/krita/core/kis_exif_info.h b/krita/core/kis_exif_info.h index aaebf3a9..5cc9cfeb 100644 --- a/krita/core/kis_exif_info.h +++ b/krita/core/kis_exif_info.h @@ -22,8 +22,8 @@ #include "kis_exif_value.h" -#include <qdom.h> -#include <qmap.h> +#include <tqdom.h> +#include <tqmap.h> class KisExifInfo { @@ -31,12 +31,12 @@ class KisExifInfo KisExifInfo(); virtual ~KisExifInfo(); - virtual bool load(const QDomElement& elmt); - virtual QDomElement save(QDomDocument& doc); + virtual bool load(const TQDomElement& elmt); + virtual TQDomElement save(TQDomDocument& doc); - bool getValue(QString name, ExifValue& value) + bool getValue(TQString name, ExifValue& value) { - if ( m_values.find( name ) == m_values.end() ) { + if ( m_values.tqfind( name ) == m_values.end() ) { return false; } else { @@ -44,11 +44,11 @@ class KisExifInfo return true; } } - void setValue(QString name, ExifValue value) + void setValue(TQString name, ExifValue value) { m_values[name] = value; } - typedef QMap<QString, ExifValue> evMap; + typedef TQMap<TQString, ExifValue> evMap; evMap::const_iterator begin() const { return m_values.begin(); } evMap::const_iterator end() const { return m_values.end(); } private: diff --git a/krita/core/kis_exif_value.cc b/krita/core/kis_exif_value.cc index 25e78208..fb1cdd03 100644 --- a/krita/core/kis_exif_value.cc +++ b/krita/core/kis_exif_value.cc @@ -24,7 +24,7 @@ #include <kmdcodec.h> namespace { -void set16Bit (unsigned char *data, ExifValue::ByteOrder order, const Q_UINT16* value) +void set16Bit (unsigned char *data, ExifValue::ByteOrder order, const TQ_UINT16* value) { switch (order) { case ExifValue::BYTE_ORDER_MOTOROLA: @@ -38,7 +38,7 @@ void set16Bit (unsigned char *data, ExifValue::ByteOrder order, const Q_UINT16* } } -void get16Bit (const unsigned char *data, ExifValue::ByteOrder order, Q_UINT16* value) +void get16Bit (const unsigned char *data, ExifValue::ByteOrder order, TQ_UINT16* value) { switch (order) { case ExifValue::BYTE_ORDER_MOTOROLA: @@ -50,7 +50,7 @@ void get16Bit (const unsigned char *data, ExifValue::ByteOrder order, Q_UINT16* } } -void get32Bit (const unsigned char *data, ExifValue::ByteOrder order, Q_UINT32* value) +void get32Bit (const unsigned char *data, ExifValue::ByteOrder order, TQ_UINT32* value) { switch (order) { case ExifValue::BYTE_ORDER_MOTOROLA: @@ -61,7 +61,7 @@ void get32Bit (const unsigned char *data, ExifValue::ByteOrder order, Q_UINT32* } } -void set32Bit(unsigned char *data, ExifValue::ByteOrder order, const Q_UINT32* value) +void set32Bit(unsigned char *data, ExifValue::ByteOrder order, const TQ_UINT32* value) { switch (order) { case ExifValue::BYTE_ORDER_MOTOROLA: @@ -79,18 +79,18 @@ void set32Bit(unsigned char *data, ExifValue::ByteOrder order, const Q_UINT32* v } } -void get64Bit (const unsigned char *data, ExifValue::ByteOrder order, Q_UINT64* value) +void get64Bit (const unsigned char *data, ExifValue::ByteOrder order, TQ_UINT64* value) { switch (order) { case ExifValue::BYTE_ORDER_MOTOROLA: - *value = (((Q_UINT64)data[0] << 56) | ((Q_UINT64)data[1] << 48) | ((Q_UINT64)data[2] << 40) | ((Q_UINT64)data[3] << 32) | ((Q_UINT64)data[4] << 24) | ((Q_UINT64)data[5] << 16) | ((Q_UINT64)data[6] << 8) | (Q_UINT64)data[7]); + *value = (((TQ_UINT64)data[0] << 56) | ((TQ_UINT64)data[1] << 48) | ((TQ_UINT64)data[2] << 40) | ((TQ_UINT64)data[3] << 32) | ((TQ_UINT64)data[4] << 24) | ((TQ_UINT64)data[5] << 16) | ((TQ_UINT64)data[6] << 8) | (TQ_UINT64)data[7]); break; case ExifValue::BYTE_ORDER_INTEL: - *value = (((Q_UINT64)data[7] << 56) | ((Q_UINT64)data[6] << 48) | ((Q_UINT64)data[5] << 40) | ((Q_UINT64)data[4] << 32) | ((Q_UINT64)data[3] << 24) | ((Q_UINT64)data[2] << 16) | ((Q_UINT64)data[1] << 8) | (Q_UINT64)data[0]); + *value = (((TQ_UINT64)data[7] << 56) | ((TQ_UINT64)data[6] << 48) | ((TQ_UINT64)data[5] << 40) | ((TQ_UINT64)data[4] << 32) | ((TQ_UINT64)data[3] << 24) | ((TQ_UINT64)data[2] << 16) | ((TQ_UINT64)data[1] << 8) | (TQ_UINT64)data[0]); } } -void set64Bit(unsigned char *data, ExifValue::ByteOrder order, const Q_UINT64* value) +void set64Bit(unsigned char *data, ExifValue::ByteOrder order, const TQ_UINT64* value) { switch (order) { case ExifValue::BYTE_ORDER_MOTOROLA: @@ -132,16 +132,16 @@ void ExifValue::allocData() m_value = new ExifNumber[components()]; } else if ( type() == EXIF_TYPE_ASCII ) { - m_value = new QString(); + m_value = new TQString(); } else if ( type() == EXIF_TYPE_UNDEFINED) { m_value = new UByteArray(); } } -bool ExifValue::load(const QDomElement& elmt) +bool ExifValue::load(const TQDomElement& elmt) { - QString attr; + TQString attr; if( (attr = elmt.attribute("ifd")).isNull() ) return false; m_ifd = attr.toInt(); @@ -157,11 +157,11 @@ bool ExifValue::load(const QDomElement& elmt) case EXIF_TYPE_BYTE: for(uint i = 0; i < components(); i++) { - if( (attr = elmt.attribute(QString("value%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("value%1").tqarg(i) ) ).isNull() ) { - setValue(i, (Q_UINT8)0); + setValue(i, (TQ_UINT8)0); } else { - setValue(i, (Q_UINT8) attr.toUInt()); + setValue(i, (TQ_UINT8) attr.toUInt()); } } break; @@ -171,22 +171,22 @@ bool ExifValue::load(const QDomElement& elmt) case EXIF_TYPE_SHORT: for(uint i = 0; i < components(); i++) { - if( (attr = elmt.attribute(QString("value%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("value%1").tqarg(i) ) ).isNull() ) { - setValue(i, (Q_UINT16)0); + setValue(i, (TQ_UINT16)0); } else { - setValue(i, (Q_UINT16) attr.toUInt()); + setValue(i, (TQ_UINT16) attr.toUInt()); } } break; case EXIF_TYPE_LONG: for(uint i = 0; i < components(); i++) { - if( (attr = elmt.attribute(QString("value%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("value%1").tqarg(i) ) ).isNull() ) { - setValue(i, (Q_UINT32)0); + setValue(i, (TQ_UINT32)0); } else { - setValue(i, (Q_UINT32) attr.toUInt()); + setValue(i, (TQ_UINT32) attr.toUInt()); } } break; @@ -194,17 +194,17 @@ bool ExifValue::load(const QDomElement& elmt) for(uint i = 0; i < components(); i++) { KisExifRational r; - if( (attr = elmt.attribute(QString("numerator%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("numerator%1").tqarg(i) ) ).isNull() ) { - r.numerator = (Q_UINT32)0; + r.numerator = (TQ_UINT32)0; } else { - r.numerator = (Q_UINT32) attr.toUInt(); + r.numerator = (TQ_UINT32) attr.toUInt(); } - if( (attr = elmt.attribute(QString("denominator%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("denominator%1").tqarg(i) ) ).isNull() ) { - r.denominator = (Q_UINT32)0; + r.denominator = (TQ_UINT32)0; } else { - r.denominator = (Q_UINT32) attr.toUInt(); + r.denominator = (TQ_UINT32) attr.toUInt(); } setValue(i, r); } @@ -212,19 +212,19 @@ bool ExifValue::load(const QDomElement& elmt) case EXIF_TYPE_SBYTE: for(uint i = 0; i < components(); i++) { - if( (attr = elmt.attribute(QString("value%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("value%1").tqarg(i) ) ).isNull() ) { - setValue(i, (Q_INT8)0); + setValue(i, (TQ_INT8)0); } else { - setValue(i, (Q_INT8) attr.toInt()); + setValue(i, (TQ_INT8) attr.toInt()); } } break; case EXIF_TYPE_UNDEFINED: { - QString instr = elmt.attribute("value"); - QByteArray out; - QByteArray in = instr.utf8(); + TQString instr = elmt.attribute("value"); + TQByteArray out; + TQByteArray in = instr.utf8(); KCodecs::base64Decode( in, out); out.resize(out.size() - 2 ); setAsUndefined((uchar*)out.data(), out.size() ); @@ -233,22 +233,22 @@ bool ExifValue::load(const QDomElement& elmt) case EXIF_TYPE_SSHORT: for(uint i = 0; i < components(); i++) { - if( (attr = elmt.attribute(QString("value%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("value%1").tqarg(i) ) ).isNull() ) { - setValue(i, (Q_INT16)0); + setValue(i, (TQ_INT16)0); } else { - setValue(i, (Q_INT16) attr.toInt()); + setValue(i, (TQ_INT16) attr.toInt()); } } break; case EXIF_TYPE_SLONG: for(uint i = 0; i < components(); i++) { - if( (attr = elmt.attribute(QString("value%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("value%1").tqarg(i) ) ).isNull() ) { - setValue(i, (Q_INT32)0); + setValue(i, (TQ_INT32)0); } else { - setValue(i, (Q_INT32) attr.toInt()); + setValue(i, (TQ_INT32) attr.toInt()); } } break; @@ -256,17 +256,17 @@ bool ExifValue::load(const QDomElement& elmt) for(uint i = 0; i < components(); i++) { KisExifSRational r; - if( (attr = elmt.attribute(QString("numerator%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("numerator%1").tqarg(i) ) ).isNull() ) { - r.numerator = (Q_INT32)0; + r.numerator = (TQ_INT32)0; } else { - r.numerator = (Q_INT32) attr.toInt(); + r.numerator = (TQ_INT32) attr.toInt(); } - if( (attr = elmt.attribute(QString("denominator%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("denominator%1").tqarg(i) ) ).isNull() ) { - r.denominator = (Q_UINT32)0; + r.denominator = (TQ_UINT32)0; } else { - r.denominator = (Q_UINT32) attr.toInt(); + r.denominator = (TQ_UINT32) attr.toInt(); } setValue(i, r); } @@ -274,7 +274,7 @@ bool ExifValue::load(const QDomElement& elmt) case EXIF_TYPE_FLOAT: for(uint i = 0; i < components(); i++) { - if( (attr = elmt.attribute(QString("value%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("value%1").tqarg(i) ) ).isNull() ) { setValue(i, (float)0); } else { @@ -285,7 +285,7 @@ bool ExifValue::load(const QDomElement& elmt) case EXIF_TYPE_DOUBLE: for(uint i = 0; i < components(); i++) { - if( (attr = elmt.attribute(QString("value%1").arg(i) ) ).isNull() ) + if( (attr = elmt.attribute(TQString("value%1").tqarg(i) ) ).isNull() ) { setValue(i, (double)0); } else { @@ -300,9 +300,9 @@ bool ExifValue::load(const QDomElement& elmt) return true; } -QDomElement ExifValue::save(QDomDocument& doc) +TQDomElement ExifValue::save(TQDomDocument& doc) { - QDomElement elmt = doc.createElement("ExifValue"); + TQDomElement elmt = doc.createElement("ExifValue"); elmt.setAttribute("ifd", ifd()); elmt.setAttribute("components", components() ); elmt.setAttribute("type", type() ); @@ -310,65 +310,65 @@ QDomElement ExifValue::save(QDomDocument& doc) { case EXIF_TYPE_BYTE: for(uint i = 0; i < components(); i++) - elmt.setAttribute(QString("value%1").arg(i), asByte( i ) ); + elmt.setAttribute(TQString("value%1").tqarg(i), asByte( i ) ); break; case EXIF_TYPE_ASCII: elmt.setAttribute("value", asAscii() ); break; case EXIF_TYPE_SHORT: for(uint i = 0; i < components(); i++) - elmt.setAttribute(QString("value%1").arg(i), asShort( i ) ); + elmt.setAttribute(TQString("value%1").tqarg(i), asShort( i ) ); break; case EXIF_TYPE_LONG: for(uint i = 0; i < components(); i++) - elmt.setAttribute(QString("value%1").arg(i), asLong( i ) ); + elmt.setAttribute(TQString("value%1").tqarg(i), asLong( i ) ); break; case EXIF_TYPE_RATIONAL: for(uint i = 0; i < components(); i++) { KisExifRational r = asRational(i); - elmt.setAttribute(QString("numerator%1").arg(i), r.numerator ); - elmt.setAttribute(QString("denominator%1").arg(i), r.denominator ); + elmt.setAttribute(TQString("numerator%1").tqarg(i), r.numerator ); + elmt.setAttribute(TQString("denominator%1").tqarg(i), r.denominator ); } break; case EXIF_TYPE_SBYTE: for(uint i = 0; i < components(); i++) - elmt.setAttribute(QString("value%1").arg(i), asSByte( i ) ); + elmt.setAttribute(TQString("value%1").tqarg(i), asSByte( i ) ); break; case EXIF_TYPE_UNDEFINED: { UByteArray value = asUndefined(); - QByteArray data; + TQByteArray data; data.setRawData((char*)value.data(), value.size()); - QByteArray encodedData; - KCodecs::base64Encode( data, encodedData ); + TQByteArray tqencodedData; + KCodecs::base64Encode( data, tqencodedData ); data.resetRawData( (char*)value.data(), value.size()); - elmt.setAttribute("value", encodedData); + elmt.setAttribute("value", tqencodedData); } break; case EXIF_TYPE_SSHORT: for(uint i = 0; i < components(); i++) - elmt.setAttribute(QString("value%1").arg(i), asSShort( i ) ); + elmt.setAttribute(TQString("value%1").tqarg(i), asSShort( i ) ); break; case EXIF_TYPE_SLONG: for(uint i = 0; i < components(); i++) - elmt.setAttribute(QString("value%1").arg(i), asSLong( i ) ); + elmt.setAttribute(TQString("value%1").tqarg(i), asSLong( i ) ); break; case EXIF_TYPE_SRATIONAL: for(uint i = 0; i < components(); i++) { KisExifSRational r = asSRational(i); - elmt.setAttribute(QString("numerator%1").arg(i), r.numerator ); - elmt.setAttribute(QString("denominator%1").arg(i), r.denominator ); + elmt.setAttribute(TQString("numerator%1").tqarg(i), r.numerator ); + elmt.setAttribute(TQString("denominator%1").tqarg(i), r.denominator ); } break; case EXIF_TYPE_FLOAT: for(uint i = 0; i < components(); i++) - elmt.setAttribute(QString("value%1").arg(i), asFloat( i ) ); + elmt.setAttribute(TQString("value%1").tqarg(i), asFloat( i ) ); break; case EXIF_TYPE_DOUBLE: for(uint i = 0; i < components(); i++) - elmt.setAttribute(QString("value%1").arg(i), asDouble( i ) ); + elmt.setAttribute(TQString("value%1").tqarg(i), asDouble( i ) ); break; case EXIF_TYPE_UNKNOW: break; @@ -435,7 +435,7 @@ void ExifValue::setValue(const unsigned char *data, unsigned int size, ExifValue ExifNumber n; for(uint i = 0; i < components(); i++) { - n.m_sbyte = ((Q_INT8*)data)[i]; + n.m_sbyte = ((TQ_INT8*)data)[i]; setAsExifNumber( i, n); } } @@ -449,7 +449,7 @@ void ExifValue::setValue(const unsigned char *data, unsigned int size, ExifValue ExifNumber n; for(uint i = 0; i < components(); i++) { - get16Bit( data + 2 * i, order, (Q_UINT16*)&n.m_sshort); + get16Bit( data + 2 * i, order, (TQ_UINT16*)&n.m_sshort); setAsExifNumber( i, n); } } @@ -460,7 +460,7 @@ void ExifValue::setValue(const unsigned char *data, unsigned int size, ExifValue ExifNumber n; for(uint i = 0; i < components(); i++) { - get32Bit( data + 4 * i, order, (Q_UINT32*)&n.m_slong); + get32Bit( data + 4 * i, order, (TQ_UINT32*)&n.m_slong); setAsExifNumber( i, n); } } @@ -471,8 +471,8 @@ void ExifValue::setValue(const unsigned char *data, unsigned int size, ExifValue ExifNumber n; for(uint i = 0; i < components(); i++) { - get32Bit( data + 8 * i, order, (Q_UINT32*)&n.m_srational.numerator); - get32Bit( data + 8 * i + 4, order, (Q_UINT32*)&n.m_srational.denominator); + get32Bit( data + 8 * i, order, (TQ_UINT32*)&n.m_srational.numerator); + get32Bit( data + 8 * i + 4, order, (TQ_UINT32*)&n.m_srational.denominator); setAsExifNumber( i, n); } } @@ -483,7 +483,7 @@ void ExifValue::setValue(const unsigned char *data, unsigned int size, ExifValue ExifNumber n; for(uint i = 0; i < components(); i++) { - get32Bit( data + 4 * i, order, (Q_UINT32*)&n.m_float); + get32Bit( data + 4 * i, order, (TQ_UINT32*)&n.m_float); setAsExifNumber( i, n); } } @@ -494,7 +494,7 @@ void ExifValue::setValue(const unsigned char *data, unsigned int size, ExifValue ExifNumber n; for(uint i = 0; i < components(); i++) { - get64Bit( data + 8 * i, order, (Q_UINT64*)&n.m_double); + get64Bit( data + 8 * i, order, (TQ_UINT64*)&n.m_double); setAsExifNumber( i, n); } } @@ -518,7 +518,7 @@ void ExifValue::convertToData(unsigned char ** data, unsigned int* size, ExifVal return; case EXIF_TYPE_ASCII: { - QString str = asAscii(); + TQString str = asAscii(); *size = str.length(); *data = new uchar[ *size ]; uchar* ptr = *data; @@ -561,7 +561,7 @@ void ExifValue::convertToData(unsigned char ** data, unsigned int* size, ExifVal *data = new uchar[*size]; for(uint i = 0; i < components(); i++) { - *(((Q_INT8*)*data) + i) = asExifNumber(i).m_sbyte; + *(((TQ_INT8*)*data) + i) = asExifNumber(i).m_sbyte; } return; case EXIF_TYPE_UNDEFINED: @@ -577,7 +577,7 @@ void ExifValue::convertToData(unsigned char ** data, unsigned int* size, ExifVal *data = new uchar[*size]; for(uint i = 0; i < components(); i++) { - set16Bit( (*data) + 2 * i, order, (Q_UINT16*)&asExifNumber(i).m_sshort); + set16Bit( (*data) + 2 * i, order, (TQ_UINT16*)&asExifNumber(i).m_sshort); } return; case EXIF_TYPE_SLONG: @@ -585,7 +585,7 @@ void ExifValue::convertToData(unsigned char ** data, unsigned int* size, ExifVal *data = new uchar[*size]; for(uint i = 0; i < components(); i++) { - set32Bit( (*data) + 4 * i, order, (Q_UINT32*)&asExifNumber(i).m_slong); + set32Bit( (*data) + 4 * i, order, (TQ_UINT32*)&asExifNumber(i).m_slong); } return; case EXIF_TYPE_SRATIONAL: @@ -594,8 +594,8 @@ void ExifValue::convertToData(unsigned char ** data, unsigned int* size, ExifVal for(uint i = 0; i < components(); i++) { ExifNumber n = asExifNumber(i); - set32Bit( (*data) + 4 * i, order, (Q_UINT32*)&asExifNumber(i).m_srational.numerator); - set32Bit( (*data) + 4 * i + 4, order, (Q_UINT32*)&asExifNumber(i).m_srational.denominator); + set32Bit( (*data) + 4 * i, order, (TQ_UINT32*)&asExifNumber(i).m_srational.numerator); + set32Bit( (*data) + 4 * i + 4, order, (TQ_UINT32*)&asExifNumber(i).m_srational.denominator); } return; case EXIF_TYPE_FLOAT: @@ -603,7 +603,7 @@ void ExifValue::convertToData(unsigned char ** data, unsigned int* size, ExifVal *data = new uchar[*size]; for(uint i = 0; i < components(); i++) { - set32Bit( (*data) + 4 * i, order, (Q_UINT32*)&asExifNumber(i).m_float); + set32Bit( (*data) + 4 * i, order, (TQ_UINT32*)&asExifNumber(i).m_float); } return; case EXIF_TYPE_DOUBLE: @@ -611,7 +611,7 @@ void ExifValue::convertToData(unsigned char ** data, unsigned int* size, ExifVal *data = new uchar[*size]; for(uint i = 0; i < components(); i++) { - set64Bit( (*data) + 4 * i, order, (Q_UINT64*)&asExifNumber(i).m_double); + set64Bit( (*data) + 4 * i, order, (TQ_UINT64*)&asExifNumber(i).m_double); } return; case EXIF_TYPE_UNKNOW: @@ -619,7 +619,7 @@ void ExifValue::convertToData(unsigned char ** data, unsigned int* size, ExifVal } } -QString ExifValue::toString() +TQString ExifValue::toString() { switch(type()) { @@ -627,17 +627,17 @@ QString ExifValue::toString() return asAscii(); case EXIF_TYPE_UNDEFINED: { - QString undefined = "undefined"; + TQString undefined = "undefined"; UByteArray array = asUndefined(); for(uint i = 0; i < components(); i++) { - undefined += "\\" + QString().setNum( array[i] ); + undefined += "\\" + TQString().setNum( array[i] ); } return undefined; } default: { - QString str = ""; + TQString str = ""; for(uint i = 0; i < components(); i++) { str += toString(i); @@ -647,30 +647,30 @@ QString ExifValue::toString() } } -QString ExifValue::toString(uint i) +TQString ExifValue::toString(uint i) { switch(type()) { case EXIF_TYPE_BYTE: - return QString("%1 ").arg( asExifNumber( i ).m_byte ); + return TQString("%1 ").tqarg( asExifNumber( i ).m_byte ); case EXIF_TYPE_SHORT: - return QString("%1 ").arg( asExifNumber( i ).m_short ); + return TQString("%1 ").tqarg( asExifNumber( i ).m_short ); case EXIF_TYPE_LONG: - return QString("%1 ").arg( asExifNumber( i ).m_long ); + return TQString("%1 ").tqarg( asExifNumber( i ).m_long ); case EXIF_TYPE_RATIONAL: - return QString("%1 / %2 ").arg( asExifNumber( i ).m_rational.numerator ).arg( asExifNumber( i ).m_rational.denominator ); + return TQString("%1 / %2 ").tqarg( asExifNumber( i ).m_rational.numerator ).tqarg( asExifNumber( i ).m_rational.denominator ); case EXIF_TYPE_SBYTE: - return QString("%1 ").arg( asExifNumber( i ).m_sbyte ); + return TQString("%1 ").tqarg( asExifNumber( i ).m_sbyte ); case EXIF_TYPE_SSHORT: - return QString("%1 ").arg( asExifNumber( i ).m_sshort ); + return TQString("%1 ").tqarg( asExifNumber( i ).m_sshort ); case EXIF_TYPE_SLONG: - return QString("%1 ").arg( asExifNumber( i ).m_slong ); + return TQString("%1 ").tqarg( asExifNumber( i ).m_slong ); case EXIF_TYPE_SRATIONAL: - return QString("%1 / %2 ").arg( asExifNumber( i ).m_srational.numerator ).arg( asExifNumber( i ).m_srational.denominator ); + return TQString("%1 / %2 ").tqarg( asExifNumber( i ).m_srational.numerator ).tqarg( asExifNumber( i ).m_srational.denominator ); case EXIF_TYPE_FLOAT: - return QString("%1 ").arg( asExifNumber( i ).m_float ); + return TQString("%1 ").tqarg( asExifNumber( i ).m_float ); case EXIF_TYPE_DOUBLE: - return QString("%1 ").arg( asExifNumber( i ).m_double ); + return TQString("%1 ").tqarg( asExifNumber( i ).m_double ); default: return "unknow "; } diff --git a/krita/core/kis_exif_value.h b/krita/core/kis_exif_value.h index 6e37e0a3..a61e305a 100644 --- a/krita/core/kis_exif_value.h +++ b/krita/core/kis_exif_value.h @@ -20,32 +20,32 @@ #ifndef KIS_EXIF_VALUE_H #define KIS_EXIF_VALUE_H -#include <qdom.h> +#include <tqdom.h> -#include <qcstring.h> -#include <qstring.h> +#include <tqcstring.h> +#include <tqstring.h> -typedef QMemArray<Q_UINT8> UByteArray; +typedef TQMemArray<TQ_UINT8> UByteArray; struct KisExifRational { - Q_UINT32 numerator; - Q_UINT32 denominator; + TQ_UINT32 numerator; + TQ_UINT32 denominator; }; struct KisExifSRational { - Q_INT32 numerator; - Q_INT32 denominator; + TQ_INT32 numerator; + TQ_INT32 denominator; }; class ExifValue { typedef union { - Q_UINT8 m_byte; - Q_UINT16 m_short; - Q_UINT32 m_long; + TQ_UINT8 m_byte; + TQ_UINT16 m_short; + TQ_UINT32 m_long; KisExifRational m_rational; - Q_INT8 m_sbyte; - Q_INT16 m_sshort; - Q_INT32 m_slong; + TQ_INT8 m_sbyte; + TQ_INT16 m_sshort; + TQ_INT32 m_slong; KisExifSRational m_srational; float m_float; double m_double; @@ -73,8 +73,8 @@ class ExifValue { ExifValue() : m_ifd(-1), m_type(EXIF_TYPE_UNKNOW), m_components(0), m_value(0) { } ExifValue(ExifType type, unsigned char *data, unsigned int size, int ifd, uint components, ExifValue::ByteOrder order); - virtual bool load(const QDomElement& elmt); - virtual QDomElement save(QDomDocument& doc); + virtual bool load(const TQDomElement& elmt); + virtual TQDomElement save(TQDomDocument& doc); /** * Return the type of the array @@ -93,23 +93,23 @@ class ExifValue { m_components = size; } } - inline const QString asAscii() { + inline const TQString asAscii() { if(m_type == EXIF_TYPE_ASCII) - return QString(*(QString*) m_value); - return QString(); + return TQString(*(TQString*) m_value); + return TQString(); } inline void setAsAscii(char* data) { if(m_type == EXIF_TYPE_ASCII) { - QString str = QString((char*) data); - *(QString*)m_value = str; + TQString str = TQString((char*) data); + *(TQString*)m_value = str; m_components = str.length(); } } - inline void setAsAscii(QString str) + inline void setAsAscii(TQString str) { - *(QString*)m_value = str; + *(TQString*)m_value = str; m_components = str.length(); } void convertToData(unsigned char ** data, unsigned int* size, ExifValue::ByteOrder order); @@ -125,35 +125,35 @@ class ExifValue { /** * This function return the value of a the ExifValue as a string. */ - QString toString(); + TQString toString(); - inline Q_UINT8 asByte(uint i) + inline TQ_UINT8 asByte(uint i) { if(m_type == EXIF_TYPE_BYTE) return asExifNumber(i).m_byte; return 0; } - inline void setValue(uint i, Q_UINT8 v) + inline void setValue(uint i, TQ_UINT8 v) { ((ExifNumber*)m_value)[i].m_byte = v; } - inline Q_UINT8 asShort(uint i) + inline TQ_UINT8 asShort(uint i) { if(m_type == EXIF_TYPE_SHORT) return asExifNumber(i).m_short; return 0; } - inline void setValue(uint i, Q_UINT16 v) + inline void setValue(uint i, TQ_UINT16 v) { ((ExifNumber*)m_value)[i].m_short = v; } - inline Q_UINT8 asLong(uint i) + inline TQ_UINT8 asLong(uint i) { if(m_type == EXIF_TYPE_LONG) return asExifNumber(i).m_long; return 0; } - inline void setValue(uint i, Q_UINT32 v) + inline void setValue(uint i, TQ_UINT32 v) { ((ExifNumber*)m_value)[i].m_long = v; } @@ -163,7 +163,7 @@ class ExifValue { return asExifNumber(i).m_rational; return KisExifRational(); } - inline void setValue(uint i, Q_UINT32 n, Q_UINT32 d) + inline void setValue(uint i, TQ_UINT32 n, TQ_UINT32 d) { ((ExifNumber*)m_value)[i].m_rational.numerator = n; ((ExifNumber*)m_value)[i].m_rational.denominator = d; @@ -172,33 +172,33 @@ class ExifValue { { ((ExifNumber*)m_value)[i].m_rational = r; } - inline Q_INT8 asSByte(uint i) + inline TQ_INT8 asSByte(uint i) { if(m_type == EXIF_TYPE_SBYTE) return asExifNumber(i).m_sbyte; return 0; } - inline void setValue(uint i, Q_INT8 v) + inline void setValue(uint i, TQ_INT8 v) { ((ExifNumber*)m_value)[i].m_sbyte = v; } - inline Q_INT16 asSShort(uint i) + inline TQ_INT16 asSShort(uint i) { if(m_type == EXIF_TYPE_SSHORT) return asExifNumber(i).m_sshort; return 0; } - inline void setValue(uint i, Q_INT16 v) + inline void setValue(uint i, TQ_INT16 v) { ((ExifNumber*)m_value)[i].m_sshort = v; } - inline Q_INT32 asSLong(uint i) + inline TQ_INT32 asSLong(uint i) { if(m_type == EXIF_TYPE_SLONG) return asExifNumber(i).m_slong; return 0; } - inline void setValue(uint i, Q_INT32 v) + inline void setValue(uint i, TQ_INT32 v) { ((ExifNumber*)m_value)[i].m_slong = v; } @@ -212,7 +212,7 @@ class ExifValue { { ((ExifNumber*)m_value)[i].m_srational = r; } - inline void setValue(uint i, Q_INT32 n, Q_INT32 d) + inline void setValue(uint i, TQ_INT32 n, TQ_INT32 d) { ((ExifNumber*)m_value)[i].m_srational.numerator = n; ((ExifNumber*)m_value)[i].m_srational.denominator = d; @@ -241,7 +241,7 @@ class ExifValue { /** * Return the ith component as a string. */ - QString toString(uint i); + TQString toString(uint i); void setValue(const unsigned char *data, unsigned int size, ExifValue::ByteOrder order); /** * Return the ExifValue as a number. diff --git a/krita/core/kis_fill_painter.cc b/krita/core/kis_fill_painter.cc index 0ccb9e8a..5b8fdcc9 100644 --- a/krita/core/kis_fill_painter.cc +++ b/krita/core/kis_fill_painter.cc @@ -22,19 +22,19 @@ #include <cfloat> #include <stack> -#include "qbrush.h" -#include "qfontinfo.h" -#include "qfontmetrics.h" -#include "qpen.h" -#include "qregion.h" -#include "qwmatrix.h" -#include <qimage.h> -#include <qmap.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpointarray.h> -#include <qrect.h> -#include <qstring.h> +#include "tqbrush.h" +#include "tqfontinfo.h" +#include "tqfontmetrics.h" +#include "tqpen.h" +#include "tqregion.h" +#include "tqwmatrix.h" +#include <tqimage.h> +#include <tqmap.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpointarray.h> +#include <tqrect.h> +#include <tqstring.h> #include <kdebug.h> #include <kcommand.h> @@ -82,23 +82,23 @@ KisFillPainter::KisFillPainter(KisPaintDeviceSP device) : super(device) // 'regular' filling // XXX: This also needs renaming, since filling ought to keep the opacity and the composite op in mind, // this is more eraseToColor. -void KisFillPainter::fillRect(Q_INT32 x1, Q_INT32 y1, Q_INT32 w, Q_INT32 h, const KisColor& kc, Q_UINT8 opacity) +void KisFillPainter::fillRect(TQ_INT32 x1, TQ_INT32 y1, TQ_INT32 w, TQ_INT32 h, const KisColor& kc, TQ_UINT8 opacity) { if (w > 0 && h > 0) { // Make sure we're in the right colorspace KisColor kc2(kc); // get rid of const kc2.convertTo(m_device->colorSpace()); - Q_UINT8 * data = kc2.data(); + TQ_UINT8 * data = kc2.data(); m_device->colorSpace()->setAlpha(data, opacity, 1); m_device->fill(x1, y1, w, h, data); - addDirtyRect(QRect(x1, y1, w, h)); + addDirtyRect(TQRect(x1, y1, w, h)); } } -void KisFillPainter::fillRect(Q_INT32 x1, Q_INT32 y1, Q_INT32 w, Q_INT32 h, KisPattern * pattern) { +void KisFillPainter::fillRect(TQ_INT32 x1, TQ_INT32 y1, TQ_INT32 w, TQ_INT32 h, KisPattern * pattern) { if (!pattern) return; if (!pattern->valid()) return; if (!m_device) return; @@ -117,7 +117,7 @@ void KisFillPainter::fillRect(Q_INT32 x1, Q_INT32 y1, Q_INT32 w, Q_INT32 h, KisP } while (y < y1 + h) { - sh = QMIN((y1 + h) - y, pattern->height() - sy); + sh = TQMIN((y1 + h) - y, pattern->height() - sy); int x = x1; @@ -128,7 +128,7 @@ void KisFillPainter::fillRect(Q_INT32 x1, Q_INT32 y1, Q_INT32 w, Q_INT32 h, KisP } while (x < x1 + w) { - sw = QMIN((x1 + w) - x, pattern->width() - sx); + sw = TQMIN((x1 + w) - x, pattern->width() - sx); bitBlt(x, y, m_compositeOp, patternLayer.data(), m_opacity, sx, sy, sw, sh); x += sw; sx = 0; @@ -137,7 +137,7 @@ void KisFillPainter::fillRect(Q_INT32 x1, Q_INT32 y1, Q_INT32 w, Q_INT32 h, KisP y+=sh; sy = 0; } - addDirtyRect(QRect(x1, y1, w, h)); + addDirtyRect(TQRect(x1, y1, w, h)); } // flood filling @@ -192,7 +192,7 @@ void KisFillPainter::genericFillEnd(KisPaintDeviceSP filled) { return; } - QRect rc = m_selection->selectedRect(); + TQRect rc = m_selection->selectedRect(); bltSelection(rc.x(), rc.y(), m_compositeOp, filled, m_selection, m_opacity, rc.x(), rc.y(), rc.width(), rc.height()); @@ -203,19 +203,19 @@ void KisFillPainter::genericFillEnd(KisPaintDeviceSP filled) { } struct FillSegment { - FillSegment(int x, int y/*, FillSegment* parent*/) : x(x), y(y)/*, parent(parent)*/ {} + FillSegment(int x, int y/*, FillSegment* tqparent*/) : x(x), y(y)/*, tqparent(tqparent)*/ {} int x; int y; -// FillSegment* parent; +// FillSegment* tqparent; }; -typedef enum { None = 0, Added = 1, Checked = 2 } Status; +typedef enum { None = 0, Added = 1, Checked = 2 } tqStatus; KisSelectionSP KisFillPainter::createFloodSelection(int startX, int startY) { if (m_width < 0 || m_height < 0) { if (m_device->hasSelection() && m_careForSelection) { - QRect rc = m_device->selection()->selectedRect(); + TQRect rc = m_device->selection()->selectedRect(); m_width = rc.width() - (startX - rc.x()); m_height = rc.height() - (startY - rc.y()); @@ -251,7 +251,7 @@ KisSelectionSP KisFillPainter::createFloodSelection(int startX, int startY) { KisColorSpace * colorSpace = selection->colorSpace(); KisColorSpace * devColorSpace = sourceDevice->colorSpace(); - Q_UINT8* source = new Q_UINT8[sourceDevice->pixelSize()]; + TQ_UINT8* source = new TQ_UINT8[sourceDevice->pixelSize()]; KisHLineIteratorPixel pixelIt = sourceDevice->createHLineIterator(startX, startY, startX+1, false); memcpy(source, pixelIt.rawData(), sourceDevice->pixelSize()); @@ -260,9 +260,9 @@ KisSelectionSP KisFillPainter::createFloodSelection(int startX, int startY) { stack.push(new FillSegment(startX, startY/*, 0*/)); - Status* map = new Status[m_size]; + tqStatus* map = new tqStatus[m_size]; - memset(map, None, m_size * sizeof(Status)); + memset(map, None, m_size * sizeof(tqStatus)); int progressPercent = 0; int pixelsDone = 0; int currentPercent = 0; emit notifyProgressStage(i18n("Making fill outline..."), 0); @@ -288,7 +288,7 @@ KisSelectionSP KisFillPainter::createFloodSelection(int startX, int startY) { it is needed to start the iterator at the first position, and then skip to (x,y). */ pixelIt = sourceDevice->createHLineIterator(0, y, m_width, false); pixelIt += x; - Q_UINT8 diff = devColorSpace->difference(source, pixelIt.rawData()); + TQ_UINT8 diff = devColorSpace->difference(source, pixelIt.rawData()); if (diff >= m_threshold || (hasSelection && srcSel->selected(pixelIt.x(), pixelIt.y()) == MIN_SELECTED)) { @@ -300,9 +300,9 @@ KisSelectionSP KisFillPainter::createFloodSelection(int startX, int startY) { KisHLineIteratorPixel selIt = selection->createHLineIterator(0, y, m_width, true); selIt += x; if (m_fuzzy) - colorSpace->fromQColor(Qt::white, MAX_SELECTED - diff, selIt.rawData()); + colorSpace->fromTQColor(TQt::white, MAX_SELECTED - diff, selIt.rawData()); else - colorSpace->fromQColor(Qt::white, MAX_SELECTED, selIt.rawData()); + colorSpace->fromTQColor(TQt::white, MAX_SELECTED, selIt.rawData()); if (y > 0 && (map[m_width * (y - 1) + x] == None)) { map[m_width * (y - 1) + x] = Added; @@ -332,9 +332,9 @@ KisSelectionSP KisFillPainter::createFloodSelection(int startX, int startY) { } if (m_fuzzy) - colorSpace->fromQColor(Qt::white, MAX_SELECTED - diff, selIt.rawData()); + colorSpace->fromTQColor(TQt::white, MAX_SELECTED - diff, selIt.rawData()); else - colorSpace->fromQColor(Qt::white, MAX_SELECTED, selIt.rawData()); + colorSpace->fromTQColor(TQt::white, MAX_SELECTED, selIt.rawData()); if (y > 0 && (map[m_width * (y - 1) + x] == None)) { map[m_width * (y - 1) + x] = Added; @@ -372,9 +372,9 @@ KisSelectionSP KisFillPainter::createFloodSelection(int startX, int startY) { } if (m_fuzzy) - colorSpace->fromQColor(Qt::white, MAX_SELECTED - diff, selIt.rawData()); + colorSpace->fromTQColor(TQt::white, MAX_SELECTED - diff, selIt.rawData()); else - colorSpace->fromQColor(Qt::white, MAX_SELECTED, selIt.rawData()); + colorSpace->fromTQColor(TQt::white, MAX_SELECTED, selIt.rawData()); if (y > 0 && (map[m_width * (y - 1) + x] == None)) { map[m_width * (y - 1) + x] = Added; diff --git a/krita/core/kis_fill_painter.h b/krita/core/kis_fill_painter.h index 63591350..da244a67 100644 --- a/krita/core/kis_fill_painter.h +++ b/krita/core/kis_fill_painter.h @@ -19,7 +19,7 @@ #ifndef KIS_FILL_PAINTER_H_ #define KIS_FILL_PAINTER_H_ -#include <qrect.h> +#include <tqrect.h> #include "kis_meta_registry.h" #include "kis_color.h" @@ -55,39 +55,39 @@ public: /** * Fill a rectangle with black transparent pixels (0, 0, 0, 0 for RGBA). */ - void eraseRect(Q_INT32 x1, Q_INT32 y1, Q_INT32 w, Q_INT32 h); + void eraseRect(TQ_INT32 x1, TQ_INT32 y1, TQ_INT32 w, TQ_INT32 h); /** * Overloaded version of the above function. */ - void eraseRect(const QRect& rc); + void eraseRect(const TQRect& rc); /** * Fill a rectangle with a certain color. */ - void fillRect(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const KisColor& c); + void fillRect(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const KisColor& c); /** * Overloaded version of the above function. */ - void fillRect(const QRect& rc, const KisColor& c); + void fillRect(const TQRect& rc, const KisColor& c); /** * Fill a rectangle with a certain color and opacity. */ - void fillRect(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const KisColor& c, Q_UINT8 opacity); + void fillRect(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const KisColor& c, TQ_UINT8 opacity); /** * Overloaded version of the above function. */ - void fillRect(const QRect& rc, const KisColor& c, Q_UINT8 opacity); + void fillRect(const TQRect& rc, const KisColor& c, TQ_UINT8 opacity); /** * Fill a rectangle with a certain pattern. The pattern is repeated if it does not fit the * entire rectangle. */ - void fillRect(Q_INT32 x1, Q_INT32 y1, Q_INT32 w, Q_INT32 h, KisPattern * pattern); + void fillRect(TQ_INT32 x1, TQ_INT32 y1, TQ_INT32 w, TQ_INT32 h, KisPattern * pattern); /** * Overloaded version of the above function. */ - void fillRect(const QRect& rc, KisPattern * pattern); + void fillRect(const TQRect& rc, KisPattern * pattern); /** * Fills the enclosed area around the point with the set color. If there is a @@ -102,7 +102,7 @@ public: void fillPattern(int startX, int startY); /** - * Returns a selection mask for the floodfill starting at the specified position. + * Returns a selection tqmask for the floodfill starting at the specified position. **/ KisSelectionSP createFloodSelection(int startX, int startY); @@ -150,7 +150,7 @@ private: int m_threshold; int m_size; int m_width, m_height; - QRect m_rect; + TQRect m_rect; bool m_sampleMerged; bool m_careForSelection; bool m_fuzzy; @@ -158,41 +158,41 @@ private: inline -void KisFillPainter::fillRect(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const KisColor& c) +void KisFillPainter::fillRect(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const KisColor& c) { fillRect(x, y, w, h, c, OPACITY_OPAQUE); } inline -void KisFillPainter::fillRect(const QRect& rc, const KisColor& c) +void KisFillPainter::fillRect(const TQRect& rc, const KisColor& c) { fillRect(rc.x(), rc.y(), rc.width(), rc.height(), c, OPACITY_OPAQUE); } inline -void KisFillPainter::eraseRect(Q_INT32 x1, Q_INT32 y1, Q_INT32 w, Q_INT32 h) +void KisFillPainter::eraseRect(TQ_INT32 x1, TQ_INT32 y1, TQ_INT32 w, TQ_INT32 h) { KisColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8(); - KisColor c(Qt::black, cs); + KisColor c(TQt::black, cs); fillRect(x1, y1, w, h, c, OPACITY_TRANSPARENT); } inline -void KisFillPainter::eraseRect(const QRect& rc) +void KisFillPainter::eraseRect(const TQRect& rc) { KisColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8(); - KisColor c(Qt::black, cs); + KisColor c(TQt::black, cs); fillRect(rc.x(), rc.y(), rc.width(), rc.height(), c, OPACITY_TRANSPARENT); } inline -void KisFillPainter::fillRect(const QRect& rc, const KisColor& c, Q_UINT8 opacity) +void KisFillPainter::fillRect(const TQRect& rc, const KisColor& c, TQ_UINT8 opacity) { fillRect(rc.x(), rc.y(), rc.width(), rc.height(), c, opacity); } inline -void KisFillPainter::fillRect(const QRect& rc, KisPattern *pattern) +void KisFillPainter::fillRect(const TQRect& rc, KisPattern *pattern) { fillRect(rc.x(), rc.y(), rc.width(), rc.height(), pattern); } diff --git a/krita/core/kis_filter.cc b/krita/core/kis_filter.cc index 05e1a92d..ee396596 100644 --- a/krita/core/kis_filter.cc +++ b/krita/core/kis_filter.cc @@ -17,12 +17,12 @@ */ #include "kis_filter.h" -#include <qstring.h> +#include <tqstring.h> #include "kis_types.h" #include "kis_filter_configuration.h" -KisFilter::KisFilter(const KisID& id, const QString & category, const QString & entry) +KisFilter::KisFilter(const KisID& id, const TQString & category, const TQString & entry) : KisProgressSubject(0, id.id().latin1()) , m_id(id) , m_progressDisplay(0) @@ -31,7 +31,7 @@ KisFilter::KisFilter(const KisID& id, const QString & category, const QString & { } -KisFilterConfiguration * KisFilter::configuration(QWidget*) +KisFilterConfiguration * KisFilter::configuration(TQWidget*) { return new KisFilterConfiguration(m_id.id(), 0); } @@ -41,7 +41,7 @@ KisFilterConfiguration * KisFilter::configuration() return new KisFilterConfiguration(m_id.id(), 0); } -KisFilterConfigWidget * KisFilter::createConfigurationWidget(QWidget *, KisPaintDeviceSP) +KisFilterConfigWidget * KisFilter::createConfigurationWidget(TQWidget *, KisPaintDeviceSP) { return 0; } @@ -63,7 +63,7 @@ void KisFilter::disableProgress() { m_progressDisplay = 0; } -void KisFilter::setProgressTotalSteps(Q_INT32 totalSteps) +void KisFilter::setProgressTotalSteps(TQ_INT32 totalSteps) { if (m_progressEnabled) { @@ -74,10 +74,10 @@ void KisFilter::setProgressTotalSteps(Q_INT32 totalSteps) } } -void KisFilter::setProgress(Q_INT32 progress) +void KisFilter::setProgress(TQ_INT32 progress) { if (m_progressEnabled) { - Q_INT32 progressPerCent = (progress * 100) / m_progressTotalSteps; + TQ_INT32 progressPerCent = (progress * 100) / m_progressTotalSteps; m_progressSteps = progress; if (progressPerCent != m_lastProgressPerCent) { @@ -94,11 +94,11 @@ void KisFilter::incProgress() } -void KisFilter::setProgressStage(const QString& stage, Q_INT32 progress) +void KisFilter::setProgressStage(const TQString& stage, TQ_INT32 progress) { if (m_progressEnabled) { - Q_INT32 progressPerCent = (progress * 100) / m_progressTotalSteps; + TQ_INT32 progressPerCent = (progress * 100) / m_progressTotalSteps; m_lastProgressPerCent = progressPerCent; emit notifyProgressStage(stage, progressPerCent); @@ -121,7 +121,7 @@ void KisFilter::setAutoUpdate(bool set) { m_autoUpdate = set; } -QRect KisFilter::enlargeRect(QRect rect, KisFilterConfiguration* c) const { +TQRect KisFilter::enlargeRect(TQRect rect, KisFilterConfiguration* c) const { int margin = overlapMarginNeeded(c); rect.rLeft() -= margin; rect.rTop() -= margin; diff --git a/krita/core/kis_filter.h b/krita/core/kis_filter.h index dd0f5186..c54b4041 100644 --- a/krita/core/kis_filter.h +++ b/krita/core/kis_filter.h @@ -20,7 +20,7 @@ #include <list> -#include <qstring.h> +#include <tqstring.h> #include <ksharedptr.h> #include <klocale.h> @@ -38,33 +38,34 @@ class KisColorSpace; class KisPreviewDialog; class KisProgressDisplayInterface; class KisFilterConfigWidget; -class QWidget; +class TQWidget; /** * Basic interface of a Krita filter. */ class KRITACORE_EXPORT KisFilter : public KisProgressSubject, public KShared { Q_OBJECT + TQ_OBJECT public: /** * Construct a Krita filter */ - KisFilter(const KisID& id, const QString & category, const QString & entry); + KisFilter(const KisID& id, const TQString & category, const TQString & entry); virtual ~KisFilter() {} public: virtual void setProgressDisplay(KisProgressDisplayInterface * progressDisplay); - virtual void process(KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFilterConfiguration*, const QRect&) = 0; + virtual void process(KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFilterConfiguration*, const TQRect&) = 0; public: /** * @return a new configuration derived from the widget. If the widget is NULL or not the correct type, * a default configuration object will be returned */ - virtual KisFilterConfiguration * configuration(QWidget*); + virtual KisFilterConfiguration * configuration(TQWidget*); /** * @return a default configuration object @@ -118,7 +119,7 @@ public: * might be bigger. Use this function to detirmine that rect. * The default implementation makes a guess using overlapMarginNeeded. */ - virtual QRect enlargeRect(QRect rect, KisFilterConfiguration* = 0) const; + virtual TQRect enlargeRect(TQRect rect, KisFilterConfiguration* = 0) const; /** * Determine the colorspace independence of this filter. @@ -149,20 +150,20 @@ public: inline const KisID id() const { return m_id; }; // Which submenu in the filters menu does filter want to go? - inline QString menuCategory() const { return m_category; }; + inline TQString menuCategory() const { return m_category; }; // The i18n'ed string this filter wants to show itself in the menu - inline QString menuEntry() const { return m_entry; }; + inline TQString menuEntry() const { return m_entry; }; /** * Create the configuration widget for this filter. * - * @param parent the Qt owner widget of this widget + * @param tqparent the TQt owner widget of this widget * @param dev the paintdevice this filter will act on * @return NULL if the filter does not use user-settable configuration settings. * else return a pointer to the new configuration widget */ - virtual KisFilterConfigWidget * createConfigurationWidget(QWidget * parent, KisPaintDeviceSP dev); + virtual KisFilterConfigWidget * createConfigurationWidget(TQWidget * tqparent, KisPaintDeviceSP dev); virtual void cancel() { m_cancelRequested = true; } @@ -173,26 +174,26 @@ public: protected slots: // Convenience functions for progress display. - void setProgressTotalSteps(Q_INT32 totalSteps); - void setProgress(Q_INT32 progress); + void setProgressTotalSteps(TQ_INT32 totalSteps); + void setProgress(TQ_INT32 progress); void incProgress(); - void setProgressStage(const QString& stage, Q_INT32 progress); + void setProgressStage(const TQString& stage, TQ_INT32 progress); void setProgressDone(); - inline Q_INT32 progress() { return m_progressSteps; } + inline TQ_INT32 progress() { return m_progressSteps; } private: bool m_cancelRequested; bool m_progressEnabled; bool m_autoUpdate; protected: - Q_INT32 m_progressTotalSteps; - Q_INT32 m_lastProgressPerCent; - Q_INT32 m_progressSteps; + TQ_INT32 m_progressTotalSteps; + TQ_INT32 m_lastProgressPerCent; + TQ_INT32 m_progressSteps; KisID m_id; KisProgressDisplayInterface * m_progressDisplay; - QString m_category; // The category in the filter menu this filter fits - QString m_entry; // the i18n'ed accelerated menu text + TQString m_category; // The category in the filter menu this filter fits + TQString m_entry; // the i18n'ed accelerated menu text }; diff --git a/krita/core/kis_filter_config_widget.cc b/krita/core/kis_filter_config_widget.cc index e694189d..df7c13d5 100644 --- a/krita/core/kis_filter_config_widget.cc +++ b/krita/core/kis_filter_config_widget.cc @@ -19,8 +19,8 @@ #include "kis_filter_config_widget.h" -KisFilterConfigWidget::KisFilterConfigWidget(QWidget * parent, const char * name, WFlags f) - : QWidget(parent, name, f) +KisFilterConfigWidget::KisFilterConfigWidget(TQWidget * tqparent, const char * name, WFlags f) + : TQWidget(tqparent, name, f) { } diff --git a/krita/core/kis_filter_config_widget.h b/krita/core/kis_filter_config_widget.h index 4d93f60b..ddb600ab 100644 --- a/krita/core/kis_filter_config_widget.h +++ b/krita/core/kis_filter_config_widget.h @@ -18,7 +18,7 @@ #ifndef _KIS_FILTER_CONFIG_WIDGET_H_ #define _KIS_FILTER_CONFIG_WIDGET_H_ -#include <qwidget.h> +#include <tqwidget.h> #include "kis_filter_configuration.h" /** @@ -26,13 +26,14 @@ * inherit this class. The configuration widget can emit sigPleaseUpdatePreview * when it wants the preview in the filter dialog to be updated. */ -class KisFilterConfigWidget : public QWidget { +class KisFilterConfigWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KisFilterConfigWidget(QWidget * parent, const char * name = 0, WFlags f = 0 ); + KisFilterConfigWidget(TQWidget * tqparent, const char * name = 0, WFlags f = 0 ); virtual ~KisFilterConfigWidget(); virtual void setConfiguration(KisFilterConfiguration * config) = 0; diff --git a/krita/core/kis_filter_configuration.cc b/krita/core/kis_filter_configuration.cc index 999edc5c..b25dcb24 100644 --- a/krita/core/kis_filter_configuration.cc +++ b/krita/core/kis_filter_configuration.cc @@ -18,8 +18,8 @@ #include "kis_filter.h" #include <kdebug.h> -#include <qdom.h> -#include <qstring.h> +#include <tqdom.h> +#include <tqstring.h> #include "kis_filter_registry.h" #include "kis_transaction.h" @@ -40,24 +40,24 @@ KisFilterConfiguration::KisFilterConfiguration(const KisFilterConfiguration & rh m_properties = rhs.m_properties; } -void KisFilterConfiguration::fromXML(const QString & s ) +void KisFilterConfiguration::fromXML(const TQString & s ) { m_properties.clear(); - QDomDocument doc; + TQDomDocument doc; doc.setContent( s ); - QDomElement e = doc.documentElement(); - QDomNode n = e.firstChild(); + TQDomElement e = doc.documentElement(); + TQDomNode n = e.firstChild(); m_name = e.attribute("name"); m_version = e.attribute("version").toInt(); while (!n.isNull()) { // We don't nest elements in filter configuration. For now... - QDomElement e = n.toElement(); - QString name; - QString type; - QString value; + TQDomElement e = n.toElement(); + TQString name; + TQString type; + TQString value; if (!e.isNull()) { if (e.tagName() == "property") { @@ -65,7 +65,7 @@ void KisFilterConfiguration::fromXML(const QString & s ) type = e.attribute("type"); value = e.text(); // XXX Convert the variant pro-actively to the right type? - m_properties[name] = QVariant(value); + m_properties[name] = TQVariant(value); } } n = n.nextSibling(); @@ -73,23 +73,23 @@ void KisFilterConfiguration::fromXML(const QString & s ) //dump(); } -QString KisFilterConfiguration::toString() +TQString KisFilterConfiguration::toString() { - QDomDocument doc = QDomDocument("filterconfig"); - QDomElement root = doc.createElement( "filterconfig" ); + TQDomDocument doc = TQDomDocument("filterconfig"); + TQDomElement root = doc.createElement( "filterconfig" ); root.setAttribute( "name", m_name ); root.setAttribute( "version", m_version ); doc.appendChild( root ); - QMap<QString, QVariant>::Iterator it; + TQMap<TQString, TQVariant>::Iterator it; for ( it = m_properties.begin(); it != m_properties.end(); ++it ) { - QDomElement e = doc.createElement( "property" ); + TQDomElement e = doc.createElement( "property" ); e.setAttribute( "name", it.key().latin1() ); - QVariant v = it.data(); + TQVariant v = it.data(); e.setAttribute( "type", v.typeName() ); - QString s = v.asString(); - QDomText text = doc.createCDATASection(v.asString() ); // XXX: Unittest this! + TQString s = v.asString(); + TQDomText text = doc.createCDATASection(v.asString() ); // XXX: Unittest this! e.appendChild(text); root.appendChild(e); } @@ -97,19 +97,19 @@ QString KisFilterConfiguration::toString() return doc.toString(); } -const QString & KisFilterConfiguration::name() const +const TQString & KisFilterConfiguration::name() const { return m_name; } -Q_INT32 KisFilterConfiguration::version() const +TQ_INT32 KisFilterConfiguration::version() const { return m_version; } -void KisFilterConfiguration::setProperty(const QString & name, const QVariant & value) +void KisFilterConfiguration::setProperty(const TQString & name, const TQVariant & value) { - if ( m_properties.find( name ) == m_properties.end() ) { + if ( m_properties.tqfind( name ) == m_properties.end() ) { m_properties.insert( name, value ); } else { @@ -117,9 +117,9 @@ void KisFilterConfiguration::setProperty(const QString & name, const QVariant & } } -bool KisFilterConfiguration::getProperty(const QString & name, QVariant & value) +bool KisFilterConfiguration::getProperty(const TQString & name, TQVariant & value) { - if ( m_properties.find( name ) == m_properties.end() ) { + if ( m_properties.tqfind( name ) == m_properties.end() ) { return false; } else { @@ -128,10 +128,10 @@ bool KisFilterConfiguration::getProperty(const QString & name, QVariant & value) } } -QVariant KisFilterConfiguration::getProperty(const QString & name) +TQVariant KisFilterConfiguration::getProperty(const TQString & name) { - if ( m_properties.find( name ) == m_properties.end() ) { - return QVariant(); + if ( m_properties.tqfind( name ) == m_properties.end() ) { + return TQVariant(); } else { return m_properties[name]; @@ -139,9 +139,9 @@ QVariant KisFilterConfiguration::getProperty(const QString & name) } -int KisFilterConfiguration::getInt(const QString & name, int def) +int KisFilterConfiguration::getInt(const TQString & name, int def) { - QVariant v = getProperty(name); + TQVariant v = getProperty(name); if (v.isValid()) return v.asInt(); else @@ -149,27 +149,27 @@ int KisFilterConfiguration::getInt(const QString & name, int def) } -double KisFilterConfiguration::getDouble(const QString & name, double def) +double KisFilterConfiguration::getDouble(const TQString & name, double def) { - QVariant v = getProperty(name); + TQVariant v = getProperty(name); if (v.isValid()) return v.asDouble(); else return def; } -bool KisFilterConfiguration::getBool(const QString & name, bool def) +bool KisFilterConfiguration::getBool(const TQString & name, bool def) { - QVariant v = getProperty(name); + TQVariant v = getProperty(name); if (v.isValid()) return v.asBool(); else return def; } -QString KisFilterConfiguration::getString(const QString & name, QString def) +TQString KisFilterConfiguration::getString(const TQString & name, TQString def) { - QVariant v = getProperty(name); + TQVariant v = getProperty(name); if (v.isValid()) return v.asString(); else @@ -178,7 +178,7 @@ QString KisFilterConfiguration::getString(const QString & name, QString def) void KisFilterConfiguration::dump() { - QMap<QString, QVariant>::Iterator it; + TQMap<TQString, TQVariant>::Iterator it; for ( it = m_properties.begin(); it != m_properties.end(); ++it ) { } diff --git a/krita/core/kis_filter_configuration.h b/krita/core/kis_filter_configuration.h index 10f9a6f4..8361861a 100644 --- a/krita/core/kis_filter_configuration.h +++ b/krita/core/kis_filter_configuration.h @@ -18,16 +18,16 @@ #ifndef _KIS_FILTER_CONFIGURATION_H_ #define _KIS_FILTER_CONFIGURATION_H_ -#include <qstring.h> -#include <qmap.h> -#include <qvariant.h> +#include <tqstring.h> +#include <tqmap.h> +#include <tqvariant.h> #include <kdebug.h> #include "koffice_export.h" class KisPreviewDialog; class KisProgressDisplayInterface; class KisFilterConfigWidget; -class QWidget; +class TQWidget; /** * A KisFilterConfiguration is the serializable representation of @@ -42,7 +42,7 @@ public: /** * Create a new filter config. */ - KisFilterConfiguration(const QString & name, Q_INT32 version) + KisFilterConfiguration(const TQString & name, TQ_INT32 version) : m_name(name) , m_version(version) {} @@ -56,49 +56,49 @@ public: /** * Fill the filter configuration object from the XML encoded representation in s. */ - virtual void fromXML(const QString &); + virtual void fromXML(const TQString &); /** * Create a serialized version of this filter config */ - virtual QString toString(); + virtual TQString toString(); /** * Get the unique, language independent name of the filter. */ - const QString & name() const; + const TQString & name() const; /** * Get the version of the filter that has created this config */ - Q_INT32 version() const; + TQ_INT32 version() const; /** * Set the property with name to value. */ - virtual void setProperty(const QString & name, const QVariant & value); + virtual void setProperty(const TQString & name, const TQVariant & value); /** * Set value to the value associated with property name * @return false if the specified property did not exist. */ - virtual bool getProperty(const QString & name, QVariant & value); + virtual bool getProperty(const TQString & name, TQVariant & value); - virtual QVariant getProperty(const QString & name); + virtual TQVariant getProperty(const TQString & name); - int getInt(const QString & name, int def = 0); - double getDouble(const QString & name, double def = 0.0); - bool getBool(const QString & name, bool def = false); - QString getString(const QString & name, QString def = QString::null); + int getInt(const TQString & name, int def = 0); + double getDouble(const TQString & name, double def = 0.0); + bool getBool(const TQString & name, bool def = false); + TQString getString(const TQString & name, TQString def = TQString()); private: void dump(); protected: - QString m_name; - Q_INT32 m_version; - QMap<QString, QVariant> m_properties; + TQString m_name; + TQ_INT32 m_version; + TQMap<TQString, TQVariant> m_properties; }; diff --git a/krita/core/kis_filter_registry.cc b/krita/core/kis_filter_registry.cc index 1b453878..43d745f4 100644 --- a/krita/core/kis_filter_registry.cc +++ b/krita/core/kis_filter_registry.cc @@ -16,8 +16,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqptrlist.h> #include <kaction.h> #include <kdebug.h> @@ -40,8 +40,8 @@ KisFilterRegistry::KisFilterRegistry() Q_ASSERT(KisFilterRegistry::m_singleton == 0); KisFilterRegistry::m_singleton = this; - KTrader::OfferList offers = KTrader::self()->query(QString::fromLatin1("Krita/Filter"), - QString::fromLatin1("(Type == 'Service') and " + KTrader::OfferList offers = KTrader::self()->query(TQString::tqfromLatin1("Krita/Filter"), + TQString::tqfromLatin1("(Type == 'Service') and " "([X-Krita-Version] == 2)")); KTrader::OfferList::ConstIterator iter; @@ -51,7 +51,7 @@ KisFilterRegistry::KisFilterRegistry() KService::Ptr service = *iter; int errCode = 0; KParts::Plugin* plugin = - KParts::ComponentFactory::createInstanceFromService<KParts::Plugin> ( service, this, 0, QStringList(), &errCode); + KParts::ComponentFactory::createInstanceFromService<KParts::Plugin> ( service, this, 0, TQStringList(), &errCode); if ( plugin ) kdDebug(DBG_AREA_PLUGINS) << "found plugin " << service->property("Name").toString() << "\n"; else { diff --git a/krita/core/kis_filter_registry.h b/krita/core/kis_filter_registry.h index 89cf1341..9ad9901d 100644 --- a/krita/core/kis_filter_registry.h +++ b/krita/core/kis_filter_registry.h @@ -20,20 +20,21 @@ #ifndef KIS_FILTER_REGISTRY_H_ #define KIS_FILTER_REGISTRY_H_ -#include <qobject.h> +#include <tqobject.h> #include "kis_types.h" #include "kis_generic_registry.h" #include <koffice_export.h> -class QString; -class QStringList; +class TQString; +class TQStringList; -class KRITACORE_EXPORT KisFilterRegistry : public QObject, public KisGenericRegistry<KisFilterSP> +class KRITACORE_EXPORT KisFilterRegistry : public TQObject, public KisGenericRegistry<KisFilterSP> { Q_OBJECT + TQ_OBJECT public: virtual ~KisFilterRegistry(); diff --git a/krita/core/kis_filter_strategy.cc b/krita/core/kis_filter_strategy.cc index 78dbcd41..f82e6cb5 100644 --- a/krita/core/kis_filter_strategy.cc +++ b/krita/core/kis_filter_strategy.cc @@ -29,7 +29,7 @@ double KisHermiteFilterStrategy::valueAt(double t) const { return(0.0); } -Q_UINT32 KisHermiteFilterStrategy::intValueAt(Q_INT32 t) const { +TQ_UINT32 KisHermiteFilterStrategy::intValueAt(TQ_INT32 t) const { /* f(t) = 2|t|^3 - 3|t|^2 + 1, -1 <= t <= 1 */ if(t < 0) t = -t; if(t < 256) @@ -61,7 +61,7 @@ double KisCubicFilterStrategy::valueAt(double x) const { return(0.0); } -Q_UINT32 KisCubicFilterStrategy::intValueAt(Q_INT32 x) const { +TQ_UINT32 KisCubicFilterStrategy::intValueAt(TQ_INT32 x) const { if (x < 2) return 0; if (x < -1) @@ -80,7 +80,7 @@ double KisBoxFilterStrategy::valueAt(double t) const { return(0.0); } -Q_UINT32 KisBoxFilterStrategy::intValueAt(Q_INT32 t) const { +TQ_UINT32 KisBoxFilterStrategy::intValueAt(TQ_INT32 t) const { /* f(t) = 1, -0.5 < t <= 0.5 */ if((t > -128) && (t <= 128)) return 255; @@ -93,7 +93,7 @@ double KisTriangleFilterStrategy::valueAt(double t) const { return(0.0); } -Q_UINT32 KisTriangleFilterStrategy::intValueAt(Q_INT32 t) const { +TQ_UINT32 KisTriangleFilterStrategy::intValueAt(TQ_INT32 t) const { /* f(t) = |t|, -1 <= t <= 1 */ if(t < 0) t = -t; if(t < 256) diff --git a/krita/core/kis_filter_strategy.h b/krita/core/kis_filter_strategy.h index 91385239..55ef3d06 100644 --- a/krita/core/kis_filter_strategy.h +++ b/krita/core/kis_filter_strategy.h @@ -34,13 +34,13 @@ class KisFilterStrategy KisID id() {return m_id;}; virtual double valueAt(double /*t*/) const {return 0;}; - virtual Q_UINT32 intValueAt(Q_INT32 t) const {return Q_UINT32(255*valueAt(t/256.0));}; + virtual TQ_UINT32 intValueAt(TQ_INT32 t) const {return TQ_UINT32(255*valueAt(t/256.0));}; double support() { return supportVal;}; - Q_UINT32 intSupport() { return intSupportVal;}; + TQ_UINT32 intSupport() { return intSupportVal;}; virtual bool boxSpecial() { return false;}; protected: double supportVal; - Q_UINT32 intSupportVal; + TQ_UINT32 intSupportVal; KisID m_id; }; @@ -51,7 +51,7 @@ class KisHermiteFilterStrategy : public KisFilterStrategy {supportVal = 1.0; intSupportVal = 256;} virtual ~KisHermiteFilterStrategy() {} - virtual Q_UINT32 intValueAt(Q_INT32 t) const; + virtual TQ_UINT32 intValueAt(TQ_INT32 t) const; virtual double valueAt(double t) const; }; @@ -62,7 +62,7 @@ class KisCubicFilterStrategy : public KisFilterStrategy {supportVal = 1.0; intSupportVal = 256;} virtual ~KisCubicFilterStrategy() {} - virtual Q_UINT32 intValueAt(Q_INT32 t) const; + virtual TQ_UINT32 intValueAt(TQ_INT32 t) const; virtual double valueAt(double t) const; }; @@ -73,7 +73,7 @@ class KisBoxFilterStrategy : public KisFilterStrategy {supportVal = 0.5; intSupportVal = 128;} virtual ~KisBoxFilterStrategy() {} - virtual Q_UINT32 intValueAt(Q_INT32 t) const; + virtual TQ_UINT32 intValueAt(TQ_INT32 t) const; virtual double valueAt(double t) const; virtual bool boxSpecial() { return true;}; }; @@ -85,7 +85,7 @@ class KisTriangleFilterStrategy : public KisFilterStrategy {supportVal = 1.0; intSupportVal = 256;} virtual ~KisTriangleFilterStrategy() {} - virtual Q_UINT32 intValueAt(Q_INT32 t) const; + virtual TQ_UINT32 intValueAt(TQ_INT32 t) const; virtual double valueAt(double t) const; }; diff --git a/krita/core/kis_gradient.cc b/krita/core/kis_gradient.cc index 33714461..efc370bb 100644 --- a/krita/core/kis_gradient.cc +++ b/krita/core/kis_gradient.cc @@ -25,9 +25,9 @@ #include <cfloat> #include <cmath> -#include <qimage.h> -#include <qtextstream.h> -#include <qfile.h> +#include <tqimage.h> +#include <tqtextstream.h> +#include <tqfile.h> #include <koColor.h> #include <kogradientmanager.h> @@ -50,7 +50,7 @@ KisGradientSegment::SineInterpolationStrategy *KisGradientSegment::SineInterpola KisGradientSegment::SphereIncreasingInterpolationStrategy *KisGradientSegment::SphereIncreasingInterpolationStrategy::m_instance = 0; KisGradientSegment::SphereDecreasingInterpolationStrategy *KisGradientSegment::SphereDecreasingInterpolationStrategy::m_instance = 0; -KisGradient::KisGradient(const QString& file) : super(file) +KisGradient::KisGradient(const TQString& file) : super(file) { } @@ -72,7 +72,7 @@ bool KisGradient::save() return false; } -QImage KisGradient::img() +TQImage KisGradient::img() { return m_img; } @@ -132,7 +132,7 @@ bool KisGradient::init() } } -void KisGradient::setImage(const QImage& img) +void KisGradient::setImage(const TQImage& img) { m_img = img; m_img.detach(); @@ -145,7 +145,7 @@ KisGradientSegment *KisGradient::segmentAt(double t) const Q_ASSERT(t >= 0 || t <= 1); Q_ASSERT(!m_segments.empty()); - for(QValueVector<KisGradientSegment *>::const_iterator it = m_segments.begin(); it!= m_segments.end(); ++it) + for(TQValueVector<KisGradientSegment *>::const_iterator it = m_segments.begin(); it!= m_segments.end(); ++it) { if (t > (*it)->startOffset() - DBL_EPSILON && t < (*it)->endOffset() + DBL_EPSILON) { return *it; @@ -155,7 +155,7 @@ KisGradientSegment *KisGradient::segmentAt(double t) const return 0; } -void KisGradient::colorAt(double t, QColor *color, Q_UINT8 *opacity) const +void KisGradient::colorAt(double t, TQColor *color, TQ_UINT8 *opacity) const { const KisGradientSegment *segment = segmentAt(t); Q_ASSERT(segment != 0); @@ -163,13 +163,13 @@ void KisGradient::colorAt(double t, QColor *color, Q_UINT8 *opacity) const if (segment) { Color col = segment->colorAt(t); *color = col.color(); - *opacity = static_cast<Q_UINT8>(col.alpha() * OPACITY_OPAQUE + 0.5); + *opacity = static_cast<TQ_UINT8>(col.alpha() * OPACITY_OPAQUE + 0.5); } } -QImage KisGradient::generatePreview(int width, int height) const +TQImage KisGradient::generatePreview(int width, int height) const { - QImage img(width, height, 32); + TQImage img(width, height, 32); for (int y = 0; y < img.height(); y++) { for (int x = 0; x < img.width(); x++) { @@ -178,8 +178,8 @@ QImage KisGradient::generatePreview(int width, int height) const int backgroundGreen = backgroundRed; int backgroundBlue = backgroundRed; - QColor color; - Q_UINT8 opacity; + TQColor color; + TQ_UINT8 opacity; double t = static_cast<double>(x) / (img.width() - 1); colorAt(t, &color, &opacity); @@ -190,7 +190,7 @@ QImage KisGradient::generatePreview(int width, int height) const int green = static_cast<int>((1 - alpha) * backgroundGreen + alpha * color.green() + 0.5); int blue = static_cast<int>((1 - alpha) * backgroundBlue + alpha * color.blue() + 0.5); - img.setPixel(x, y, qRgb(red, green, blue)); + img.setPixel(x, y, tqRgb(red, green, blue)); } } @@ -435,7 +435,7 @@ Color KisGradientSegment::RGBColorInterpolationStrategy::colorAt(double t, Color int blue = static_cast<int>(startBlue + t * (end.color().blue() - startBlue) + 0.5); double alpha = startAlpha + t * (end.alpha() - startAlpha); - return Color(QColor(red, green, blue), alpha); + return Color(TQColor(red, green, blue), alpha); } KisGradientSegment::HSVCWColorInterpolationStrategy *KisGradientSegment::HSVCWColorInterpolationStrategy::instance() diff --git a/krita/core/kis_gradient.h b/krita/core/kis_gradient.h index 3610e0e0..50bc0fd8 100644 --- a/krita/core/kis_gradient.h +++ b/krita/core/kis_gradient.h @@ -24,15 +24,15 @@ #ifndef KIS_GRADIENT_H #define KIS_GRADIENT_H -#include <qvaluevector.h> -#include <qcolor.h> +#include <tqvaluevector.h> +#include <tqcolor.h> #include <kio/job.h> #include "kis_resource.h" #include "kis_global.h" -class QImage; +class TQImage; enum { INTERP_LINEAR = 0, @@ -48,17 +48,17 @@ enum { COLOR_INTERP_HSV_CW }; -// TODO: Replace QColor with KisColor +// TODO: Replace TQColor with KisColor class Color { public: Color() { m_alpha = 0; } - Color(const QColor& color, double alpha) { m_color = color; m_alpha = alpha; } + Color(const TQColor& color, double alpha) { m_color = color; m_alpha = alpha; } - const QColor& color() const { return m_color; } + const TQColor& color() const { return m_color; } double alpha() const { return m_alpha; } private: - QColor m_color; + TQColor m_color; double m_alpha; }; @@ -232,32 +232,33 @@ class KisGradientSegment { class KisGradient : public KisResource { typedef KisResource super; Q_OBJECT + TQ_OBJECT public: - KisGradient(const QString& file); + KisGradient(const TQString& file); virtual ~KisGradient(); virtual bool load(); virtual bool save(); - virtual QImage img(); - virtual QImage generatePreview(int width, int height) const; + virtual TQImage img(); + virtual TQImage generatePreview(int width, int height) const; - void colorAt(double t, QColor *color, Q_UINT8 *opacity) const; + void colorAt(double t, TQColor *color, TQ_UINT8 *opacity) const; KisGradientSegment *segmentAt(double t) const; protected: inline void pushSegment( KisGradientSegment* segment ) { m_segments.push_back(segment); }; - void setImage(const QImage& img); + void setImage(const TQImage& img); - QValueVector<KisGradientSegment *> m_segments; + TQValueVector<KisGradientSegment *> m_segments; private: bool init(); private: - QByteArray m_data; - QImage m_img; + TQByteArray m_data; + TQImage m_img; }; #endif // KIS_GRADIENT_H diff --git a/krita/core/kis_gradient_painter.cc b/krita/core/kis_gradient_painter.cc index b73623aa..2258d899 100644 --- a/krita/core/kis_gradient_painter.cc +++ b/krita/core/kis_gradient_painter.cc @@ -20,20 +20,20 @@ #include <string.h> #include <cfloat> -#include "qbrush.h" -#include "qcolor.h" -#include "qfontinfo.h" -#include "qfontmetrics.h" -#include "qpen.h" -#include "qregion.h" -#include "qwmatrix.h" -#include <qimage.h> -#include <qmap.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpointarray.h> -#include <qrect.h> -#include <qstring.h> +#include "tqbrush.h" +#include "tqcolor.h" +#include "tqfontinfo.h" +#include "tqfontmetrics.h" +#include "tqpen.h" +#include "tqregion.h" +#include "tqwmatrix.h" +#include <tqimage.h> +#include <tqmap.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpointarray.h> +#include <tqrect.h> +#include <tqstring.h> #include <kdebug.h> #include <klocale.h> @@ -246,7 +246,7 @@ namespace { distance2 = fabs(distance2); } - double t = QMAX(distance1, distance2) / m_vectorLength; + double t = TQMAX(distance1, distance2) / m_vectorLength; return t; } @@ -483,42 +483,42 @@ KisGradientPainter::KisGradientPainter(KisPaintDeviceSP device) : super(device), bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart, const KisPoint& gradientVectorEnd, - enumGradientShape shape, + enumGradientShape tqshape, enumGradientRepeat repeat, double antiAliasThreshold, bool reverseGradient, - Q_INT32 startx, - Q_INT32 starty, - Q_INT32 width, - Q_INT32 height) + TQ_INT32 startx, + TQ_INT32 starty, + TQ_INT32 width, + TQ_INT32 height) { m_cancelRequested = false; if (!m_gradient) return false; - GradientShapeStrategy *shapeStrategy = 0; + GradientShapeStrategy *tqshapeStrategy = 0; - switch (shape) { + switch (tqshape) { case GradientShapeLinear: - shapeStrategy = new LinearGradientStrategy(gradientVectorStart, gradientVectorEnd); + tqshapeStrategy = new LinearGradientStrategy(gradientVectorStart, gradientVectorEnd); break; case GradientShapeBiLinear: - shapeStrategy = new BiLinearGradientStrategy(gradientVectorStart, gradientVectorEnd); + tqshapeStrategy = new BiLinearGradientStrategy(gradientVectorStart, gradientVectorEnd); break; case GradientShapeRadial: - shapeStrategy = new RadialGradientStrategy(gradientVectorStart, gradientVectorEnd); + tqshapeStrategy = new RadialGradientStrategy(gradientVectorStart, gradientVectorEnd); break; case GradientShapeSquare: - shapeStrategy = new SquareGradientStrategy(gradientVectorStart, gradientVectorEnd); + tqshapeStrategy = new SquareGradientStrategy(gradientVectorStart, gradientVectorEnd); break; case GradientShapeConical: - shapeStrategy = new ConicalGradientStrategy(gradientVectorStart, gradientVectorEnd); + tqshapeStrategy = new ConicalGradientStrategy(gradientVectorStart, gradientVectorEnd); break; case GradientShapeConicalSymetric: - shapeStrategy = new ConicalSymetricGradientStrategy(gradientVectorStart, gradientVectorEnd); + tqshapeStrategy = new ConicalSymetricGradientStrategy(gradientVectorStart, gradientVectorEnd); break; } - Q_CHECK_PTR(shapeStrategy); + Q_CHECK_PTR(tqshapeStrategy); GradientRepeatStrategy *repeatStrategy = 0; @@ -537,7 +537,7 @@ bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart, //If the device has a selection only iterate over that selection - QRect r; + TQRect r; if( m_device->hasSelection() ) { r = m_device->selection()->selectedExactRect(); startx = r.x(); @@ -546,10 +546,10 @@ bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart, height = r.height(); } - Q_INT32 endx = startx + width - 1; - Q_INT32 endy = starty + height - 1; + TQ_INT32 endx = startx + width - 1; + TQ_INT32 endy = starty + height - 1; - QImage layer (width, height, 32); + TQImage layer (width, height, 32); layer.setAlphaBuffer(true); int pixelsProcessed = 0; @@ -566,20 +566,20 @@ bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart, for (int y = starty; y <= endy; y++) { for (int x = startx; x <= endx; x++) { - double t = shapeStrategy->valueAt( x, y); + double t = tqshapeStrategy->valueAt( x, y); t = repeatStrategy->valueAt(t); if (reverseGradient) { t = 1 - t; } - QColor color; - Q_UINT8 opacity; + TQColor color; + TQ_UINT8 opacity; m_gradient->colorAt(t, &color, &opacity); layer.setPixel(x - startx, y - starty, - qRgba(color.red(), color.green(), color.blue(), opacity)); + tqRgba(color.red(), color.green(), color.blue(), opacity)); pixelsProcessed++; @@ -601,18 +601,18 @@ bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart, if (!m_cancelRequested && antiAliasThreshold < 1 - DBL_EPSILON) { - QColor color; + TQColor color; emit notifyProgressStage(i18n("Anti-aliasing gradient..."), lastProgressPercent); - Q_UINT8 * layerPointer = layer.bits(); + TQ_UINT8 * layerPointer = layer.bits(); for (int y = starty; y <= endy; y++) { for (int x = startx; x <= endx; x++) { double maxDistance = 0; - Q_UINT8 redThis = layerPointer[2]; - Q_UINT8 greenThis = layerPointer[1]; - Q_UINT8 blueThis = layerPointer[0]; - Q_UINT8 thisPixelOpacity = layerPointer[3]; + TQ_UINT8 redThis = layerPointer[2]; + TQ_UINT8 greenThis = layerPointer[1]; + TQ_UINT8 blueThis = layerPointer[0]; + TQ_UINT8 thisPixelOpacity = layerPointer[3]; for (int yOffset = -1; yOffset < 2; yOffset++) { for (int xOffset = -1; xOffset < 2; xOffset++) { @@ -624,11 +624,11 @@ bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart, if (sampleX >= startx && sampleX <= endx && sampleY >= starty && sampleY <= endy) { uint x = sampleX - startx; uint y = sampleY - starty; - Q_UINT8 * pixelPos = layer.bits() + (y * width * 4) + (x * 4); - Q_UINT8 red = *(pixelPos +2); - Q_UINT8 green = *(pixelPos + 1); - Q_UINT8 blue = *pixelPos; - Q_UINT8 opacity = *(pixelPos + 3); + TQ_UINT8 * pixelPos = layer.bits() + (y * width * 4) + (x * 4); + TQ_UINT8 red = *(pixelPos +2); + TQ_UINT8 green = *(pixelPos + 1); + TQ_UINT8 blue = *pixelPos; + TQ_UINT8 opacity = *(pixelPos + 3); double dRed = (red * opacity - redThis * thisPixelOpacity) / 65535.0; double dGreen = (green * opacity - greenThis * thisPixelOpacity) / 65535.0; @@ -662,14 +662,14 @@ bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart, double sampleX = x - 0.5 + (sampleWidth / 2) + xSample * sampleWidth; double sampleY = y - 0.5 + (sampleWidth / 2) + ySample * sampleWidth; - double t = shapeStrategy->valueAt(sampleX, sampleY); + double t = tqshapeStrategy->valueAt(sampleX, sampleY); t = repeatStrategy->valueAt(t); if (reverseGradient) { t = 1 - t; } - Q_UINT8 opacity; + TQ_UINT8 opacity; m_gradient->colorAt(t, &color, &opacity); @@ -685,7 +685,7 @@ bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart, int blue = totalBlue / (numSamples * numSamples); int opacity = totalOpacity / (numSamples * numSamples); - layer.setPixel(x - startx, y - starty, qRgba(red, green, blue, opacity)); + layer.setPixel(x - startx, y - starty, tqRgba(red, green, blue, opacity)); } pixelsProcessed++; @@ -715,7 +715,7 @@ bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart, dev->writeBytes(layer.bits(), startx, starty, width, height); bltSelection(startx, starty, m_compositeOp, dev, m_opacity, startx, starty, width, height); } - delete shapeStrategy; + delete tqshapeStrategy; emit notifyProgressDone(); diff --git a/krita/core/kis_gradient_painter.h b/krita/core/kis_gradient_painter.h index ccfd5c3c..fc31b117 100644 --- a/krita/core/kis_gradient_painter.h +++ b/krita/core/kis_gradient_painter.h @@ -66,14 +66,14 @@ public: */ bool paintGradient(const KisPoint& gradientVectorStart, const KisPoint& gradientVectorEnd, - enumGradientShape shape, + enumGradientShape tqshape, enumGradientRepeat repeat, double antiAliasThreshold, bool reverseGradient, - Q_INT32 startx, - Q_INT32 starty, - Q_INT32 width, - Q_INT32 height); + TQ_INT32 startx, + TQ_INT32 starty, + TQ_INT32 width, + TQ_INT32 height); private: diff --git a/krita/core/kis_group_layer.cc b/krita/core/kis_group_layer.cc index 2a2ed325..a3a35339 100644 --- a/krita/core/kis_group_layer.cc +++ b/krita/core/kis_group_layer.cc @@ -18,8 +18,8 @@ #include <kdebug.h> #include <kglobal.h> -#include <qimage.h> -#include <qdatetime.h> +#include <tqimage.h> +#include <tqdatetime.h> #include "kis_types.h" #include "kis_layer.h" @@ -31,7 +31,7 @@ #include "kis_merge_visitor.h" #include "kis_fill_painter.h" -KisGroupLayer::KisGroupLayer(KisImage *img, const QString &name, Q_UINT8 opacity) : +KisGroupLayer::KisGroupLayer(KisImage *img, const TQString &name, TQ_UINT8 opacity) : super(img, name, opacity), m_x(0), m_y(0) @@ -69,7 +69,7 @@ void KisGroupLayer::setDirty(bool propagate) if (propagate) emit (sigDirty(m_dirtyRect)); } -void KisGroupLayer::setDirty(const QRect & rc, bool propagate) +void KisGroupLayer::setDirty(const TQRect & rc, bool propagate) { KisLayer::setDirty(rc, propagate); if (propagate) emit sigDirty(rc); @@ -88,11 +88,11 @@ bool KisGroupLayer::paintLayerInducesProjectionOptimization(KisPaintLayer* l) { && l->opacity() == OPACITY_OPAQUE && !l->temporaryTarget() && !l->hasMask(); } -KisPaintDeviceSP KisGroupLayer::projection(const QRect & rect) +KisPaintDeviceSP KisGroupLayer::projection(const TQRect & rect) { - // We don't have a parent, and we've got only one child: abuse the child's + // We don't have a tqparent, and we've got only one child: abuse the child's // paint device as the projection if the child is visible and 100% opaque - if (parent() == 0 && childCount() == 1) { + if (tqparent() == 0 && childCount() == 1) { KisPaintLayerSP l = dynamic_cast<KisPaintLayer*>(firstChild().data()); if (paintLayerInducesProjectionOptimization(l)) { l->setClean(rect); @@ -113,8 +113,8 @@ KisPaintDeviceSP KisGroupLayer::projection(const QRect & rect) // Okay, we need to update the intersection between // what's dirty and what's asked us to be updated. // XXX Nooo, that doesn't work, since the call to setClean following this, is actually: - // m_dirtyRect = QRect(); So the non-intersecting part gets brilliantly lost otherwise. - const QRect rc = m_dirtyRect;//rect.intersect(m_dirtyRect); + // m_dirtyRect = TQRect(); So the non-intersecting part gets brilliantly lost otherwise. + const TQRect rc = m_dirtyRect;//rect.intersect(m_dirtyRect); updateProjection(rc); setClean(rect); @@ -146,14 +146,14 @@ KisLayerSP KisGroupLayer::at(int index) const int KisGroupLayer::index(KisLayerSP layer) const { - if (layer->parent().data() == this) + if (layer->tqparent().data() == this) return layer->index(); return -1; } void KisGroupLayer::setIndex(KisLayerSP layer, int index) { - if (layer->parent().data() != this) + if (layer->tqparent().data() != this) return; //TODO optimize removeLayer(layer); @@ -163,7 +163,7 @@ void KisGroupLayer::setIndex(KisLayerSP layer, int index) bool KisGroupLayer::addLayer(KisLayerSP newLayer, int x) { if (x < 0 || kClamp(uint(x), uint(0), childCount()) != uint(x) || - newLayer->parent() || m_layers.contains(newLayer)) + newLayer->tqparent() || m_layers.tqcontains(newLayer)) { kdWarning() << "invalid input to KisGroupLayer::addLayer(KisLayerSP newLayer, int x)!" << endl; return false; @@ -185,7 +185,7 @@ bool KisGroupLayer::addLayer(KisLayerSP newLayer, int x) bool KisGroupLayer::addLayer(KisLayerSP newLayer, KisLayerSP aboveThis) { - if (aboveThis && aboveThis->parent().data() != this) + if (aboveThis && aboveThis->tqparent().data() != this) { kdWarning() << "invalid input to KisGroupLayer::addLayer(KisLayerSP newLayer, KisLayerSP aboveThis)!" << endl; return false; @@ -207,7 +207,7 @@ bool KisGroupLayer::removeLayer(int x) m_layers.erase(m_layers.begin() + reverseIndex(index)); setDirty(removedLayer->extent()); if (childCount() < 1) { - // No children, nothing to show for it. + // No tqchildren, nothing to show for it. m_projection->clear(); setDirty(); } @@ -219,7 +219,7 @@ bool KisGroupLayer::removeLayer(int x) bool KisGroupLayer::removeLayer(KisLayerSP layer) { - if (layer->parent().data() != this) + if (layer->tqparent().data() != this) { kdWarning() << "invalid input to KisGroupLayer::removeLayer()!" << endl; return false; @@ -237,9 +237,9 @@ void KisGroupLayer::setImage(KisImage *image) } } -QRect KisGroupLayer::extent() const +TQRect KisGroupLayer::extent() const { - QRect groupExtent; + TQRect groupExtent; for (vKisLayerSP_cit it = m_layers.begin(); it != m_layers.end(); ++it) { @@ -249,9 +249,9 @@ QRect KisGroupLayer::extent() const return groupExtent; } -QRect KisGroupLayer::exactBounds() const +TQRect KisGroupLayer::exactBounds() const { - QRect groupExactBounds; + TQRect groupExactBounds; for (vKisLayerSP_cit it = m_layers.begin(); it != m_layers.end(); ++it) { @@ -261,14 +261,14 @@ QRect KisGroupLayer::exactBounds() const return groupExactBounds; } -Q_INT32 KisGroupLayer::x() const +TQ_INT32 KisGroupLayer::x() const { return m_x; } -void KisGroupLayer::setX(Q_INT32 x) +void KisGroupLayer::setX(TQ_INT32 x) { - Q_INT32 delta = x - m_x; + TQ_INT32 delta = x - m_x; for (vKisLayerSP_cit it = m_layers.begin(); it != m_layers.end(); ++it) { @@ -278,14 +278,14 @@ void KisGroupLayer::setX(Q_INT32 x) m_x = x; } -Q_INT32 KisGroupLayer::y() const +TQ_INT32 KisGroupLayer::y() const { return m_y; } -void KisGroupLayer::setY(Q_INT32 y) +void KisGroupLayer::setY(TQ_INT32 y) { - Q_INT32 delta = y - m_y; + TQ_INT32 delta = y - m_y; for (vKisLayerSP_cit it = m_layers.begin(); it != m_layers.end(); ++it) { @@ -296,19 +296,19 @@ void KisGroupLayer::setY(Q_INT32 y) m_y = y; } -QImage KisGroupLayer::createThumbnail(Q_INT32 w, Q_INT32 h) +TQImage KisGroupLayer::createThumbnail(TQ_INT32 w, TQ_INT32 h) { return m_projection->createThumbnail(w, h); } -void KisGroupLayer::updateProjection(const QRect & rc) +void KisGroupLayer::updateProjection(const TQRect & rc) { if (!m_dirtyRect.isValid()) return; // Get the first layer in this group to start compositing with KisLayerSP child = lastChild(); - // No child -- clear the projection. Without children, a group layer is empty. + // No child -- clear the projection. Without tqchildren, a group layer is empty. if (!child) m_projection->clear(); KisLayerSP startWith = 0; @@ -317,7 +317,7 @@ void KisGroupLayer::updateProjection(const QRect & rc) // If this is the rootlayer, don't do anything with adj. layers that are below the // first paintlayer - bool gotPaintLayer = (parent() != 0); + bool gotPaintLayer = (tqparent() != 0); // Look through all the child layers, searching for the first dirty layer // if it's found, and if we have found an adj. layer before the the dirty layer, @@ -404,8 +404,8 @@ void KisGroupLayer::updateProjection(const QRect & rc) const KisCompositeOp cop = child->compositeOp(); const bool block = child->signalsBlocked(); child->blockSignals(true); - // Composite op copy doesn't take a mask/selection into account, so we need - // to make a difference between a paintlayer with a mask, and one without + // Composite op copy doesn't take a tqmask/selection into account, so we need + // to make a difference between a paintlayer with a tqmask, and one without KisPaintLayer* l = dynamic_cast<KisPaintLayer*>(child.data()); if (l && l->hasMask()) child->m_compositeOp = COMPOSITE_OVER; diff --git a/krita/core/kis_group_layer.h b/krita/core/kis_group_layer.h index 7b1a764a..3a2e042a 100644 --- a/krita/core/kis_group_layer.h +++ b/krita/core/kis_group_layer.h @@ -37,9 +37,10 @@ class KisGroupLayer : public KisLayer { typedef KisLayer super; Q_OBJECT + TQ_OBJECT public: - KisGroupLayer(KisImage *img, const QString &name, Q_UINT8 opacity); + KisGroupLayer(KisImage *img, const TQString &name, TQ_UINT8 opacity); KisGroupLayer(const KisGroupLayer& rhs); virtual ~KisGroupLayer(); @@ -47,46 +48,46 @@ public: public: /** - * Set the entire layer extent dirty; this percolates up to parent layers all the + * Set the entire layer extent dirty; this percolates up to tqparent layers all the * way to the root layer. */ virtual void setDirty(bool propagate = true); /** * Add the given rect to the set of dirty rects for this layer; - * this percolates up to parent layers all the way to the root + * this percolates up to tqparent layers all the way to the root * layer. */ - virtual void setDirty(const QRect & rect, bool propagate = true); + virtual void setDirty(const TQRect & rect, bool propagate = true); virtual void activate() {}; virtual void deactivate() {}; - virtual Q_INT32 x() const; - virtual void setX(Q_INT32); + virtual TQ_INT32 x() const; + virtual void setX(TQ_INT32); - virtual Q_INT32 y() const; - virtual void setY(Q_INT32); + virtual TQ_INT32 y() const; + virtual void setY(TQ_INT32); // Sets this layer and all its descendants' owner image to the given image. virtual void setImage(KisImage *image); - virtual QRect extent() const; - virtual QRect exactBounds() const; + virtual TQRect extent() const; + virtual TQRect exactBounds() const; virtual bool accept(KisLayerVisitor &v) { // kdDebug(41001) << "GROUP\t\t" << name() // << " dirty: " << dirty() -// << ", " << m_layers.count() << " children " +// << ", " << m_layers.count() << " tqchildren " // << ", projection: " << m_projection // << "\n"; return v.visit(this); }; virtual void resetProjection(KisPaintDevice* to = 0); /// will copy from to, if !0, CoW!! - virtual KisPaintDeviceSP projection(const QRect & rect); + virtual KisPaintDeviceSP projection(const TQRect & rect); virtual uint childCount() const; @@ -116,24 +117,24 @@ public: /// Removes the layer from this group. Fails if there's no such layer in this group. virtual bool removeLayer(KisLayerSP layer); - virtual QImage createThumbnail(Q_INT32 w, Q_INT32 h); + virtual TQImage createThumbnail(TQ_INT32 w, TQ_INT32 h); /// Returns if the layer will induce the projection hack (if the only layer in this group) virtual bool paintLayerInducesProjectionOptimization(KisPaintLayer* l); signals: - void sigDirty(QRect rc); + void sigDirty(TQRect rc); private: - void updateProjection(const QRect & rc); + void updateProjection(const TQRect & rc); inline int reverseIndex(int index) const { return childCount() - 1 - index; }; vKisLayerSP m_layers; // Contains the list of all layers KisPaintDeviceSP m_projection; // The cached composition of all layers in this group - Q_INT32 m_x; - Q_INT32 m_y; + TQ_INT32 m_x; + TQ_INT32 m_y; }; #endif // KIS_GROUP_LAYER_H_ diff --git a/krita/core/kis_histogram.cc b/krita/core/kis_histogram.cc index 97fdeac4..1b4db526 100644 --- a/krita/core/kis_histogram.cc +++ b/krita/core/kis_histogram.cc @@ -18,7 +18,7 @@ */ #include <kdebug.h> -#include <qdatetime.h> // ### Debug +#include <tqdatetime.h> // ### Debug #include "kis_types.h" #include "kis_histogram.h" @@ -59,12 +59,12 @@ KisHistogram::~KisHistogram() void KisHistogram::updateHistogram() { - Q_INT32 x,y,w,h; + TQ_INT32 x,y,w,h; m_dev->exactBounds(x,y,w,h); KisRectIteratorPixel srcIt = m_dev->createRectIterator(x,y,w,h, false); KisColorSpace* cs = m_dev->colorSpace(); - QTime t; + TQTime t; t.start(); // Let the producer do it's work @@ -109,8 +109,8 @@ KisHistogram::Calculations KisHistogram::selectionCalculations() { return m_selectionCalculations.at(m_channel); } -QValueVector<KisHistogram::Calculations> KisHistogram::calculateForRange(double from, double to) { - QValueVector<Calculations> calculations; +TQValueVector<KisHistogram::Calculations> KisHistogram::calculateForRange(double from, double to) { + TQValueVector<Calculations> calculations; uint count = m_producer->channels().count(); for (uint i = 0; i < count; i++) { @@ -126,7 +126,7 @@ KisHistogram::Calculations KisHistogram::calculateSingleRange(int channel, doubl // XXX If from == to, we only want a specific bin, handle that properly! double max = from, min = to, total = 0.0, mean = 0.0; //, median = 0.0, stddev = 0.0; - Q_UINT32 high = 0, low = (Q_UINT32) -1, count = 0; + TQ_UINT32 high = 0, low = (TQ_UINT32) -1, count = 0; if (m_producer->count() == 0) { // We won't get anything, even if a range is specified @@ -134,17 +134,17 @@ KisHistogram::Calculations KisHistogram::calculateSingleRange(int channel, doubl return c; } - Q_INT32 totbins = m_producer->numberOfBins(); - Q_UINT32 current; + TQ_INT32 totbins = m_producer->numberOfBins(); + TQ_UINT32 current; // convert the double range into actual bins: double factor = static_cast<double>(totbins) / m_producer->viewWidth(); - Q_INT32 fromBin = static_cast<Q_INT32>((from - m_producer->viewFrom()) * factor); - Q_INT32 toBin = fromBin + static_cast<Q_INT32>((to - from) * factor); + TQ_INT32 fromBin = static_cast<TQ_INT32>((from - m_producer->viewFrom()) * factor); + TQ_INT32 toBin = fromBin + static_cast<TQ_INT32>((to - from) * factor); // Min, max, count, low, high - for (Q_INT32 i = fromBin; i < toBin; i++) { + for (TQ_INT32 i = fromBin; i < toBin; i++) { current = m_producer->getBinAt(channel, i); double pos = static_cast<double>(i) / factor + from; if (current > high) @@ -194,22 +194,22 @@ void KisHistogram::dump() { /* for( int i = 0; i <256; ++i ) { kdDebug(DBG_AREA_MATH) << "Value " - << QString().setNum(i) + << TQString().setNum(i) << ": " - << QString().setNum(m_values[i]) + << TQString().setNum(m_values[i]) << "\n"; }*/ kdDebug(DBG_AREA_MATH) << "\n"; - kdDebug(DBG_AREA_MATH) << "Max: " << QString().setNum(c.getMax()) << "\n"; - kdDebug(DBG_AREA_MATH) << "Min: " << QString().setNum(c.getMin()) << "\n"; - kdDebug(DBG_AREA_MATH) << "High: " << QString().setNum(c.getHighest()) << "\n"; - kdDebug(DBG_AREA_MATH) << "Low: " << QString().setNum(c.getLowest()) << "\n"; + kdDebug(DBG_AREA_MATH) << "Max: " << TQString().setNum(c.getMax()) << "\n"; + kdDebug(DBG_AREA_MATH) << "Min: " << TQString().setNum(c.getMin()) << "\n"; + kdDebug(DBG_AREA_MATH) << "High: " << TQString().setNum(c.getHighest()) << "\n"; + kdDebug(DBG_AREA_MATH) << "Low: " << TQString().setNum(c.getLowest()) << "\n"; kdDebug(DBG_AREA_MATH) << "Mean: " << m_producer->positionToString(c.getMean()) << "\n"; - kdDebug(DBG_AREA_MATH) << "Total: " << QString().setNum(c.getTotal()) << "\n"; -// kdDebug(DBG_AREA_MATH) << "Median: " << QString().setNum(m_median) << "\n"; -// kdDebug(DBG_AREA_MATH) << "Stddev: " << QString().setNum(m_stddev) << "\n"; -// kdDebug(DBG_AREA_MATH) << "percentile: " << QString().setNum(m_percentile) << "\n"; + kdDebug(DBG_AREA_MATH) << "Total: " << TQString().setNum(c.getTotal()) << "\n"; +// kdDebug(DBG_AREA_MATH) << "Median: " << TQString().setNum(m_median) << "\n"; +// kdDebug(DBG_AREA_MATH) << "Stddev: " << TQString().setNum(m_stddev) << "\n"; +// kdDebug(DBG_AREA_MATH) << "percentile: " << TQString().setNum(m_percentile) << "\n"; kdDebug(DBG_AREA_MATH) << "\n"; } diff --git a/krita/core/kis_histogram.h b/krita/core/kis_histogram.h index 3365bde1..3d315994 100644 --- a/krita/core/kis_histogram.h +++ b/krita/core/kis_histogram.h @@ -51,7 +51,7 @@ public: double m_max, m_min, m_mean, m_total, m_median, m_stddev; - Q_UINT32 m_high, m_low, m_count; + TQ_UINT32 m_high, m_low, m_count; friend class KisHistogram; @@ -70,18 +70,18 @@ public: */ inline double getMin() { return m_min; } /// This function return the highest value of the histogram - inline Q_UINT32 getHighest() { return m_high; } + inline TQ_UINT32 getHighest() { return m_high; } /// This function return the lowest value of the histogram - inline Q_UINT32 getLowest() { return m_low; } + inline TQ_UINT32 getLowest() { return m_low; } /// This function return the mean of value of the histogram inline double getMean() { return m_mean; } //double getMedian() { return m_median; } //double getStandardDeviation() { return m_stddev; } /// This function return the number of pixels used by the histogram - inline Q_UINT32 getCount() { return m_count; } + inline TQ_UINT32 getCount() { return m_count; } /** The sum of (the contents of every bin * the double value of that bin)*/ inline double getTotal() { return m_total; } - //Q_UINT8 getPercentile() { return m_percentile; } // What is this exactly? XXX + //TQ_UINT8 getPercentile() { return m_percentile; } // What is this exactly? XXX }; KisHistogram(KisPaintLayerSP layer, @@ -108,14 +108,14 @@ public: /** The information on the current selection for the current channel */ Calculations selectionCalculations(); - inline Q_UINT32 getValue(Q_UINT8 i) { return m_producer->getBinAt(m_channel, i); } + inline TQ_UINT32 getValue(TQ_UINT8 i) { return m_producer->getBinAt(m_channel, i); } inline enumHistogramType getHistogramType() { return m_type; } inline void setHistogramType(enumHistogramType type) { m_type = type; } inline void setProducer(KisHistogramProducerSP producer) { m_producer = producer; } - inline void setChannel(Q_INT32 channel) { m_channel = channel; } + inline void setChannel(TQ_INT32 channel) { m_channel = channel; } inline KisHistogramProducerSP producer() { return m_producer; } - inline Q_INT32 channel() { return m_channel; } + inline TQ_INT32 channel() { return m_channel; } inline bool hasSelection() { return m_selection; } inline double selectionFrom() { return m_selFrom; } @@ -129,7 +129,7 @@ public: private: // Dump the histogram to debug. void dump(); - QValueVector<Calculations> calculateForRange(double from, double to); + TQValueVector<Calculations> calculateForRange(double from, double to); Calculations calculateSingleRange(int channel, double from, double to); KisPaintDeviceSP m_device; @@ -137,13 +137,13 @@ private: enumHistogramType m_type; - Q_INT32 m_channel; + TQ_INT32 m_channel; double m_selFrom, m_selTo; bool m_selection; KisPaintDeviceSP m_dev; - QValueVector<Calculations> m_completeCalculations, m_selectionCalculations; + TQValueVector<Calculations> m_completeCalculations, m_selectionCalculations; }; diff --git a/krita/core/kis_image.cc b/krita/core/kis_image.cc index 2c56b606..30f3ad36 100644 --- a/krita/core/kis_image.cc +++ b/krita/core/kis_image.cc @@ -22,13 +22,13 @@ #include <config.h> #include LCMS_HEADER -#include <qimage.h> -#include <qpainter.h> -#include <qsize.h> -#include <qtl.h> -#include <qapplication.h> -#include <qthread.h> -#include <qdatetime.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqsize.h> +#include <tqtl.h> +#include <tqapplication.h> +#include <tqthread.h> +#include <tqdatetime.h> #include <kcommand.h> #include <kdebug.h> @@ -74,7 +74,7 @@ class KisImage::KisImagePrivate { public: KisColor backgroundColor; - Q_UINT32 lockCount; + TQ_UINT32 lockCount; bool sizeChangedWhileLocked; bool selectionChangedWhileLocked; KisSubstrateSP substrate; @@ -90,15 +90,15 @@ namespace { public: KisResizeImageCmd(KisUndoAdapter *adapter, KisImageSP img, - Q_INT32 width, - Q_INT32 height, - Q_INT32 oldWidth, - Q_INT32 oldHeight) : super(i18n("Resize Image")) + TQ_INT32 width, + TQ_INT32 height, + TQ_INT32 oldWidth, + TQ_INT32 oldHeight) : super(i18n("Resize Image")) { m_adapter = adapter; m_img = img; - m_before = QSize(oldWidth, oldHeight); - m_after = QSize(width, height); + m_before = TQSize(oldWidth, oldHeight); + m_after = TQSize(width, height); } virtual ~KisResizeImageCmd() @@ -123,8 +123,8 @@ namespace { private: KisUndoAdapter *m_adapter; KisImageSP m_img; - QSize m_before; - QSize m_after; + TQSize m_before; + TQSize m_after; }; // ------------------------------------------------------- @@ -134,7 +134,7 @@ namespace { public: KisChangeLayersCmd(KisUndoAdapter *adapter, KisImageSP img, - KisGroupLayerSP oldRootLayer, KisGroupLayerSP newRootLayer, const QString& name) + KisGroupLayerSP oldRootLayer, KisGroupLayerSP newRootLayer, const TQString& name) : super(name) { m_adapter = adapter; @@ -227,7 +227,7 @@ namespace { typedef KNamedCommand super; public: - KisImageCommand(const QString& name, KisImageSP image); + KisImageCommand(const TQString& name, KisImageSP image); virtual ~KisImageCommand() {} virtual void execute() = 0; @@ -239,7 +239,7 @@ namespace { KisImageSP m_image; }; - KisImageCommand::KisImageCommand(const QString& name, KisImageSP image) : + KisImageCommand::KisImageCommand(const TQString& name, KisImageSP image) : super(name), m_image(image) { } @@ -258,12 +258,12 @@ namespace { typedef KisImageCommand super; public: - KisLayerPositionCommand(const QString& name, KisImageSP image, KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP aboveThis) : super(name, image) + KisLayerPositionCommand(const TQString& name, KisImageSP image, KisLayerSP layer, KisGroupLayerSP tqparent, KisLayerSP aboveThis) : super(name, image) { m_layer = layer; - m_oldParent = layer->parent(); + m_oldParent = layer->tqparent(); m_oldAboveThis = layer->nextSibling(); - m_newParent = parent; + m_newParent = tqparent; m_newAboveThis = aboveThis; } @@ -300,7 +300,7 @@ namespace { { m_img = img; m_layer = layer; - m_parent = layer->parent(); + m_parent = layer->tqparent(); m_aboveThis = layer->nextSibling(); } @@ -385,7 +385,7 @@ namespace { m_layer = layer; m_prevParent = wasParent; m_prevAbove = wasAbove; - m_newParent = layer->parent(); + m_newParent = layer->tqparent(); m_newAbove = layer->nextSibling(); } @@ -427,8 +427,8 @@ namespace { LayerPropsCmd(KisLayerSP layer, KisImageSP img, KisUndoAdapter *adapter, - const QString& name, - Q_INT32 opacity, + const TQString& name, + TQ_INT32 opacity, const KisCompositeOp& compositeOp) : super(i18n("Layer Property Changes")) { m_layer = layer; @@ -446,8 +446,8 @@ namespace { public: virtual void execute() { - QString name = m_layer->name(); - Q_INT32 opacity = m_layer->opacity(); + TQString name = m_layer->name(); + TQ_INT32 opacity = m_layer->opacity(); KisCompositeOp compositeOp = m_layer->compositeOp(); m_adapter->setUndo(false); @@ -471,8 +471,8 @@ namespace { KisUndoAdapter *m_adapter; KisLayerSP m_layer; KisImageSP m_img; - QString m_name; - Q_INT32 m_opacity; + TQString m_name; + TQ_INT32 m_opacity; KisCompositeOp m_compositeOp; }; @@ -516,22 +516,22 @@ namespace { }; } -KisImage::KisImage(KisUndoAdapter *adapter, Q_INT32 width, Q_INT32 height, KisColorSpace * colorSpace, const QString& name) - : QObject(0, name.latin1()), KShared() +KisImage::KisImage(KisUndoAdapter *adapter, TQ_INT32 width, TQ_INT32 height, KisColorSpace * colorSpace, const TQString& name) + : TQObject(0, name.latin1()), KShared() { init(adapter, width, height, colorSpace, name); setName(name); m_dcop = 0L; } -KisImage::KisImage(const KisImage& rhs) : QObject(), KShared(rhs) +KisImage::KisImage(const KisImage& rhs) : TQObject(), KShared(rhs) { m_dcop = 0L; if (this != &rhs) { m_private = new KisImagePrivate(*rhs.m_private); m_private->perspectiveGrid = new KisPerspectiveGrid(*rhs.m_private->perspectiveGrid); m_uri = rhs.m_uri; - m_name = QString::null; + m_name = TQString(); m_width = rhs.m_width; m_height = rhs.m_height; m_xres = rhs.m_xres; @@ -545,7 +545,7 @@ KisImage::KisImage(const KisImage& rhs) : QObject(), KShared(rhs) Q_CHECK_PTR(m_bkg); m_rootLayer = static_cast<KisGroupLayer*>(rhs.m_rootLayer->clone().data()); - connect(m_rootLayer, SIGNAL(sigDirty(QRect)), this, SIGNAL(sigImageUpdated(QRect))); + connect(m_rootLayer, TQT_SIGNAL(sigDirty(TQRect)), this, TQT_SIGNAL(sigImageUpdated(TQRect))); m_annotations = rhs.m_annotations; // XXX the annotations would probably need to be deep-copied @@ -558,7 +558,7 @@ KisImage::KisImage(const KisImage& rhs) : QObject(), KShared(rhs) m_rootLayer->setImage(this); // Set the active paint layer if(rhs.activeLayer() != NULL) { - QString layerName = rhs.activeLayer()->name(); + TQString layerName = rhs.activeLayer()->name(); // kdDebug(12345) << "KisImage::KisImage: active layer = " << layerName << "\n"; KisLayerSP activeLayer = rootLayer()->findLayer(layerName); Q_ASSERT(activeLayer); @@ -588,23 +588,23 @@ KisImage::~KisImage() delete m_dcop; } -QString KisImage::name() const +TQString KisImage::name() const { return m_name; } -void KisImage::setName(const QString& name) +void KisImage::setName(const TQString& name) { if (!name.isEmpty()) m_name = name; } -QString KisImage::description() const +TQString KisImage::description() const { return m_description; } -void KisImage::setDescription(const QString& description) +void KisImage::setDescription(const TQString& description) { if (!description.isEmpty()) m_description = description; @@ -622,7 +622,7 @@ void KisImage::setBackgroundColor(const KisColor & color) } -QString KisImage::nextLayerName() const +TQString KisImage::nextLayerName() const { if (m_nserver->currentSeed() == 0) { m_nserver->number(); @@ -637,7 +637,7 @@ void KisImage::rollBackLayerName() m_nserver->rollback(); } -void KisImage::init(KisUndoAdapter *adapter, Q_INT32 width, Q_INT32 height, KisColorSpace * colorSpace, const QString& name) +void KisImage::init(KisUndoAdapter *adapter, TQ_INT32 width, TQ_INT32 height, KisColorSpace * colorSpace, const TQString& name) { Q_ASSERT(colorSpace); @@ -647,7 +647,7 @@ void KisImage::init(KisUndoAdapter *adapter, Q_INT32 width, Q_INT32 height, Kis } m_private = new KisImagePrivate(); - m_private->backgroundColor = KisColor(Qt::white, colorSpace); + m_private->backgroundColor = KisColor(TQt::white, colorSpace); m_private->lockCount = 0; m_private->sizeChangedWhileLocked = false; m_private->selectionChangedWhileLocked = false; @@ -663,7 +663,7 @@ void KisImage::init(KisUndoAdapter *adapter, Q_INT32 width, Q_INT32 height, Kis m_bkg = new KisBackground(); m_rootLayer = new KisGroupLayer(this,"root", OPACITY_OPAQUE); - connect(m_rootLayer, SIGNAL(sigDirty(QRect)), this, SIGNAL(sigImageUpdated(QRect))); + connect(m_rootLayer, TQT_SIGNAL(sigDirty(TQRect)), this, TQT_SIGNAL(sigImageUpdated(TQRect))); m_xres = 1.0; m_yres = 1.0; @@ -681,7 +681,7 @@ bool KisImage::locked() const void KisImage::lock() { if (!locked()) { - if (m_rootLayer) disconnect(m_rootLayer, SIGNAL(sigDirty(QRect)), this, SIGNAL(sigImageUpdated(QRect))); + if (m_rootLayer) disconnect(m_rootLayer, TQT_SIGNAL(sigDirty(TQRect)), this, TQT_SIGNAL(sigImageUpdated(TQRect))); m_private->sizeChangedWhileLocked = false; m_private->selectionChangedWhileLocked = false; } @@ -707,7 +707,7 @@ void KisImage::unlock() emit sigActiveSelectionChanged(this); } - if (m_rootLayer) connect(m_rootLayer, SIGNAL(sigDirty(QRect)), this, SIGNAL(sigImageUpdated(QRect))); + if (m_rootLayer) connect(m_rootLayer, TQT_SIGNAL(sigDirty(TQRect)), this, TQT_SIGNAL(sigImageUpdated(TQRect))); } } } @@ -721,12 +721,12 @@ void KisImage::emitSizeChanged() } } -void KisImage::notifyLayerUpdated(KisLayerSP layer, QRect rc) +void KisImage::notifyLayerUpdated(KisLayerSP layer, TQRect rc) { emit sigLayerUpdated(layer, rc); } -void KisImage::resize(Q_INT32 w, Q_INT32 h, Q_INT32 x, Q_INT32 y, bool cropLayers) +void KisImage::resize(TQ_INT32 w, TQ_INT32 h, TQ_INT32 x, TQ_INT32 y, bool cropLayers) { if (w != width() || h != height()) { @@ -746,7 +746,7 @@ void KisImage::resize(Q_INT32 w, Q_INT32 h, Q_INT32 x, Q_INT32 y, bool cropLayer m_height = h; if (cropLayers) { - KisCropVisitor v(QRect(x, y, w, h)); + KisCropVisitor v(TQRect(x, y, w, h)); m_rootLayer->accept(v); } @@ -761,7 +761,7 @@ void KisImage::resize(Q_INT32 w, Q_INT32 h, Q_INT32 x, Q_INT32 y, bool cropLayer } } -void KisImage::resize(const QRect& rc, bool cropLayers) +void KisImage::resize(const TQRect& rc, bool cropLayers) { resize(rc.width(), rc.height(), rc.x(), rc.y(), cropLayers); } @@ -772,9 +772,9 @@ void KisImage::scale(double sx, double sy, KisProgressDisplayInterface *progress if (nlayers() == 0) return; // Nothing to scale // New image size. XXX: Pass along to discourage rounding errors? - Q_INT32 w, h; - w = (Q_INT32)(( width() * sx) + 0.5); - h = (Q_INT32)(( height() * sy) + 0.5); + TQ_INT32 w, h; + w = (TQ_INT32)(( width() * sx) + 0.5); + h = (TQ_INT32)(( height() * sy) + 0.5); if (w != width() || h != height()) { @@ -819,12 +819,12 @@ void KisImage::rotate(double radians, KisProgressDisplayInterface *progress) { lock(); - Q_INT32 w = width(); - Q_INT32 h = height(); - Q_INT32 tx = Q_INT32((w*cos(radians) - h*sin(radians) - w) / 2 + 0.5); - Q_INT32 ty = Q_INT32((h*cos(radians) + w*sin(radians) - h) / 2 + 0.5); - w = (Q_INT32)(width()*QABS(cos(radians)) + height()*QABS(sin(radians)) + 0.5); - h = (Q_INT32)(height()*QABS(cos(radians)) + width()*QABS(sin(radians)) + 0.5); + TQ_INT32 w = width(); + TQ_INT32 h = height(); + TQ_INT32 tx = TQ_INT32((w*cos(radians) - h*sin(radians) - w) / 2 + 0.5); + TQ_INT32 ty = TQ_INT32((h*cos(radians) + w*sin(radians) - h) / 2 + 0.5); + w = (TQ_INT32)(width()*TQABS(cos(radians)) + height()*TQABS(sin(radians)) + 0.5); + h = (TQ_INT32)(height()*TQABS(cos(radians)) + width()*TQABS(sin(radians)) + 0.5); tx -= (w - width()) / 2; ty -= (h - height()) / 2; @@ -858,23 +858,23 @@ void KisImage::shear(double angleX, double angleY, KisProgressDisplayInterface * const double pi=3.1415926535897932385; //new image size - Q_INT32 w=width(); - Q_INT32 h=height(); + TQ_INT32 w=width(); + TQ_INT32 h=height(); if(angleX != 0 || angleY != 0){ - double deltaY=height()*QABS(tan(angleX*pi/180)*tan(angleY*pi/180)); - w = (Q_INT32) ( width() + QABS(height()*tan(angleX*pi/180)) ); + double deltaY=height()*TQABS(tan(angleX*pi/180)*tan(angleY*pi/180)); + w = (TQ_INT32) ( width() + TQABS(height()*tan(angleX*pi/180)) ); //ugly fix for the problem of having two extra pixels if only a shear along one //axis is done. This has to be fixed in the cropping code in KisRotateVisitor! if (angleX == 0 || angleY == 0) - h = (Q_INT32) ( height() + QABS(w*tan(angleY*pi/180)) ); + h = (TQ_INT32) ( height() + TQABS(w*tan(angleY*pi/180)) ); else if (angleX > 0 && angleY > 0) - h = (Q_INT32) ( height() + QABS(w*tan(angleY*pi/180))- 2 * deltaY + 2 ); + h = (TQ_INT32) ( height() + TQABS(w*tan(angleY*pi/180))- 2 * deltaY + 2 ); else if (angleX < 0 && angleY < 0) - h = (Q_INT32) ( height() + QABS(w*tan(angleY*pi/180))- 2 * deltaY + 2 ); + h = (TQ_INT32) ( height() + TQABS(w*tan(angleY*pi/180))- 2 * deltaY + 2 ); else - h = (Q_INT32) ( height() + QABS(w*tan(angleY*pi/180)) ); + h = (TQ_INT32) ( height() + TQABS(w*tan(angleY*pi/180)) ); } if (w != width() || h != height()) { @@ -906,7 +906,7 @@ void KisImage::shear(double angleX, double angleY, KisProgressDisplayInterface * } } -void KisImage::convertTo(KisColorSpace * dstColorSpace, Q_INT32 renderingIntent) +void KisImage::convertTo(KisColorSpace * dstColorSpace, TQ_INT32 renderingIntent) { if ( m_colorSpace == dstColorSpace ) { @@ -982,12 +982,12 @@ void KisImage::setResolution(double xres, double yres) m_yres = yres; } -Q_INT32 KisImage::width() const +TQ_INT32 KisImage::width() const { return m_width; } -Q_INT32 KisImage::height() const +TQ_INT32 KisImage::height() const { return m_height; } @@ -1034,7 +1034,7 @@ KisPaintDeviceSP KisImage::activeDevice() return 0; } -KisLayerSP KisImage::newLayer(const QString& name, Q_UINT8 opacity, const KisCompositeOp& compositeOp, KisColorSpace * colorstrategy) +KisLayerSP KisImage::newLayer(const TQString& name, TQ_UINT8 opacity, const KisCompositeOp& compositeOp, KisColorSpace * colorstrategy) { KisPaintLayer * layer; if (colorstrategy) @@ -1048,7 +1048,7 @@ KisLayerSP KisImage::newLayer(const QString& name, Q_UINT8 opacity, const KisCom layer->setVisible(true); if (m_activeLayer != 0) { - addLayer(layer, m_activeLayer->parent().data(), m_activeLayer->nextSibling()); + addLayer(layer, m_activeLayer->tqparent().data(), m_activeLayer->nextSibling()); } else { addLayer(layer, m_rootLayer, 0); @@ -1058,12 +1058,12 @@ KisLayerSP KisImage::newLayer(const QString& name, Q_UINT8 opacity, const KisCom return layer; } -void KisImage::setLayerProperties(KisLayerSP layer, Q_UINT8 opacity, const KisCompositeOp& compositeOp, const QString& name) +void KisImage::setLayerProperties(KisLayerSP layer, TQ_UINT8 opacity, const KisCompositeOp& compositeOp, const TQString& name) { if (layer && (layer->opacity() != opacity || layer->compositeOp() != compositeOp || layer->name() != name)) { if (undo()) { - QString oldname = layer->name(); - Q_INT32 oldopacity = layer->opacity(); + TQString oldname = layer->name(); + TQ_INT32 oldopacity = layer->opacity(); KisCompositeOp oldCompositeOp = layer->compositeOp(); layer->setName(name); layer->setOpacity(opacity); @@ -1089,7 +1089,7 @@ KisLayerSP KisImage::activeLayer() const KisPaintDeviceSP KisImage::projection() { - return m_rootLayer->projection(QRect(0, 0, m_width, m_height)); + return m_rootLayer->projection(TQRect(0, 0, m_width, m_height)); } KisLayerSP KisImage::activate(KisLayerSP layer) @@ -1105,7 +1105,7 @@ KisLayerSP KisImage::activate(KisLayerSP layer) return layer; } -KisLayerSP KisImage::findLayer(const QString& name) const +KisLayerSP KisImage::findLayer(const TQString& name) const { return rootLayer()->findLayer(name); } @@ -1116,30 +1116,30 @@ KisLayerSP KisImage::findLayer(int id) const } -bool KisImage::addLayer(KisLayerSP layer, KisGroupLayerSP parent) +bool KisImage::addLayer(KisLayerSP layer, KisGroupLayerSP tqparent) { - return addLayer(layer, parent, parent->firstChild()); + return addLayer(layer, tqparent, tqparent->firstChild()); } -bool KisImage::addLayer(KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP aboveThis) +bool KisImage::addLayer(KisLayerSP layer, KisGroupLayerSP tqparent, KisLayerSP aboveThis) { - if (!parent) + if (!tqparent) return false; - const bool success = parent->addLayer(layer, aboveThis); + const bool success = tqparent->addLayer(layer, aboveThis); if (success) { KisPaintLayerSP player = dynamic_cast<KisPaintLayer*>(layer.data()); if (player != 0) { // XXX: This should also be done whenever a layer grows! - QValueVector<KisPaintDeviceAction *> actions = KisMetaRegistry::instance() -> + TQValueVector<KisPaintDeviceAction *> actions = KisMetaRegistry::instance() -> csRegistry()->paintDeviceActionsFor(player->paintDevice()->colorSpace()); for (uint i = 0; i < actions.count(); i++) { actions.at(i)->act(player.data()->paintDevice(), width(), height()); } - connect(player, SIGNAL(sigMaskInfoChanged()), this, SIGNAL(sigMaskInfoChanged())); + connect(player, TQT_SIGNAL(sigMaskInfoChanged()), this, TQT_SIGNAL(sigMaskInfoChanged())); } if (layer->extent().isValid()) layer->setDirty(); @@ -1163,12 +1163,12 @@ bool KisImage::removeLayer(KisLayerSP layer) if (!layer || layer->image() != this) return false; - if (KisGroupLayerSP parent = layer->parent()) { + if (KisGroupLayerSP tqparent = layer->tqparent()) { // Adjustment layers should mark the layers underneath them, whose rendering // they have cached, diryt on removal. Otherwise, the group won't be re-rendered. KisAdjustmentLayer * al = dynamic_cast<KisAdjustmentLayer*>(layer.data()); if (al) { - QRect r = al->extent(); + TQRect r = al->extent(); lock(); // Lock the image, because we are going to dirty a lot of layers KisLayerSP l = layer->nextSibling(); while (l) { @@ -1181,11 +1181,11 @@ bool KisImage::removeLayer(KisLayerSP layer) } KisPaintLayerSP player = dynamic_cast<KisPaintLayer*>(layer.data()); if (player != 0) { - disconnect(player, SIGNAL(sigMaskInfoChanged()), - this, SIGNAL(sigMaskInfoChanged())); + disconnect(player, TQT_SIGNAL(sigMaskInfoChanged()), + this, TQT_SIGNAL(sigMaskInfoChanged())); } KisLayerSP l = layer->prevSibling(); - QRect r = layer->extent(); + TQRect r = layer->extent(); while (l) { l->setDirty(r, false); l = l->prevSibling(); @@ -1196,21 +1196,21 @@ bool KisImage::removeLayer(KisLayerSP layer) const bool wasActive = layer == activeLayer(); // sigLayerRemoved can set it to 0, we don't want that in the else of wasActive! KisLayerSP actLayer = activeLayer(); - const bool success = parent->removeLayer(layer); + const bool success = tqparent->removeLayer(layer); if (success) { layer->setImage(0); if (!layer->temporary() && undo()) { - m_adapter->addCommand(new LayerRmCmd(m_adapter, this, layer, parent, wasAbove)); + m_adapter->addCommand(new LayerRmCmd(m_adapter, this, layer, tqparent, wasAbove)); } if (!layer->temporary()) { - emit sigLayerRemoved(layer, parent, wasAbove); + emit sigLayerRemoved(layer, tqparent, wasAbove); if (wasActive) { if (wasBelow) activate(wasBelow); else if (wasAbove) activate(wasAbove); - else if (parent != rootLayer()) - activate(parent.data()); + else if (tqparent != rootLayer()) + activate(tqparent.data()); else activate(rootLayer()->firstChild()); } else { @@ -1228,7 +1228,7 @@ bool KisImage::raiseLayer(KisLayerSP layer) { if (!layer) return false; - return moveLayer(layer, layer->parent().data(), layer->prevSibling()); + return moveLayer(layer, layer->tqparent().data(), layer->prevSibling()); } bool KisImage::lowerLayer(KisLayerSP layer) @@ -1236,7 +1236,7 @@ bool KisImage::lowerLayer(KisLayerSP layer) if (!layer) return false; if (KisLayerSP next = layer->nextSibling()) - return moveLayer(layer, layer->parent().data(), next->nextSibling()); + return moveLayer(layer, layer->tqparent().data(), next->nextSibling()); return false; } @@ -1254,15 +1254,15 @@ bool KisImage::toBottom(KisLayerSP layer) return moveLayer(layer, rootLayer(), 0); } -bool KisImage::moveLayer(KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP aboveThis) +bool KisImage::moveLayer(KisLayerSP layer, KisGroupLayerSP tqparent, KisLayerSP aboveThis) { - if (!parent) + if (!tqparent) return false; - KisGroupLayerSP wasParent = layer->parent(); + KisGroupLayerSP wasParent = layer->tqparent(); KisLayerSP wasAbove = layer->nextSibling(); - if (wasParent.data() == parent.data() && wasAbove.data() == aboveThis.data()) + if (wasParent.data() == tqparent.data() && wasAbove.data() == aboveThis.data()) return false; lock(); @@ -1272,7 +1272,7 @@ bool KisImage::moveLayer(KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP ab return false; } - const bool success = parent->addLayer(layer, aboveThis); + const bool success = tqparent->addLayer(layer, aboveThis); layer->setDirty(); @@ -1294,12 +1294,12 @@ bool KisImage::moveLayer(KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP ab return success; } -Q_INT32 KisImage::nlayers() const +TQ_INT32 KisImage::nlayers() const { return rootLayer()->numLayers() - 1; } -Q_INT32 KisImage::nHiddenLayers() const +TQ_INT32 KisImage::nHiddenLayers() const { return rootLayer()->numLayers(KisLayer::Hidden); } @@ -1307,18 +1307,18 @@ Q_INT32 KisImage::nHiddenLayers() const void KisImage::flatten() { KisGroupLayerSP oldRootLayer = m_rootLayer; - disconnect(oldRootLayer, SIGNAL(sigDirty(QRect)), this, SIGNAL(sigImageUpdated(QRect))); + disconnect(oldRootLayer, TQT_SIGNAL(sigDirty(TQRect)), this, TQT_SIGNAL(sigImageUpdated(TQRect))); KisPaintLayer *dst = new KisPaintLayer(this, nextLayerName(), OPACITY_OPAQUE, colorSpace()); Q_CHECK_PTR(dst); - QRect rc = mergedImage()->extent(); + TQRect rc = mergedImage()->extent(); KisPainter gc(dst->paintDevice()); gc.bitBlt(rc.x(), rc.y(), COMPOSITE_COPY, mergedImage(), OPACITY_OPAQUE, rc.left(), rc.top(), rc.width(), rc.height()); m_rootLayer = new KisGroupLayer(this, "", OPACITY_OPAQUE); - connect(m_rootLayer, SIGNAL(sigDirty(QRect)), this, SIGNAL(sigImageUpdated(QRect))); + connect(m_rootLayer, TQT_SIGNAL(sigDirty(TQRect)), this, TQT_SIGNAL(sigImageUpdated(TQRect))); if (undo()) { m_adapter->beginMacro(i18n("Flatten Image")); @@ -1347,7 +1347,7 @@ void KisImage::mergeLayer(KisLayerSP layer) KisPaintLayer *player = new KisPaintLayer(this, layer->name(), OPACITY_OPAQUE, colorSpace()); Q_CHECK_PTR(player); - QRect rc = layer->extent() | layer->nextSibling()->extent(); + TQRect rc = layer->extent() | layer->nextSibling()->extent(); undoAdapter()->beginMacro(i18n("Merge with Layer Below")); @@ -1357,7 +1357,7 @@ void KisImage::mergeLayer(KisLayerSP layer) layer->accept(visitor); removeLayer(layer->nextSibling()); - addLayer(player, layer->parent(), layer); + addLayer(player, layer->tqparent(), layer); removeLayer(layer); undoAdapter()->endMacro(); @@ -1369,20 +1369,20 @@ void KisImage::setModified() emit sigImageModified(); } -void KisImage::renderToPainter(Q_INT32 x1, - Q_INT32 y1, - Q_INT32 x2, - Q_INT32 y2, - QPainter &painter, +void KisImage::renderToPainter(TQ_INT32 x1, + TQ_INT32 y1, + TQ_INT32 x2, + TQ_INT32 y2, + TQPainter &painter, KisProfile * monitorProfile, PaintFlags paintFlags, float exposure) { - QImage img = convertToQImage(x1, y1, x2, y2, monitorProfile, exposure); + TQImage img = convertToTQImage(x1, y1, x2, y2, monitorProfile, exposure); - Q_INT32 w = x2 - x1 + 1; - Q_INT32 h = y2 - y1 + 1; + TQ_INT32 w = x2 - x1 + 1; + TQ_INT32 h = y2 - y1 + 1; if (paintFlags & PAINT_BACKGROUND) { @@ -1405,18 +1405,18 @@ void KisImage::renderToPainter(Q_INT32 x1, painter.drawImage(x1, y1, img, 0, 0, w, h); } -QImage KisImage::convertToQImage(Q_INT32 x1, - Q_INT32 y1, - Q_INT32 x2, - Q_INT32 y2, +TQImage KisImage::convertToTQImage(TQ_INT32 x1, + TQ_INT32 y1, + TQ_INT32 x2, + TQ_INT32 y2, KisProfile * profile, float exposure) { - Q_INT32 w = x2 - x1 + 1; - Q_INT32 h = y2 - y1 + 1; + TQ_INT32 w = x2 - x1 + 1; + TQ_INT32 h = y2 - y1 + 1; - KisPaintDeviceSP dev = m_rootLayer->projection(QRect(x1, y1, w, h)); - QImage img = dev->convertToQImage(profile, x1, y1, w, h, exposure); + KisPaintDeviceSP dev = m_rootLayer->projection(TQRect(x1, y1, w, h)); + TQImage img = dev->convertToTQImage(profile, x1, y1, w, h, exposure); if (!img.isNull()) { @@ -1439,24 +1439,24 @@ QImage KisImage::convertToQImage(Q_INT32 x1, return img; } - return QImage(); + return TQImage(); } -QImage KisImage::convertToQImage(const QRect& r, const QSize& scaledImageSize, KisProfile *profile, PaintFlags paintFlags, float exposure) +TQImage KisImage::convertToTQImage(const TQRect& r, const TQSize& scaledImageSize, KisProfile *profile, PaintFlags paintFlags, float exposure) { if (r.isEmpty() || scaledImageSize.isEmpty()) { - return QImage(); + return TQImage(); } - Q_INT32 imageWidth = width(); - Q_INT32 imageHeight = height(); - Q_UINT32 pixelSize = colorSpace()->pixelSize(); + TQ_INT32 imageWidth = width(); + TQ_INT32 imageHeight = height(); + TQ_UINT32 pixelSize = colorSpace()->pixelSize(); double xScale = static_cast<double>(imageWidth) / scaledImageSize.width(); double yScale = static_cast<double>(imageHeight) / scaledImageSize.height(); - QRect srcRect; + TQRect srcRect; srcRect.setLeft(static_cast<int>(r.left() * xScale)); srcRect.setRight(static_cast<int>(ceil((r.right() + 1) * xScale)) - 1); @@ -1464,28 +1464,28 @@ QImage KisImage::convertToQImage(const QRect& r, const QSize& scaledImageSize, K srcRect.setBottom(static_cast<int>(ceil((r.bottom() + 1) * yScale)) - 1); KisPaintDeviceSP mergedImage = m_rootLayer->projection(srcRect); - QTime t; + TQTime t; t.start(); - Q_UINT8 *scaledImageData = new Q_UINT8[r.width() * r.height() * pixelSize]; + TQ_UINT8 *scaledImageData = new TQ_UINT8[r.width() * r.height() * pixelSize]; - Q_UINT8 *imageRow = new Q_UINT8[srcRect.width() * pixelSize]; - const Q_INT32 imageRowX = srcRect.x(); + TQ_UINT8 *imageRow = new TQ_UINT8[srcRect.width() * pixelSize]; + const TQ_INT32 imageRowX = srcRect.x(); - for (Q_INT32 y = 0; y < r.height(); ++y) { + for (TQ_INT32 y = 0; y < r.height(); ++y) { - Q_INT32 dstY = r.y() + y; - Q_INT32 dstX = r.x(); - Q_INT32 srcY = (dstY * imageHeight) / scaledImageSize.height(); + TQ_INT32 dstY = r.y() + y; + TQ_INT32 dstX = r.x(); + TQ_INT32 srcY = (dstY * imageHeight) / scaledImageSize.height(); mergedImage->readBytes(imageRow, imageRowX, srcY, srcRect.width(), 1); - Q_UINT8 *dstPixel = scaledImageData + (y * r.width() * pixelSize); - Q_UINT32 columnsRemaining = r.width(); + TQ_UINT8 *dstPixel = scaledImageData + (y * r.width() * pixelSize); + TQ_UINT32 columnsRemaining = r.width(); while (columnsRemaining > 0) { - Q_INT32 srcX = (dstX * imageWidth) / scaledImageSize.width(); + TQ_INT32 srcX = (dstX * imageWidth) / scaledImageSize.width(); memcpy(dstPixel, imageRow + ((srcX - imageRowX) * pixelSize), pixelSize); @@ -1498,7 +1498,7 @@ QImage KisImage::convertToQImage(const QRect& r, const QSize& scaledImageSize, K delete [] imageRow; - QImage image = colorSpace()->convertToQImage(scaledImageData, r.width(), r.height(), profile, INTENT_PERCEPTUAL, exposure); + TQImage image = colorSpace()->convertToTQImage(scaledImageData, r.width(), r.height(), profile, INTENT_PERCEPTUAL, exposure); delete [] scaledImageData; #ifdef __BIG_ENDIAN__ @@ -1518,13 +1518,13 @@ QImage KisImage::convertToQImage(const QRect& r, const QSize& scaledImageSize, K #endif if (paintFlags & PAINT_BACKGROUND) { - m_bkg->paintBackground(image, r, scaledImageSize, QSize(imageWidth, imageHeight)); + m_bkg->paintBackground(image, r, scaledImageSize, TQSize(imageWidth, imageHeight)); image.setAlphaBuffer(false); } if (paintFlags & PAINT_SELECTION) { if (m_activeLayer != 0) { - m_activeLayer->paintSelection(image, r, scaledImageSize, QSize(imageWidth, imageHeight)); + m_activeLayer->paintSelection(image, r, scaledImageSize, TQSize(imageWidth, imageHeight)); } } @@ -1539,12 +1539,12 @@ QImage KisImage::convertToQImage(const QRect& r, const QSize& scaledImageSize, K KisPaintDeviceSP KisImage::mergedImage() { - return m_rootLayer->projection(QRect(0, 0, m_width, m_height)); + return m_rootLayer->projection(TQRect(0, 0, m_width, m_height)); } -KisColor KisImage::mergedPixel(Q_INT32 x, Q_INT32 y) +KisColor KisImage::mergedPixel(TQ_INT32 x, TQ_INT32 y) { - return m_rootLayer->projection(QRect(x, y, 1, 1))->colorAt(x, y); + return m_rootLayer->projection(TQRect(x, y, 1, 1))->colorAt(x, y); } void KisImage::notifyLayersChanged() @@ -1561,9 +1561,9 @@ void KisImage::notifyImageLoaded() { } -QRect KisImage::bounds() const +TQRect KisImage::bounds() const { - return QRect(0, 0, width(), height()); + return TQRect(0, 0, width(), height()); } @@ -1593,9 +1593,9 @@ void KisImage::slotSelectionChanged() slotSelectionChanged(bounds()); } -void KisImage::slotSelectionChanged(const QRect& r) +void KisImage::slotSelectionChanged(const TQRect& r) { - QRect r2(r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2); + TQRect r2(r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2); if (!locked()) { emit sigActiveSelectionChanged(this); @@ -1619,12 +1619,12 @@ void KisImage::setColorSpace(KisColorSpace * colorSpace) void KisImage::setRootLayer(KisGroupLayerSP rootLayer) { - disconnect(m_rootLayer, SIGNAL(sigDirty(QRect)), this, SIGNAL(sigImageUpdated(QRect))); + disconnect(m_rootLayer, TQT_SIGNAL(sigDirty(TQRect)), this, TQT_SIGNAL(sigImageUpdated(TQRect))); m_rootLayer = rootLayer; if (!locked()) { - connect(m_rootLayer, SIGNAL(sigDirty(QRect)), this, SIGNAL(sigImageUpdated(QRect))); + connect(m_rootLayer, TQT_SIGNAL(sigDirty(TQRect)), this, TQT_SIGNAL(sigImageUpdated(TQRect))); } activate(m_rootLayer->firstChild()); } @@ -1643,7 +1643,7 @@ void KisImage::addAnnotation(KisAnnotationSP annotation) m_annotations.push_back(annotation); } -KisAnnotationSP KisImage::annotation(QString type) +KisAnnotationSP KisImage::annotation(TQString type) { vKisAnnotationSP_it it = m_annotations.begin(); while (it != m_annotations.end()) { @@ -1655,7 +1655,7 @@ KisAnnotationSP KisImage::annotation(QString type) return 0; } -void KisImage::removeAnnotation(QString type) +void KisImage::removeAnnotation(TQString type) { vKisAnnotationSP_it it = m_annotations.begin(); while (it != m_annotations.end()) { diff --git a/krita/core/kis_image.h b/krita/core/kis_image.h index fccb2fd3..a3917953 100644 --- a/krita/core/kis_image.h +++ b/krita/core/kis_image.h @@ -19,10 +19,10 @@ #ifndef KIS_IMAGE_H_ #define KIS_IMAGE_H_ -#include <qobject.h> -#include <qstring.h> -#include <qvaluevector.h> -#include <qmutex.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqvaluevector.h> +#include <tqmutex.h> #include <config.h> @@ -58,11 +58,12 @@ class KisProgressDisplayInterface; class KisPaintLayer; class KisPerspectiveGrid; -class KRITACORE_EXPORT KisImage : public QObject, public KShared { +class KRITACORE_EXPORT KisImage : public TQObject, public KShared { Q_OBJECT + TQ_OBJECT public: - KisImage(KisUndoAdapter * adapter, Q_INT32 width, Q_INT32 height, KisColorSpace * colorSpace, const QString& name); + KisImage(KisUndoAdapter * adapter, TQ_INT32 width, TQ_INT32 height, KisColorSpace * colorSpace, const TQString& name); KisImage(const KisImage& rhs); virtual ~KisImage(); virtual DCOPObject *dcopObject(); @@ -78,26 +79,26 @@ public: /// Paint the specified rect onto the painter, adjusting the colors using the /// given profile. The exposure setting is used if the image has a high dynamic range. - virtual void renderToPainter(Q_INT32 x1, - Q_INT32 y1, - Q_INT32 x2, - Q_INT32 y2, - QPainter &painter, + virtual void renderToPainter(TQ_INT32 x1, + TQ_INT32 y1, + TQ_INT32 x2, + TQ_INT32 y2, + TQPainter &painter, KisProfile *profile, PaintFlags paintFlags, float exposure = 0.0f); /** - * Render the projection onto a QImage. In contrast with the above method, the + * Render the projection onto a TQImage. In contrast with the above method, the * selection is not rendered. */ - virtual QImage convertToQImage(Q_INT32 x1, - Q_INT32 y1, - Q_INT32 x2, - Q_INT32 y2, + virtual TQImage convertToTQImage(TQ_INT32 x1, + TQ_INT32 y1, + TQ_INT32 x2, + TQ_INT32 y2, KisProfile * profile, float exposure = 0.0f); - virtual QImage convertToQImage(const QRect& r, const QSize& fullImageSize, KisProfile *profile, PaintFlags paintFlags, float exposure = 0.0f); + virtual TQImage convertToTQImage(const TQRect& r, const TQSize& fullImageSize, KisProfile *profile, PaintFlags paintFlags, float exposure = 0.0f); KisBackgroundSP background() const; KisSubstrateSP substrate() const; @@ -126,17 +127,17 @@ public: KisColor backgroundColor() const; void setBackgroundColor(const KisColor & color); - QString name() const; - void setName(const QString& name); + TQString name() const; + void setName(const TQString& name); - QString description() const; - void setDescription(const QString& description); + TQString description() const; + void setDescription(const TQString& description); - QString nextLayerName() const; + TQString nextLayerName() const; void rollBackLayerName(); KisPerspectiveGrid* perspectiveGrid(); - void createPerspectiveGrid(QPoint topLeft, QPoint topRight, QPoint bottomRight, QPoint bottomLeft); + void createPerspectiveGrid(TQPoint topLeft, TQPoint topRight, TQPoint bottomRight, TQPoint bottomLeft); /** * Resize the image to the specified width and height. The resize * method handles the creating on an undo step itself. @@ -147,7 +148,7 @@ public: * @param y the y position of the crop on all layer if cropLayers is true * @param cropLayers if true, all layers are cropped to the new size. */ - void resize(Q_INT32 w, Q_INT32 h, Q_INT32 x = 0, Q_INT32 y = 0, bool cropLayers = false); + void resize(TQ_INT32 w, TQ_INT32 h, TQ_INT32 x = 0, TQ_INT32 y = 0, bool cropLayers = false); /** * Resize the image to the specified width and height. The resize @@ -156,7 +157,7 @@ public: * @param rc the rect describing the new width and height of the image * @param cropLayers if true, all layers are cropped to the new rect */ - void resize(const QRect& rc, bool cropLayers = false); + void resize(const TQRect& rc, bool cropLayers = false); void scale(double sx, double sy, KisProgressDisplayInterface *m_progress, KisFilterStrategy *filterStrategy); void rotate(double radians, KisProgressDisplayInterface *m_progress); @@ -165,7 +166,7 @@ public: /** * Convert the image and all its layers to the dstColorSpace */ - void convertTo(KisColorSpace * dstColorSpace, Q_INT32 renderingIntent = INTENT_PERCEPTUAL); + void convertTo(KisColorSpace * dstColorSpace, TQ_INT32 renderingIntent = INTENT_PERCEPTUAL); // Get the profile associated with this image KisProfile * getProfile() const; @@ -210,8 +211,8 @@ public: double yRes(); void setResolution(double xres, double yres); - Q_INT32 width() const; - Q_INT32 height() const; + TQ_INT32 width() const; + TQ_INT32 height() const; bool empty() const; @@ -224,16 +225,16 @@ public: /* * Returns the colour of the merged image at pixel (x, y). */ - KisColor mergedPixel(Q_INT32 x, Q_INT32 y); + KisColor mergedPixel(TQ_INT32 x, TQ_INT32 y); /// Creates a new paint layer with the specified properties, adds it to the image, and returns it. - KisLayerSP newLayer(const QString& name, Q_UINT8 opacity, + KisLayerSP newLayer(const TQString& name, TQ_UINT8 opacity, const KisCompositeOp& compositeOp = KisCompositeOp(), KisColorSpace * colorstrategy = 0); /// Get the active painting device. Returns 0 if the active layer does not have a paint device. KisPaintDeviceSP activeDevice(); - void setLayerProperties(KisLayerSP layer, Q_UINT8 opacity, const KisCompositeOp& compositeOp, const QString& name); + void setLayerProperties(KisLayerSP layer, TQ_UINT8 opacity, const KisCompositeOp& compositeOp, const TQString& name); KisGroupLayerSP rootLayer() const; KisLayerSP activeLayer() const; @@ -243,27 +244,27 @@ public: KisPaintDeviceSP projection(); KisLayerSP activate(KisLayerSP layer); - KisLayerSP findLayer(const QString& name) const; + KisLayerSP findLayer(const TQString& name) const; KisLayerSP findLayer(int id) const; /// Move layer to specified position - bool moveLayer(KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP aboveThis); + bool moveLayer(KisLayerSP layer, KisGroupLayerSP tqparent, KisLayerSP aboveThis); /** * Add an already existing layer to the image. The layer is put on top * of the layers in the specified layergroup * @param layer the layer to be added - * @param parent the parent layer + * @param tqparent the tqparent layer */ - bool addLayer(KisLayerSP layer, KisGroupLayerSP parent); + bool addLayer(KisLayerSP layer, KisGroupLayerSP tqparent); /** * Add already existing layer to image. * * @param layer the layer to be added - * @param parent the parent layer + * @param tqparent the tqparent layer * @param aboveThis in the list with child layers of the specified - * parent, add this layer above the specified sibling. + * tqparent, add this layer above the specified sibling. * if 0, the layer is put in the lowermost position in * its group. * @param notify If true, the image is immediately recomposited, if false, @@ -271,7 +272,7 @@ public: * * returns false if adding the layer didn't work, true if the layer got added */ - bool addLayer(KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP aboveThis); + bool addLayer(KisLayerSP layer, KisGroupLayerSP tqparent, KisLayerSP aboveThis); /// Remove layer bool removeLayer(KisLayerSP layer); @@ -288,8 +289,8 @@ public: /// Move layer to bottom slot bool toBottom(KisLayerSP layer); - Q_INT32 nlayers() const; - Q_INT32 nHiddenLayers() const; + TQ_INT32 nlayers() const; + TQ_INT32 nHiddenLayers() const; KCommand *raiseLayerCommand(KisLayerSP layer); KCommand *lowerLayerCommand(KisLayerSP layer); @@ -308,7 +309,7 @@ public: */ void mergeLayer(KisLayerSP l); - QRect bounds() const; + TQRect bounds() const; /// use if the layers have changed _completely_ (eg. when flattening) void notifyLayersChanged(); @@ -317,7 +318,7 @@ public: void notifyImageLoaded(); - void notifyLayerUpdated(KisLayerSP layer, QRect rc); + void notifyLayerUpdated(KisLayerSP layer, TQRect rc); void setColorSpace(KisColorSpace * colorSpace); void setRootLayer(KisGroupLayerSP rootLayer); @@ -332,10 +333,10 @@ public: void addAnnotation(KisAnnotationSP annotation); /** get the annotation with the given type, can return 0 */ - KisAnnotationSP annotation(QString type); + KisAnnotationSP annotation(TQString type); /** delete the annotation, if the image contains it */ - void removeAnnotation(QString type); + void removeAnnotation(TQString type); /** * Start of an iteration over the annotations of this image (including the ICC Profile) @@ -349,26 +350,26 @@ signals: void sigActiveSelectionChanged(KisImageSP image); void sigSelectionChanged(KisImageSP image); - void sigSelectionChanged(KisImageSP image, const QRect& rect); + void sigSelectionChanged(KisImageSP image, const TQRect& rect); /// Emitted after a different layer is made active. void sigLayerActivated(KisLayerSP layer); - /// Emitted after a layer is added: you can find out where by asking it for its parent(), et al. + /// Emitted after a layer is added: you can find out where by asking it for its tqparent(), et al. void sigLayerAdded(KisLayerSP layer); /** Emitted after a layer is removed. It's no longer in the image, but still exists, so @p layer is valid. @param layer the removed layer - @param parent the parent of the layer, before it was removed + @param tqparent the tqparent of the layer, before it was removed @param wasAboveThis the layer it was above, before it was removed. */ void sigLayerRemoved(KisLayerSP layer, KisGroupLayerSP wasParent, KisLayerSP wasAboveThis); - /** Emitted after a layer is moved to a different position under its parent layer, or its parent changes. + /** Emitted after a layer is moved to a different position under its tqparent layer, or its tqparent changes. - @param previousParent the parent of the layer, before it was moved + @param previousParent the tqparent of the layer, before it was moved @param wasAboveThis the layer it was above, before it was moved. */ void sigLayerMoved(KisLayerSP layer, KisGroupLayerSP previousParent, KisLayerSP wasAboveThis); @@ -388,7 +389,7 @@ signals: * * @param rc The rect that has been recomposited. */ - void sigImageUpdated(QRect rc); + void sigImageUpdated(TQRect rc); /** * Emitted whenever a layer is modified. @@ -396,38 +397,38 @@ signals: * @param layer The layer that has been modified. * @param rc The rectangle that has been modified. */ - void sigLayerUpdated(KisLayerSP layer, QRect rc); + void sigLayerUpdated(KisLayerSP layer, TQRect rc); /** * Emitted whenever the image has been modified, so that it doesn't match with the version saved on disk. */ void sigImageModified(); - void sigSizeChanged(Q_INT32 w, Q_INT32 h); + void sigSizeChanged(TQ_INT32 w, TQ_INT32 h); void sigProfileChanged(KisProfile * profile); void sigColorSpaceChanged(KisColorSpace* cs); - /// Emitted when any layer's mask info got updated (or when the current layer changes) + /// Emitted when any layer's tqmask info got updated (or when the current layer changes) void sigMaskInfoChanged(); public slots: void slotSelectionChanged(); - void slotSelectionChanged(const QRect& r); + void slotSelectionChanged(const TQRect& r); private: KisImage& operator=(const KisImage& rhs); - void init(KisUndoAdapter * adapter, Q_INT32 width, Q_INT32 height, KisColorSpace * colorSpace, const QString& name); + void init(KisUndoAdapter * adapter, TQ_INT32 width, TQ_INT32 height, KisColorSpace * colorSpace, const TQString& name); void emitSizeChanged(); private: KURL m_uri; - QString m_name; - QString m_description; + TQString m_name; + TQString m_description; - Q_INT32 m_width; - Q_INT32 m_height; + TQ_INT32 m_width; + TQ_INT32 m_height; double m_xres; double m_yres; @@ -437,7 +438,7 @@ private: KisColorSpace * m_colorSpace; bool m_dirty; - QRect m_dirtyRect; + TQRect m_dirtyRect; KisBackgroundSP m_bkg; diff --git a/krita/core/kis_image_iface.cc b/krita/core/kis_image_iface.cc index 5a74c480..a52cc8a4 100644 --- a/krita/core/kis_image_iface.cc +++ b/krita/core/kis_image_iface.cc @@ -42,7 +42,7 @@ int KisImageIface::width() const return m_img->width(); } -void KisImageIface::setName(const QString& name) +void KisImageIface::setName(const TQString& name) { m_img->setName( name ); } diff --git a/krita/core/kis_image_iface.h b/krita/core/kis_image_iface.h index 77baa516..acf36738 100644 --- a/krita/core/kis_image_iface.h +++ b/krita/core/kis_image_iface.h @@ -24,7 +24,7 @@ #include <dcopobject.h> -#include <qstring.h> +#include <tqstring.h> class KisImage; class KisPaintDeviceIface; @@ -39,7 +39,7 @@ k_dcop: int height() const; int width() const; - void setName(const QString& name); + void setName(const TQString& name); void rotateCCW(); void rotateCW(); diff --git a/krita/core/kis_imagepipe_brush.cc b/krita/core/kis_imagepipe_brush.cc index ad745014..2b926dd0 100644 --- a/krita/core/kis_imagepipe_brush.cc +++ b/krita/core/kis_imagepipe_brush.cc @@ -31,13 +31,13 @@ #include <limits.h> #include <stdlib.h> -#include <qimage.h> -#include <qpoint.h> -#include <qvaluevector.h> -#include <qfile.h> -#include <qregexp.h> -#include <qstringlist.h> -#include <qtextstream.h> +#include <tqimage.h> +#include <tqpoint.h> +#include <tqvaluevector.h> +#include <tqfile.h> +#include <tqregexp.h> +#include <tqstringlist.h> +#include <tqtextstream.h> #include <kdebug.h> #include <klocale.h> @@ -47,25 +47,25 @@ #include "kis_paint_device.h" #include "kis_imagepipe_brush.h" #include "kis_brush.h" -#include "kis_alpha_mask.h" +#include "kis_alpha_tqmask.h" #include "kis_layer.h" #include "kis_meta_registry.h" #include "kis_colorspace_factory_registry.h" -KisPipeBrushParasite::KisPipeBrushParasite(const QString& source) +KisPipeBrushParasite::KisPipeBrushParasite(const TQString& source) { needsMovement = false; - QRegExp basicSplitter(" ", true); - QRegExp parasiteSplitter(":", true); - QStringList parasites = QStringList::split(basicSplitter, source); + TQRegExp basicSplitter(" ", true); + TQRegExp parasiteSplitter(":", true); + TQStringList parasites = TQStringList::split(basicSplitter, source); for (uint i = 0; i < parasites.count(); i++) { - QStringList splitted = QStringList::split(parasiteSplitter, *parasites.at(i)); + TQStringList splitted = TQStringList::split(parasiteSplitter, *parasites.at(i)); if (splitted.count() != 2) { kdWarning(41001) << "Wrong count for this parasite key/value:" << *parasites.at(i) << endl; continue; } - QString index = *splitted.at(0); + TQString index = *splitted.at(0); if (index == "dim") { dim = (*splitted.at(1)).toInt(); if (dim < 1 || dim > MaxDim) { @@ -74,7 +74,7 @@ KisPipeBrushParasite::KisPipeBrushParasite(const QString& source) } else if (index.startsWith("sel")) { int selIndex = index.mid(strlen("sel")).toInt(); if (selIndex >= 0 && selIndex < dim) { - QString selectionMode = *splitted.at(1); + TQString selectionMode = *splitted.at(1); if (selectionMode == "incremental") selection[selIndex] = Incremental; else if (selectionMode == "angular") { @@ -124,11 +124,11 @@ void KisPipeBrushParasite::setBrushesCount() { } } -bool KisPipeBrushParasite::saveToDevice(QIODevice* dev) const { +bool KisPipeBrushParasite::saveToDevice(TQIODevice* dev) const { // write out something like // <count> ncells:<count> dim:<dim> rank0:<rank0> sel0:<sel0> <...> - QTextStream stream(dev); + TQTextStream stream(dev); /// FIXME things like step, placement and so are not added (nor loaded, as a matter of fact) stream << ncells << " ncells:" << ncells << " dim:" << dim; @@ -149,16 +149,16 @@ bool KisPipeBrushParasite::saveToDevice(QIODevice* dev) const { return true; } -KisImagePipeBrush::KisImagePipeBrush(const QString& filename) : super(filename) +KisImagePipeBrush::KisImagePipeBrush(const TQString& filename) : super(filename) { m_brushType = INVALID; m_numOfBrushes = 0; m_currentBrush = 0; } -KisImagePipeBrush::KisImagePipeBrush(const QString& name, int w, int h, - QValueVector< QValueVector<KisPaintDevice*> > devices, - QValueVector<KisPipeBrushParasite::SelectionMode> modes) +KisImagePipeBrush::KisImagePipeBrush(const TQString& name, int w, int h, + TQValueVector< TQValueVector<KisPaintDevice*> > devices, + TQValueVector<KisPipeBrushParasite::SelectionMode> modes) : super("") { Q_ASSERT(devices.count() == modes.count()); @@ -193,7 +193,7 @@ KisImagePipeBrush::~KisImagePipeBrush() bool KisImagePipeBrush::load() { - QFile file(filename()); + TQFile file(filename()); file.open(IO_ReadOnly); m_data = file.readAll(); file.close(); @@ -206,33 +206,33 @@ bool KisImagePipeBrush::init() // XXX: This stuff is in utf-8, too. // The first line contains the name -- this means we look until we arrive at the first newline - QValueVector<char> line1; + TQValueVector<char> line1; - Q_UINT32 i = 0; + TQ_UINT32 i = 0; while (m_data[i] != '\n' && i < m_data.size()) { line1.append(m_data[i]); i++; } - setName(i18n(QString::fromUtf8(&line1[0], i).ascii())); + setName(i18n(TQString::fromUtf8(&line1[0], i).ascii())); i++; // Skip past the first newline // The second line contains the number of brushes, separated by a space from the parasite // XXX: This stuff is in utf-8, too. - QValueVector<char> line2; + TQValueVector<char> line2; while (m_data[i] != '\n' && i < m_data.size()) { line2.append(m_data[i]); i++; } - QString paramline = QString::fromUtf8((&line2[0]), line2.size()); - Q_UINT32 m_numOfBrushes = paramline.left(paramline.find(' ')).toUInt(); - m_parasite = paramline.mid(paramline.find(' ') + 1); + TQString paramline = TQString::fromUtf8((&line2[0]), line2.size()); + TQ_UINT32 m_numOfBrushes = paramline.left(paramline.tqfind(' ')).toUInt(); + m_parasite = paramline.mid(paramline.tqfind(' ') + 1); i++; // Skip past the second newline - Q_UINT32 numOfBrushes = 0; + TQ_UINT32 numOfBrushes = 0; while (numOfBrushes < m_numOfBrushes && i < m_data.size()){ KisBrush * brush = new KisBrush(name() + "_" + numOfBrushes, m_data, @@ -263,18 +263,18 @@ bool KisImagePipeBrush::init() bool KisImagePipeBrush::save() { - QFile file(filename()); + TQFile file(filename()); file.open(IO_WriteOnly | IO_Truncate); bool ok = saveToDevice(&file); file.close(); return ok; } -bool KisImagePipeBrush::saveToDevice(QIODevice* dev) const +bool KisImagePipeBrush::saveToDevice(TQIODevice* dev) const { - QCString utf8Name = name().utf8(); // Names in v2 brushes are in UTF-8 + TQCString utf8Name = name().utf8(); // Names in v2 brushes are in UTF-8 char const* name = utf8Name.data(); - int len = qstrlen(name); + int len = tqstrlen(name); if (parasite().dim != 1) { kdWarning(41001) << "Save to file for pipe brushes with dim != not yet supported!" << endl; @@ -308,7 +308,7 @@ bool KisImagePipeBrush::saveToDevice(QIODevice* dev) const return true; } -QImage KisImagePipeBrush::img() +TQImage KisImagePipeBrush::img() { if (m_brushes.isEmpty()) { return 0; @@ -318,11 +318,11 @@ QImage KisImagePipeBrush::img() } } -KisAlphaMaskSP KisImagePipeBrush::mask(const KisPaintInformation& info, double subPixelX, double subPixelY) const +KisAlphaMaskSP KisImagePipeBrush::tqmask(const KisPaintInformation& info, double subPixelX, double subPixelY) const { if (m_brushes.isEmpty()) return 0; selectNextBrush(info); - return m_brushes.at(m_currentBrush)->mask(info, subPixelX, subPixelY); + return m_brushes.at(m_currentBrush)->tqmask(info, subPixelX, subPixelY); } KisPaintDeviceSP KisImagePipeBrush::image(KisColorSpace * colorSpace, const KisPaintInformation& info, double subPixelX, double subPixelY) const @@ -332,7 +332,7 @@ KisPaintDeviceSP KisImagePipeBrush::image(KisColorSpace * colorSpace, const KisP return m_brushes.at(m_currentBrush)->image(colorSpace, info, subPixelX, subPixelY); } -void KisImagePipeBrush::setParasiteString(const QString& parasite) +void KisImagePipeBrush::setParasiteString(const TQString& parasite) { m_parasiteString = parasite; m_parasite = KisPipeBrushParasite(parasite); @@ -433,16 +433,16 @@ KisImagePipeBrush* KisImagePipeBrush::clone() const { // The obvious way of cloning each brush in this one doesn't work for some reason... // XXX Multidimensionals not supported yet, change together with the constructor... - QValueVector< QValueVector<KisPaintDevice*> > devices; - QValueVector<KisPipeBrushParasite::SelectionMode> modes; + TQValueVector< TQValueVector<KisPaintDevice*> > devices; + TQValueVector<KisPipeBrushParasite::SelectionMode> modes; - devices.push_back(QValueVector<KisPaintDevice*>()); + devices.push_back(TQValueVector<KisPaintDevice*>()); modes.push_back(m_parasite.selection[0]); for (uint i = 0; i < m_brushes.count(); i++) { KisPaintDevice* pd = new KisPaintDevice( KisMetaRegistry::instance()->csRegistry()->getColorSpace(KisID("RGBA",""),""), "clone pd" ); - pd->convertFromQImage(m_brushes.at(i)->img(), ""); + pd->convertFromTQImage(m_brushes.at(i)->img(), ""); devices.at(0).append(pd); } diff --git a/krita/core/kis_imagepipe_brush.h b/krita/core/kis_imagepipe_brush.h index 8a183848..bc54204b 100644 --- a/krita/core/kis_imagepipe_brush.h +++ b/krita/core/kis_imagepipe_brush.h @@ -19,11 +19,11 @@ #ifndef KIS_IMAGEPIPE_BRUSH_ #define KIS_IMAGEPIPE_BRUSH_ -#include <qptrlist.h> -#include <qvaluelist.h> -#include <qvaluevector.h> -#include <qmap.h> -#include <qstring.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> +#include <tqvaluevector.h> +#include <tqmap.h> +#include <tqstring.h> #include <kio/job.h> @@ -31,10 +31,10 @@ #include "kis_brush.h" #include "kis_global.h" -class QCString; -class QImage; -class QPoint; -class QSize; +class TQCString; +class TQImage; +class TQPoint; +class TQSize; /** * The parasite info that gets loaded from the terribly documented gimp pipe brush parasite. @@ -66,11 +66,11 @@ public: /// Initializes the brushesCount helper void setBrushesCount(); /// Load the parasite from the source string - KisPipeBrushParasite(const QString& source); + KisPipeBrushParasite(const TQString& source); /** * Saves a GIMP-compatible representation of this parasite to the device. Also writes the * number of brushes (== ncells) (no trailing '\n') */ - bool saveToDevice(QIODevice* dev) const; + bool saveToDevice(TQIODevice* dev) const; /** Velocity won't be supported, atm Angular and Tilt aren't either, but have chances of implementation */ enum SelectionMode { @@ -78,21 +78,21 @@ public: }; enum Placement { DefaultPlacement, ConstantPlacement, RandomPlacement }; static int const MaxDim = 4; - //Q_INT32 step; - Q_INT32 ncells; - Q_INT32 dim; + //TQ_INT32 step; + TQ_INT32 ncells; + TQ_INT32 dim; // Apparantly only used for editing a pipe brush, which we won't at the moment - // Q_INT32 cols, rows; - // Q_INT32 cellwidth, cellheight; + // TQ_INT32 cols, rows; + // TQ_INT32 cellwidth, cellheight; // Aparantly the gimp doesn't use this anymore? Anyway it is a bit weird to // paint at someplace else than where your cursor displays it will... //Placement placement; - Q_INT32 rank[MaxDim]; + TQ_INT32 rank[MaxDim]; SelectionMode selection[MaxDim]; /// The total count of brushes in each dimension (helper) - Q_INT32 brushesCount[MaxDim]; + TQ_INT32 brushesCount[MaxDim]; /// The current index in each dimension, so that the selection modes know where to start - Q_INT32 index[MaxDim]; + TQ_INT32 index[MaxDim]; /// If true, the brush won't be painted when there is no motion bool needsMovement; }; @@ -101,32 +101,33 @@ public: class KisImagePipeBrush : public KisBrush { typedef KisBrush super; Q_OBJECT + TQ_OBJECT public: - KisImagePipeBrush(const QString& filename); + KisImagePipeBrush(const TQString& filename); /** * Specialized constructor that makes a new pipe brush from a sequence of samesize * devices. The fact that it's a vector of a vector, is to support multidimensional * brushes (not yet supported!) */ - KisImagePipeBrush(const QString& name, int w, int h, - QValueVector< QValueVector<KisPaintDevice*> > devices, - QValueVector<KisPipeBrushParasite::SelectionMode> modes); + KisImagePipeBrush(const TQString& name, int w, int h, + TQValueVector< TQValueVector<KisPaintDevice*> > devices, + TQValueVector<KisPipeBrushParasite::SelectionMode> modes); virtual ~KisImagePipeBrush(); virtual bool load(); virtual bool save(); /// Will call KisBrush's saveToDevice as well - virtual bool saveToDevice(QIODevice* dev) const; + virtual bool saveToDevice(TQIODevice* dev) const; /** @return the next image in the pipe. */ - virtual QImage img(); + virtual TQImage img(); /** - @return the next mask in the pipe. + @return the next tqmask in the pipe. */ - virtual KisAlphaMaskSP mask(const KisPaintInformation& info, + virtual KisAlphaMaskSP tqmask(const KisPaintInformation& info, double subPixelX = 0, double subPixelY = 0) const; virtual KisPaintDeviceSP image(KisColorSpace * colorSpace, const KisPaintInformation& info, double subPixelX = 0, double subPixelY = 0) const; @@ -149,17 +150,17 @@ public: private: bool init(); - void setParasiteString(const QString& parasite); + void setParasiteString(const TQString& parasite); void selectNextBrush(const KisPaintInformation& info) const; - QString m_name; - QString m_parasiteString; // Contains instructions on how to use the brush + TQString m_name; + TQString m_parasiteString; // Contains instructions on how to use the brush mutable KisPipeBrushParasite m_parasite; - Q_UINT32 m_numOfBrushes; - mutable Q_UINT32 m_currentBrush; + TQ_UINT32 m_numOfBrushes; + mutable TQ_UINT32 m_currentBrush; - QByteArray m_data; - mutable QPtrList<KisBrush> m_brushes; + TQByteArray m_data; + mutable TQPtrList<KisBrush> m_brushes; enumBrushType m_brushType; diff --git a/krita/core/kis_iterator.cc b/krita/core/kis_iterator.cc index f43f3d5b..0e0c2d81 100644 --- a/krita/core/kis_iterator.cc +++ b/krita/core/kis_iterator.cc @@ -17,7 +17,7 @@ */ -#include <qglobal.h> +#include <tqglobal.h> #include <kdebug.h> @@ -25,7 +25,7 @@ #include "kis_datamanager.h" #include "kis_tilediterator.h" -KisRectIterator::KisRectIterator ( KisDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, bool writable) +KisRectIterator::KisRectIterator ( KisDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, bool writable) { m_iter = new KisTiledRectIterator(dm, x, y, w, h, writable); } @@ -44,11 +44,11 @@ KisRectIterator::~KisRectIterator() { } -Q_UINT8 * KisRectIterator::rawData() const { return m_iter->rawData();} +TQ_UINT8 * KisRectIterator::rawData() const { return m_iter->rawData();} -const Q_UINT8 * KisRectIterator::oldRawData() const { return m_iter->oldRawData();} +const TQ_UINT8 * KisRectIterator::oldRawData() const { return m_iter->oldRawData();} -Q_INT32 KisRectIterator::nConseqPixels() const { return m_iter->nConseqPixels(); } +TQ_INT32 KisRectIterator::nConseqPixels() const { return m_iter->nConseqPixels(); } KisRectIterator & KisRectIterator::operator+=(int n) { m_iter->operator+=(n); return *this; } @@ -56,12 +56,12 @@ KisRectIterator & KisRectIterator::operator++() { m_iter->operator++(); return * bool KisRectIterator::isDone() const { return m_iter->isDone(); } -Q_INT32 KisRectIterator::x() const { return m_iter->x(); } -Q_INT32 KisRectIterator::y() const { return m_iter->y(); } +TQ_INT32 KisRectIterator::x() const { return m_iter->x(); } +TQ_INT32 KisRectIterator::y() const { return m_iter->y(); } //--------------------------------------------------------------------------------------- -KisHLineIterator::KisHLineIterator ( KisDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, bool writable) +KisHLineIterator::KisHLineIterator ( KisDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable) { m_iter = new KisTiledHLineIterator(dm, x, y, w, writable); } @@ -82,16 +82,16 @@ KisHLineIterator::~KisHLineIterator() { } -Q_UINT8 *KisHLineIterator::rawData() const +TQ_UINT8 *KisHLineIterator::rawData() const { return m_iter->rawData(); } -const Q_UINT8 *KisHLineIterator::oldRawData() const { return m_iter->oldRawData();} +const TQ_UINT8 *KisHLineIterator::oldRawData() const { return m_iter->oldRawData();} KisHLineIterator & KisHLineIterator::operator++() { m_iter->operator++(); return *this; } -Q_INT32 KisHLineIterator::nConseqHPixels() const { return m_iter->nConseqHPixels(); } +TQ_INT32 KisHLineIterator::nConseqHPixels() const { return m_iter->nConseqHPixels(); } KisHLineIterator & KisHLineIterator::operator+=(int n) { m_iter->operator+=(n); return *this; } @@ -99,15 +99,15 @@ KisHLineIterator & KisHLineIterator::operator--() { m_iter->operator--(); return bool KisHLineIterator::isDone() const { return m_iter->isDone(); } -Q_INT32 KisHLineIterator::x() const { return m_iter->x(); } +TQ_INT32 KisHLineIterator::x() const { return m_iter->x(); } -Q_INT32 KisHLineIterator::y() const { return m_iter->y(); } +TQ_INT32 KisHLineIterator::y() const { return m_iter->y(); } void KisHLineIterator::nextRow() { m_iter->nextRow(); } //--------------------------------------------------------------------------------------- -KisVLineIterator::KisVLineIterator ( KisDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 h, bool writable) +KisVLineIterator::KisVLineIterator ( KisDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable) { m_iter = new KisTiledVLineIterator(dm, x, y, h, writable); } @@ -127,16 +127,16 @@ KisVLineIterator::~KisVLineIterator() { } -Q_UINT8 *KisVLineIterator::rawData() const { return m_iter->rawData();} +TQ_UINT8 *KisVLineIterator::rawData() const { return m_iter->rawData();} -const Q_UINT8 * KisVLineIterator::oldRawData() const { return m_iter->oldRawData();} +const TQ_UINT8 * KisVLineIterator::oldRawData() const { return m_iter->oldRawData();} KisVLineIterator & KisVLineIterator::operator++() { m_iter->operator++(); return *this; } bool KisVLineIterator::isDone() const { return m_iter->isDone(); } -Q_INT32 KisVLineIterator::x() const { return m_iter->x(); } +TQ_INT32 KisVLineIterator::x() const { return m_iter->x(); } -Q_INT32 KisVLineIterator::y() const { return m_iter->y(); } +TQ_INT32 KisVLineIterator::y() const { return m_iter->y(); } void KisVLineIterator::nextCol() { return m_iter->nextCol(); } diff --git a/krita/core/kis_iterator.h b/krita/core/kis_iterator.h index 67206272..893461a5 100644 --- a/krita/core/kis_iterator.h +++ b/krita/core/kis_iterator.h @@ -19,7 +19,7 @@ #ifndef KIS_ITERATOR_H_ #define KIS_ITERATOR_H_ -#include <qglobal.h> +#include <tqglobal.h> #include <ksharedptr.h> class KisTiledRectIterator; @@ -42,7 +42,7 @@ class KisRectIterator public: - KisRectIterator ( KisDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, bool writable); + KisRectIterator ( KisDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, bool writable); public: virtual ~KisRectIterator(); @@ -52,14 +52,14 @@ public: public: /// returns a pointer to the pixel data. Do NOT interpret the data - leave that to a colorstrategy - Q_UINT8 * rawData() const; + TQ_UINT8 * rawData() const; /// Returns a pointer to the pixel data as it was at the moment of the last memento creation. - const Q_UINT8 * oldRawData() const; + const TQ_UINT8 * oldRawData() const; /// Returns the number of consequtive pixels that we point at /// This is useful for optimizing - Q_INT32 nConseqPixels() const; + TQ_INT32 nConseqPixels() const; /// Advances a number of pixels until it reaches the end of the rect KisRectIterator & operator+=(int n); @@ -71,10 +71,10 @@ public: bool isDone() const; // current x position - Q_INT32 x() const; + TQ_INT32 x() const; // current y position - Q_INT32 y() const; + TQ_INT32 y() const; private: @@ -86,7 +86,7 @@ class KisHLineIterator public: - KisHLineIterator ( KisDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, bool writable); + KisHLineIterator ( KisDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable); public: @@ -96,17 +96,17 @@ public: public: /// Returns a pointer to the pixel data. Do NOT interpret the data - leave that to a colorstrategy - Q_UINT8 *rawData() const; + TQ_UINT8 *rawData() const; /// Returns a pointer to the pixel data as it was at the moment of the last memento creation. - const Q_UINT8 *oldRawData() const; + const TQ_UINT8 *oldRawData() const; /// Advances one pixel until it reaches the end of the line KisHLineIterator & operator++(); /// Returns the number of consequtive horizontal pixels that we point at /// This is useful for optimizing - Q_INT32 nConseqHPixels() const; + TQ_INT32 nConseqHPixels() const; /// Advances a number of pixels until it reaches the end of the line KisHLineIterator & operator+=(int n); @@ -118,10 +118,10 @@ public: bool isDone() const; /// current x position - Q_INT32 x() const; + TQ_INT32 x() const; /// current y position - Q_INT32 y() const; + TQ_INT32 y() const; /// increment to the next row and rewind to the begining void nextRow(); @@ -136,7 +136,7 @@ class KisVLineIterator { public: - KisVLineIterator ( KisDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 h, bool writable); + KisVLineIterator ( KisDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable); public: ~KisVLineIterator(); KisVLineIterator(const KisVLineIterator& rhs); @@ -144,10 +144,10 @@ public: public: /// returns a pointer to the pixel data. Do NOT interpret the data - leave that to a colorstrategy - Q_UINT8 *rawData() const; + TQ_UINT8 *rawData() const; /// Returns a pointer to the pixel data as it was at the moment of the last memento creation. - const Q_UINT8 * oldRawData() const; + const TQ_UINT8 * oldRawData() const; /// Advances one pixel until it reaches the end of the line KisVLineIterator & operator++(); @@ -156,10 +156,10 @@ public: bool isDone() const; /// current x position - Q_INT32 x() const; + TQ_INT32 x() const; /// current y position - Q_INT32 y() const; + TQ_INT32 y() const; /// increment to the next column and rewind to the begining void nextCol(); diff --git a/krita/core/kis_iteratorpixeltrait.h b/krita/core/kis_iteratorpixeltrait.h index 5aadad56..5d2c957f 100644 --- a/krita/core/kis_iteratorpixeltrait.h +++ b/krita/core/kis_iteratorpixeltrait.h @@ -76,7 +76,7 @@ public: * Return one channel from the current kispixel. Does not check whether * channel index actually exists in this colorspace. */ - inline Q_UINT8 operator[](int index) const + inline TQ_UINT8 operator[](int index) const { return m_underlyingIterator->rawData()[index]; }; /** @@ -93,7 +93,7 @@ public: /** * Returns the degree of selectedness of the pixel. */ - inline Q_UINT8 selectedness() const + inline TQ_UINT8 selectedness() const { if (m_selectionIterator) return *(m_selectionIterator->rawData()); @@ -103,11 +103,11 @@ public: }; /** - * Returns the selectionmask from the current point; this is guaranteed + * Returns the selectiontqmask from the current point; this is guaranteed * to have the same number of consecutive pixels that the iterator has * at a given point. It return a 0 if there is no selection. */ - inline Q_UINT8 * selectionMask() const + inline TQ_UINT8 * selectionMask() const { if ( m_selectionIterator ) return m_selectionIterator->rawData(); diff --git a/krita/core/kis_iterators_pixel.cc b/krita/core/kis_iterators_pixel.cc index 062fde73..e543714c 100644 --- a/krita/core/kis_iterators_pixel.cc +++ b/krita/core/kis_iterators_pixel.cc @@ -22,7 +22,7 @@ #include "kis_global.h" #include "kis_paint_device.h" -KisHLineIteratorPixel::KisHLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 offsetx, Q_INT32 offsety, bool writable) : +KisHLineIteratorPixel::KisHLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 offsetx, TQ_INT32 offsety, bool writable) : KisHLineIterator(dm, x - offsetx, y - offsety, w, writable), KisIteratorPixelTrait <KisHLineIterator> ( ndevice, this ), m_offsetx(offsetx), m_offsety(offsety) @@ -34,7 +34,7 @@ KisHLineIteratorPixel::KisHLineIteratorPixel( KisPaintDevice *ndevice, KisDataMa } } -KisVLineIteratorPixel::KisVLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 h, Q_INT32 offsetx, Q_INT32 offsety, bool writable) : +KisVLineIteratorPixel::KisVLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, TQ_INT32 offsetx, TQ_INT32 offsety, bool writable) : KisVLineIterator(dm, x - offsetx, y - offsety, h, writable), KisIteratorPixelTrait <KisVLineIterator> ( ndevice, this ), m_offsetx(offsetx), m_offsety(offsety) @@ -46,7 +46,7 @@ KisVLineIteratorPixel::KisVLineIteratorPixel( KisPaintDevice *ndevice, KisDataMa } } -KisRectIteratorPixel::KisRectIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_INT32 offsetx, Q_INT32 offsety, bool writable) : +KisRectIteratorPixel::KisRectIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, TQ_INT32 offsetx, TQ_INT32 offsety, bool writable) : KisRectIterator(dm, x - offsetx, y - offsety, w, h, writable), KisIteratorPixelTrait <KisRectIterator> ( ndevice, this ), m_offsetx(offsetx), m_offsety(offsety) diff --git a/krita/core/kis_iterators_pixel.h b/krita/core/kis_iterators_pixel.h index ad7d7f1f..bd82f856 100644 --- a/krita/core/kis_iterators_pixel.h +++ b/krita/core/kis_iterators_pixel.h @@ -35,7 +35,7 @@ class KisHLineIteratorPixel : public KisHLineIterator, public KisIteratorPixelTr public: KisHLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, - Q_INT32 x , Q_INT32 y , Q_INT32 w, Q_INT32 offsetx, Q_INT32 offsety, + TQ_INT32 x , TQ_INT32 y , TQ_INT32 w, TQ_INT32 offsetx, TQ_INT32 offsety, bool writable); KisHLineIteratorPixel(const KisHLineIteratorPixel& rhs) : KisHLineIterator(rhs), KisIteratorPixelTrait<KisHLineIterator>(rhs) @@ -60,30 +60,30 @@ public: /// Advances a number of pixels until it reaches the end of the line KisHLineIteratorPixel & operator+=(int n) { KisHLineIterator::operator+=(n); advance(n); return *this; }; - Q_INT32 x() const { return KisHLineIterator::x() + m_offsetx; } + TQ_INT32 x() const { return KisHLineIterator::x() + m_offsetx; } - Q_INT32 y() const { return KisHLineIterator::y() + m_offsety; } + TQ_INT32 y() const { return KisHLineIterator::y() + m_offsety; } - Q_INT32 nConseqHPixels() const { + TQ_INT32 nConseqHPixels() const { if (m_selectionIterator) { - Q_INT32 parent = KisHLineIteratorPixel::nConseqHPixels(); - Q_INT32 selection = m_selectionIterator->nConseqHPixels(); - if (parent < selection) - return parent; + TQ_INT32 tqparent = KisHLineIteratorPixel::nConseqHPixels(); + TQ_INT32 selection = m_selectionIterator->nConseqHPixels(); + if (tqparent < selection) + return tqparent; return selection; } return KisHLineIteratorPixel::nConseqHPixels(); } protected: - Q_INT32 m_offsetx, m_offsety; + TQ_INT32 m_offsetx, m_offsety; }; class KisVLineIteratorPixel : public KisVLineIterator, public KisIteratorPixelTrait <KisVLineIterator> { public: KisVLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, - Q_INT32 xpos , Q_INT32 ypos , Q_INT32 height, Q_INT32 offsetx, Q_INT32 offsety, + TQ_INT32 xpos , TQ_INT32 ypos , TQ_INT32 height, TQ_INT32 offsetx, TQ_INT32 offsety, bool writable); KisVLineIteratorPixel(const KisVLineIteratorPixel& rhs) : KisVLineIterator(rhs), KisIteratorPixelTrait<KisVLineIterator>(rhs) @@ -103,20 +103,20 @@ public: if (m_selectionIterator) m_selectionIterator->nextCol(); } - Q_INT32 x() const { return KisVLineIterator::x() + m_offsetx; } + TQ_INT32 x() const { return KisVLineIterator::x() + m_offsetx; } - Q_INT32 y() const { return KisVLineIterator::y() + m_offsety; } + TQ_INT32 y() const { return KisVLineIterator::y() + m_offsety; } protected: - Q_INT32 m_offsetx, m_offsety; + TQ_INT32 m_offsetx, m_offsety; }; class KisRectIteratorPixel : public KisRectIterator, public KisIteratorPixelTrait <KisRectIterator> { public: KisRectIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, - Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_INT32 offsetx, Q_INT32 offsety, + TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, TQ_INT32 offsetx, TQ_INT32 offsety, bool writable); KisRectIteratorPixel(const KisRectIteratorPixel& rhs) : KisRectIterator(rhs), KisIteratorPixelTrait<KisRectIterator>(rhs) @@ -131,16 +131,16 @@ public: inline KisRectIteratorPixel & operator ++() { KisRectIterator::operator++(); advance(1); return *this;} - Q_INT32 x() const { return KisRectIterator::x() + m_offsetx; } + TQ_INT32 x() const { return KisRectIterator::x() + m_offsetx; } - Q_INT32 y() const { return KisRectIterator::y() + m_offsety; } + TQ_INT32 y() const { return KisRectIterator::y() + m_offsety; } - Q_INT32 nConseqPixels() const { + TQ_INT32 nConseqPixels() const { if (m_selectionIterator) { - Q_INT32 parent = KisRectIterator::nConseqPixels(); - Q_INT32 selection = m_selectionIterator->nConseqPixels(); - if (parent < selection) - return parent; + TQ_INT32 tqparent = KisRectIterator::nConseqPixels(); + TQ_INT32 selection = m_selectionIterator->nConseqPixels(); + if (tqparent < selection) + return tqparent; return selection; } return KisRectIterator::nConseqPixels(); @@ -148,7 +148,7 @@ public: protected: - Q_INT32 m_offsetx, m_offsety; + TQ_INT32 m_offsetx, m_offsety; }; #endif diff --git a/krita/core/kis_layer.cc b/krita/core/kis_layer.cc index b19a4dcf..cac178e5 100644 --- a/krita/core/kis_layer.cc +++ b/krita/core/kis_layer.cc @@ -18,7 +18,7 @@ */ #include <kdebug.h> -#include <qimage.h> +#include <tqimage.h> #include "kis_debug_areas.h" #include "kis_group_layer.h" @@ -33,7 +33,7 @@ namespace { typedef KNamedCommand super; public: - KisLayerCommand(const QString& name, KisLayerSP layer); + KisLayerCommand(const TQString& name, KisLayerSP layer); virtual ~KisLayerCommand() {} virtual void execute() = 0; @@ -45,7 +45,7 @@ namespace { KisLayerSP m_layer; }; - KisLayerCommand::KisLayerCommand(const QString& name, KisLayerSP layer) : + KisLayerCommand::KisLayerCommand(const TQString& name, KisLayerSP layer) : super(name), m_layer(layer) { } @@ -94,17 +94,17 @@ namespace { typedef KisLayerCommand super; public: - KisLayerOpacityCommand(KisLayerSP layer, Q_UINT8 oldOpacity, Q_UINT8 newOpacity); + KisLayerOpacityCommand(KisLayerSP layer, TQ_UINT8 oldOpacity, TQ_UINT8 newOpacity); virtual void execute(); virtual void unexecute(); private: - Q_UINT8 m_oldOpacity; - Q_UINT8 m_newOpacity; + TQ_UINT8 m_oldOpacity; + TQ_UINT8 m_newOpacity; }; - KisLayerOpacityCommand::KisLayerOpacityCommand(KisLayerSP layer, Q_UINT8 oldOpacity, Q_UINT8 newOpacity) : + KisLayerOpacityCommand::KisLayerOpacityCommand(KisLayerSP layer, TQ_UINT8 oldOpacity, TQ_UINT8 newOpacity) : super(i18n("Layer Opacity"), layer) { m_oldOpacity = oldOpacity; @@ -198,31 +198,31 @@ namespace { typedef KNamedCommand super; public: - KisLayerOffsetCommand(KisLayerSP layer, const QPoint& oldpos, const QPoint& newpos); + KisLayerOffsetCommand(KisLayerSP layer, const TQPoint& oldpos, const TQPoint& newpos); virtual ~KisLayerOffsetCommand(); virtual void execute(); virtual void unexecute(); private: - void moveTo(const QPoint& pos); + void moveTo(const TQPoint& pos); private: KisLayerSP m_layer; - QRect m_updateRect; - QPoint m_oldPos; - QPoint m_newPos; + TQRect m_updateRect; + TQPoint m_oldPos; + TQPoint m_newPos; }; - KisLayerOffsetCommand::KisLayerOffsetCommand(KisLayerSP layer, const QPoint& oldpos, const QPoint& newpos) : + KisLayerOffsetCommand::KisLayerOffsetCommand(KisLayerSP layer, const TQPoint& oldpos, const TQPoint& newpos) : super(i18n("Move Layer")) { m_layer = layer; m_oldPos = oldpos; m_newPos = newpos; - QRect currentBounds = m_layer->exactBounds(); - QRect oldBounds = currentBounds; + TQRect currentBounds = m_layer->exactBounds(); + TQRect oldBounds = currentBounds; oldBounds.moveBy(oldpos.x() - newpos.x(), oldpos.y() - newpos.y()); m_updateRect = currentBounds | oldBounds; @@ -242,7 +242,7 @@ namespace { moveTo(m_oldPos); } - void KisLayerOffsetCommand::moveTo(const QPoint& pos) + void KisLayerOffsetCommand::moveTo(const TQPoint& pos) { if (m_layer->undoAdapter()) { m_layer->undoAdapter()->setUndo(false); @@ -266,8 +266,8 @@ static int getID() } -KisLayer::KisLayer(KisImage *img, const QString &name, Q_UINT8 opacity) : - QObject(0, name.latin1()), +KisLayer::KisLayer(KisImage *img, const TQString &name, TQ_UINT8 opacity) : + TQObject(0, name.latin1()), KShared(), m_id(getID()), m_index(-1), @@ -283,7 +283,7 @@ KisLayer::KisLayer(KisImage *img, const QString &name, Q_UINT8 opacity) : } KisLayer::KisLayer(const KisLayer& rhs) : - QObject(), + TQObject(), KShared(rhs) { if (this != &rhs) { @@ -305,14 +305,14 @@ KisLayer::~KisLayer() { } -void KisLayer::setClean(const QRect & rect) +void KisLayer::setClean(const TQRect & rect) { if (m_dirtyRect.isValid() && rect.isValid()) { // XXX: We should only set the parts clean that were actually cleaned. However, extent and exactBounds conspire // to make that very hard atm. - //if (rect.contains(m_dirtyRect)) m_dirtyRect = QRect(); - m_dirtyRect = QRect(); + //if (rect.tqcontains(m_dirtyRect)) m_dirtyRect = TQRect(); + m_dirtyRect = TQRect(); } } @@ -323,25 +323,25 @@ bool KisLayer::dirty() } -bool KisLayer::dirty(const QRect & rc) +bool KisLayer::dirty(const TQRect & rc) { if (!m_dirtyRect.isValid() || !rc.isValid()) return false; return rc.intersects(m_dirtyRect); } -QRect KisLayer::dirtyRect() const +TQRect KisLayer::dirtyRect() const { return m_dirtyRect; } void KisLayer::setDirty(bool propagate) { - QRect rc = extent(); + TQRect rc = extent(); if (rc.isValid()) m_dirtyRect = rc; - // If we're dirty, our parent is dirty, if we've got a parent + // If we're dirty, our tqparent is dirty, if we've got a tqparent if (propagate && m_parent && rc.isValid()) m_parent->setDirty(m_dirtyRect); if (m_image && rc.isValid()) { @@ -349,9 +349,9 @@ void KisLayer::setDirty(bool propagate) } } -void KisLayer::setDirty(const QRect & rc, bool propagate) +void KisLayer::setDirty(const TQRect & rc, bool propagate) { - // If we're dirty, our parent is dirty, if we've got a parent + // If we're dirty, our tqparent is dirty, if we've got a tqparent if (rc.isValid()) m_dirtyRect |= rc; @@ -364,23 +364,23 @@ void KisLayer::setDirty(const QRect & rc, bool propagate) } } -KisGroupLayerSP KisLayer::parent() const +KisGroupLayerSP KisLayer::tqparent() const { return m_parent; } KisLayerSP KisLayer::prevSibling() const { - if (!parent()) + if (!tqparent()) return 0; - return parent()->at(index() - 1); + return tqparent()->at(index() - 1); } KisLayerSP KisLayer::nextSibling() const { - if (!parent()) + if (!tqparent()) return 0; - return parent()->at(index() + 1); + return tqparent()->at(index() + 1); } int KisLayer::index() const @@ -390,12 +390,12 @@ int KisLayer::index() const void KisLayer::setIndex(int i) { - if (!parent()) + if (!tqparent()) return; - parent()->setIndex(this, i); + tqparent()->setIndex(this, i); } -KisLayerSP KisLayer::findLayer(const QString& n) const +KisLayerSP KisLayer::findLayer(const TQString& n) const { if (name() == n) return const_cast<KisLayer*>(this); //HACK any less ugly way? findLayer() is conceptually const... @@ -437,12 +437,12 @@ bool KisLayer::matchesFlags(int flags) const return true; } -Q_UINT8 KisLayer::opacity() const +TQ_UINT8 KisLayer::opacity() const { return m_opacity; } -void KisLayer::setOpacity(Q_UINT8 val) +void KisLayer::setOpacity(TQ_UINT8 val) { if (m_opacity != val) { @@ -452,12 +452,12 @@ void KisLayer::setOpacity(Q_UINT8 val) } } -KNamedCommand *KisLayer::setOpacityCommand(Q_UINT8 newOpacity) +KNamedCommand *KisLayer::setOpacityCommand(TQ_UINT8 newOpacity) { return new KisLayerOpacityCommand(this, opacity(), newOpacity); } -KNamedCommand *KisLayer::setOpacityCommand(Q_UINT8 prevOpacity, Q_UINT8 newOpacity) +KNamedCommand *KisLayer::setOpacityCommand(TQ_UINT8 prevOpacity, TQ_UINT8 newOpacity) { return new KisLayerOpacityCommand(this, prevOpacity, newOpacity); } @@ -518,12 +518,12 @@ KNamedCommand *KisLayer::setLockedCommand(bool newLocked) return new KisLayerLockedCommand(this, newLocked); } -QString KisLayer::name() const +TQString KisLayer::name() const { return m_name; } -void KisLayer::setName(const QString& name) +void KisLayer::setName(const TQString& name) { if (!name.isEmpty() && m_name != name) { @@ -548,7 +548,7 @@ KNamedCommand *KisLayer::setCompositeOpCommand(const KisCompositeOp& newComposit return new KisLayerCompositeOpCommand(this, compositeOp(), newCompositeOp); } -KNamedCommand *KisLayer::moveCommand(QPoint oldPosition, QPoint newPosition) +KNamedCommand *KisLayer::moveCommand(TQPoint oldPosition, TQPoint newPosition) { return new KisLayerOffsetCommand(this, oldPosition, newPosition); } @@ -561,19 +561,19 @@ KisUndoAdapter *KisLayer::undoAdapter() const return 0; } -void KisLayer::paintMaskInactiveLayers(QImage &, Q_INT32, Q_INT32, Q_INT32, Q_INT32) +void KisLayer::paintMaskInactiveLayers(TQImage &, TQ_INT32, TQ_INT32, TQ_INT32, TQ_INT32) { } -void KisLayer::paintSelection(QImage &, Q_INT32, Q_INT32, Q_INT32, Q_INT32) +void KisLayer::paintSelection(TQImage &, TQ_INT32, TQ_INT32, TQ_INT32, TQ_INT32) { } -void KisLayer::paintSelection(QImage &, const QRect&, const QSize&, const QSize&) +void KisLayer::paintSelection(TQImage &, const TQRect&, const TQSize&, const TQSize&) { } -QImage KisLayer::createThumbnail(Q_INT32, Q_INT32) +TQImage KisLayer::createThumbnail(TQ_INT32, TQ_INT32) { return 0; } @@ -592,7 +592,7 @@ void KisLayerSupportsIndirectPainting::setTemporaryCompositeOp(const KisComposit m_compositeOp = c; } -void KisLayerSupportsIndirectPainting::setTemporaryOpacity(Q_UINT8 o) { +void KisLayerSupportsIndirectPainting::setTemporaryOpacity(TQ_UINT8 o) { m_compositeOpacity = o; } @@ -604,7 +604,7 @@ KisCompositeOp KisLayerSupportsIndirectPainting::temporaryCompositeOp() const { return m_compositeOp; } -Q_UINT8 KisLayerSupportsIndirectPainting::temporaryOpacity() const { +TQ_UINT8 KisLayerSupportsIndirectPainting::temporaryOpacity() const { return m_compositeOpacity; } diff --git a/krita/core/kis_layer.h b/krita/core/kis_layer.h index 5da5181d..fd710839 100644 --- a/krita/core/kis_layer.h +++ b/krita/core/kis_layer.h @@ -19,14 +19,14 @@ #ifndef KIS_LAYER_H_ #define KIS_LAYER_H_ -#include <qobject.h> +#include <tqobject.h> #include "kis_types.h" #include "kis_layer_visitor.h" #include "kis_composite_op.h" #include <koffice_export.h> class KNamedCommand; -class QPainter; +class TQPainter; class KisUndoAdapter; class KisGroupLayer; @@ -38,12 +38,13 @@ class KisGroupLayer; * is at the top of the group in the layerlist, using next will iterate to the bottom to last, * whereas previous will go up to first again. **/ -class KRITACORE_EXPORT KisLayer : public QObject, public KShared +class KRITACORE_EXPORT KisLayer : public TQObject, public KShared { Q_OBJECT + TQ_OBJECT public: - KisLayer(KisImage *img, const QString &name, Q_UINT8 opacity); + KisLayer(KisImage *img, const TQString &name, TQ_UINT8 opacity); KisLayer(const KisLayer& rhs); virtual ~KisLayer(); @@ -51,7 +52,7 @@ public: /** * Set the specified rect to clean */ - virtual void setClean(const QRect & rect); + virtual void setClean(const TQRect & rect); /** * If the layer has been changed and not been composited yet, this returns true @@ -61,24 +62,24 @@ public: /** * Return true if the given rect intersects the dirty rect(s) of this layer */ - virtual bool dirty(const QRect & rc); + virtual bool dirty(const TQRect & rc); - virtual QRect dirtyRect() const; + virtual TQRect dirtyRect() const; /** - * Set the entire layer extent dirty; this percolates up to parent layers all the + * Set the entire layer extent dirty; this percolates up to tqparent layers all the * way to the root layer. */ virtual void setDirty(bool propagate = true); /** * Add the given rect to the set of dirty rects for this layer; - * this percolates up to parent layers all the way to the root + * this percolates up to tqparent layers all the way to the root * layer. */ - virtual void setDirty(const QRect & rect, bool propagate = true); + virtual void setDirty(const TQRect & rect, bool propagate = true); /// Return a copy of this layer virtual KisLayerSP clone() const = 0; @@ -86,41 +87,41 @@ public: /// Returns the ID of the layer, which is guaranteed to be unique among all KisLayers. int id() const { return m_id; } - /* Returns the index of the layer in its parent's list of child layers. Indices + /* Returns the index of the layer in its tqparent's list of child layers. Indices * increase from 0, which is the topmost layer in the list, to the bottommost. */ virtual int index() const; - /// Moves this layer to the specified index within its parent's list of child layers. + /// Moves this layer to the specified index within its tqparent's list of child layers. virtual void setIndex(int index); /** - * Returns the parent layer of a layer. This is 0 only for a root layer; otherwise + * Returns the tqparent layer of a layer. This is 0 only for a root layer; otherwise * this will be an actual GroupLayer */ - virtual KisGroupLayerSP parent() const; + virtual KisGroupLayerSP tqparent() const; /** - * Returns the previous sibling of this layer in the parent's list. This is the layer - * *above* this layer. 0 is returned if there is no parent, or if this child has no more + * Returns the previous sibling of this layer in the tqparent's list. This is the layer + * *above* this layer. 0 is returned if there is no tqparent, or if this child has no more * previous siblings (== firstChild()) */ virtual KisLayerSP prevSibling() const; /** - * Returns the next sibling of this layer in the parent's list. This is the layer *below* - * this layer. 0 is returned if there is no parent, or if this child has no more next + * Returns the next sibling of this layer in the tqparent's list. This is the layer *below* + * this layer. 0 is returned if there is no tqparent, or if this child has no more next * siblings (== lastChild()) */ virtual KisLayerSP nextSibling() const; /** - * Returns the sibling above this layer in its parent's list. 0 is returned if there is no parent, + * Returns the sibling above this layer in its tqparent's list. 0 is returned if there is no tqparent, * or if this layer is the topmost layer in its group. This is the same as calling prevSibling(). */ KisLayerSP siblingAbove() const { return prevSibling(); } /** - * Returns the sibling below this layer in its parent's list. 0 is returned if there is no parent, + * Returns the sibling below this layer in its tqparent's list. 0 is returned if there is no tqparent, * or if this layer is the bottommost layer in its group. This is the same as calling nextSibling(). */ KisLayerSP siblingBelow() const { return nextSibling(); } @@ -135,7 +136,7 @@ public: virtual KisLayerSP lastChild() const { return 0; } /// Recursively searches this layer and any child layers for a layer with the specified name. - virtual KisLayerSP findLayer(const QString& name) const; + virtual KisLayerSP findLayer(const TQString& name) const; /// Recursively searches this layer and any child layers for a layer with the specified ID. virtual KisLayerSP findLayer(int id) const; @@ -153,27 +154,27 @@ public: virtual void deactivate() {}; public: - virtual Q_INT32 x() const = 0; - virtual void setX(Q_INT32) = 0; + virtual TQ_INT32 x() const = 0; + virtual void setX(TQ_INT32) = 0; - virtual Q_INT32 y() const = 0; - virtual void setY(Q_INT32) = 0; + virtual TQ_INT32 y() const = 0; + virtual void setY(TQ_INT32) = 0; - virtual KNamedCommand *moveCommand(QPoint oldPosition, QPoint newPosition); + virtual KNamedCommand *moveCommand(TQPoint oldPosition, TQPoint newPosition); /// Returns an approximation of where the bounds on actual data are in this layer - virtual QRect extent() const = 0; + virtual TQRect extent() const = 0; /// Returns the exact bounds of where the actual data resides in this layer - virtual QRect exactBounds() const = 0; + virtual TQRect exactBounds() const = 0; virtual const bool visible() const; virtual void setVisible(bool v); KNamedCommand *setVisibleCommand(bool visiblel); - Q_UINT8 opacity() const; - void setOpacity(Q_UINT8 val); - KNamedCommand *setOpacityCommand(Q_UINT8 val); - KNamedCommand *setOpacityCommand(Q_UINT8 prevOpacity, Q_UINT8 newOpacity); + TQ_UINT8 opacity() const; + void setOpacity(TQ_UINT8 val); + KNamedCommand *setOpacityCommand(TQ_UINT8 val); + KNamedCommand *setOpacityCommand(TQ_UINT8 prevOpacity, TQ_UINT8 newOpacity); bool locked() const; void setLocked(bool l); @@ -184,8 +185,8 @@ public: bool temporary() const; void setTemporary(bool t); - virtual QString name() const; - virtual void setName(const QString& name); + virtual TQString name() const; + virtual void setName(const TQString& name); KisCompositeOp compositeOp() { return m_compositeOp; } void setCompositeOp(const KisCompositeOp& compositeOp); @@ -196,16 +197,16 @@ public: KisUndoAdapter *undoAdapter() const; - /// paints a mask where the selection on this layer resides - virtual void paintSelection(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); - virtual void paintSelection(QImage &img, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize); + /// paints a tqmask where the selection on this layer resides + virtual void paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); + virtual void paintSelection(TQImage &img, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize); /// paints where no data is on this layer. Useful when it is a transparent layer stacked on top of another one - virtual void paintMaskInactiveLayers(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + virtual void paintMaskInactiveLayers(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); - /// Returns a thumbnail in requested size. The QImage may have transparent parts. + /// Returns a thumbnail in requested size. The TQImage may have transparent parts. /// May also return 0 - virtual QImage createThumbnail(Q_INT32 w, Q_INT32 h); + virtual TQImage createThumbnail(TQ_INT32 w, TQ_INT32 h); /// Accept the KisLayerVisitor (for the Visitor design pattern), should call the correct function on the KisLayerVisitor for this layer type virtual bool accept(KisLayerVisitor &) = 0; @@ -217,14 +218,14 @@ private: int m_id; int m_index; - Q_UINT8 m_opacity; + TQ_UINT8 m_opacity; bool m_locked; bool m_visible; bool m_temporary; // XXX: keep a list of dirty rects instead of always aggegrating them - QRect m_dirtyRect; - QString m_name; + TQRect m_dirtyRect; + TQString m_name; KisGroupLayerSP m_parent; KisImage *m_image; @@ -237,15 +238,15 @@ class KRITACORE_EXPORT KisLayerSupportsIndirectPainting { // To simulate the indirect painting KisPaintDeviceSP m_temporaryTarget; KisCompositeOp m_compositeOp; - Q_UINT8 m_compositeOpacity; + TQ_UINT8 m_compositeOpacity; public: // Indirect painting void setTemporaryTarget(KisPaintDeviceSP t); void setTemporaryCompositeOp(const KisCompositeOp& c); - void setTemporaryOpacity(Q_UINT8 o); + void setTemporaryOpacity(TQ_UINT8 o); KisPaintDeviceSP temporaryTarget(); KisCompositeOp temporaryCompositeOp() const; - Q_UINT8 temporaryOpacity() const; + TQ_UINT8 temporaryOpacity() const; // Or I could make KisLayer a virtual base of KisLayerSupportsIndirectPainting and so, but // I'm sure virtual diamond inheritance isn't as appreciated as this diff --git a/krita/core/kis_math_toolbox.cpp b/krita/core/kis_math_toolbox.cpp index d0f49e71..f4fdf88c 100644 --- a/krita/core/kis_math_toolbox.cpp +++ b/krita/core/kis_math_toolbox.cpp @@ -44,36 +44,36 @@ KisMathToolboxFactoryRegistry::~KisMathToolboxFactoryRegistry() { } template<typename T> -double toDouble(Q_UINT8* data, int channelpos ) +double toDouble(TQ_UINT8* data, int channelpos ) { return (float)( *((T*)(data + channelpos)) ); } -typedef double (*PtrToDouble)(Q_UINT8*, int); +typedef double (*PtrToDouble)(TQ_UINT8*, int); template<typename T> -void fromDouble(Q_UINT8* data, int channelpos, double v ) +void fromDouble(TQ_UINT8* data, int channelpos, double v ) { *((T*)(data + channelpos)) = (T)v; } -typedef void (*PtrFromDouble)(Q_UINT8*, int, double); +typedef void (*PtrFromDouble)(TQ_UINT8*, int, double); -void KisMathToolbox::transformToFR(KisPaintDeviceSP src, KisFloatRepresentation* fr, const QRect& rect) +void KisMathToolbox::transformToFR(KisPaintDeviceSP src, KisFloatRepresentation* fr, const TQRect& rect) { - Q_INT32 depth = src->colorSpace()->nColorChannels(); - QMemArray<PtrToDouble> f(depth); - QValueVector<KisChannelInfo *> cis = src->colorSpace()->channels(); - for(Q_INT32 k = 0; k < depth; k++) + TQ_INT32 depth = src->colorSpace()->nColorChannels(); + TQMemArray<PtrToDouble> f(depth); + TQValueVector<KisChannelInfo *> cis = src->colorSpace()->channels(); + for(TQ_INT32 k = 0; k < depth; k++) { switch( cis[k]->channelValueType() ) { case KisChannelInfo::UINT8: - f[k] = toDouble<Q_UINT8>; + f[k] = toDouble<TQ_UINT8>; break; case KisChannelInfo::UINT16: - f[k] = toDouble<Q_UINT16>; + f[k] = toDouble<TQ_UINT16>; break; #ifdef HAVE_OPENEXR case KisChannelInfo::FLOAT16: @@ -84,10 +84,10 @@ void KisMathToolbox::transformToFR(KisPaintDeviceSP src, KisFloatRepresentation* f[k] = toDouble<float>; break; case KisChannelInfo::INT8: - f[k] = toDouble<Q_INT8>; + f[k] = toDouble<TQ_INT8>; break; case KisChannelInfo::INT16: - f[k] = toDouble<Q_INT16>; + f[k] = toDouble<TQ_INT16>; break; default: kdWarning() << "Unsupported value type in KisMathToolbox" << endl; @@ -101,7 +101,7 @@ void KisMathToolbox::transformToFR(KisPaintDeviceSP src, KisFloatRepresentation* float *dstIt = fr->coeffs + (i-rect.y()) * fr->size * fr->depth; while( ! srcIt.isDone() ) { - Q_UINT8* v1 = srcIt.rawData(); + TQ_UINT8* v1 = srcIt.rawData(); for( int k = 0; k < depth; k++) { *dstIt = f[k](v1, cis[k]->pos()); @@ -112,20 +112,20 @@ void KisMathToolbox::transformToFR(KisPaintDeviceSP src, KisFloatRepresentation* } } -void KisMathToolbox::transformFromFR(KisPaintDeviceSP dst, KisFloatRepresentation* fr, const QRect& rect) +void KisMathToolbox::transformFromFR(KisPaintDeviceSP dst, KisFloatRepresentation* fr, const TQRect& rect) { - Q_INT32 depth = dst->colorSpace()->nColorChannels(); - QMemArray<PtrFromDouble> f(depth); - QValueVector<KisChannelInfo *> cis = dst->colorSpace()->channels(); - for(Q_INT32 k = 0; k < depth; k++) + TQ_INT32 depth = dst->colorSpace()->nColorChannels(); + TQMemArray<PtrFromDouble> f(depth); + TQValueVector<KisChannelInfo *> cis = dst->colorSpace()->channels(); + for(TQ_INT32 k = 0; k < depth; k++) { switch( cis[k]->channelValueType() ) { case KisChannelInfo::UINT8: - f[k] = fromDouble<Q_UINT8>; + f[k] = fromDouble<TQ_UINT8>; break; case KisChannelInfo::UINT16: - f[k] = fromDouble<Q_UINT16>; + f[k] = fromDouble<TQ_UINT16>; break; #ifdef HAVE_OPENEXR case KisChannelInfo::FLOAT16: @@ -136,10 +136,10 @@ void KisMathToolbox::transformFromFR(KisPaintDeviceSP dst, KisFloatRepresentatio f[k] = fromDouble<float>; break; case KisChannelInfo::INT8: - f[k] = fromDouble<Q_INT8>; + f[k] = fromDouble<TQ_INT8>; break; case KisChannelInfo::INT16: - f[k] = fromDouble<Q_INT16>; + f[k] = fromDouble<TQ_INT16>; break; default: kdWarning() << "Unsupported value type in KisMathToolbox" << endl; @@ -152,7 +152,7 @@ void KisMathToolbox::transformFromFR(KisPaintDeviceSP dst, KisFloatRepresentatio float *srcIt = fr->coeffs + (i-rect.y()) * fr->size * fr->depth; while( ! dstIt.isDone() ) { - Q_UINT8* v1 = dstIt.rawData(); + TQ_UINT8* v1 = dstIt.rawData(); for( int k = 0; k < depth; k++) { f[k](v1, cis[k]->pos(), *srcIt); diff --git a/krita/core/kis_math_toolbox.h b/krita/core/kis_math_toolbox.h index 0ddc545f..8d5bef50 100644 --- a/krita/core/kis_math_toolbox.h +++ b/krita/core/kis_math_toolbox.h @@ -21,7 +21,7 @@ #ifndef KIS_MATH_TOOLBOX_H #define KIS_MATH_TOOLBOX_H -#include <qobject.h> +#include <tqobject.h> // typedef unsigned int uint; @@ -31,14 +31,15 @@ #include <new> -class KisMathToolbox : public QObject { +class KisMathToolbox : public TQObject { Q_OBJECT + TQ_OBJECT public: struct KisFloatRepresentation { KisFloatRepresentation(uint nsize, uint ndepth) throw(std::bad_alloc ) : coeffs(new float[nsize*nsize*ndepth]) ,size(nsize), depth(ndepth) { // XXX: Valgrind shows that these are being used without being initialised. - for (Q_UINT32 i = 0; i < nsize*nsize*ndepth; ++i) { + for (TQ_UINT32 i = 0; i < nsize*nsize*ndepth; ++i) { coeffs[i] = 0; } } @@ -57,8 +58,8 @@ class KisMathToolbox : public QObject { * This function initialize a wavelet structure * @param lay the layer that will be used for the transformation */ - inline KisWavelet* initWavelet(KisPaintDeviceSP lay, const QRect&) throw(std::bad_alloc ); - inline uint fastWaveletTotalSteps(const QRect&); + inline KisWavelet* initWavelet(KisPaintDeviceSP lay, const TQRect&) throw(std::bad_alloc ); + inline uint fastWaveletTotalSteps(const TQRect&); /** * This function reconstruct the layer from the information of a wavelet * @param src layer from which the wavelet will be computed @@ -67,7 +68,7 @@ class KisMathToolbox : public QObject { * in transformToWavelet and in untransformToWavelet, use initWavelet to initialize * the buffer */ - virtual KisWavelet* fastWaveletTransformation(KisPaintDeviceSP src, const QRect&, KisWavelet* buff = 0) =0; + virtual KisWavelet* fastWaveletTransformation(KisPaintDeviceSP src, const TQRect&, KisWavelet* buff = 0) =0; /** * This function reconstruct the layer from the information of a wavelet * @param dst layer on which the wavelet will be untransform @@ -77,7 +78,7 @@ class KisMathToolbox : public QObject { * in transformToWavelet and in untransformToWavelet, use initWavelet to initialize * the buffer */ - virtual void fastWaveletUntransformation(KisPaintDeviceSP dst, const QRect&, KisWavelet* wav, KisWavelet* buff = 0) =0; + virtual void fastWaveletUntransformation(KisPaintDeviceSP dst, const TQRect&, KisWavelet* wav, KisWavelet* buff = 0) =0; signals: void nextStep(); protected: @@ -85,12 +86,12 @@ class KisMathToolbox : public QObject { * This function transform a paint device into a KisFloatRepresentation, this function is colorspace independant, * for Wavelet, Pyramid and FFT the data is allways the exact value of the channel stored in a float. */ - void transformToFR(KisPaintDeviceSP src, KisFloatRepresentation*, const QRect&); + void transformToFR(KisPaintDeviceSP src, KisFloatRepresentation*, const TQRect&); /** * This function transform a KisFloatRepresentation into a paint device, this function is colorspace independant, * for Wavelet, Pyramid and FFT the data is allways the exact value of the channel stored in a float. */ - void transformFromFR(KisPaintDeviceSP dst, KisFloatRepresentation*, const QRect&); + void transformFromFR(KisPaintDeviceSP dst, KisFloatRepresentation*, const TQRect&); private: KisID m_id; }; @@ -102,16 +103,16 @@ class KisMathToolboxFactoryRegistry : public KisGenericRegistry<KisMathToolbox*> }; -inline KisMathToolbox::KisWavelet* KisMathToolbox::initWavelet(KisPaintDeviceSP src, const QRect& rect) throw(std::bad_alloc ) +inline KisMathToolbox::KisWavelet* KisMathToolbox::initWavelet(KisPaintDeviceSP src, const TQRect& rect) throw(std::bad_alloc ) { int size; int maxrectsize = (rect.height() < rect.width()) ? rect.width() : rect.height(); for(size = 2; size < maxrectsize; size *= 2) ; - Q_INT32 depth = src->colorSpace()->nColorChannels(); + TQ_INT32 depth = src->colorSpace()->nColorChannels(); return new KisWavelet(size, depth); } -inline uint KisMathToolbox::fastWaveletTotalSteps(const QRect& rect) +inline uint KisMathToolbox::fastWaveletTotalSteps(const TQRect& rect) { int size, steps; int maxrectsize = (rect.height() < rect.width()) ? rect.width() : rect.height(); diff --git a/krita/core/kis_merge_visitor.h b/krita/core/kis_merge_visitor.h index 73331591..68053384 100644 --- a/krita/core/kis_merge_visitor.h +++ b/krita/core/kis_merge_visitor.h @@ -20,7 +20,7 @@ #ifndef KIS_MERGE_H_ #define KIS_MERGE_H_ -#include <qrect.h> +#include <tqrect.h> #include "kis_types.h" #include "kis_paint_device.h" @@ -45,7 +45,7 @@ public: * Don't even _think_ of creating a merge visitor without a projection; without a projection, * the adjustmentlayers won't work. */ - KisMergeVisitor(KisPaintDeviceSP projection, const QRect& rc) : + KisMergeVisitor(KisPaintDeviceSP projection, const TQRect& rc) : KisLayerVisitor() { Q_ASSERT(projection); @@ -60,8 +60,8 @@ private: KSharedPtr<Target> paintIndirect(KisPaintDeviceSP source, KSharedPtr<Target> target, KisLayerSupportsIndirectPainting* layer, - Q_INT32 sx, Q_INT32 sy, Q_INT32 dx, Q_INT32 dy, - Q_INT32 w, Q_INT32 h) { + TQ_INT32 sx, TQ_INT32 sy, TQ_INT32 dx, TQ_INT32 dy, + TQ_INT32 w, TQ_INT32 h) { KisPainter gc2(target.data()); gc2.bitBlt(dx, dy, COMPOSITE_COPY, source, OPACITY_OPAQUE, sx, sy, w, h); @@ -85,9 +85,9 @@ public: if (!layer->visible()) return true; - Q_INT32 sx, sy, dx, dy, w, h; + TQ_INT32 sx, sy, dx, dy, w, h; - QRect rc = layer->paintDevice()->extent() & m_rc; + TQRect rc = layer->paintDevice()->extent() & m_rc; // Indirect painting? KisPaintDeviceSP tempTarget = layer->temporaryTarget(); @@ -114,11 +114,11 @@ public: gc.bitBlt(dx, dy, layer->compositeOp(), source, layer->opacity(), sx, sy, w, h); } else { if (layer->renderMask()) { - // To display the mask, we don't do things with composite op and opacity + // To display the tqmask, we don't do things with composite op and opacity // This is like the gimp does it, I guess that's ok? // Note that here we'll use m_rc, because even if the extent of the device is - // empty, we want a full mask to be drawn! (we don't change rc, since + // empty, we want a full tqmask to be drawn! (we don't change rc, since // it'd mess with setClean). This is because KisPainter::bitBlt &'s with // the source device's extent. This is ok in normal circumstances, but // we changed the default tile. Fixing this properly would mean fixing it there. @@ -129,36 +129,36 @@ public: dx = sx; dy = sy; - // The problem is that the extent of the layer mask might not be extended + // The problem is that the extent of the layer tqmask might not be extended // enough. Check if that is the case - KisPaintDeviceSP mask = layer->getMask(); - QRect mextent = mask->extent(); + KisPaintDeviceSP tqmask = layer->getMask(); + TQRect mextent = tqmask->extent(); if ((mextent & m_rc) != m_rc) { // Iterate over all pixels in the m_rc area. With just accessing the // tiles in read-write mode, we ensure that the tiles get created if they // do not exist. If they do, they'll remain untouched since we don't // actually write data to it. // XXX Admission: this is actually kind of a hack :-( - KisRectIteratorPixel it = mask->createRectIterator(sx, sy, w, h, true); + KisRectIteratorPixel it = tqmask->createRectIterator(sx, sy, w, h, true); while (!it.isDone()) ++it; } if (tempTarget) { KisPaintDeviceSP temp = new KisPaintDevice(source->colorSpace()); - mask = paintIndirect(mask, temp, layer, sx, sy, dx, dy, w, h); + tqmask = paintIndirect(tqmask, temp, layer, sx, sy, dx, dy, w, h); } - gc.bitBlt(dx, dy, COMPOSITE_OVER, mask, OPACITY_OPAQUE, sx, sy, w, h); + gc.bitBlt(dx, dy, COMPOSITE_OVER, tqmask, OPACITY_OPAQUE, sx, sy, w, h); } else { - KisSelectionSP mask = layer->getMaskAsSelection(); - // The indirect painting happens on the mask + KisSelectionSP tqmask = layer->getMaskAsSelection(); + // The indirect painting happens on the tqmask if (tempTarget && layer->editMask()) { - KisPaintDeviceSP maskSrc = layer->getMask(); - KisPaintDeviceSP temp = new KisPaintDevice(maskSrc->colorSpace()); - temp = paintIndirect(maskSrc, temp, layer, sx, sy, dx, dy, w, h); + KisPaintDeviceSP tqmaskSrc = layer->getMask(); + KisPaintDeviceSP temp = new KisPaintDevice(tqmaskSrc->colorSpace()); + temp = paintIndirect(tqmaskSrc, temp, layer, sx, sy, dx, dy, w, h); // Blegh KisRectIteratorPixel srcIt = temp->createRectIterator(sx, sy, w, h, false); - KisRectIteratorPixel dstIt = mask->createRectIterator(sx, sy, w, h, true); + KisRectIteratorPixel dstIt = tqmask->createRectIterator(sx, sy, w, h, true); while(!dstIt.isDone()) { // Same as in convertMaskToSelection @@ -167,7 +167,7 @@ public: ++dstIt; } } else if (tempTarget) { - // We have a mask, and paint indirect, but not on the mask + // We have a tqmask, and paint indirect, but not on the tqmask KisPaintDeviceSP temp = new KisPaintDevice(source->colorSpace()); source = paintIndirect(source, temp, layer, sx, sy, dx, dy, w, h); } @@ -175,7 +175,7 @@ public: gc.bltSelection(dx, dy, layer->compositeOp(), source, - mask, + tqmask, layer->opacity(), sx, sy, w, h); } } @@ -197,11 +197,11 @@ public: if (!layer->visible()) return true; - Q_INT32 sx, sy, dx, dy, w, h; + TQ_INT32 sx, sy, dx, dy, w, h; // This automatically makes sure the projection is up-to-date for the specified rect. KisPaintDeviceSP dev = layer->projection(m_rc); - QRect rc = dev->extent() & m_rc; + TQRect rc = dev->extent() & m_rc; sx = rc.left(); sy = rc.top(); @@ -232,9 +232,9 @@ public: if (!dev) return true; - Q_INT32 sx, sy, dx, dy, w, h; + TQ_INT32 sx, sy, dx, dy, w, h; - QRect rc = dev->extent() & m_rc; + TQRect rc = dev->extent() & m_rc; sx= rc.left(); sy = rc.top(); @@ -290,7 +290,7 @@ public: tmp = new KisPaintDevice(m_projection->colorSpace()); KisPainter gc(tmp); - QRect selectedRect = selection->selectedRect(); + TQRect selectedRect = selection->selectedRect(); selectedRect &= m_rc; if (selectedRect.width() == 0 || selectedRect.height() == 0) // Don't even try @@ -351,7 +351,7 @@ public: private: KisPaintDeviceSP m_projection; - QRect m_rc; + TQRect m_rc; }; #endif // KIS_MERGE_H_ diff --git a/krita/core/kis_meta_registry.cc b/krita/core/kis_meta_registry.cc index 70f21f76..9ef2c67f 100644 --- a/krita/core/kis_meta_registry.cc +++ b/krita/core/kis_meta_registry.cc @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qstringlist.h> -#include <qdir.h> +#include <tqstringlist.h> +#include <tqdir.h> #include <kstandarddirs.h> #include <kglobal.h> @@ -39,10 +39,10 @@ KisMetaRegistry::KisMetaRegistry() // Add those things here as well, since we are not yet using KisDoc's KisFactory instance (which inits these as well) KGlobal::instance()->dirs()->addResourceType("kis_profiles", KStandardDirs::kde_default("data") + "krita/profiles/"); KGlobal::instance()->dirs()->addResourceDir("kis_profiles", "/usr/share/color/icc"); - KGlobal::instance()->dirs()->addResourceDir("kis_profiles", QDir::homeDirPath() + QString("/.icc/")); - KGlobal::instance()->dirs()->addResourceDir("kis_profiles", QDir::homeDirPath() + QString("/.color/icc/")); + KGlobal::instance()->dirs()->addResourceDir("kis_profiles", TQDir::homeDirPath() + TQString("/.icc/")); + KGlobal::instance()->dirs()->addResourceDir("kis_profiles", TQDir::homeDirPath() + TQString("/.color/icc/")); - QStringList profileFilenames; + TQStringList profileFilenames; profileFilenames += KGlobal::instance()->dirs()->findAllResources("kis_profiles", "*.icm", true /* recursive */); profileFilenames += KGlobal::instance()->dirs()->findAllResources("kis_profiles", "*.ICM", true); profileFilenames += KGlobal::instance()->dirs()->findAllResources("kis_profiles", "*.ICC", true); diff --git a/krita/core/kis_nameserver.cc b/krita/core/kis_nameserver.cc index bdc59ca2..ff66144d 100644 --- a/krita/core/kis_nameserver.cc +++ b/krita/core/kis_nameserver.cc @@ -17,7 +17,7 @@ */ #include "kis_nameserver.h" -KisNameServer::KisNameServer(const QString& prefix, Q_INT32 seed) +KisNameServer::KisNameServer(const TQString& prefix, TQ_INT32 seed) { m_prefix = prefix; m_generator = seed; @@ -27,17 +27,17 @@ KisNameServer::~KisNameServer() { } -QString KisNameServer::name() +TQString KisNameServer::name() { - return m_prefix.arg(m_generator++); + return m_prefix.tqarg(m_generator++); } -Q_INT32 KisNameServer::currentSeed() const +TQ_INT32 KisNameServer::currentSeed() const { return m_generator; } -Q_INT32 KisNameServer::number() +TQ_INT32 KisNameServer::number() { return m_generator++; } diff --git a/krita/core/kis_nameserver.h b/krita/core/kis_nameserver.h index 1e4c560d..a6989853 100644 --- a/krita/core/kis_nameserver.h +++ b/krita/core/kis_nameserver.h @@ -18,22 +18,22 @@ #ifndef KIS_NAMESERVER_H_ #define KIS_NAMESERVER_H_ -#include <qstring.h> +#include <tqstring.h> #include "kis_global.h" class KisNameServer { public: - KisNameServer(const QString& prefix, Q_INT32 seed = 1); + KisNameServer(const TQString& prefix, TQ_INT32 seed = 1); ~KisNameServer(); - QString name(); - Q_INT32 number(); - Q_INT32 currentSeed() const; + TQString name(); + TQ_INT32 number(); + TQ_INT32 currentSeed() const; void rollback(); private: - Q_INT32 m_generator; - QString m_prefix; + TQ_INT32 m_generator; + TQString m_prefix; }; #endif // KIS_NAMESERVER_H_ diff --git a/krita/core/kis_paint_device.cc b/krita/core/kis_paint_device.cc index 4bf15c1d..a6942626 100644 --- a/krita/core/kis_paint_device.cc +++ b/krita/core/kis_paint_device.cc @@ -16,13 +16,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qrect.h> -#include <qwmatrix.h> -#include <qimage.h> -#include <qdatetime.h> -#include <qapplication.h> -#include <qvaluelist.h> -#include <qtimer.h> +#include <tqrect.h> +#include <tqwmatrix.h> +#include <tqimage.h> +#include <tqdatetime.h> +#include <tqapplication.h> +#include <tqvaluelist.h> +#include <tqtimer.h> #include <kcommand.h> #include <klocale.h> @@ -61,7 +61,7 @@ namespace { typedef KNamedCommand super; public: - KisPaintDeviceCommand(const QString& name, KisPaintDeviceSP paintDevice); + KisPaintDeviceCommand(const TQString& name, KisPaintDeviceSP paintDevice); virtual ~KisPaintDeviceCommand() {} virtual void execute() = 0; @@ -73,7 +73,7 @@ namespace { KisPaintDeviceSP m_paintDevice; }; - KisPaintDeviceCommand::KisPaintDeviceCommand(const QString& name, KisPaintDeviceSP paintDevice) : + KisPaintDeviceCommand::KisPaintDeviceCommand(const TQString& name, KisPaintDeviceSP paintDevice) : super(name), m_paintDevice(paintDevice) { } @@ -89,24 +89,24 @@ namespace { typedef KNamedCommand super; public: - MoveCommand(KisPaintDeviceSP device, const QPoint& oldpos, const QPoint& newpos); + MoveCommand(KisPaintDeviceSP device, const TQPoint& oldpos, const TQPoint& newpos); virtual ~MoveCommand(); virtual void execute(); virtual void unexecute(); private: - void moveTo(const QPoint& pos); + void moveTo(const TQPoint& pos); void undoOff(); void undoOn(); private: KisPaintDeviceSP m_device; - QPoint m_oldPos; - QPoint m_newPos; + TQPoint m_oldPos; + TQPoint m_newPos; }; - MoveCommand::MoveCommand(KisPaintDeviceSP device, const QPoint& oldpos, const QPoint& newpos) : + MoveCommand::MoveCommand(KisPaintDeviceSP device, const TQPoint& oldpos, const TQPoint& newpos) : super(i18n("Move Layer")) { m_device = device; @@ -146,7 +146,7 @@ namespace { undoOn(); } - void MoveCommand::moveTo(const QPoint& pos) + void MoveCommand::moveTo(const TQPoint& pos) { m_device->move(pos.x(), pos.y()); } @@ -202,7 +202,7 @@ namespace { } KisPaintDevice::KisPaintDevice(KisColorSpace * colorSpace, const char * name) : - QObject(0, name), KShared(), m_exifInfo(0), m_lock( false ) + TQObject(0, name), KShared(), m_exifInfo(0), m_lock( false ) { if (colorSpace == 0) { kdWarning(41001) << "Cannot create paint device without colorstrategy!\n"; @@ -217,8 +217,8 @@ KisPaintDevice::KisPaintDevice(KisColorSpace * colorSpace, const char * name) : m_pixelSize = colorSpace->pixelSize(); m_nChannels = colorSpace->nChannels(); - Q_UINT8* defPixel = new Q_UINT8 [ m_pixelSize ]; - colorSpace->fromQColor(Qt::black, OPACITY_TRANSPARENT, defPixel); + TQ_UINT8* defPixel = new TQ_UINT8 [ m_pixelSize ]; + colorSpace->fromTQColor(TQt::black, OPACITY_TRANSPARENT, defPixel); m_datamanager = new KisDataManager(m_pixelSize, defPixel); delete [] defPixel; @@ -236,8 +236,8 @@ KisPaintDevice::KisPaintDevice(KisColorSpace * colorSpace, const char * name) : } -KisPaintDevice::KisPaintDevice(KisLayer *parent, KisColorSpace * colorSpace, const char * name) : - QObject(0, name), KShared(), m_exifInfo(0), m_lock( false ) +KisPaintDevice::KisPaintDevice(KisLayer *tqparent, KisColorSpace * colorSpace, const char * name) : + TQObject(0, name), KShared(), m_exifInfo(0), m_lock( false ) { m_longRunningFilterTimer = 0; @@ -250,10 +250,10 @@ KisPaintDevice::KisPaintDevice(KisLayer *parent, KisColorSpace * colorSpace, con m_selectionDeselected = false; m_selection = 0; - m_parentLayer = parent; + m_parentLayer = tqparent; - if (colorSpace == 0 && parent != 0 && parent->image() != 0) { - m_colorSpace = parent->image()->colorSpace(); + if (colorSpace == 0 && tqparent != 0 && tqparent->image() != 0) { + m_colorSpace = tqparent->image()->colorSpace(); } else { m_colorSpace = colorSpace; @@ -264,27 +264,27 @@ KisPaintDevice::KisPaintDevice(KisLayer *parent, KisColorSpace * colorSpace, con m_pixelSize = m_colorSpace->pixelSize(); m_nChannels = m_colorSpace->nChannels(); - Q_UINT8* defPixel = new Q_UINT8[ m_pixelSize ]; - m_colorSpace->fromQColor(Qt::black, OPACITY_TRANSPARENT, defPixel); + TQ_UINT8* defPixel = new TQ_UINT8[ m_pixelSize ]; + m_colorSpace->fromTQColor(TQt::black, OPACITY_TRANSPARENT, defPixel); m_datamanager = new KisDataManager(m_pixelSize, defPixel); delete [] defPixel; Q_CHECK_PTR(m_datamanager); m_extentIsValid = true; - if ( QString ( name ) == QString( "Layer 1" ) ) { + if ( TQString ( name ) == TQString( "Layer 1" ) ) { m_longRunningFilters = m_colorSpace->createBackgroundFilters(); if (!m_longRunningFilters.isEmpty()) { - m_longRunningFilterTimer = new QTimer(this); - connect(m_longRunningFilterTimer, SIGNAL(timeout()), this, SLOT(runBackgroundFilters())); + m_longRunningFilterTimer = new TQTimer(this); + connect(m_longRunningFilterTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(runBackgroundFilters())); m_longRunningFilterTimer->start(2000); } } } -KisPaintDevice::KisPaintDevice(const KisPaintDevice& rhs) : QObject(), KShared(rhs) +KisPaintDevice::KisPaintDevice(const KisPaintDevice& rhs) : TQObject(), KShared(rhs) { if (this != &rhs) { m_longRunningFilterTimer = 0; @@ -324,8 +324,8 @@ KisPaintDevice::~KisPaintDevice() { delete m_dcop; delete m_longRunningFilterTimer; - QValueList<KisFilter*>::iterator it; - QValueList<KisFilter*>::iterator end = m_longRunningFilters.end(); + TQValueList<KisFilter*>::iterator it; + TQValueList<KisFilter*>::iterator end = m_longRunningFilters.end(); for (it = m_longRunningFilters.begin(); it != end; ++it) { KisFilter * f = (*it); delete f; @@ -343,17 +343,17 @@ DCOPObject *KisPaintDevice::dcopObject() return m_dcop; } -KisLayer *KisPaintDevice::parentLayer() const +KisLayer *KisPaintDevice::tqparentLayer() const { return m_parentLayer; } -void KisPaintDevice::setParentLayer(KisLayer *parentLayer) +void KisPaintDevice::setParentLayer(KisLayer *tqparentLayer) { - m_parentLayer = parentLayer; + m_parentLayer = tqparentLayer; } -void KisPaintDevice::setDirty(const QRect & rc) +void KisPaintDevice::setDirty(const TQRect & rc) { if (m_parentLayer) m_parentLayer->setDirty(rc); } @@ -373,9 +373,9 @@ KisImage *KisPaintDevice::image() const } -void KisPaintDevice::move(Q_INT32 x, Q_INT32 y) +void KisPaintDevice::move(TQ_INT32 x, TQ_INT32 y) { - QRect dirtyRect = extent(); + TQRect dirtyRect = extent(); m_x = x; m_y = y; @@ -393,31 +393,31 @@ void KisPaintDevice::move(Q_INT32 x, Q_INT32 y) emit positionChanged(this); } -void KisPaintDevice::move(const QPoint& pt) +void KisPaintDevice::move(const TQPoint& pt) { move(pt.x(), pt.y()); } -KNamedCommand * KisPaintDevice::moveCommand(Q_INT32 x, Q_INT32 y) +KNamedCommand * KisPaintDevice::moveCommand(TQ_INT32 x, TQ_INT32 y) { - KNamedCommand * cmd = new MoveCommand(this, QPoint(m_x, m_y), QPoint(x, y)); + KNamedCommand * cmd = new MoveCommand(this, TQPoint(m_x, m_y), TQPoint(x, y)); Q_CHECK_PTR(cmd); cmd->execute(); return cmd; } -void KisPaintDevice::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const +void KisPaintDevice::extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const { m_datamanager->extent(x, y, w, h); x += m_x; y += m_y; } -QRect KisPaintDevice::extent() const +TQRect KisPaintDevice::extent() const { - Q_INT32 x, y, w, h; + TQ_INT32 x, y, w, h; extent(x, y, w, h); - return QRect(x, y, w, h); + return TQRect(x, y, w, h); } bool KisPaintDevice::extentIsValid() const @@ -430,27 +430,27 @@ void KisPaintDevice::setExtentIsValid(bool isValid) m_extentIsValid = isValid; } -void KisPaintDevice::exactBounds(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const +void KisPaintDevice::exactBounds(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const { - QRect r = exactBounds(); + TQRect r = exactBounds(); x = r.x(); y = r.y(); w = r.width(); h = r.height(); } -QRect KisPaintDevice::exactBoundsOldMethod() const +TQRect KisPaintDevice::exactBoundsOldMethod() const { - Q_INT32 x, y, w, h, boundX, boundY, boundW, boundH; + TQ_INT32 x, y, w, h, boundX, boundY, boundW, boundH; extent(x, y, w, h); extent(boundX, boundY, boundW, boundH); - const Q_UINT8* defaultPixel = m_datamanager->defaultPixel(); + const TQ_UINT8* defaultPixel = m_datamanager->defaultPixel(); bool found = false; - for (Q_INT32 y2 = y; y2 < y + h ; ++y2) { + for (TQ_INT32 y2 = y; y2 < y + h ; ++y2) { KisHLineIterator it = const_cast<KisPaintDevice *>(this)->createHLineIterator(x, y2, w, false); while (!it.isDone() && found == false) { if (memcmp(it.rawData(), defaultPixel, m_pixelSize) != 0) { @@ -465,7 +465,7 @@ QRect KisPaintDevice::exactBoundsOldMethod() const found = false; - for (Q_INT32 y2 = y + h; y2 > y ; --y2) { + for (TQ_INT32 y2 = y + h; y2 > y ; --y2) { KisHLineIterator it = const_cast<KisPaintDevice *>(this)->createHLineIterator(x, y2, w, false); while (!it.isDone() && found == false) { if (memcmp(it.rawData(), defaultPixel, m_pixelSize) != 0) { @@ -479,7 +479,7 @@ QRect KisPaintDevice::exactBoundsOldMethod() const } found = false; - for (Q_INT32 x2 = x; x2 < x + w ; ++x2) { + for (TQ_INT32 x2 = x; x2 < x + w ; ++x2) { KisVLineIterator it = const_cast<KisPaintDevice *>(this)->createVLineIterator(x2, y, h, false); while (!it.isDone() && found == false) { if (memcmp(it.rawData(), defaultPixel, m_pixelSize) != 0) { @@ -495,7 +495,7 @@ QRect KisPaintDevice::exactBoundsOldMethod() const found = false; // Look for right edge ) - for (Q_INT32 x2 = x + w; x2 > x ; --x2) { + for (TQ_INT32 x2 = x + w; x2 > x ; --x2) { KisVLineIterator it = const_cast<KisPaintDevice *>(this)->createVLineIterator(x2, y, h, false); while (!it.isDone() && found == false) { if (memcmp(it.rawData(), defaultPixel, m_pixelSize) != 0) { @@ -514,21 +514,21 @@ QRect KisPaintDevice::exactBoundsOldMethod() const if (found) break; } - return QRect(boundX, boundY, boundW, boundH); + return TQRect(boundX, boundY, boundW, boundH); } -QRect KisPaintDevice::exactBoundsImprovedOldMethod() const +TQRect KisPaintDevice::exactBoundsImprovedOldMethod() const { // Solution n°2 - Q_INT32 x, y, w, h, boundX2, boundY2, boundW2, boundH2; + TQ_INT32 x, y, w, h, boundX2, boundY2, boundW2, boundH2; extent(x, y, w, h); extent(boundX2, boundY2, boundW2, boundH2); - const Q_UINT8* defaultPixel = m_datamanager->defaultPixel(); + const TQ_UINT8* defaultPixel = m_datamanager->defaultPixel(); bool found = false; { KisHLineIterator it = const_cast<KisPaintDevice *>(this)->createHLineIterator(x, y, w, false); - for (Q_INT32 y2 = y; y2 < y + h ; ++y2) { + for (TQ_INT32 y2 = y; y2 < y + h ; ++y2) { while (!it.isDone() && found == false) { if (memcmp(it.rawData(), defaultPixel, m_pixelSize) != 0) { boundY2 = y2; @@ -544,7 +544,7 @@ QRect KisPaintDevice::exactBoundsImprovedOldMethod() const found = false; - for (Q_INT32 y2 = y + h; y2 > y ; --y2) { + for (TQ_INT32 y2 = y + h; y2 > y ; --y2) { KisHLineIterator it = const_cast<KisPaintDevice *>(this)->createHLineIterator(x, y2, w, false); while (!it.isDone() && found == false) { if (memcmp(it.rawData(), defaultPixel, m_pixelSize) != 0) { @@ -560,7 +560,7 @@ QRect KisPaintDevice::exactBoundsImprovedOldMethod() const { KisVLineIterator it = const_cast<KisPaintDevice *>(this)->createVLineIterator(x, boundY2, boundH2, false); - for (Q_INT32 x2 = x; x2 < x + w ; ++x2) { + for (TQ_INT32 x2 = x; x2 < x + w ; ++x2) { while (!it.isDone() && found == false) { if (memcmp(it.rawData(), defaultPixel, m_pixelSize) != 0) { boundX2 = x2; @@ -578,7 +578,7 @@ QRect KisPaintDevice::exactBoundsImprovedOldMethod() const // Look for right edge ) { - for (Q_INT32 x2 = x + w; x2 > x ; --x2) { + for (TQ_INT32 x2 = x + w; x2 > x ; --x2) { KisVLineIterator it = const_cast<KisPaintDevice *>(this)->createVLineIterator(/*x + w*/ x2, boundY2, boundH2, false); while (!it.isDone() && found == false) { if (memcmp(it.rawData(), defaultPixel, m_pixelSize) != 0) { @@ -597,23 +597,23 @@ QRect KisPaintDevice::exactBoundsImprovedOldMethod() const if (found) break; } } - return QRect(boundX2, boundY2, boundW2, boundH2); + return TQRect(boundX2, boundY2, boundW2, boundH2); } -QRect KisPaintDevice::exactBounds() const +TQRect KisPaintDevice::exactBounds() const { - QRect r2 = exactBoundsImprovedOldMethod(); + TQRect r2 = exactBoundsImprovedOldMethod(); return r2; } -void KisPaintDevice::crop(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +void KisPaintDevice::crop(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { m_datamanager->setExtent(x - m_x, y - m_y, w, h); } -void KisPaintDevice::crop(QRect r) +void KisPaintDevice::crop(TQRect r) { r.moveBy(-m_x, -m_y); m_datamanager->setExtent(r); } @@ -623,14 +623,14 @@ void KisPaintDevice::clear() m_datamanager->clear(); } -void KisPaintDevice::fill(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const Q_UINT8 *fillPixel) +void KisPaintDevice::fill(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *fillPixel) { m_datamanager->clear(x, y, w, h, fillPixel); } void KisPaintDevice::mirrorX() { - QRect r; + TQRect r; if (hasSelection()) { r = selection()->selectedRect(); } @@ -638,7 +638,7 @@ void KisPaintDevice::mirrorX() r = exactBounds(); } - for (Q_INT32 y = r.top(); y <= r.bottom(); ++y) { + for (TQ_INT32 y = r.top(); y <= r.bottom(); ++y) { KisHLineIteratorPixel srcIt = createHLineIterator(r.x(), y, r.width(), false); KisHLineIteratorPixel dstIt = createHLineIterator(r.x(), y, r.width(), true); @@ -661,7 +661,7 @@ void KisPaintDevice::mirrorX() void KisPaintDevice::mirrorY() { /* Read a line from bottom to top and and from top to bottom and write their values to each other */ - QRect r; + TQRect r; if (hasSelection()) { r = selection()->selectedRect(); } @@ -670,7 +670,7 @@ void KisPaintDevice::mirrorY() } - Q_INT32 y1, y2; + TQ_INT32 y1, y2; for (y1 = r.top(), y2 = r.bottom(); y1 <= r.bottom(); ++y1, --y2) { KisHLineIteratorPixel itTop = createHLineIterator(r.x(), y1, r.width(), true); KisHLineIteratorPixel itBottom = createHLineIterator(r.x(), y2, r.width(), false); @@ -713,7 +713,7 @@ bool KisPaintDevice::read(KoStore *store) return retval; } -void KisPaintDevice::convertTo(KisColorSpace * dstColorSpace, Q_INT32 renderingIntent) +void KisPaintDevice::convertTo(KisColorSpace * dstColorSpace, TQ_INT32 renderingIntent) { kdDebug(41004) << "Converting " << name() << " to " << dstColorSpace->id().id() << " from " << m_colorSpace->id().id() << "\n"; @@ -726,29 +726,29 @@ void KisPaintDevice::convertTo(KisColorSpace * dstColorSpace, Q_INT32 renderingI dst.setX(getX()); dst.setY(getY()); - Q_INT32 x, y, w, h; + TQ_INT32 x, y, w, h; extent(x, y, w, h); - for (Q_INT32 row = y; row < y + h; ++row) { + for (TQ_INT32 row = y; row < y + h; ++row) { - Q_INT32 column = x; - Q_INT32 columnsRemaining = w; + TQ_INT32 column = x; + TQ_INT32 columnsRemaining = w; while (columnsRemaining > 0) { - Q_INT32 numContiguousDstColumns = dst.numContiguousColumns(column, row, row); - Q_INT32 numContiguousSrcColumns = numContiguousColumns(column, row, row); + TQ_INT32 numContiguousDstColumns = dst.numContiguousColumns(column, row, row); + TQ_INT32 numContiguousSrcColumns = numContiguousColumns(column, row, row); - Q_INT32 columns = QMIN(numContiguousDstColumns, numContiguousSrcColumns); - columns = QMIN(columns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousDstColumns, numContiguousSrcColumns); + columns = TQMIN(columns, columnsRemaining); - //const Q_UINT8 *srcData = pixel(column, row); - //Q_UINT8 *dstData = dst.writablePixel(column, row); + //const TQ_UINT8 *srcData = pixel(column, row); + //TQ_UINT8 *dstData = dst.writablePixel(column, row); KisHLineIteratorPixel srcIt = createHLineIterator(column, row, columns, false); KisHLineIteratorPixel dstIt = dst.createHLineIterator(column, row, columns, true); - const Q_UINT8 *srcData = srcIt.rawData(); - Q_UINT8 *dstData = dstIt.rawData(); + const TQ_UINT8 *srcData = srcIt.rawData(); + TQ_UINT8 *dstData = dstIt.rawData(); m_colorSpace->convertPixelsTo(srcData, dstData, dstColorSpace, columns, renderingIntent); @@ -801,14 +801,14 @@ KisUndoAdapter *KisPaintDevice::undoAdapter() const return 0; } -void KisPaintDevice::convertFromQImage(const QImage& image, const QString &srcProfileName, - Q_INT32 offsetX, Q_INT32 offsetY) +void KisPaintDevice::convertFromTQImage(const TQImage& image, const TQString &srcProfileName, + TQ_INT32 offsetX, TQ_INT32 offsetY) { - QImage img = image; + TQImage img = image; // Krita is little-endian inside. - if (img.bitOrder() == QImage::LittleEndian) { - img = img.convertBitOrder(QImage::BigEndian); + if (img.bitOrder() == TQImage::LittleEndian) { + img = img.convertBitOrder(TQImage::BigEndian); } kdDebug() << k_funcinfo << img.bitOrder()<< endl; // Krita likes bgra (convertDepth returns *this is the img is alread 32 bits) @@ -820,7 +820,7 @@ void KisPaintDevice::convertFromQImage(const QImage& image, const QString &srcPr } else { #endif - Q_UINT8 * dstData = new Q_UINT8[img.width() * img.height() * pixelSize()]; + TQ_UINT8 * dstData = new TQ_UINT8[img.width() * img.height() * pixelSize()]; KisMetaRegistry::instance()->csRegistry() ->getColorSpace(KisID("RGBA",""),srcProfileName)-> convertPixelsTo(img.bits(), dstData, colorSpace(), img.width() * img.height()); @@ -828,12 +828,12 @@ void KisPaintDevice::convertFromQImage(const QImage& image, const QString &srcPr // } } -QImage KisPaintDevice::convertToQImage(KisProfile * dstProfile, float exposure) +TQImage KisPaintDevice::convertToTQImage(KisProfile * dstProfile, float exposure) { - Q_INT32 x1; - Q_INT32 y1; - Q_INT32 w; - Q_INT32 h; + TQ_INT32 x1; + TQ_INT32 y1; + TQ_INT32 w; + TQ_INT32 h; x1 = - getX(); y1 = - getY(); @@ -846,31 +846,31 @@ QImage KisPaintDevice::convertToQImage(KisProfile * dstProfile, float exposure) extent(x1, y1, w, h); } - return convertToQImage(dstProfile, x1, y1, w, h, exposure); + return convertToTQImage(dstProfile, x1, y1, w, h, exposure); } -// XXX: is this faster than building the QImage ourselves? It makes -QImage KisPaintDevice::convertToQImage(KisProfile * dstProfile, Q_INT32 x1, Q_INT32 y1, Q_INT32 w, Q_INT32 h, float exposure) +// XXX: is this faster than building the TQImage ourselves? It makes +TQImage KisPaintDevice::convertToTQImage(KisProfile * dstProfile, TQ_INT32 x1, TQ_INT32 y1, TQ_INT32 w, TQ_INT32 h, float exposure) { if (w < 0) - return QImage(); + return TQImage(); if (h < 0) - return QImage(); + return TQImage(); - Q_UINT8 * data = new Q_UINT8 [w * h * m_pixelSize]; + TQ_UINT8 * data = new TQ_UINT8 [w * h * m_pixelSize]; Q_CHECK_PTR(data); - // XXX: Is this really faster than converting line by line and building the QImage directly? + // XXX: Is this really faster than converting line by line and building the TQImage directly? // This copies potentially a lot of data. readBytes(data, x1, y1, w, h); - QImage image = colorSpace()->convertToQImage(data, w, h, dstProfile, INTENT_PERCEPTUAL, exposure); + TQImage image = colorSpace()->convertToTQImage(data, w, h, dstProfile, INTENT_PERCEPTUAL, exposure); delete[] data; return image; } -KisPaintDeviceSP KisPaintDevice::createThumbnailDevice(Q_INT32 w, Q_INT32 h) +KisPaintDeviceSP KisPaintDevice::createThumbnailDevice(TQ_INT32 w, TQ_INT32 h) { KisPaintDeviceSP thumbnail = new KisPaintDevice(colorSpace(), "thumbnail"); @@ -884,7 +884,7 @@ KisPaintDeviceSP KisPaintDevice::createThumbnailDevice(Q_INT32 w, Q_INT32 h) } else { - const QRect e = exactBounds(); + const TQRect e = exactBounds(); srcw = e.width(); srch = e.height(); } @@ -892,23 +892,23 @@ KisPaintDeviceSP KisPaintDevice::createThumbnailDevice(Q_INT32 w, Q_INT32 h) if (w > srcw) { w = srcw; - h = Q_INT32(double(srcw) / w * h); + h = TQ_INT32(double(srcw) / w * h); } if (h > srch) { h = srch; - w = Q_INT32(double(srch) / h * w); + w = TQ_INT32(double(srch) / h * w); } if (srcw > srch) - h = Q_INT32(double(srch) / srcw * w); + h = TQ_INT32(double(srch) / srcw * w); else if (srch > srcw) - w = Q_INT32(double(srcw) / srch * h); + w = TQ_INT32(double(srcw) / srch * h); - for (Q_INT32 y=0; y < h; ++y) { - Q_INT32 iY = (y * srch ) / h; - for (Q_INT32 x=0; x < w; ++x) { - Q_INT32 iX = (x * srcw ) / w; + for (TQ_INT32 y=0; y < h; ++y) { + TQ_INT32 iY = (y * srch ) / h; + for (TQ_INT32 x=0; x < w; ++x) { + TQ_INT32 iX = (x * srcw ) / w; thumbnail->setPixel(x, y, colorAt(iX, iY)); } } @@ -918,7 +918,7 @@ KisPaintDeviceSP KisPaintDevice::createThumbnailDevice(Q_INT32 w, Q_INT32 h) } -QImage KisPaintDevice::createThumbnail(Q_INT32 w, Q_INT32 h) +TQImage KisPaintDevice::createThumbnail(TQ_INT32 w, TQ_INT32 h) { int srcw, srch; if( image() ) @@ -928,7 +928,7 @@ QImage KisPaintDevice::createThumbnail(Q_INT32 w, Q_INT32 h) } else { - const QRect e = extent(); + const TQRect e = extent(); srcw = e.width(); srch = e.height(); } @@ -936,37 +936,37 @@ QImage KisPaintDevice::createThumbnail(Q_INT32 w, Q_INT32 h) if (w > srcw) { w = srcw; - h = Q_INT32(double(srcw) / w * h); + h = TQ_INT32(double(srcw) / w * h); } if (h > srch) { h = srch; - w = Q_INT32(double(srch) / h * w); + w = TQ_INT32(double(srch) / h * w); } if (srcw > srch) - h = Q_INT32(double(srch) / srcw * w); + h = TQ_INT32(double(srch) / srcw * w); else if (srch > srcw) - w = Q_INT32(double(srcw) / srch * h); + w = TQ_INT32(double(srcw) / srch * h); - QColor c; - Q_UINT8 opacity; - QImage img(w,h,32); + TQColor c; + TQ_UINT8 opacity; + TQImage img(w,h,32); - for (Q_INT32 y=0; y < h; ++y) { - Q_INT32 iY = (y * srch ) / h; - for (Q_INT32 x=0; x < w; ++x) { - Q_INT32 iX = (x * srcw ) / w; + for (TQ_INT32 y=0; y < h; ++y) { + TQ_INT32 iY = (y * srch ) / h; + for (TQ_INT32 x=0; x < w; ++x) { + TQ_INT32 iX = (x * srcw ) / w; pixel(iX, iY, &c, &opacity); - const QRgb rgb = c.rgb(); - img.setPixel(x, y, qRgba(qRed(rgb), qGreen(rgb), qBlue(rgb), opacity)); + const TQRgb rgb = c.rgb(); + img.setPixel(x, y, tqRgba(tqRed(rgb), tqGreen(rgb), tqBlue(rgb), opacity)); } } return img; } -KisRectIteratorPixel KisPaintDevice::createRectIterator(Q_INT32 left, Q_INT32 top, Q_INT32 w, Q_INT32 h, bool writable) +KisRectIteratorPixel KisPaintDevice::createRectIterator(TQ_INT32 left, TQ_INT32 top, TQ_INT32 w, TQ_INT32 h, bool writable) { if(hasSelection()) return KisRectIteratorPixel(this, m_datamanager, m_selection->m_datamanager, left, top, w, h, m_x, m_y, writable); @@ -974,7 +974,7 @@ KisRectIteratorPixel KisPaintDevice::createRectIterator(Q_INT32 left, Q_INT32 to return KisRectIteratorPixel(this, m_datamanager, NULL, left, top, w, h, m_x, m_y, writable); } -KisHLineIteratorPixel KisPaintDevice::createHLineIterator(Q_INT32 x, Q_INT32 y, Q_INT32 w, bool writable) +KisHLineIteratorPixel KisPaintDevice::createHLineIterator(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable) { if(hasSelection()) return KisHLineIteratorPixel(this, m_datamanager, m_selection->m_datamanager, x, y, w, m_x, m_y, writable); @@ -982,7 +982,7 @@ KisHLineIteratorPixel KisPaintDevice::createHLineIterator(Q_INT32 x, Q_INT32 y, return KisHLineIteratorPixel(this, m_datamanager, NULL, x, y, w, m_x, m_y, writable); } -KisVLineIteratorPixel KisPaintDevice::createVLineIterator(Q_INT32 x, Q_INT32 y, Q_INT32 h, bool writable) +KisVLineIteratorPixel KisPaintDevice::createVLineIterator(TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable) { if(hasSelection()) return KisVLineIteratorPixel(this, m_datamanager, m_selection->m_datamanager, x, y, h, m_x, m_y, writable); @@ -991,7 +991,7 @@ KisVLineIteratorPixel KisPaintDevice::createVLineIterator(Q_INT32 x, Q_INT32 y, } -KisRandomAccessorPixel KisPaintDevice::createRandomAccessor(Q_INT32 x, Q_INT32 y, bool writable) { +KisRandomAccessorPixel KisPaintDevice::createRandomAccessor(TQ_INT32 x, TQ_INT32 y, bool writable) { if(hasSelection()) return KisRandomAccessorPixel(m_datamanager, m_selection->m_datamanager, x, y, m_x, m_y, writable); else @@ -1010,7 +1010,7 @@ void KisPaintDevice::emitSelectionChanged() } } -void KisPaintDevice::emitSelectionChanged(const QRect& r) +void KisPaintDevice::emitSelectionChanged(const TQRect& r) { if (m_parentLayer && m_parentLayer->image()) { m_parentLayer->image()->slotSelectionChanged(r); @@ -1062,7 +1062,7 @@ void KisPaintDevice::reselect() void KisPaintDevice::addSelection(KisSelectionSP selection) { KisPainter painter(this->selection().data()); - QRect r = selection->selectedExactRect(); + TQRect r = selection->selectedExactRect(); painter.bitBlt(r.x(), r.y(), COMPOSITE_OVER, selection.data(), r.x(), r.y(), r.width(), r.height()); painter.end(); } @@ -1071,7 +1071,7 @@ void KisPaintDevice::subtractSelection(KisSelectionSP selection) { KisPainter painter(this->selection().data()); selection->invert(); - QRect r = selection->selectedExactRect(); + TQRect r = selection->selectedExactRect(); painter.bitBlt(r.x(), r.y(), COMPOSITE_ERASE, selection.data(), r.x(), r.y(), r.width(), r.height()); selection->invert(); @@ -1082,11 +1082,11 @@ void KisPaintDevice::clearSelection() { if (!hasSelection()) return; - QRect r = m_selection->selectedExactRect(); + TQRect r = m_selection->selectedExactRect(); if (r.isValid()) { - for (Q_INT32 y = 0; y < r.height(); y++) { + for (TQ_INT32 y = 0; y < r.height(); y++) { KisHLineIterator devIt = createHLineIterator(r.x(), r.y() + y, r.width(), true); KisHLineIterator selectionIt = m_selection->createHLineIterator(r.x(), r.y() + y, r.width(), false); @@ -1107,23 +1107,23 @@ void KisPaintDevice::clearSelection() } } -void KisPaintDevice::applySelectionMask(KisSelectionSP mask) +void KisPaintDevice::applySelectionMask(KisSelectionSP tqmask) { - QRect r = mask->selectedRect(); + TQRect r = tqmask->selectedRect(); crop(r); - for (Q_INT32 y = r.top(); y <= r.bottom(); ++y) { + for (TQ_INT32 y = r.top(); y <= r.bottom(); ++y) { KisHLineIterator pixelIt = createHLineIterator(r.x(), y, r.width(), true); - KisHLineIterator maskIt = mask->createHLineIterator(r.x(), y, r.width(), false); + KisHLineIterator tqmaskIt = tqmask->createHLineIterator(r.x(), y, r.width(), false); while (!pixelIt.isDone()) { // XXX: Optimize by using stretches - m_colorSpace->applyAlphaU8Mask( pixelIt.rawData(), maskIt.rawData(), 1); + m_colorSpace->applyAlphaU8Mask( pixelIt.rawData(), tqmaskIt.rawData(), 1); ++pixelIt; - ++maskIt; + ++tqmaskIt; } } } @@ -1139,25 +1139,25 @@ KisSelectionSP KisPaintDevice::setSelection( KisSelectionSP selection) else return 0; } -bool KisPaintDevice::pixel(Q_INT32 x, Q_INT32 y, QColor *c, Q_UINT8 *opacity) +bool KisPaintDevice::pixel(TQ_INT32 x, TQ_INT32 y, TQColor *c, TQ_UINT8 *opacity) { KisHLineIteratorPixel iter = createHLineIterator(x, y, 1, false); - Q_UINT8 *pix = iter.rawData(); + TQ_UINT8 *pix = iter.rawData(); if (!pix) return false; - colorSpace()->toQColor(pix, c, opacity); + colorSpace()->toTQColor(pix, c, opacity); return true; } -bool KisPaintDevice::pixel(Q_INT32 x, Q_INT32 y, KisColor * kc) +bool KisPaintDevice::pixel(TQ_INT32 x, TQ_INT32 y, KisColor * kc) { KisHLineIteratorPixel iter = createHLineIterator(x, y, 1, false); - Q_UINT8 *pix = iter.rawData(); + TQ_UINT8 *pix = iter.rawData(); if (!pix) return false; @@ -1166,25 +1166,25 @@ bool KisPaintDevice::pixel(Q_INT32 x, Q_INT32 y, KisColor * kc) return true; } -KisColor KisPaintDevice::colorAt(Q_INT32 x, Q_INT32 y) +KisColor KisPaintDevice::colorAt(TQ_INT32 x, TQ_INT32 y) { //return KisColor(m_datamanager->pixel(x - m_x, y - m_y), m_colorSpace); KisHLineIteratorPixel iter = createHLineIterator(x, y, 1, true); return KisColor(iter.rawData(), m_colorSpace); } -bool KisPaintDevice::setPixel(Q_INT32 x, Q_INT32 y, const QColor& c, Q_UINT8 opacity) +bool KisPaintDevice::setPixel(TQ_INT32 x, TQ_INT32 y, const TQColor& c, TQ_UINT8 opacity) { KisHLineIteratorPixel iter = createHLineIterator(x, y, 1, true); - colorSpace()->fromQColor(c, opacity, iter.rawData()); + colorSpace()->fromTQColor(c, opacity, iter.rawData()); return true; } -bool KisPaintDevice::setPixel(Q_INT32 x, Q_INT32 y, const KisColor& kc) +bool KisPaintDevice::setPixel(TQ_INT32 x, TQ_INT32 y, const KisColor& kc) { - Q_UINT8 * pix; + TQ_UINT8 * pix; if (kc.colorSpace() != m_colorSpace) { KisColor kc2 (kc, m_colorSpace); pix = kc2.data(); @@ -1200,39 +1200,39 @@ bool KisPaintDevice::setPixel(Q_INT32 x, Q_INT32 y, const KisColor& kc) } -Q_INT32 KisPaintDevice::numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT32 maxY) +TQ_INT32 KisPaintDevice::numContiguousColumns(TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY) { return m_datamanager->numContiguousColumns(x - m_x, minY - m_y, maxY - m_y); } -Q_INT32 KisPaintDevice::numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 maxX) +TQ_INT32 KisPaintDevice::numContiguousRows(TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX) { return m_datamanager->numContiguousRows(y - m_y, minX - m_x, maxX - m_x); } -Q_INT32 KisPaintDevice::rowStride(Q_INT32 x, Q_INT32 y) +TQ_INT32 KisPaintDevice::rowStride(TQ_INT32 x, TQ_INT32 y) { return m_datamanager->rowStride(x - m_x, y - m_y); } -const Q_UINT8* KisPaintDevice::pixel(Q_INT32 x, Q_INT32 y) +const TQ_UINT8* KisPaintDevice::pixel(TQ_INT32 x, TQ_INT32 y) { return m_datamanager->pixel(x - m_x, y - m_y); } -Q_UINT8* KisPaintDevice::writablePixel(Q_INT32 x, Q_INT32 y) +TQ_UINT8* KisPaintDevice::writablePixel(TQ_INT32 x, TQ_INT32 y) { return m_datamanager->writablePixel(x - m_x, y - m_y); } -void KisPaintDevice::setX(Q_INT32 x) +void KisPaintDevice::setX(TQ_INT32 x) { m_x = x; if(m_selection && m_selection != this) m_selection->setX(x); } -void KisPaintDevice::setY(Q_INT32 y) +void KisPaintDevice::setY(TQ_INT32 y) { m_y = y; if(m_selection && m_selection != this) @@ -1240,12 +1240,12 @@ void KisPaintDevice::setY(Q_INT32 y) } -void KisPaintDevice::readBytes(Q_UINT8 * data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +void KisPaintDevice::readBytes(TQ_UINT8 * data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { m_datamanager->readBytes(data, x - m_x, y - m_y, w, h); } -void KisPaintDevice::writeBytes(const Q_UINT8 * data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +void KisPaintDevice::writeBytes(const TQ_UINT8 * data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { m_datamanager->writeBytes( data, x - m_x, y - m_y, w, h); } @@ -1269,10 +1269,10 @@ void KisPaintDevice::runBackgroundFilters() KisTransaction * cmd = new KisTransaction("Running autofilters", this); - QRect rc = extent(); + TQRect rc = extent(); if (!m_longRunningFilters.isEmpty()) { - QValueList<KisFilter*>::iterator it; - QValueList<KisFilter*>::iterator end = m_longRunningFilters.end(); + TQValueList<KisFilter*>::iterator it; + TQValueList<KisFilter*>::iterator end = m_longRunningFilters.end(); for (it = m_longRunningFilters.begin(); it != end; ++it) { (*it)->process(this, this, 0, rc); } diff --git a/krita/core/kis_paint_device.h b/krita/core/kis_paint_device.h index 3b1dcfe7..653c013a 100644 --- a/krita/core/kis_paint_device.h +++ b/krita/core/kis_paint_device.h @@ -18,13 +18,13 @@ #ifndef KIS_PAINT_DEVICE_IMPL_H_ #define KIS_PAINT_DEVICE_IMPL_H_ -#include <qcolor.h> -#include <qobject.h> -#include <qpixmap.h> -#include <qptrlist.h> -#include <qrect.h> -#include <qvaluelist.h> -#include <qstring.h> +#include <tqcolor.h> +#include <tqobject.h> +#include <tqpixmap.h> +#include <tqptrlist.h> +#include <tqrect.h> +#include <tqvaluelist.h> +#include <tqstring.h> #include "kis_types.h" #include "kdebug.h" @@ -37,11 +37,11 @@ class DCOPObject; -class QImage; -class QSize; -class QPoint; -class QWMatrix; -class QTimer; +class TQImage; +class TQSize; +class TQPoint; +class TQWMatrix; +class TQTimer; class KNamedCommand; @@ -71,11 +71,12 @@ typedef KSharedPtr<KisMemento> KisMementoSP; * when pixels are accessed by an iterator. */ class KRITACORE_EXPORT KisPaintDevice - : public QObject + : public TQObject , public KShared { Q_OBJECT + TQ_OBJECT public: @@ -89,13 +90,13 @@ public: /** * Create a new paint device with the specified colorspace. The - * parentLayer will be notified of changes to this paint device. + * tqparentLayer will be notified of changes to this paint device. * - * @param parentLayer the layer that contains this paint device. + * @param tqparentLayer the layer that contains this paint device. * @param colorSpace the colorspace of this paint device * @param name for debugging purposes */ - KisPaintDevice(KisLayer *parentLayer, KisColorSpace * colorSpace, const char * name = 0); + KisPaintDevice(KisLayer *tqparentLayer, KisColorSpace * colorSpace, const char * name = 0); KisPaintDevice(const KisPaintDevice& rhs); virtual ~KisPaintDevice(); @@ -120,28 +121,28 @@ public: /** * Moves the device to these new coordinates (so no incremental move or so) */ - virtual void move(Q_INT32 x, Q_INT32 y); + virtual void move(TQ_INT32 x, TQ_INT32 y); /** * Convenience method for the above */ - virtual void move(const QPoint& pt); + virtual void move(const TQPoint& pt); /** * Move the paint device to the specified location and make it possible to * undo the move. */ - virtual KNamedCommand * moveCommand(Q_INT32 x, Q_INT32 y); + virtual KNamedCommand * moveCommand(TQ_INT32 x, TQ_INT32 y); /** * Returns true of x,y is within the extent of this paint device */ - bool contains(Q_INT32 x, Q_INT32 y) const; + bool tqcontains(TQ_INT32 x, TQ_INT32 y) const; /** * Convenience method for the above */ - bool contains(const QPoint& pt) const; + bool tqcontains(const TQPoint& pt) const; /** * Retrieve the bounds of the paint device. The size is not exact, @@ -149,8 +150,8 @@ public: * For instance, the tiled datamanager keeps the extent to the nearest * multiple of 64. */ - virtual void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const; - virtual QRect extent() const; + virtual void extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const; + virtual TQRect extent() const; /** * XXX: This should be a temporay hack, awaiting a proper fix. @@ -168,18 +169,18 @@ public: * Get the exact bounds of this paint device. This may be very slow, * especially on larger paint devices because it does a linear scanline search. */ - virtual void exactBounds(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const; - virtual QRect exactBounds() const; - virtual QRect exactBoundsOldMethod() const; - virtual QRect exactBoundsImprovedOldMethod() const; + virtual void exactBounds(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const; + virtual TQRect exactBounds() const; + virtual TQRect exactBoundsOldMethod() const; + virtual TQRect exactBoundsImprovedOldMethod() const; /** * Cut the paint device down to the specified rect */ - void crop(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + void crop(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); /// Convience method for the above - void crop(QRect r); + void crop(TQRect r); /** * Complete erase the current paint device. Its size will become 0. @@ -189,7 +190,7 @@ public: /** * Fill the given rectangle with the given pixel. */ - void fill(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const Q_UINT8 *fillPixel); + void fill(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *fillPixel); /** * Read the bytes representing the rectangle described by x, y, w, h into @@ -201,7 +202,7 @@ public: * Reading from areas not previously initialized will read the default * pixel value into data but not initialize that region. */ - virtual void readBytes(Q_UINT8 * data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + virtual void readBytes(TQ_UINT8 * data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); /** * Copy the bytes in data into the rect specified by x, y, w, h. If the @@ -211,40 +212,40 @@ public: * If the data is written to areas of the paint device not previously initialized, * the paint device will grow. */ - virtual void writeBytes(const Q_UINT8 * data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + virtual void writeBytes(const TQ_UINT8 * data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); /** * Get the number of contiguous columns starting at x, valid for all values * of y between minY and maxY. */ - Q_INT32 numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT32 maxY); + TQ_INT32 numContiguousColumns(TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY); /** * Get the number of contiguous rows starting at y, valid for all values * of x between minX and maxX. */ - Q_INT32 numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 maxX); + TQ_INT32 numContiguousRows(TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX); /** * Get the row stride at pixel (x, y). This is the number of bytes to add to a * pointer to pixel (x, y) to access (x, y + 1). */ - Q_INT32 rowStride(Q_INT32 x, Q_INT32 y); + TQ_INT32 rowStride(TQ_INT32 x, TQ_INT32 y); /** * Get a read-only pointer to pixel (x, y). */ - KDE_DEPRECATED const Q_UINT8* pixel(Q_INT32 x, Q_INT32 y); + KDE_DEPRECATED const TQ_UINT8* pixel(TQ_INT32 x, TQ_INT32 y); /** * Get a read-write pointer to pixel (x, y). */ - KDE_DEPRECATED Q_UINT8* writablePixel(Q_INT32 x, Q_INT32 y); + KDE_DEPRECATED TQ_UINT8* writablePixel(TQ_INT32 x, TQ_INT32 y); /** * Converts the paint device to a different colorspace */ - virtual void convertTo(KisColorSpace * dstColorSpace, Q_INT32 renderingIntent = INTENT_PERCEPTUAL); + virtual void convertTo(KisColorSpace * dstColorSpace, TQ_INT32 renderingIntent = INTENT_PERCEPTUAL); /** * Changes the profile of the colorspace of this paint device to the given @@ -256,10 +257,10 @@ public: * Fill this paint device with the data from img; starting at (offsetX, offsetY) * @param srcProfileName name of the RGB profile to interpret the img as. "" is interpreted as sRGB */ - virtual void convertFromQImage(const QImage& img, const QString &srcProfileName, Q_INT32 offsetX = 0, Q_INT32 offsetY = 0); + virtual void convertFromTQImage(const TQImage& img, const TQString &srcProfileName, TQ_INT32 offsetX = 0, TQ_INT32 offsetY = 0); /** - * Create an RGBA QImage from a rectangle in the paint device. + * Create an RGBA TQImage from a rectangle in the paint device. * * @param x Left coordinate of the rectangle * @param y Top coordinate of the rectangle @@ -270,31 +271,31 @@ public: * like sRGB). * @param exposure The exposure setting used to render a preview of a high dynamic range image. */ - virtual QImage convertToQImage(KisProfile * dstProfile, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, float exposure = 0.0f); + virtual TQImage convertToTQImage(KisProfile * dstProfile, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, float exposure = 0.0f); /** - * Create an RGBA QImage from a rectangle in the paint device. The rectangle is defined by the parent image's bounds. + * Create an RGBA TQImage from a rectangle in the paint device. The rectangle is defined by the tqparent image's bounds. * * @param dstProfile RGB profile to use in conversion. May be 0, in which * case it's up to the colour strategy to choose a profile (most * like sRGB). * @param exposure The exposure setting used to render a preview of a high dynamic range image. */ - virtual QImage convertToQImage(KisProfile * dstProfile, float exposure = 0.0f); + virtual TQImage convertToTQImage(KisProfile * dstProfile, float exposure = 0.0f); /** * Creates a paint device thumbnail of the paint device, retaining the aspect ratio. * The width and height of the returned device won't exceed \p maxw and \p maxw, but they may be smaller. */ - KisPaintDeviceSP createThumbnailDevice(Q_INT32 w, Q_INT32 h); + KisPaintDeviceSP createThumbnailDevice(TQ_INT32 w, TQ_INT32 h); /** * Creates a thumbnail of the paint device, retaining the aspect ratio. - * The width and height of the returned QImage won't exceed \p maxw and \p maxw, but they may be smaller. + * The width and height of the returned TQImage won't exceed \p maxw and \p maxw, but they may be smaller. * The colors are not corrected for display! */ - virtual QImage createThumbnail(Q_INT32 maxw, Q_INT32 maxh); + virtual TQImage createThumbnail(TQ_INT32 maxw, TQ_INT32 maxh); /** @@ -305,7 +306,7 @@ public: * * @return true if the operation was succesful. */ - bool pixel(Q_INT32 x, Q_INT32 y, QColor *c, Q_UINT8 *opacity); + bool pixel(TQ_INT32 x, TQ_INT32 y, TQColor *c, TQ_UINT8 *opacity); /** @@ -317,17 +318,17 @@ public: * * @return true if the operation was succesful. */ - bool pixel(Q_INT32 x, Q_INT32 y, KisColor * kc); + bool pixel(TQ_INT32 x, TQ_INT32 y, KisColor * kc); /** * Return the KisColor of the pixel at x,y. */ - KisColor colorAt(Q_INT32 x, Q_INT32 y); + KisColor colorAt(TQ_INT32 x, TQ_INT32 y); /** * Set the specified pixel to the specified color. Note that this * bypasses KisPainter. the PaintDevice is here used as an equivalent - * to QImage, not QPixmap. This means that this is not undoable; also, + * to TQImage, not TQPixmap. This means that this is not undoable; also, * there is no compositing with an existing value at this location. * * The color values will be transformed from the display profile to @@ -339,9 +340,9 @@ public: * @return true if the operation was succesful * */ - bool setPixel(Q_INT32 x, Q_INT32 y, const QColor& c, Q_UINT8 opacity); + bool setPixel(TQ_INT32 x, TQ_INT32 y, const TQColor& c, TQ_UINT8 opacity); - bool setPixel(Q_INT32 x, Q_INT32 y, const KisColor& kc); + bool setPixel(TQ_INT32 x, TQ_INT32 y, const KisColor& kc); KisColorSpace * colorSpace() const; @@ -355,37 +356,37 @@ public: /** * The X offset of the paint device */ - Q_INT32 getX() const; + TQ_INT32 getX() const; /** * The Y offset of the paint device */ - Q_INT32 getY() const; + TQ_INT32 getY() const; /** * Return the X offset of the paint device */ - void setX(Q_INT32 x); + void setX(TQ_INT32 x); /** * Return the Y offset of the paint device */ - void setY(Q_INT32 y); + void setY(TQ_INT32 y); /** * Return the number of bytes a pixel takes. */ - virtual Q_INT32 pixelSize() const; + virtual TQ_INT32 pixelSize() const; /** * Return the number of channels a pixel takes */ - virtual Q_INT32 nChannels() const; + virtual TQ_INT32 nChannels() const; /** * Return the image that contains this paint device, or 0 if it is not - * part of an image. This is the same as calling parentLayer()->image(). + * part of an image. This is the same as calling tqparentLayer()->image(). */ KisImage *image() const; @@ -393,21 +394,21 @@ public: * Returns the KisLayer that contains this paint device, or 0 if this is not * part of a layer. */ - KisLayer *parentLayer() const; + KisLayer *tqparentLayer() const; /** * Set the KisLayer that contains this paint device, or 0 if this is not * part of a layer. */ - void setParentLayer(KisLayer *parentLayer); + void setParentLayer(KisLayer *tqparentLayer); /** - * Add the specified rect top the parent layer (if present) + * Add the specified rect top the tqparent layer (if present) */ - virtual void setDirty(const QRect & rc); + virtual void setDirty(const TQRect & rc); /** - * Set the parent layer completely dirty, if this paint device has one. + * Set the tqparent layer completely dirty, if this paint device has one. */ virtual void setDirty(); @@ -428,17 +429,17 @@ public: /** * This function return an iterator which points to the first pixel of an rectangle */ - KisRectIteratorPixel createRectIterator(Q_INT32 left, Q_INT32 top, Q_INT32 w, Q_INT32 h, bool writable); + KisRectIteratorPixel createRectIterator(TQ_INT32 left, TQ_INT32 top, TQ_INT32 w, TQ_INT32 h, bool writable); /** * This function return an iterator which points to the first pixel of a horizontal line */ - KisHLineIteratorPixel createHLineIterator(Q_INT32 x, Q_INT32 y, Q_INT32 w, bool writable); + KisHLineIteratorPixel createHLineIterator(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable); /** * This function return an iterator which points to the first pixel of a vertical line */ - KisVLineIteratorPixel createVLineIterator(Q_INT32 x, Q_INT32 y, Q_INT32 h, bool writable); + KisVLineIteratorPixel createVLineIterator(TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable); /** * This function creates a random accessor which allow to randomly access any pixels on @@ -446,7 +447,7 @@ public: * <b>Note:</b> random access is way slower than iterators, allways use iterators whenever * you can */ - KisRandomAccessorPixel createRandomAccessor(Q_INT32 x, Q_INT32 y, bool writable); + KisRandomAccessorPixel createRandomAccessor(TQ_INT32 x, TQ_INT32 y, bool writable); /** * This function create a random accessor which can easily access to sub pixel values. @@ -478,10 +479,10 @@ public: void clearSelection(); /** - * Apply a mask to the image data, i.e. multiply each pixel's opacity by its - * selectedness in the mask. + * Apply a tqmask to the image data, i.e. multiply each pixel's opacity by its + * selectedness in the tqmask. */ - void applySelectionMask(KisSelectionSP mask); + void applySelectionMask(KisSelectionSP tqmask); /** * Sets the selection of this paint device to the new selection, @@ -500,7 +501,7 @@ public: * * @param r the area for which the selection has changed */ - void emitSelectionChanged(const QRect& r); + void emitSelectionChanged(const TQRect& r); KisUndoAdapter *undoAdapter() const; @@ -516,7 +517,7 @@ public: bool hasExifInfo() { return m_exifInfo != 0; } signals: void positionChanged(KisPaintDeviceSP device); - void ioProgress(Q_INT8 percentage); + void ioProgress(TQ_INT8 percentage); void profileChanged(KisProfile * profile); private slots: @@ -537,12 +538,12 @@ private: bool m_extentIsValid; - Q_INT32 m_x; - Q_INT32 m_y; + TQ_INT32 m_x; + TQ_INT32 m_y; KisColorSpace * m_colorSpace; // Cached for quick access - Q_INT32 m_pixelSize; - Q_INT32 m_nChannels; + TQ_INT32 m_pixelSize; + TQ_INT32 m_nChannels; // Whether the selection is active bool m_hasSelection; @@ -556,19 +557,19 @@ private: KisExifInfo* m_exifInfo; - QValueList<KisFilter*> m_longRunningFilters; - QTimer * m_longRunningFilterTimer; + TQValueList<KisFilter*> m_longRunningFilters; + TQTimer * m_longRunningFilterTimer; bool m_lock; }; -inline Q_INT32 KisPaintDevice::pixelSize() const +inline TQ_INT32 KisPaintDevice::pixelSize() const { Q_ASSERT(m_pixelSize > 0); return m_pixelSize; } -inline Q_INT32 KisPaintDevice::nChannels() const +inline TQ_INT32 KisPaintDevice::nChannels() const { Q_ASSERT(m_nChannels > 0); return m_nChannels; @@ -582,12 +583,12 @@ inline KisColorSpace * KisPaintDevice::colorSpace() const } -inline Q_INT32 KisPaintDevice::getX() const +inline TQ_INT32 KisPaintDevice::getX() const { return m_x; } -inline Q_INT32 KisPaintDevice::getY() const +inline TQ_INT32 KisPaintDevice::getY() const { return m_y; } diff --git a/krita/core/kis_paint_device_action.h b/krita/core/kis_paint_device_action.h index 4dbbc365..1e3d41f0 100644 --- a/krita/core/kis_paint_device_action.h +++ b/krita/core/kis_paint_device_action.h @@ -19,7 +19,7 @@ #define KIS_PAINTDEV_ACTION_H_ #include "kis_paint_device.h" -class QString; +class TQString; /** * Defines an action to do with a paint device. It can be force used by the gui on creation @@ -33,11 +33,11 @@ public: * up a dialog to choose a texture. The width and height are added because these may * be needed in some cases. */ - virtual void act(KisPaintDeviceSP paintDev, Q_INT32 w = 0, Q_INT32 h = 0) const = 0; + virtual void act(KisPaintDeviceSP paintDev, TQ_INT32 w = 0, TQ_INT32 h = 0) const = 0; /// The name of the action, to be displayed in the GUI - virtual QString name() const = 0; + virtual TQString name() const = 0; /// A description of the action, to be displayed in the GUI - virtual QString description() const = 0; + virtual TQString description() const = 0; }; #endif // KIS_PAINTDEV_ACTION_H_ diff --git a/krita/core/kis_paint_device_iface.cc b/krita/core/kis_paint_device_iface.cc index ff4c7034..1aace538 100644 --- a/krita/core/kis_paint_device_iface.cc +++ b/krita/core/kis_paint_device_iface.cc @@ -27,33 +27,33 @@ #include "kis_paint_device.h" -KisPaintDeviceIface::KisPaintDeviceIface( KisPaintDevice * parent ) +KisPaintDeviceIface::KisPaintDeviceIface( KisPaintDevice * tqparent ) : DCOPObject("paintdevice") { - m_parent = parent; + m_parent = tqparent; } -Q_INT32 KisPaintDeviceIface::pixelSize() const +TQ_INT32 KisPaintDeviceIface::pixelSize() const { return m_parent->pixelSize(); } -Q_INT32 KisPaintDeviceIface::nChannels() const +TQ_INT32 KisPaintDeviceIface::nChannels() const { return m_parent->nChannels(); } -QByteArray KisPaintDeviceIface::readBytes(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +TQByteArray KisPaintDeviceIface::readBytes(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { - QByteArray b (w * h * m_parent->pixelSize()); + TQByteArray b (w * h * m_parent->pixelSize()); - m_parent->readBytes((Q_UINT8*)b.data(), x, y, w, h); + m_parent->readBytes((TQ_UINT8*)b.data(), x, y, w, h); return b; } -void KisPaintDeviceIface::writeBytes(QByteArray bytes, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +void KisPaintDeviceIface::writeBytes(TQByteArray bytes, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { - m_parent->writeBytes((Q_UINT8*)bytes.data(), x, y, w, h); + m_parent->writeBytes((TQ_UINT8*)bytes.data(), x, y, w, h); } DCOPRef KisPaintDeviceIface::colorSpace() const diff --git a/krita/core/kis_paint_device_iface.h b/krita/core/kis_paint_device_iface.h index d712f410..164b0380 100644 --- a/krita/core/kis_paint_device_iface.h +++ b/krita/core/kis_paint_device_iface.h @@ -23,7 +23,7 @@ #include <dcopref.h> #include <dcopobject.h> -#include <qstring.h> +#include <tqstring.h> class KisPaintDevice; @@ -31,18 +31,18 @@ class KisPaintDeviceIface : virtual public DCOPObject { K_DCOP public: - KisPaintDeviceIface( KisPaintDevice * parent ); + KisPaintDeviceIface( KisPaintDevice * tqparent ); k_dcop: /** * Return the number of bytes a pixel takes. */ - Q_INT32 pixelSize() const; + TQ_INT32 pixelSize() const; /** * Return the number of channels a pixel takes */ - Q_INT32 nChannels() const; + TQ_INT32 nChannels() const; /** * Read the bytes representing the rectangle described by x, y, w, h into @@ -54,7 +54,7 @@ k_dcop: * Reading from areas not previously initialized will read the default * pixel value into data. */ - QByteArray readBytes(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + TQByteArray readBytes(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); /** * Copy the bytes in data into the rect specified by x, y, w, h. If there @@ -64,7 +64,7 @@ k_dcop: * If the data is written to areas of the paint device not previously initialized, * the paint device will grow. */ - void writeBytes(QByteArray bytes, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + void writeBytes(TQByteArray bytes, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); /** * Get the colorspace of this image diff --git a/krita/core/kis_paint_layer.cc b/krita/core/kis_paint_layer.cc index 2567c75c..63663067 100644 --- a/krita/core/kis_paint_layer.cc +++ b/krita/core/kis_paint_layer.cc @@ -18,7 +18,7 @@ */ #include <kdebug.h> -#include <qimage.h> +#include <tqimage.h> #include "kis_debug_areas.h" #include "kis_image.h" @@ -33,39 +33,39 @@ #include "kis_datamanager.h" #include "kis_undo_adapter.h" -KisPaintLayer::KisPaintLayer(KisImage *img, const QString& name, Q_UINT8 opacity, KisPaintDeviceSP dev) +KisPaintLayer::KisPaintLayer(KisImage *img, const TQString& name, TQ_UINT8 opacity, KisPaintDeviceSP dev) : super(img, name, opacity) { Q_ASSERT(img); Q_ASSERT(dev); m_paintdev = dev; - m_mask = 0; - m_maskAsSelection = 0; + m_tqmask = 0; + m_tqmaskAsSelection = 0; m_paintdev->setParentLayer(this); m_renderMask = false; m_editMask = true; } -KisPaintLayer::KisPaintLayer(KisImage *img, const QString& name, Q_UINT8 opacity) +KisPaintLayer::KisPaintLayer(KisImage *img, const TQString& name, TQ_UINT8 opacity) : super(img, name, opacity) { Q_ASSERT(img); m_paintdev = new KisPaintDevice(this, img->colorSpace(), name.latin1()); - m_mask = 0; - m_maskAsSelection = 0; + m_tqmask = 0; + m_tqmaskAsSelection = 0; m_renderMask = false; m_editMask = true; } -KisPaintLayer::KisPaintLayer(KisImage *img, const QString& name, Q_UINT8 opacity, KisColorSpace * colorSpace) +KisPaintLayer::KisPaintLayer(KisImage *img, const TQString& name, TQ_UINT8 opacity, KisColorSpace * colorSpace) : super(img, name, opacity) { Q_ASSERT(img); Q_ASSERT(colorSpace); m_paintdev = new KisPaintDevice(this, colorSpace, name.latin1()); - m_mask = 0; - m_maskAsSelection = 0; + m_tqmask = 0; + m_tqmaskAsSelection = 0; m_renderMask = false; m_editMask = true; } @@ -76,8 +76,8 @@ KisPaintLayer::KisPaintLayer(const KisPaintLayer& rhs) : m_paintdev = new KisPaintDevice( *rhs.m_paintdev.data() ); m_paintdev->setParentLayer(this); if (rhs.hasMask()) { - m_mask = new KisPaintDevice(*rhs.m_mask.data()); - m_mask->setParentLayer(this); + m_tqmask = new KisPaintDevice(*rhs.m_tqmask.data()); + m_tqmask->setParentLayer(this); } m_renderMask = rhs.m_renderMask; m_editMask = rhs.m_editMask; @@ -93,42 +93,42 @@ KisPaintLayer::~KisPaintLayer() if (m_paintdev != 0) { m_paintdev->setParentLayer(0); } - if (m_mask != 0) { - m_mask->setParentLayer(0); + if (m_tqmask != 0) { + m_tqmask->setParentLayer(0); } } -void KisPaintLayer::paintSelection(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +void KisPaintLayer::paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { if (m_paintdev && m_paintdev->hasSelection()) { m_paintdev->selection()->paintSelection(img, x, y, w, h); - } else if (m_mask && m_editMask && m_mask->hasSelection()) { - m_mask->selection()->paintSelection(img, x, y, w, h); + } else if (m_tqmask && m_editMask && m_tqmask->hasSelection()) { + m_tqmask->selection()->paintSelection(img, x, y, w, h); } } -void KisPaintLayer::paintSelection(QImage &img, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize) +void KisPaintLayer::paintSelection(TQImage &img, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize) { if (m_paintdev && m_paintdev->hasSelection()) { m_paintdev->selection()->paintSelection(img, scaledImageRect, scaledImageSize, imageSize); - } else if (m_mask && m_editMask && m_mask->hasSelection()) { - m_mask->selection()->paintSelection(img, scaledImageRect, scaledImageSize, imageSize); + } else if (m_tqmask && m_editMask && m_tqmask->hasSelection()) { + m_tqmask->selection()->paintSelection(img, scaledImageRect, scaledImageSize, imageSize); } } -void KisPaintLayer::paintMaskInactiveLayers(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +void KisPaintLayer::paintMaskInactiveLayers(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { uchar *j = img.bits(); KisColorSpace *cs = m_paintdev->colorSpace(); - for (Q_INT32 y2 = y; y2 < h + y; ++y2) { + for (TQ_INT32 y2 = y; y2 < h + y; ++y2) { KisHLineIteratorPixel it = m_paintdev->createHLineIterator(x, y2, w, false); while ( ! it.isDone()) { - Q_UINT8 s = cs->getAlpha(it.rawData()); + TQ_UINT8 s = cs->getAlpha(it.rawData()); if(s==0) { - Q_UINT8 g = (*(j + 0) + *(j + 1 ) + *(j + 2 )) / 9; + TQ_UINT8 g = (*(j + 0) + *(j + 1 ) + *(j + 2 )) / 9; *(j+0) = 128+g ; *(j+1) = 165+g; @@ -140,66 +140,66 @@ void KisPaintLayer::paintMaskInactiveLayers(QImage &img, Q_INT32 x, Q_INT32 y, Q } } -QImage KisPaintLayer::createThumbnail(Q_INT32 w, Q_INT32 h) +TQImage KisPaintLayer::createThumbnail(TQ_INT32 w, TQ_INT32 h) { if (m_paintdev) return m_paintdev->createThumbnail(w, h); else - return QImage(); + return TQImage(); } -Q_INT32 KisPaintLayer::x() const { +TQ_INT32 KisPaintLayer::x() const { if (m_paintdev) return m_paintdev->getX(); else return 0; } -void KisPaintLayer::setX(Q_INT32 x) +void KisPaintLayer::setX(TQ_INT32 x) { if (m_paintdev) m_paintdev->setX(x); } -Q_INT32 KisPaintLayer::y() const { +TQ_INT32 KisPaintLayer::y() const { if (m_paintdev) return m_paintdev->getY(); else return 0; } -void KisPaintLayer::setY(Q_INT32 y) { +void KisPaintLayer::setY(TQ_INT32 y) { if (m_paintdev) m_paintdev->setY(y); } -QRect KisPaintLayer::extent() const { +TQRect KisPaintLayer::extent() const { if (m_paintdev) return m_paintdev->extent(); else - return QRect(); + return TQRect(); } -QRect KisPaintLayer::exactBounds() const { +TQRect KisPaintLayer::exactBounds() const { if (m_paintdev) return m_paintdev->exactBounds(); else - return QRect(); + return TQRect(); } void KisPaintLayer::removeMask() { if (!hasMask()) return; - m_mask->setParentLayer(0); - m_mask = 0; - m_maskAsSelection = 0; + m_tqmask->setParentLayer(0); + m_tqmask = 0; + m_tqmaskAsSelection = 0; setDirty(); emit sigMaskInfoChanged(); } -// ### XXX Do we apply the mask outside the image boundaries too? I'd say no, but I'm not sure +// ### XXX Do we apply the tqmask outside the image boundaries too? I'd say no, but I'm not sure void KisPaintLayer::applyMask() { if (!hasMask()) return; @@ -210,7 +210,7 @@ void KisPaintLayer::applyMask() { // A bit slow; but it works KisPaintDeviceSP temp = new KisPaintDevice(m_paintdev->colorSpace()); KisPainter gc(temp); - gc.bltSelection(x, y, COMPOSITE_OVER, m_paintdev, m_maskAsSelection, OPACITY_OPAQUE, x, y, w, h); + gc.bltSelection(x, y, COMPOSITE_OVER, m_paintdev, m_tqmaskAsSelection, OPACITY_OPAQUE, x, y, w, h); gc.end(); gc.begin(m_paintdev); gc.bitBlt(x, y, COMPOSITE_COPY, temp, OPACITY_OPAQUE, x, y, w, h); @@ -221,18 +221,18 @@ void KisPaintLayer::applyMask() { KisPaintDeviceSP KisPaintLayer::createMask() { if (hasMask()) - return m_mask; + return m_tqmask; kdDebug() << k_funcinfo << endl; // Grey8 nicely fits our needs of being intuitively comparable to other apps' - // mask layer interfaces. It does have an alpha component though, which is a bit + // tqmask layer interfaces. It does have an alpha component though, which is a bit // less appropriate in this context. - m_mask = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry() + m_tqmask = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry() ->getColorSpace(KisID("GRAYA"), 0)); genericMaskCreationHelper(); - return m_mask; + return m_tqmask; } // FIXME If from is a paint device is not grey8!! @@ -241,31 +241,31 @@ void KisPaintLayer::createMaskFromPaintDevice(KisPaintDeviceSP from) { return; // Or overwrite? XXX kdDebug() << k_funcinfo << endl; - m_mask = from; // KisPaintDevice(*from); XXX + m_tqmask = from; // KisPaintDevice(*from); XXX genericMaskCreationHelper(); } void KisPaintLayer::createMaskFromSelection(KisSelectionSP from) { kdDebug() << k_funcinfo << endl; - m_mask = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry() + m_tqmask = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry() ->getColorSpace(KisID("GRAYA"), 0)); - m_mask->setParentLayer(this); + m_tqmask->setParentLayer(this); - m_maskAsSelection = new KisSelection(); // Anonymous selection is good enough + m_tqmaskAsSelection = new KisSelection(); // Anonymous selection is good enough - // Default pixel is opaque white == don't mask? - Q_UINT8 const defPixel[] = { 255, 255 }; - m_mask->dataManager()->setDefaultPixel(defPixel); + // Default pixel is opaque white == don't tqmask? + TQ_UINT8 const defPixel[] = { 255, 255 }; + m_tqmask->dataManager()->setDefaultPixel(defPixel); if (from) { - QRect r(extent()); + TQRect r(extent()); int w = r.width(); int h = r.height(); for (int y = r.y(); y < h; y++) { KisHLineIteratorPixel srcIt = from->createHLineIterator(r.x(), y, w, false); - KisHLineIteratorPixel dstIt = m_mask->createHLineIterator(r.x(), y, w, true); + KisHLineIteratorPixel dstIt = m_tqmask->createHLineIterator(r.x(), y, w, true); while(!dstIt.isDone()) { // XXX same remark as in convertMaskToSelection @@ -286,13 +286,13 @@ void KisPaintLayer::createMaskFromSelection(KisSelectionSP from) { KisPaintDeviceSP KisPaintLayer::getMask() { createMask(); kdDebug() << k_funcinfo << endl; - return m_mask; + return m_tqmask; } KisSelectionSP KisPaintLayer::getMaskAsSelection() { createMask(); kdDebug() << k_funcinfo << endl; - return m_maskAsSelection; + return m_tqmaskAsSelection; } void KisPaintLayer::setEditMask(bool b) { @@ -309,10 +309,10 @@ void KisPaintLayer::setRenderMask(bool b) { emit sigMaskInfoChanged(); } -void KisPaintLayer::convertMaskToSelection(const QRect& r) { - KisRectIteratorPixel srcIt = m_mask->createRectIterator(r.x(), r.y(), +void KisPaintLayer::convertMaskToSelection(const TQRect& r) { + KisRectIteratorPixel srcIt = m_tqmask->createRectIterator(r.x(), r.y(), r.width(), r.height(), false); - KisRectIteratorPixel dstIt = m_maskAsSelection->createRectIterator(r.x(), r.y(), + KisRectIteratorPixel dstIt = m_tqmaskAsSelection->createRectIterator(r.x(), r.y(), r.width(), r.height(), true); while(!dstIt.isDone()) { @@ -326,13 +326,13 @@ void KisPaintLayer::convertMaskToSelection(const QRect& r) { } void KisPaintLayer::genericMaskCreationHelper() { - m_mask->setParentLayer(this); + m_tqmask->setParentLayer(this); - m_maskAsSelection = new KisSelection(); // Anonymous selection is good enough + m_tqmaskAsSelection = new KisSelection(); // Anonymous selection is good enough - // Default pixel is opaque white == don't mask? - Q_UINT8 const defPixel[] = { 255, 255 }; - m_mask->dataManager()->setDefaultPixel(defPixel); + // Default pixel is opaque white == don't tqmask? + TQ_UINT8 const defPixel[] = { 255, 255 }; + m_tqmask->dataManager()->setDefaultPixel(defPixel); setDirty(); emit sigMaskInfoChanged(); @@ -344,7 +344,7 @@ void KisPaintLayer::setDirty(bool propagate) { super::setDirty(propagate); } -void KisPaintLayer::setDirty(const QRect & rect, bool propagate) { +void KisPaintLayer::setDirty(const TQRect & rect, bool propagate) { if (hasMask()) convertMaskToSelection(rect); super::setDirty(rect, propagate); @@ -355,16 +355,16 @@ namespace { class KisCreateMaskCommand : public KNamedCommand { typedef KNamedCommand super; KisPaintLayerSP m_layer; - KisPaintDeviceSP m_mask; + KisPaintDeviceSP m_tqmask; public: - KisCreateMaskCommand(const QString& name, KisPaintLayer* layer) + KisCreateMaskCommand(const TQString& name, KisPaintLayer* layer) : super(name), m_layer(layer) {} virtual void execute() { kdDebug() << k_funcinfo << endl; - if (!m_mask) - m_mask = m_layer->createMask(); + if (!m_tqmask) + m_tqmask = m_layer->createMask(); else - m_layer->createMaskFromPaintDevice(m_mask); + m_layer->createMaskFromPaintDevice(m_tqmask); } virtual void unexecute() { m_layer->removeMask(); @@ -374,35 +374,35 @@ namespace { class KisMaskFromSelectionCommand : public KNamedCommand { typedef KNamedCommand super; KisPaintLayerSP m_layer; - KisPaintDeviceSP m_maskBefore; - KisPaintDeviceSP m_maskAfter; + KisPaintDeviceSP m_tqmaskBefore; + KisPaintDeviceSP m_tqmaskAfter; KisSelectionSP m_selection; public: - KisMaskFromSelectionCommand(const QString& name, KisPaintLayer* layer) + KisMaskFromSelectionCommand(const TQString& name, KisPaintLayer* layer) : super(name), m_layer(layer) { if (m_layer->hasMask()) - m_maskBefore = m_layer->getMask(); + m_tqmaskBefore = m_layer->getMask(); else - m_maskBefore = 0; - m_maskAfter = 0; + m_tqmaskBefore = 0; + m_tqmaskAfter = 0; if (m_layer->paintDevice()->hasSelection()) m_selection = m_layer->paintDevice()->selection(); else m_selection = 0; } virtual void execute() { - if (!m_maskAfter) { + if (!m_tqmaskAfter) { m_layer->createMaskFromSelection(m_selection); - m_maskAfter = m_layer->getMask(); + m_tqmaskAfter = m_layer->getMask(); } else { m_layer->paintDevice()->deselect(); - m_layer->createMaskFromPaintDevice(m_maskAfter); + m_layer->createMaskFromPaintDevice(m_tqmaskAfter); } } virtual void unexecute() { m_layer->paintDevice()->setSelection(m_selection); - if (m_maskBefore) - m_layer->createMaskFromPaintDevice(m_maskBefore); + if (m_tqmaskBefore) + m_layer->createMaskFromPaintDevice(m_tqmaskBefore); else m_layer->removeMask(); } @@ -411,12 +411,12 @@ namespace { class KisMaskToSelectionCommand : public KNamedCommand { typedef KNamedCommand super; KisPaintLayerSP m_layer; - KisPaintDeviceSP m_mask; + KisPaintDeviceSP m_tqmask; KisSelectionSP m_selection; public: - KisMaskToSelectionCommand(const QString& name, KisPaintLayer* layer) + KisMaskToSelectionCommand(const TQString& name, KisPaintLayer* layer) : super(name), m_layer(layer) { - m_mask = m_layer->getMask(); + m_tqmask = m_layer->getMask(); if (m_layer->paintDevice()->hasSelection()) m_selection = m_layer->paintDevice()->selection(); else @@ -431,18 +431,18 @@ namespace { m_layer->paintDevice()->setSelection(m_selection); else m_layer->paintDevice()->deselect(); - m_layer->createMaskFromPaintDevice(m_mask); + m_layer->createMaskFromPaintDevice(m_tqmask); } }; class KisRemoveMaskCommand : public KNamedCommand { typedef KNamedCommand super; KisPaintLayerSP m_layer; - KisPaintDeviceSP m_mask; + KisPaintDeviceSP m_tqmask; public: - KisRemoveMaskCommand(const QString& name, KisPaintLayer* layer) + KisRemoveMaskCommand(const TQString& name, KisPaintLayer* layer) : super(name), m_layer(layer) { - m_mask = m_layer->getMask(); + m_tqmask = m_layer->getMask(); } virtual void execute() { kdDebug() << k_funcinfo << endl; @@ -451,19 +451,19 @@ namespace { virtual void unexecute() { // I hope that if the undo stack unwinds, it will end up here in the right // state again; taking a deep-copy sounds like wasteful to me - m_layer->createMaskFromPaintDevice(m_mask); + m_layer->createMaskFromPaintDevice(m_tqmask); } }; class KisApplyMaskCommand : public KNamedCommand { typedef KNamedCommand super; KisPaintLayerSP m_layer; - KisPaintDeviceSP m_mask; + KisPaintDeviceSP m_tqmask; KisPaintDeviceSP m_original; public: - KisApplyMaskCommand(const QString& name, KisPaintLayer* layer) + KisApplyMaskCommand(const TQString& name, KisPaintLayer* layer) : super(name), m_layer(layer) { - m_mask = m_layer->getMask(); + m_tqmask = m_layer->getMask(); m_original = new KisPaintDevice(*m_layer->paintDevice()); } virtual void execute() { @@ -479,7 +479,7 @@ namespace { gc.bitBlt(x, y, COMPOSITE_COPY, m_original, OPACITY_OPAQUE, x, y, w, h); gc.end(); - m_layer->createMaskFromPaintDevice(m_mask); + m_layer->createMaskFromPaintDevice(m_tqmask); } }; } @@ -488,11 +488,11 @@ KNamedCommand* KisPaintLayer::createMaskCommand() { return new KisCreateMaskCommand(i18n("Create Layer Mask"), this); } -KNamedCommand* KisPaintLayer::maskFromSelectionCommand() { +KNamedCommand* KisPaintLayer::tqmaskFromSelectionCommand() { return new KisMaskFromSelectionCommand(i18n("Mask From Selection"), this); } -KNamedCommand* KisPaintLayer::maskToSelectionCommand() { +KNamedCommand* KisPaintLayer::tqmaskToSelectionCommand() { return new KisMaskToSelectionCommand(i18n("Mask to Selection"), this); } diff --git a/krita/core/kis_paint_layer.h b/krita/core/kis_paint_layer.h index 2c4b562f..9e598e7a 100644 --- a/krita/core/kis_paint_layer.h +++ b/krita/core/kis_paint_layer.h @@ -29,11 +29,12 @@ class KisPaintLayer : public KisLayer, public KisLayerSupportsIndirectPainting { typedef KisLayer super; Q_OBJECT + TQ_OBJECT public: - KisPaintLayer(KisImage *img, const QString& name, Q_UINT8 opacity, KisPaintDeviceSP dev); - KisPaintLayer(KisImage *img, const QString& name, Q_UINT8 opacity); - KisPaintLayer(KisImage *img, const QString& name, Q_UINT8 opacity, KisColorSpace * colorSpace); + KisPaintLayer(KisImage *img, const TQString& name, TQ_UINT8 opacity, KisPaintDeviceSP dev); + KisPaintLayer(KisImage *img, const TQString& name, TQ_UINT8 opacity); + KisPaintLayer(KisImage *img, const TQString& name, TQ_UINT8 opacity, KisColorSpace * colorSpace); KisPaintLayer(const KisPaintLayer& rhs); virtual ~KisPaintLayer(); @@ -46,21 +47,21 @@ public: // Called when another layer is made active virtual void deactivate() {} - virtual Q_INT32 x() const; - virtual void setX(Q_INT32 x); + virtual TQ_INT32 x() const; + virtual void setX(TQ_INT32 x); - virtual Q_INT32 y() const; - virtual void setY(Q_INT32 y); + virtual TQ_INT32 y() const; + virtual void setY(TQ_INT32 y); - virtual QRect extent() const; - virtual QRect exactBounds() const; + virtual TQRect extent() const; + virtual TQRect exactBounds() const; - virtual void paintSelection(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); - virtual void paintSelection(QImage &img, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize); + virtual void paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); + virtual void paintSelection(TQImage &img, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize); - virtual void paintMaskInactiveLayers(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + virtual void paintMaskInactiveLayers(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); - virtual QImage createThumbnail(Q_INT32 w, Q_INT32 h); + virtual TQImage createThumbnail(TQ_INT32 w, TQ_INT32 h); virtual bool accept(KisLayerVisitor &v) { @@ -72,55 +73,55 @@ public: inline KisPaintDeviceSP paintDevice() const { return m_paintdev; } - /// Returns the paintDevice that accompanies this layer (or mask, see editMask) + /// Returns the paintDevice that accompanies this layer (or tqmask, see editMask) inline KisPaintDeviceSP paintDeviceOrMask() const { if (hasMask() && editMask()) - return m_mask; + return m_tqmask; return m_paintdev; } // Mask Layer - /// Does this layer have a layer mask? - bool hasMask() const { return m_mask != 0; } + /// Does this layer have a layer tqmask? + bool hasMask() const { return m_tqmask != 0; } // XXX TODO: Make these undo-able! - /// Create a mask if it does not yet exist, and return it + /// Create a tqmask if it does not yet exist, and return it KisPaintDeviceSP createMask(); - /// Convert the from argument to the mask + /// Convert the from argument to the tqmask void createMaskFromPaintDevice(KisPaintDeviceSP from); /** * Convert the from selection to a paint device (should convert the getMaskAsSelection - * result back to the mask). Overwrites the current mask, if any. Also removes the selection + * result back to the tqmask). Overwrites the current tqmask, if any. Also removes the selection */ void createMaskFromSelection(KisSelectionSP from); - /// Remove the layer mask + /// Remove the layer tqmask void removeMask(); - /// Apply the layer mask to the paint device, this removes the mask afterwards + /// Apply the layer tqmask to the paint device, this removes the tqmask afterwards void applyMask(); - /// Returns the layer mask's device. Creates one if there is currently none + /// Returns the layer tqmask's device. Creates one if there is currently none KisPaintDeviceSP getMask(); - /// Returns the layer mask's device, converted to a selection. Creates one if there is currently none + /// Returns the layer tqmask's device, converted to a selection. Creates one if there is currently none KisSelectionSP getMaskAsSelection(); /// Undoable version of createMask KNamedCommand* createMaskCommand(); /// Undoable version of createMaskFromSelection - KNamedCommand* maskFromSelectionCommand(); - /// Undoable, removes the current mask, but converts it to the current selection - KNamedCommand* maskToSelectionCommand(); + KNamedCommand* tqmaskFromSelectionCommand(); + /// Undoable, removes the current tqmask, but converts it to the current selection + KNamedCommand* tqmaskToSelectionCommand(); /// Undoable version of removeMask KNamedCommand* removeMaskCommand(); /// Undoable version of applyMask KNamedCommand* applyMaskCommand(); - /// Returns true if the masked part of the mask will be rendered instead of being transparent + /// Returns true if the tqmasked part of the tqmask will be rendered instead of being transparent bool renderMask() const { return m_renderMask; } /// Set the renderMask property void setRenderMask(bool b); /** * When this returns true, the KisPaintDevice returned in paintDevice will actually - * be the layer mask (if there is one). This is so that tools can draw on the mask + * be the layer tqmask (if there is one). This is so that tools can draw on the tqmask * without needing to know its existance. */ bool editMask() const { return m_editMask; } @@ -130,22 +131,22 @@ public: /// Overridden to call the private convertMaskToSelection virtual void setDirty(bool propagate = true); /// Same as above - virtual void setDirty(const QRect & rect, bool propagate = true); + virtual void setDirty(const TQRect & rect, bool propagate = true); // KisLayerSupportsIndirectPainting virtual KisLayer* layer() { return this; } signals: - /// When the mask is created/destroyed or the editmask or rendermask is changed + /// When the tqmask is created/destroyed or the edittqmask or rendertqmask is changed void sigMaskInfoChanged(); private: - void convertMaskToSelection(const QRect& r); + void convertMaskToSelection(const TQRect& r); void genericMaskCreationHelper(); KisPaintDeviceSP m_paintdev; - // Layer mask related: + // Layer tqmask related: // XXX It would be nice to merge the next 2 devices... - KisPaintDeviceSP m_mask; // The mask that we can edit and display easily - KisSelectionSP m_maskAsSelection; // The mask as selection, to apply and render easily + KisPaintDeviceSP m_tqmask; // The tqmask that we can edit and display easily + KisSelectionSP m_tqmaskAsSelection; // The tqmask as selection, to apply and render easily bool m_renderMask; bool m_editMask; }; diff --git a/krita/core/kis_painter.cc b/krita/core/kis_painter.cc index 8086696f..b8353918 100644 --- a/krita/core/kis_painter.cc +++ b/krita/core/kis_painter.cc @@ -26,19 +26,19 @@ #include <climits> #include <strings.h> -#include "qbrush.h" -#include "qfontinfo.h" -#include "qfontmetrics.h" -#include "qpen.h" -#include "qregion.h" -#include "qwmatrix.h" -#include <qimage.h> -#include <qmap.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpointarray.h> -#include <qrect.h> -#include <qstring.h> +#include "tqbrush.h" +#include "tqfontinfo.h" +#include "tqfontmetrics.h" +#include "tqpen.h" +#include "tqregion.h" +#include "tqwmatrix.h" +#include <tqimage.h> +#include <tqmap.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpointarray.h> +#include <tqrect.h> +#include <tqstring.h> #include <kdebug.h> #include <kcommand.h> @@ -121,7 +121,7 @@ KCommand *KisPainter::end() return endTransaction(); } -void KisPainter::beginTransaction(const QString& customName) +void KisPainter::beginTransaction(const TQString& customName) { if (m_transaction) delete m_transaction; @@ -145,24 +145,24 @@ KCommand *KisPainter::endTransaction() } -QRect KisPainter::dirtyRect() { - QRect r = m_dirtyRect; - m_dirtyRect = QRect(); +TQRect KisPainter::dirtyRect() { + TQRect r = m_dirtyRect; + m_dirtyRect = TQRect(); return r; } -void KisPainter::bitBlt(Q_INT32 dx, Q_INT32 dy, +void KisPainter::bitBlt(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp& op, KisPaintDeviceSP srcdev, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh) + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh) { if (srcdev == 0) { return; } - QRect srcRect = QRect(sx, sy, sw, sh); + TQRect srcRect = TQRect(sx, sy, sw, sh); if (srcdev->extentIsValid() && op != COMPOSITE_COPY) { srcRect &= srcdev->extent(); @@ -180,42 +180,42 @@ void KisPainter::bitBlt(Q_INT32 dx, Q_INT32 dy, sw = srcRect.width(); sh = srcRect.height(); - addDirtyRect(QRect(dx, dy, sw, sh)); + addDirtyRect(TQRect(dx, dy, sw, sh)); KisColorSpace * srcCs = srcdev->colorSpace(); - Q_INT32 dstY = dy; - Q_INT32 srcY = sy; - Q_INT32 rowsRemaining = sh; + TQ_INT32 dstY = dy; + TQ_INT32 srcY = sy; + TQ_INT32 rowsRemaining = sh; while (rowsRemaining > 0) { - Q_INT32 dstX = dx; - Q_INT32 srcX = sx; - Q_INT32 columnsRemaining = sw; - Q_INT32 numContiguousDstRows = m_device->numContiguousRows(dstY, dstX, dstX + sw - 1); - Q_INT32 numContiguousSrcRows = srcdev->numContiguousRows(srcY, srcX, srcX + sw - 1); + TQ_INT32 dstX = dx; + TQ_INT32 srcX = sx; + TQ_INT32 columnsRemaining = sw; + TQ_INT32 numContiguousDstRows = m_device->numContiguousRows(dstY, dstX, dstX + sw - 1); + TQ_INT32 numContiguousSrcRows = srcdev->numContiguousRows(srcY, srcX, srcX + sw - 1); - Q_INT32 rows = QMIN(numContiguousDstRows, numContiguousSrcRows); - rows = QMIN(rows, rowsRemaining); + TQ_INT32 rows = TQMIN(numContiguousDstRows, numContiguousSrcRows); + rows = TQMIN(rows, rowsRemaining); while (columnsRemaining > 0) { - Q_INT32 numContiguousDstColumns = m_device->numContiguousColumns(dstX, dstY, dstY + rows - 1); - Q_INT32 numContiguousSrcColumns = srcdev->numContiguousColumns(srcX, srcY, srcY + rows - 1); + TQ_INT32 numContiguousDstColumns = m_device->numContiguousColumns(dstX, dstY, dstY + rows - 1); + TQ_INT32 numContiguousSrcColumns = srcdev->numContiguousColumns(srcX, srcY, srcY + rows - 1); - Q_INT32 columns = QMIN(numContiguousDstColumns, numContiguousSrcColumns); - columns = QMIN(columns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousDstColumns, numContiguousSrcColumns); + columns = TQMIN(columns, columnsRemaining); - Q_INT32 srcRowStride = srcdev->rowStride(srcX, srcY); - //const Q_UINT8 *srcData = srcdev->pixel(srcX, srcY); + TQ_INT32 srcRowStride = srcdev->rowStride(srcX, srcY); + //const TQ_UINT8 *srcData = srcdev->pixel(srcX, srcY); KisHLineIteratorPixel srcIt = srcdev->createHLineIterator(srcX, srcY, columns, false); - const Q_UINT8 *srcData = srcIt.rawData(); + const TQ_UINT8 *srcData = srcIt.rawData(); - //Q_UINT8 *dstData = m_device->writablePixel(dstX, dstY); - Q_INT32 dstRowStride = m_device->rowStride(dstX, dstY); + //TQ_UINT8 *dstData = m_device->writablePixel(dstX, dstY); + TQ_INT32 dstRowStride = m_device->rowStride(dstX, dstY); KisHLineIteratorPixel dstIt = m_device->createHLineIterator(dstX, dstY, columns, true); - Q_UINT8 *dstData = dstIt.rawData(); + TQ_UINT8 *dstData = dstIt.rawData(); m_colorSpace->bitBlt(dstData, @@ -241,16 +241,16 @@ void KisPainter::bitBlt(Q_INT32 dx, Q_INT32 dy, } } -void KisPainter::bltSelection(Q_INT32 dx, Q_INT32 dy, +void KisPainter::bltSelection(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp &op, KisPaintDeviceSP srcdev, KisSelectionSP seldev, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh) + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh) { // Better use a probablistic method than a too slow one - if (seldev->isProbablyTotallyUnselected(QRect(dx, dy, sw, sh))) { + if (seldev->isProbablyTotallyUnselected(TQRect(dx, dy, sw, sh))) { /* kdDebug() << "Blitting outside selection rect\n"; @@ -264,13 +264,13 @@ void KisPainter::bltSelection(Q_INT32 dx, Q_INT32 dy, bltMask(dx,dy,op,srcdev,seldev.data(),opacity,sx,sy,sw,sh); } -void KisPainter::bltMask(Q_INT32 dx, Q_INT32 dy, +void KisPainter::bltMask(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp &op, KisPaintDeviceSP srcdev, KisPaintDeviceSP seldev, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh) + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh) { if (srcdev == 0) return; @@ -280,7 +280,7 @@ void KisPainter::bltMask(Q_INT32 dx, Q_INT32 dy, if (m_device == 0) return; - QRect srcRect = QRect(sx, sy, sw, sh); + TQRect srcRect = TQRect(sx, sy, sw, sh); if (srcdev->extentIsValid() && op != COMPOSITE_COPY) { srcRect &= srcdev->extent(); @@ -298,51 +298,51 @@ void KisPainter::bltMask(Q_INT32 dx, Q_INT32 dy, sw = srcRect.width(); sh = srcRect.height(); - addDirtyRect(QRect(dx, dy, sw, sh)); + addDirtyRect(TQRect(dx, dy, sw, sh)); KisColorSpace * srcCs = srcdev->colorSpace(); - Q_INT32 dstY = dy; - Q_INT32 srcY = sy; - Q_INT32 rowsRemaining = sh; + TQ_INT32 dstY = dy; + TQ_INT32 srcY = sy; + TQ_INT32 rowsRemaining = sh; while (rowsRemaining > 0) { - Q_INT32 dstX = dx; - Q_INT32 srcX = sx; - Q_INT32 columnsRemaining = sw; - Q_INT32 numContiguousDstRows = m_device->numContiguousRows(dstY, dstX, dstX + sw - 1); - Q_INT32 numContiguousSrcRows = srcdev->numContiguousRows(srcY, srcX, srcX + sw - 1); - Q_INT32 numContiguousSelRows = seldev->numContiguousRows(dstY, dstX, dstX + sw - 1); + TQ_INT32 dstX = dx; + TQ_INT32 srcX = sx; + TQ_INT32 columnsRemaining = sw; + TQ_INT32 numContiguousDstRows = m_device->numContiguousRows(dstY, dstX, dstX + sw - 1); + TQ_INT32 numContiguousSrcRows = srcdev->numContiguousRows(srcY, srcX, srcX + sw - 1); + TQ_INT32 numContiguousSelRows = seldev->numContiguousRows(dstY, dstX, dstX + sw - 1); - Q_INT32 rows = QMIN(numContiguousDstRows, numContiguousSrcRows); - rows = QMIN(numContiguousSelRows, rows); - rows = QMIN(rows, rowsRemaining); + TQ_INT32 rows = TQMIN(numContiguousDstRows, numContiguousSrcRows); + rows = TQMIN(numContiguousSelRows, rows); + rows = TQMIN(rows, rowsRemaining); while (columnsRemaining > 0) { - Q_INT32 numContiguousDstColumns = m_device->numContiguousColumns(dstX, dstY, dstY + rows - 1); - Q_INT32 numContiguousSrcColumns = srcdev->numContiguousColumns(srcX, srcY, srcY + rows - 1); - Q_INT32 numContiguousSelColumns = seldev->numContiguousColumns(dstX, dstY, dstY + rows - 1); + TQ_INT32 numContiguousDstColumns = m_device->numContiguousColumns(dstX, dstY, dstY + rows - 1); + TQ_INT32 numContiguousSrcColumns = srcdev->numContiguousColumns(srcX, srcY, srcY + rows - 1); + TQ_INT32 numContiguousSelColumns = seldev->numContiguousColumns(dstX, dstY, dstY + rows - 1); - Q_INT32 columns = QMIN(numContiguousDstColumns, numContiguousSrcColumns); - columns = QMIN(numContiguousSelColumns, columns); - columns = QMIN(columns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousDstColumns, numContiguousSrcColumns); + columns = TQMIN(numContiguousSelColumns, columns); + columns = TQMIN(columns, columnsRemaining); - //Q_UINT8 *dstData = m_device->writablePixel(dstX, dstY); - Q_INT32 dstRowStride = m_device->rowStride(dstX, dstY); + //TQ_UINT8 *dstData = m_device->writablePixel(dstX, dstY); + TQ_INT32 dstRowStride = m_device->rowStride(dstX, dstY); KisHLineIteratorPixel dstIt = m_device->createHLineIterator(dstX, dstY, columns, true); - Q_UINT8 *dstData = dstIt.rawData(); + TQ_UINT8 *dstData = dstIt.rawData(); - //const Q_UINT8 *srcData = srcdev->pixel(srcX, srcY); - Q_INT32 srcRowStride = srcdev->rowStride(srcX, srcY); + //const TQ_UINT8 *srcData = srcdev->pixel(srcX, srcY); + TQ_INT32 srcRowStride = srcdev->rowStride(srcX, srcY); KisHLineIteratorPixel srcIt = srcdev->createHLineIterator(srcX, srcY, columns, false); - const Q_UINT8 *srcData = srcIt.rawData(); + const TQ_UINT8 *srcData = srcIt.rawData(); - //const Q_UINT8 *selData = seldev->pixel(dstX, dstY); - Q_INT32 selRowStride = seldev->rowStride(dstX, dstY); + //const TQ_UINT8 *selData = seldev->pixel(dstX, dstY); + TQ_INT32 selRowStride = seldev->rowStride(dstX, dstY); KisHLineIteratorPixel selIt = seldev->createHLineIterator(dstX, dstY, columns, false); - const Q_UINT8 *selData = selIt.rawData(); + const TQ_UINT8 *selData = selIt.rawData(); m_colorSpace->bitBlt(dstData, dstRowStride, @@ -368,12 +368,12 @@ void KisPainter::bltMask(Q_INT32 dx, Q_INT32 dy, } -void KisPainter::bltSelection(Q_INT32 dx, Q_INT32 dy, +void KisPainter::bltSelection(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp& op, KisPaintDeviceSP srcdev, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh) + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh) { if (m_device == 0) return; if (!m_device->hasSelection()) { @@ -812,13 +812,13 @@ void KisPainter::fillPolygon(const vKisPoint& points, FillStyle fillStyle) } // Fill the polygon bounding rectangle with the required contents then we'll - // create a mask for the actual polygon coverage. + // create a tqmask for the actual polygon coverage. KisPaintDeviceSP polygon = new KisPaintDevice(m_device->colorSpace(), "polygon"); Q_CHECK_PTR(polygon); KisFillPainter fillPainter(polygon); - QRect boundingRectangle(x0, y0, x1 - x0 + 1, y1 - y0 + 1); + TQRect boundingRectangle(x0, y0, x1 - x0 + 1, y1 - y0 + 1); // Clip to the image bounds. if (m_device->image()) { @@ -899,7 +899,7 @@ void KisPainter::fillPolygon(const vKisPoint& points, FillStyle fillStyle) polygon->applySelectionMask(polygonMask); - QRect r = polygon->extent(); + TQRect r = polygon->extent(); // The strokes for the outline may have already added updated the dirtyrect, but it can't hurt, // and if we're painting without outlines, then there will be no dirty rect. Let's do it ourselves... diff --git a/krita/core/kis_painter.h b/krita/core/kis_painter.h index fa8de088..abfd8b17 100644 --- a/krita/core/kis_painter.h +++ b/krita/core/kis_painter.h @@ -34,15 +34,15 @@ #include <koffice_export.h> -class QRect; +class TQRect; class KisTransaction; class KisBrush; class KisPattern; /** * KisPainter contains the graphics primitives necessary to draw on a - * KisPaintDevice. This is the same kind of abstraction as used in Qt - * itself, where you have QPainter and QPaintDevice. + * KisPaintDevice. This is the same kind of abstraction as used in TQt + * itself, where you have TQPainter and TQPaintDevice. * * However, KisPainter works on a tiled image and supports different * colour models, and that's a lot more complicated. @@ -79,7 +79,7 @@ public: KCommand *end(); /// Begin an undoable paint operation - void beginTransaction(const QString& customName = QString::null); + void beginTransaction(const TQString& customName = TQString()); /// Finish the undoable paint operation KCommand *endTransaction(); @@ -102,11 +102,11 @@ public: /** * Blast the specified region from src onto the current paint device. */ - void bitBlt(Q_INT32 dx, Q_INT32 dy, + void bitBlt(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp& op, KisPaintDeviceSP src, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh) + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh) { bitBlt(dx, dy, op, src, OPACITY_OPAQUE, sx, sy, sw, sh); } @@ -115,47 +115,47 @@ public: * Overloaded version of the previous, differs in that it is possible to specify * a value for opacity */ - void bitBlt(Q_INT32 dx, Q_INT32 dy, + void bitBlt(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp& op, KisPaintDeviceSP src, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh); + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh); /** - * A version of bitBlt that renders using an external mask, ignoring + * A version of bitBlt that renders using an external tqmask, ignoring * the src device's own selection, if it has one. */ - void bltMask(Q_INT32 dx, Q_INT32 dy, + void bltMask(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp &op, KisPaintDeviceSP src, KisPaintDeviceSP selMask, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh); + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh); /** - * A version of bitBlt that renders using an external selection mask, ignoring + * A version of bitBlt that renders using an external selection tqmask, ignoring * the src device's own selection, if it has one. */ - void bltSelection(Q_INT32 dx, Q_INT32 dy, + void bltSelection(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp &op, KisPaintDeviceSP src, KisSelectionSP selMask, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh); + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh); /** - * A version of bitBlt that renders using the src device's selection mask, if it has one. + * A version of bitBlt that renders using the src device's selection tqmask, if it has one. */ - void bltSelection(Q_INT32 dx, Q_INT32 dy, + void bltSelection(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp &op, KisPaintDeviceSP src, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh); + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh); /** @@ -166,19 +166,19 @@ public: * * Call will RESET the dirtyRect! */ - QRect dirtyRect(); + TQRect dirtyRect(); /** * Add the r to the current dirty rect, and return the dirtyRect after adding r to it. */ - QRect addDirtyRect(QRect r) { m_dirtyRect |= r; return m_dirtyRect; } + TQRect addDirtyRect(TQRect r) { m_dirtyRect |= r; return m_dirtyRect; } /** * Paint a line that connects the dots in points */ - void paintPolyline(const QValueVector <KisPoint> &points, + void paintPolyline(const TQValueVector <KisPoint> &points, int index = 0, int numPoints = -1); /** @@ -323,9 +323,9 @@ public: StrokeStyle strokeStyle() const { return m_strokeStyle; } /// Set the opacity which is used in painting (like filling polygons) - void setOpacity(Q_UINT8 opacity) { m_opacity = opacity; } + void setOpacity(TQ_UINT8 opacity) { m_opacity = opacity; } /// Returns the opacity that is used in painting - Q_UINT8 opacity() const { return m_opacity; } + TQ_UINT8 opacity() const { return m_opacity; } /** * Sets the current composite operation. Everything painted will be composited on @@ -399,7 +399,7 @@ protected: KisPaintDeviceSP m_device; KisTransaction *m_transaction; - QRect m_dirtyRect; + TQRect m_dirtyRect; KisColor m_paintColor; KisColor m_backgroundColor; @@ -413,13 +413,13 @@ protected: bool m_duplicateHealing; int m_duplicateHealingRadius; bool m_duplicatePerspectiveCorrection; - Q_UINT8 m_opacity; + TQ_UINT8 m_opacity; KisCompositeOp m_compositeOp; KisFilterSP m_filter; KisPaintOp * m_paintOp; double m_pressure; bool m_cancelRequested; - Q_INT32 m_pixelSize; + TQ_INT32 m_pixelSize; KisColorSpace * m_colorSpace; KisProfile * m_profile; KisPaintDeviceSP m_dab; diff --git a/krita/core/kis_paintop.cc b/krita/core/kis_paintop.cc index 4030e931..e00484f1 100644 --- a/krita/core/kis_paintop.cc +++ b/krita/core/kis_paintop.cc @@ -19,12 +19,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "qwidget.h" +#include "tqwidget.h" #include "kis_painter.h" #include "kis_layer.h" #include "kis_types.h" #include "kis_paintop.h" -#include "kis_alpha_mask.h" +#include "kis_alpha_tqmask.h" #include "kis_point.h" #include "kis_colorspace.h" #include "kis_global.h" @@ -42,11 +42,11 @@ KisPaintOp::~KisPaintOp() { } -KisPaintDeviceSP KisPaintOp::computeDab(KisAlphaMaskSP mask) { - return computeDab(mask, m_painter->device()->colorSpace()); +KisPaintDeviceSP KisPaintOp::computeDab(KisAlphaMaskSP tqmask) { + return computeDab(tqmask, m_painter->device()->colorSpace()); } -KisPaintDeviceSP KisPaintOp::computeDab(KisAlphaMaskSP mask, KisColorSpace *cs) +KisPaintDeviceSP KisPaintOp::computeDab(KisAlphaMaskSP tqmask, KisColorSpace *cs) { // XXX: According to the SeaShore source, the Gimp uses a // temporary layer the size of the layer that is being painted @@ -63,22 +63,22 @@ KisPaintDeviceSP KisPaintOp::computeDab(KisAlphaMaskSP mask, KisColorSpace *cs) KisColorSpace * colorSpace = m_dab->colorSpace(); - Q_INT32 pixelSize = colorSpace->pixelSize(); + TQ_INT32 pixelSize = colorSpace->pixelSize(); - Q_INT32 maskWidth = mask->width(); - Q_INT32 maskHeight = mask->height(); + TQ_INT32 tqmaskWidth = tqmask->width(); + TQ_INT32 tqmaskHeight = tqmask->height(); // Convert the kiscolor to the right colorspace. kc.convertTo(colorSpace); - KisHLineIteratorPixel hiter = m_dab->createHLineIterator(0, 0, maskWidth, true); - for (int y = 0; y < maskHeight; y++) + KisHLineIteratorPixel hiter = m_dab->createHLineIterator(0, 0, tqmaskWidth, true); + for (int y = 0; y < tqmaskHeight; y++) { int x=0; while(! hiter.isDone()) { - // XXX: Set mask - colorSpace->setAlpha(kc.data(), mask->alphaAt(x++, y), 1); + // XXX: Set tqmask + colorSpace->setAlpha(kc.data(), tqmask->alphaAt(x++, y), 1); memcpy(hiter.rawData(), kc.data(), pixelSize); ++hiter; } @@ -88,9 +88,9 @@ KisPaintDeviceSP KisPaintOp::computeDab(KisAlphaMaskSP mask, KisColorSpace *cs) return m_dab; } -void KisPaintOp::splitCoordinate(double coordinate, Q_INT32 *whole, double *fraction) +void KisPaintOp::splitCoordinate(double coordinate, TQ_INT32 *whole, double *fraction) { - Q_INT32 i = static_cast<Q_INT32>(coordinate); + TQ_INT32 i = static_cast<TQ_INT32>(coordinate); if (coordinate < 0) { // We always want the fractional part to be positive. @@ -110,4 +110,4 @@ void KisPaintOp::setSource(KisPaintDeviceSP p) { } -KisPaintOpSettings* KisPaintOpFactory::settings(QWidget* /*parent*/, const KisInputDevice& /*inputDevice*/) { return 0; } +KisPaintOpSettings* KisPaintOpFactory::settings(TQWidget* /*tqparent*/, const KisInputDevice& /*inputDevice*/) { return 0; } diff --git a/krita/core/kis_paintop.h b/krita/core/kis_paintop.h index 6a6efddc..8e8587ea 100644 --- a/krita/core/kis_paintop.h +++ b/krita/core/kis_paintop.h @@ -23,7 +23,7 @@ #ifndef KIS_PAINTOP_H_ #define KIS_PAINTOP_H_ -#include <qstring.h> +#include <tqstring.h> #include <ksharedptr.h> #include <klocale.h> @@ -41,7 +41,7 @@ class KisAlphaMask; class KisPainter; class KisColorSpace; class KisInputDevice; -class QWidget; +class TQWidget; /** * This class keeps information that can be used in the painting process, for example by @@ -79,14 +79,14 @@ public: protected: - virtual KisPaintDeviceSP computeDab(KisAlphaMaskSP mask); - virtual KisPaintDeviceSP computeDab(KisAlphaMaskSP mask, KisColorSpace *cs); + virtual KisPaintDeviceSP computeDab(KisAlphaMaskSP tqmask); + virtual KisPaintDeviceSP computeDab(KisAlphaMaskSP tqmask, KisColorSpace *cs); /** * Split the coordinate into whole + fraction, where fraction is always >= 0. */ - virtual void splitCoordinate(double coordinate, Q_INT32 *whole, double *fraction); + virtual void splitCoordinate(double coordinate, TQ_INT32 *whole, double *fraction); KisPainter * m_painter; KisPaintDeviceSP m_source; // use this layer as source layer for the operation @@ -97,10 +97,10 @@ private: class KisPaintOpSettings { public: - KisPaintOpSettings(QWidget *parent) { Q_UNUSED(parent); } + KisPaintOpSettings(TQWidget *tqparent) { Q_UNUSED(tqparent); } virtual ~KisPaintOpSettings() {} - virtual QWidget *widget() const { return 0; } + virtual TQWidget *widget() const { return 0; } }; /** @@ -121,7 +121,7 @@ public: /** * The filename of the pixmap we can use to represent this paintop in the ui. */ - virtual QString pixmap() { return ""; } + virtual TQString pixmap() { return ""; } /** * Whether this paintop is internal to a certain tool or can be used @@ -135,7 +135,7 @@ public: * specified input device. Return 0 if there are no settings available for the given * device. */ - virtual KisPaintOpSettings* settings(QWidget* parent, const KisInputDevice& inputDevice); + virtual KisPaintOpSettings* settings(TQWidget* tqparent, const KisInputDevice& inputDevice); }; #endif // KIS_PAINTOP_H_ diff --git a/krita/core/kis_paintop_registry.cc b/krita/core/kis_paintop_registry.cc index 0ba7b5f3..e023e5b4 100644 --- a/krita/core/kis_paintop_registry.cc +++ b/krita/core/kis_paintop_registry.cc @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qpixmap.h> -#include <qwidget.h> +#include <tqpixmap.h> +#include <tqwidget.h> #include <kdebug.h> #include <kinstance.h> @@ -43,8 +43,8 @@ KisPaintOpRegistry::KisPaintOpRegistry() Q_ASSERT(KisPaintOpRegistry::m_singleton == 0); KisPaintOpRegistry::m_singleton = this; - KTrader::OfferList offers = KTrader::self()->query(QString::fromLatin1("Krita/Paintop"), - QString::fromLatin1("(Type == 'Service') and " + KTrader::OfferList offers = KTrader::self()->query(TQString::tqfromLatin1("Krita/Paintop"), + TQString::tqfromLatin1("(Type == 'Service') and " "([X-Krita-Version] == 2)")); KTrader::OfferList::ConstIterator iter; @@ -54,7 +54,7 @@ KisPaintOpRegistry::KisPaintOpRegistry() KService::Ptr service = *iter; int errCode = 0; KParts::Plugin* plugin = - KParts::ComponentFactory::createInstanceFromService<KParts::Plugin> ( service, this, 0, QStringList(), &errCode); + KParts::ComponentFactory::createInstanceFromService<KParts::Plugin> ( service, this, 0, TQStringList(), &errCode); if ( plugin ) kdDebug(41006) << "found plugin " << service->property("Name").toString() << "\n"; else { @@ -98,16 +98,16 @@ KisPaintOp * KisPaintOpRegistry::paintOp(const KisID & id, const KisPaintOpSetti } } -KisPaintOp * KisPaintOpRegistry::paintOp(const QString & id, const KisPaintOpSettings * settings, KisPainter * painter) const +KisPaintOp * KisPaintOpRegistry::paintOp(const TQString & id, const KisPaintOpSettings * settings, KisPainter * painter) const { return paintOp(KisID(id, ""), settings, painter); } -KisPaintOpSettings * KisPaintOpRegistry::settings(const KisID& id, QWidget * parent, const KisInputDevice& inputDevice) const +KisPaintOpSettings * KisPaintOpRegistry::settings(const KisID& id, TQWidget * tqparent, const KisInputDevice& inputDevice) const { KisPaintOpFactory* f = get(id); if (f) - return f->settings( parent, inputDevice ); + return f->settings( tqparent, inputDevice ); return 0; } @@ -124,7 +124,7 @@ bool KisPaintOpRegistry::userVisible(const KisID & id, KisColorSpace* cs) const } -QString KisPaintOpRegistry::pixmap(const KisID & id) const +TQString KisPaintOpRegistry::pixmap(const KisID & id) const { KisPaintOpFactorySP f = get(id); diff --git a/krita/core/kis_paintop_registry.h b/krita/core/kis_paintop_registry.h index c544a601..c61105b6 100644 --- a/krita/core/kis_paintop_registry.h +++ b/krita/core/kis_paintop_registry.h @@ -19,14 +19,14 @@ #ifndef KIS_PAINTOP_REGISTRY_H_ #define KIS_PAINTOP_REGISTRY_H_ -#include <qobject.h> +#include <tqobject.h> #include "kis_types.h" #include "kis_generic_registry.h" #include <koffice_export.h> -class QWidget; -class QStringList; +class TQWidget; +class TQStringList; class KisPaintOp; class KisPaintOpSettings; @@ -34,10 +34,11 @@ class KisPainter; class KisColorSpace; class KisInputDevice; -class KRITACORE_EXPORT KisPaintOpRegistry : public QObject, public KisGenericRegistry<KisPaintOpFactorySP> +class KRITACORE_EXPORT KisPaintOpRegistry : public TQObject, public KisGenericRegistry<KisPaintOpFactorySP> { Q_OBJECT + TQ_OBJECT public: virtual ~KisPaintOpRegistry(); @@ -50,21 +51,21 @@ public: /** * Return a newly created paintopd */ - KisPaintOp * paintOp(const QString& id, const KisPaintOpSettings * settings, KisPainter * painter) const; + KisPaintOp * paintOp(const TQString& id, const KisPaintOpSettings * settings, KisPainter * painter) const; /** * Create and return an (abstracted) configuration widget * for using the specified paintop with the specified input device, - * with the specified parent as widget parent. Returns 0 if there + * with the specified tqparent as widget tqparent. Returns 0 if there * are no settings available for the given device. */ - KisPaintOpSettings * settings(const KisID& id, QWidget * parent, const KisInputDevice& inputDevice) const; + KisPaintOpSettings * settings(const KisID& id, TQWidget * tqparent, const KisInputDevice& inputDevice) const; // Whether we should show this paintop in the toolchest bool userVisible(const KisID & id, KisColorSpace* cs) const; // Get the name of the icon to show in the toolchest - QString pixmap(const KisID & id) const; + TQString pixmap(const KisID & id) const; public: diff --git a/krita/core/kis_palette.cc b/krita/core/kis_palette.cc index ad39eed5..daf8d84d 100644 --- a/krita/core/kis_palette.cc +++ b/krita/core/kis_palette.cc @@ -29,11 +29,11 @@ #include <stdlib.h> #include <cfloat> -#include <qimage.h> -#include <qpoint.h> -#include <qvaluevector.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqimage.h> +#include <tqpoint.h> +#include <tqvaluevector.h> +#include <tqfile.h> +#include <tqtextstream.h> #include <kdebug.h> #include <klocale.h> @@ -54,8 +54,8 @@ namespace { } -KisPalette::KisPalette(const QImage * img, Q_INT32 nColors, const QString & name) - : super(QString("")), +KisPalette::KisPalette(const TQImage * img, TQ_INT32 nColors, const TQString & name) + : super(TQString("")), m_name(name) { Q_ASSERT(nColors > 0); @@ -66,8 +66,8 @@ KisPalette::KisPalette(const QImage * img, Q_INT32 nColors, const QString & name m_columns = 0; // Set the default value that the GIMP uses... } -KisPalette::KisPalette(const KisPaintDeviceSP device, Q_INT32 nColors, const QString & name) - : super(QString("")), +KisPalette::KisPalette(const KisPaintDeviceSP device, TQ_INT32 nColors, const TQString & name) + : super(TQString("")), m_name(name) { Q_ASSERT(nColors > 0); @@ -79,17 +79,17 @@ KisPalette::KisPalette(const KisPaintDeviceSP device, Q_INT32 nColors, const QSt } -KisPalette::KisPalette(const KisGradient * gradient, Q_INT32 nColors, const QString & name) - : super(QString("")), +KisPalette::KisPalette(const KisGradient * gradient, TQ_INT32 nColors, const TQString & name) + : super(TQString("")), m_name(name) { Q_ASSERT(nColors > 0); Q_ASSERT(gradient != 0); double dx, cur_x; - QColor c; - Q_INT32 i; - Q_UINT8 opacity; + TQColor c; + TQ_INT32 i; + TQ_UINT8 opacity; dx = 1.0 / (nColors - 1); KisPaletteEntry e; @@ -102,7 +102,7 @@ KisPalette::KisPalette(const KisGradient * gradient, Q_INT32 nColors, const QStr m_columns = 0; // Set the default value that the GIMP uses... } -KisPalette::KisPalette(const QString& filename) +KisPalette::KisPalette(const TQString& filename) : super(filename) { // Implemented in super class @@ -135,7 +135,7 @@ KisPalette::~KisPalette() bool KisPalette::load() { - QFile file(filename()); + TQFile file(filename()); file.open(IO_ReadOnly); m_data = file.readAll(); file.close(); @@ -145,19 +145,19 @@ bool KisPalette::load() bool KisPalette::save() { - QFile file(filename()); + TQFile file(filename()); if (!file.open(IO_WriteOnly | IO_Truncate)) { return false; } - QTextStream stream(&file); + TQTextStream stream(&file); // Header: Magic\nName: <name>\nColumns: <no idea what this means, but default = 0> // In any case, we don't use Columns... stream << "GIMP Palette\nName: " << name() << "\nColumns: " << m_columns << "\n#\n"; for (uint i = 0; i < m_colors.size(); i++) { const KisPaletteEntry& entry = m_colors.at(i); - QColor c = entry.color; + TQColor c = entry.color; stream << c.red() << " " << c.green() << " " << c.blue() << "\t"; if (entry.name.isEmpty()) stream << "Untitled\n"; @@ -169,12 +169,12 @@ bool KisPalette::save() return true; } -QImage KisPalette::img() +TQImage KisPalette::img() { return m_img; } -Q_INT32 KisPalette::nColors() +TQ_INT32 KisPalette::nColors() { return m_colors.count(); } @@ -183,7 +183,7 @@ bool KisPalette::init() { enumPaletteType format = FORMAT_UNKNOWN; - QString s = QString::fromUtf8(m_data.data(), m_data.count()); + TQString s = TQString::fromUtf8(m_data.data(), m_data.count()); if (s.isEmpty() || s.isNull() || s.length() < 50) { kdWarning(DBG_AREA_FILE) << "Illegal Gimp palette file: " << filename() << "\n"; @@ -198,18 +198,18 @@ bool KisPalette::init() else if (s.startsWith("GIMP Palette")) { // XXX: No checks for wrong input yet! - Q_UINT32 index = 0; + TQ_UINT32 index = 0; - QStringList lines = QStringList::split("\n", s); + TQStringList lines = TQStringList::split("\n", s); if (lines.size() < 3) { return false; } - QString entry, channel, columns; - QStringList c; - Q_INT32 r, g, b; - QColor color; + TQString entry, channel, columns; + TQStringList c; + TQ_INT32 r, g, b; + TQColor color; KisPaletteEntry e; format = FORMAT_GPL; @@ -232,13 +232,13 @@ bool KisPalette::init() index = 3; } - for (Q_UINT32 i = index; i < lines.size(); i++) { + for (TQ_UINT32 i = index; i < lines.size(); i++) { if (lines[i].startsWith("#")) { m_comment += lines[i].mid(1).stripWhiteSpace() + " "; } else if (!lines[i].isEmpty()) { - QStringList a = QStringList::split(" ", lines[i].replace(QChar('\t'), " ")); + TQStringList a = TQStringList::split(" ", lines[i].tqreplace(TQChar('\t'), " ")); if (a.count() < 3) { @@ -259,10 +259,10 @@ bool KisPalette::init() break; } - color = QColor(r, g, b); + color = TQColor(r, g, b); e.color = color; - QString name = a.join(" "); + TQString name = a.join(" "); e.name = name.isEmpty() ? i18n("Untitled") : name; add(e); @@ -286,8 +286,8 @@ void KisPalette::add(const KisPaletteEntry & c) void KisPalette::remove(const KisPaletteEntry & c) { - QValueVector<KisPaletteEntry>::iterator it = m_colors.begin(); - QValueVector<KisPaletteEntry>::iterator end = m_colors.end(); + TQValueVector<KisPaletteEntry>::iterator it = m_colors.begin(); + TQValueVector<KisPaletteEntry>::iterator end = m_colors.end(); while (it != end) { if ((*it) == c) { @@ -298,7 +298,7 @@ void KisPalette::remove(const KisPaletteEntry & c) } } -KisPaletteEntry KisPalette::getColor(Q_UINT32 index) +KisPaletteEntry KisPalette::getColor(TQ_UINT32 index) { return m_colors[index]; } diff --git a/krita/core/kis_palette.h b/krita/core/kis_palette.h index 5d7d02c9..ef178819 100644 --- a/krita/core/kis_palette.h +++ b/krita/core/kis_palette.h @@ -18,9 +18,9 @@ #ifndef KIS_PALETTE_ #define KIS_PALETTE_ -#include <qimage.h> -#include <qcolor.h> -#include <qvaluevector.h> +#include <tqimage.h> +#include <tqcolor.h> +#include <tqvaluevector.h> #include <kio/job.h> #include <kpalette.h> @@ -29,15 +29,15 @@ #include "kis_resource.h" #include "kis_global.h" #include "kis_gradient.h" -#include "kis_alpha_mask.h" +#include "kis_alpha_tqmask.h" -class QPoint; -class QPixmap; +class TQPoint; +class TQPixmap; class KisPaintDevice; struct KisPaletteEntry { - QColor color; - QString name; + TQColor color; + TQString name; bool operator==(const KisPaletteEntry& rhs) const { return color == rhs.color && name == rhs.name; } @@ -51,28 +51,29 @@ class KisPalette : public KisResource { typedef KisResource super; Q_OBJECT + TQ_OBJECT public: /** * Create a palette from the colours in an image */ - KisPalette(const QImage * img, Q_INT32 nColors, const QString & name); + KisPalette(const TQImage * img, TQ_INT32 nColors, const TQString & name); /** * Create a palette from the colours in a paint device */ - KisPalette(const KisPaintDeviceSP device, Q_INT32 nColors, const QString & name); + KisPalette(const KisPaintDeviceSP device, TQ_INT32 nColors, const TQString & name); /** * Create a palette from the colours in a gradient */ - KisPalette(const KisGradient * gradient, Q_INT32 nColors, const QString & name); + KisPalette(const KisGradient * gradient, TQ_INT32 nColors, const TQString & name); /** * Load a palette from a file. This can be a Gimp * palette, a RIFF palette or a Photoshop palette. */ - KisPalette(const QString& filename); + KisPalette(const TQString& filename); /// Create an empty palette KisPalette(); @@ -84,28 +85,28 @@ public: virtual bool load(); virtual bool save(); - virtual QImage img(); + virtual TQImage img(); public: void add(const KisPaletteEntry &); void remove(const KisPaletteEntry &); - KisPaletteEntry getColor(Q_UINT32 index); - Q_INT32 nColors(); + KisPaletteEntry getColor(TQ_UINT32 index); + TQ_INT32 nColors(); private: bool init(); private: - QByteArray m_data; + TQByteArray m_data; bool m_ownData; - QImage m_img; - QString m_name; - QString m_comment; - Q_INT32 m_columns; - QValueVector<KisPaletteEntry> m_colors; + TQImage m_img; + TQString m_name; + TQString m_comment; + TQ_INT32 m_columns; + TQValueVector<KisPaletteEntry> m_colors; }; #endif // KIS_PALETTE_ diff --git a/krita/core/kis_part_layer_iface.h b/krita/core/kis_part_layer_iface.h index b324c975..1d4f7b99 100644 --- a/krita/core/kis_part_layer_iface.h +++ b/krita/core/kis_part_layer_iface.h @@ -18,7 +18,7 @@ #ifndef KIS_PART_LAYER_IFACE_ #define KIS_PART_LAYER_IFACE_ -#include <qdom.h> +#include <tqdom.h> #include "kis_types.h" /** @@ -27,10 +27,10 @@ class KisPartLayer : public KisLayer { typedef KisLayer super; public: - KisPartLayer(KisImage *img, const QString &name, Q_UINT8 opacity) + KisPartLayer(KisImage *img, const TQString &name, TQ_UINT8 opacity) : super(img, name, opacity) {} - virtual KisPaintDeviceSP prepareProjection(KisPaintDeviceSP projection, const QRect& r) = 0; - virtual bool saveToXML(QDomDocument doc, QDomElement elem) = 0; + virtual KisPaintDeviceSP prepareProjection(KisPaintDeviceSP projection, const TQRect& r) = 0; + virtual bool saveToXML(TQDomDocument doc, TQDomElement elem) = 0; }; #endif // KIS_PART_IFACE_LAYER_IFACE_ diff --git a/krita/core/kis_pattern.cc b/krita/core/kis_pattern.cc index db6ae0a1..516d3d8b 100644 --- a/krita/core/kis_pattern.cc +++ b/krita/core/kis_pattern.cc @@ -27,12 +27,12 @@ #include <limits.h> #include <stdlib.h> -#include <qpoint.h> -#include <qsize.h> -#include <qimage.h> -#include <qvaluevector.h> -#include <qmap.h> -#include <qfile.h> +#include <tqpoint.h> +#include <tqsize.h> +#include <tqimage.h> +#include <tqvaluevector.h> +#include <tqmap.h> +#include <tqfile.h> #include <kdebug.h> #include <klocale.h> @@ -43,19 +43,19 @@ namespace { struct GimpPatternHeader { - Q_UINT32 header_size; /* header_size = sizeof (PatternHeader) + brush name */ - Q_UINT32 version; /* pattern file version # */ - Q_UINT32 width; /* width of pattern */ - Q_UINT32 height; /* height of pattern */ - Q_UINT32 bytes; /* depth of pattern in bytes : 1, 2, 3 or 4*/ - Q_UINT32 magic_number; /* GIMP brush magic number */ + TQ_UINT32 header_size; /* header_size = sizeof (PatternHeader) + brush name */ + TQ_UINT32 version; /* pattern file version # */ + TQ_UINT32 width; /* width of pattern */ + TQ_UINT32 height; /* height of pattern */ + TQ_UINT32 bytes; /* depth of pattern in bytes : 1, 2, 3 or 4*/ + TQ_UINT32 magic_number; /* GIMP brush magic number */ }; // Yes! This is _NOT_ what my pat.txt file says. It's really not 'GIMP', but 'GPAT' - Q_UINT32 const GimpPatternMagic = (('G' << 24) + ('P' << 16) + ('A' << 8) + ('T' << 0)); + TQ_UINT32 const GimpPatternMagic = (('G' << 24) + ('P' << 16) + ('A' << 8) + ('T' << 0)); } -KisPattern::KisPattern(const QString& file) : super(file), m_hasFile(true) +KisPattern::KisPattern(const TQString& file) : super(file), m_hasFile(true) { } @@ -64,7 +64,7 @@ KisPattern::KisPattern(KisPaintDevice* image, int x, int y, int w, int h) { // Forcefully convert to RGBA8 // XXX profile and exposure? - setImage(image->convertToQImage(0, x, y, w, h)); + setImage(image->convertToTQImage(0, x, y, w, h)); setName(image->name()); } @@ -77,11 +77,11 @@ bool KisPattern::load() if (!m_hasFile) return true; - QFile file(filename()); + TQFile file(filename()); file.open(IO_ReadOnly); - QByteArray data = file.readAll(); + TQByteArray data = file.readAll(); if (!data.isEmpty()) { - Q_INT32 startPos = m_data.size(); + TQ_INT32 startPos = m_data.size(); m_data.resize(m_data.size() + data.count()); memcpy(&m_data[startPos], data.data(), data.count()); @@ -92,10 +92,10 @@ bool KisPattern::load() bool KisPattern::save() { - QFile file(filename()); + TQFile file(filename()); file.open(IO_WriteOnly | IO_Truncate); - QTextStream stream(&file); + TQTextStream stream(&file); // Header: header_size (24+name length),version,width,height,colourdepth of brush,magic,name // depth: 1 = greyscale, 2 = greyscale + A, 3 = RGB, 4 = RGBA // magic = "GPAT", as a single uint32, the docs are wrong here! @@ -105,9 +105,9 @@ bool KisPattern::save() // Version is 1 for now... GimpPatternHeader ph; - QCString utf8Name = name().utf8(); + TQCString utf8Name = name().utf8(); char const* name = utf8Name.data(); - int nameLength = qstrlen(name); + int nameLength = tqstrlen(name); ph.header_size = htonl(sizeof(GimpPatternHeader) + nameLength + 1); // trailing 0 ph.version = htonl(1); @@ -116,7 +116,7 @@ bool KisPattern::save() ph.bytes = htonl(4); ph.magic_number = htonl(GimpPatternMagic); - QByteArray bytes; + TQByteArray bytes; bytes.setRawData(reinterpret_cast<char*>(&ph), sizeof(GimpPatternHeader)); int wrote = file.writeBlock(bytes); bytes.resetRawData(reinterpret_cast<char*>(&ph), sizeof(GimpPatternHeader)); @@ -130,14 +130,14 @@ bool KisPattern::save() int k = 0; bytes.resize(width() * height() * 4); - for (Q_INT32 y = 0; y < height(); y++) { - for (Q_INT32 x = 0; x < width(); x++) { + for (TQ_INT32 y = 0; y < height(); y++) { + for (TQ_INT32 x = 0; x < width(); x++) { // RGBA only - QRgb pixel = m_img.pixel(x,y); - bytes[k++] = static_cast<char>(qRed(pixel)); - bytes[k++] = static_cast<char>(qGreen(pixel)); - bytes[k++] = static_cast<char>(qBlue(pixel)); - bytes[k++] = static_cast<char>(qAlpha(pixel)); + TQRgb pixel = m_img.pixel(x,y); + bytes[k++] = static_cast<char>(tqRed(pixel)); + bytes[k++] = static_cast<char>(tqGreen(pixel)); + bytes[k++] = static_cast<char>(tqBlue(pixel)); + bytes[k++] = static_cast<char>(tqAlpha(pixel)); } } @@ -150,7 +150,7 @@ bool KisPattern::save() return true; } -QImage KisPattern::img() +TQImage KisPattern::img() { return m_img; } @@ -159,8 +159,8 @@ bool KisPattern::init() { // load Gimp patterns GimpPatternHeader bh; - Q_INT32 k; - QValueVector<char> name; + TQ_INT32 k; + TQValueVector<char> name; if (sizeof(GimpPatternHeader) > m_data.size()) { return false; @@ -195,47 +195,47 @@ bool KisPattern::init() if (bh.bytes == 1) { // Grayscale - Q_INT32 val; + TQ_INT32 val; - for (Q_UINT32 y = 0; y < bh.height; y++) { - for (Q_UINT32 x = 0; x < bh.width; x++, k++) { - if (static_cast<Q_UINT32>(k) > m_data.size()) { + for (TQ_UINT32 y = 0; y < bh.height; y++) { + for (TQ_UINT32 x = 0; x < bh.width; x++, k++) { + if (static_cast<TQ_UINT32>(k) > m_data.size()) { kdDebug(DBG_AREA_FILE) << "failed in gray\n"; return false; } val = m_data[k]; - m_img.setPixel(x, y, qRgb(val, val, val)); + m_img.setPixel(x, y, tqRgb(val, val, val)); m_img.setAlphaBuffer(false); } } } else if (bh.bytes == 2) { // Grayscale + A - Q_INT32 val; - Q_INT32 alpha; - for (Q_UINT32 y = 0; y < bh.height; y++) { - for (Q_UINT32 x = 0; x < bh.width; x++, k++) { - if (static_cast<Q_UINT32>(k + 2) > m_data.size()) { + TQ_INT32 val; + TQ_INT32 alpha; + for (TQ_UINT32 y = 0; y < bh.height; y++) { + for (TQ_UINT32 x = 0; x < bh.width; x++, k++) { + if (static_cast<TQ_UINT32>(k + 2) > m_data.size()) { kdDebug(DBG_AREA_FILE) << "failed in grayA\n"; return false; } val = m_data[k]; alpha = m_data[k++]; - m_img.setPixel(x, y, qRgba(val, val, val, alpha)); + m_img.setPixel(x, y, tqRgba(val, val, val, alpha)); m_img.setAlphaBuffer(true); } } } else if (bh.bytes == 3) { // RGB without alpha - for (Q_UINT32 y = 0; y < bh.height; y++) { - for (Q_UINT32 x = 0; x < bh.width; x++) { - if (static_cast<Q_UINT32>(k + 3) > m_data.size()) { + for (TQ_UINT32 y = 0; y < bh.height; y++) { + for (TQ_UINT32 x = 0; x < bh.width; x++) { + if (static_cast<TQ_UINT32>(k + 3) > m_data.size()) { kdDebug(DBG_AREA_FILE) << "failed in RGB\n"; return false; } - m_img.setPixel(x, y, qRgb(m_data[k], + m_img.setPixel(x, y, tqRgb(m_data[k], m_data[k + 1], m_data[k + 2])); k += 3; @@ -244,14 +244,14 @@ bool KisPattern::init() } } else if (bh.bytes == 4) { // Has alpha - for (Q_UINT32 y = 0; y < bh.height; y++) { - for (Q_UINT32 x = 0; x < bh.width; x++) { - if (static_cast<Q_UINT32>(k + 4) > m_data.size()) { + for (TQ_UINT32 y = 0; y < bh.height; y++) { + for (TQ_UINT32 x = 0; x < bh.width; x++) { + if (static_cast<TQ_UINT32>(k + 4) > m_data.size()) { kdDebug(DBG_AREA_FILE) << "failed in RGBA\n"; return false; } - m_img.setPixel(x, y, qRgba(m_data[k], + m_img.setPixel(x, y, tqRgba(m_data[k], m_data[k + 1], m_data[k + 2], m_data[k + 3])); @@ -277,7 +277,7 @@ bool KisPattern::init() KisPaintDeviceSP KisPattern::image(KisColorSpace * colorSpace) { // Check if there's already a pattern prepared for this colorspace - QMap<QString, KisPaintDeviceSP>::const_iterator it = m_colorspaces.find(colorSpace->id().id()); + TQMap<TQString, KisPaintDeviceSP>::const_iterator it = m_colorspaces.tqfind(colorSpace->id().id()); if (it != m_colorspaces.end()) return (*it); @@ -286,33 +286,33 @@ KisPaintDeviceSP KisPattern::image(KisColorSpace * colorSpace) { Q_CHECK_PTR(layer); - layer->convertFromQImage(m_img,""); + layer->convertFromTQImage(m_img,""); m_colorspaces[colorSpace->id().id()] = layer; return layer; } -Q_INT32 KisPattern::width() const +TQ_INT32 KisPattern::width() const { return m_width; } -void KisPattern::setWidth(Q_INT32 w) +void KisPattern::setWidth(TQ_INT32 w) { m_width = w; } -Q_INT32 KisPattern::height() const +TQ_INT32 KisPattern::height() const { return m_height; } -void KisPattern::setHeight(Q_INT32 h) +void KisPattern::setHeight(TQ_INT32 h) { m_height = h; } -void KisPattern::setImage(const QImage& img) +void KisPattern::setImage(const TQImage& img) { m_hasFile = false; m_img = img; diff --git a/krita/core/kis_pattern.h b/krita/core/kis_pattern.h index 4b5868f3..7d18f1f3 100644 --- a/krita/core/kis_pattern.h +++ b/krita/core/kis_pattern.h @@ -27,23 +27,24 @@ #include "kis_resource.h" #include "kis_types.h" -class QPoint; -class QImage; +class TQPoint; +class TQImage; class KisColorSpace; class KisPaintDevice; class KisPattern : public KisResource { typedef KisResource super; Q_OBJECT + TQ_OBJECT public: - KisPattern(const QString& file); + KisPattern(const TQString& file); KisPattern(KisPaintDevice* image, int x, int y, int w, int h); virtual ~KisPattern(); virtual bool load(); virtual bool save(); - virtual QImage img(); + virtual TQImage img(); /** * returns a KisPaintDeviceSP made with colorSpace as the ColorSpace strategy @@ -51,28 +52,28 @@ public: **/ KisPaintDeviceSP image(KisColorSpace * colorSpace); - Q_INT32 width() const; - Q_INT32 height() const; + TQ_INT32 width() const; + TQ_INT32 height() const; - void setImage(const QImage& img); + void setImage(const TQImage& img); KisPattern* clone() const; protected: - void setWidth(Q_INT32 w); - void setHeight(Q_INT32 h); + void setWidth(TQ_INT32 w); + void setHeight(TQ_INT32 h); private: bool init(); private: - QByteArray m_data; - QImage m_img; - QMap<QString, KisPaintDeviceSP> m_colorspaces; + TQByteArray m_data; + TQImage m_img; + TQMap<TQString, KisPaintDeviceSP> m_colorspaces; bool m_hasFile; - Q_INT32 m_width; - Q_INT32 m_height; + TQ_INT32 m_width; + TQ_INT32 m_height; }; #endif diff --git a/krita/core/kis_perspective_grid.cpp b/krita/core/kis_perspective_grid.cpp index d9b0e800..7f029d26 100644 --- a/krita/core/kis_perspective_grid.cpp +++ b/krita/core/kis_perspective_grid.cpp @@ -27,7 +27,7 @@ KisSubPerspectiveGrid::KisSubPerspectiveGrid(KisPerspectiveGridNodeSP topLeft, K } -bool KisSubPerspectiveGrid::contains(const KisPoint p) const +bool KisSubPerspectiveGrid::tqcontains(const KisPoint p) const { return true; KisPerspectiveMath::LineEquation d1 = KisPerspectiveMath::computeLineEquation( topLeft(), topRight() ); @@ -79,7 +79,7 @@ bool KisPerspectiveGrid::addNewSubGrid( KisSubPerspectiveGrid* ng ) void KisPerspectiveGrid::clearSubGrids( ) { - for( QValueList<KisSubPerspectiveGrid*>::const_iterator it = begin(); it != end(); ++it) + for( TQValueList<KisSubPerspectiveGrid*>::const_iterator it = begin(); it != end(); ++it) { delete *it; } @@ -88,9 +88,9 @@ void KisPerspectiveGrid::clearSubGrids( ) KisSubPerspectiveGrid* KisPerspectiveGrid::gridAt(KisPoint p) { - for( QValueList<KisSubPerspectiveGrid*>::const_iterator it = begin(); it != end(); ++it) + for( TQValueList<KisSubPerspectiveGrid*>::const_iterator it = begin(); it != end(); ++it) { - if( (*it)->contains(p) ) + if( (*it)->tqcontains(p) ) { return *it; } diff --git a/krita/core/kis_perspective_grid.h b/krita/core/kis_perspective_grid.h index 76021a6c..26a1feb2 100644 --- a/krita/core/kis_perspective_grid.h +++ b/krita/core/kis_perspective_grid.h @@ -21,7 +21,7 @@ #ifndef KIS_PERSPECTIVE_GRID_H #define KIS_PERSPECTIVE_GRID_H -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <kis_perspective_math.h> #include <kis_point.h> @@ -67,7 +67,7 @@ class KisSubPerspectiveGrid { /** * @return true if the point p is contain by the grid */ - bool contains(const KisPoint p) const; + bool tqcontains(const KisPoint p) const; private: inline KisPoint computeVanishingPoint(KisPerspectiveGridNodeSP p11, KisPerspectiveGridNodeSP p12, KisPerspectiveGridNodeSP p21, KisPerspectiveGridNodeSP p22) { @@ -91,8 +91,8 @@ class KisPerspectiveGrid { * @return false if the grid wasn't added, note that subgrids must be attached to an other grid, except if it's the first grid */ bool addNewSubGrid( KisSubPerspectiveGrid* ng ); - inline QValueList<KisSubPerspectiveGrid*>::const_iterator begin() const { return m_subGrids.begin(); } - inline QValueList<KisSubPerspectiveGrid*>::const_iterator end() const { return m_subGrids.end(); } + inline TQValueList<KisSubPerspectiveGrid*>::const_iterator begin() const { return m_subGrids.begin(); } + inline TQValueList<KisSubPerspectiveGrid*>::const_iterator end() const { return m_subGrids.end(); } inline bool hasSubGrids() const { return !m_subGrids.isEmpty(); } void clearSubGrids(); inline int countSubGrids() const { return m_subGrids.size(); } @@ -101,7 +101,7 @@ class KisPerspectiveGrid { */ KisSubPerspectiveGrid* gridAt(KisPoint p); private: - QValueList<KisSubPerspectiveGrid*> m_subGrids; + TQValueList<KisSubPerspectiveGrid*> m_subGrids; }; #endif diff --git a/krita/core/kis_perspective_math.cpp b/krita/core/kis_perspective_math.cpp index eadbab8b..44a43a03 100644 --- a/krita/core/kis_perspective_math.cpp +++ b/krita/core/kis_perspective_math.cpp @@ -20,7 +20,7 @@ #include "kis_perspective_math.h" -#include <qrect.h> +#include <tqrect.h> #if 1 @@ -534,12 +534,12 @@ double* KisPerspectiveMath::computeMatrixTransfo( const KisPoint& topLeft1, cons return matrix; } -double* KisPerspectiveMath::computeMatrixTransfoToPerspective(const KisPoint& topLeft, const KisPoint& topRight, const KisPoint& bottomLeft, const KisPoint& bottomRight, const QRect& r) +double* KisPerspectiveMath::computeMatrixTransfoToPerspective(const KisPoint& topLeft, const KisPoint& topRight, const KisPoint& bottomLeft, const KisPoint& bottomRight, const TQRect& r) { return KisPerspectiveMath::computeMatrixTransfo(topLeft, topRight, bottomLeft, bottomRight, r.topLeft(), r.topRight(), r.bottomLeft(), r.bottomRight()); } -double* KisPerspectiveMath::computeMatrixTransfoFromPerspective(const QRect& r, const KisPoint& topLeft, const KisPoint& topRight, const KisPoint& bottomLeft, const KisPoint& bottomRight) +double* KisPerspectiveMath::computeMatrixTransfoFromPerspective(const TQRect& r, const KisPoint& topLeft, const KisPoint& topRight, const KisPoint& bottomLeft, const KisPoint& bottomRight) { return KisPerspectiveMath::computeMatrixTransfo(r.topLeft(), r.topRight(), r.bottomLeft(), r.bottomRight(), topLeft, topRight, bottomLeft, bottomRight); } diff --git a/krita/core/kis_perspective_math.h b/krita/core/kis_perspective_math.h index 047e571e..b7cbdb79 100644 --- a/krita/core/kis_perspective_math.h +++ b/krita/core/kis_perspective_math.h @@ -22,15 +22,15 @@ #include "kis_point.h" -class QRect; +class TQRect; class KisPerspectiveMath { private: KisPerspectiveMath() { } public: static double* computeMatrixTransfo( const KisPoint& topLeft1, const KisPoint& topRight1, const KisPoint& bottomLeft1, const KisPoint& bottomRight1 , const KisPoint& topLeft2, const KisPoint& topRight2, const KisPoint& bottomLeft2, const KisPoint& bottomRight2); - static double* computeMatrixTransfoToPerspective(const KisPoint& topLeft, const KisPoint& topRight, const KisPoint& bottomLeft, const KisPoint& bottomRight, const QRect& r); - static double* computeMatrixTransfoFromPerspective(const QRect& r, const KisPoint& topLeft, const KisPoint& topRight, const KisPoint& bottomLeft, const KisPoint& bottomRight); + static double* computeMatrixTransfoToPerspective(const KisPoint& topLeft, const KisPoint& topRight, const KisPoint& bottomLeft, const KisPoint& bottomRight, const TQRect& r); + static double* computeMatrixTransfoFromPerspective(const TQRect& r, const KisPoint& topLeft, const KisPoint& topRight, const KisPoint& bottomLeft, const KisPoint& bottomRight); struct LineEquation { // y = a*x + b double a, b; diff --git a/krita/core/kis_perspectivetransform_worker.cpp b/krita/core/kis_perspectivetransform_worker.cpp index bb98b3bf..4dccceb0 100644 --- a/krita/core/kis_perspectivetransform_worker.cpp +++ b/krita/core/kis_perspectivetransform_worker.cpp @@ -30,7 +30,7 @@ KisPerspectiveTransformWorker::KisPerspectiveTransformWorker(KisPaintDeviceSP de : KisProgressSubject(), m_dev(dev), m_cancelRequested(false), m_progress(progress) { - QRect m_r; + TQRect m_r; if(m_dev->hasSelection()) m_r = m_dev->selection()->selectedExactRect(); else diff --git a/krita/core/kis_perspectivetransform_worker.h b/krita/core/kis_perspectivetransform_worker.h index 2f53625f..0f5f7833 100644 --- a/krita/core/kis_perspectivetransform_worker.h +++ b/krita/core/kis_perspectivetransform_worker.h @@ -38,15 +38,15 @@ class KisPerspectiveTransformWorker : public KisProgressSubject private: virtual void cancel() { m_cancelRequested = true; } private: - Q_INT32 m_progressTotalSteps; - Q_INT32 m_lastProgressReport; - Q_INT32 m_progressStep; + TQ_INT32 m_progressTotalSteps; + TQ_INT32 m_lastProgressReport; + TQ_INT32 m_progressStep; double m_xcenter, m_ycenter, m_p, m_q; KisPaintDeviceSP m_dev; bool m_cancelRequested; KisProgressDisplayInterface *m_progress; double m_matrix[3][3]; - QRect m_r; + TQRect m_r; }; #endif diff --git a/krita/core/kis_point.h b/krita/core/kis_point.h index ee5dba78..3c576cb5 100644 --- a/krita/core/kis_point.h +++ b/krita/core/kis_point.h @@ -18,7 +18,7 @@ #ifndef KIS_POINT_H_ #define KIS_POINT_H_ -#include <qvaluevector.h> +#include <tqvaluevector.h> #include <KoPoint.h> /** @@ -30,19 +30,19 @@ class KisPoint : public KoPoint { public: KisPoint() {} KisPoint(double x, double y) : super(x, y) {} - KisPoint(const QPoint& pt) : super(pt) {} + KisPoint(const TQPoint& pt) : super(pt) {} KisPoint(const KoPoint& pt) : super(pt) {} int floorX() const { return static_cast<int>(x()); } int floorY() const { return static_cast<int>(y()); } - int roundX() const { return qRound(x()); } - int roundY() const { return qRound(y()); } + int roundX() const { return tqRound(x()); } + int roundY() const { return tqRound(y()); } - QPoint floorQPoint() const { return QPoint(static_cast<int>(x()), static_cast<int>(y())); } - QPoint roundQPoint() const { return QPoint(qRound(x()), qRound(y())); } + TQPoint floorTQPoint() const { return TQPoint(static_cast<int>(x()), static_cast<int>(y())); } + TQPoint roundTQPoint() const { return TQPoint(tqRound(x()), tqRound(y())); } }; -typedef QValueVector<KisPoint> vKisPoint; +typedef TQValueVector<KisPoint> vKisPoint; #endif // KIS_POINT_H_ diff --git a/krita/core/kis_random_accessor.cpp b/krita/core/kis_random_accessor.cpp index 3d538453..c2b2bec8 100644 --- a/krita/core/kis_random_accessor.cpp +++ b/krita/core/kis_random_accessor.cpp @@ -21,7 +21,7 @@ #include "kis_tiled_random_accessor.h" -KisRandomAccessor::KisRandomAccessor(KisTiledDataManager *ktm, Q_INT32 x, Q_INT32 y, Q_INT32 offsetx, Q_INT32 offsety, bool writable) : m_offsetx(offsetx), m_offsety(offsety) +KisRandomAccessor::KisRandomAccessor(KisTiledDataManager *ktm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 offsetx, TQ_INT32 offsety, bool writable) : m_offsetx(offsetx), m_offsety(offsety) { m_accessor = new KisTiledRandomAccessor(ktm, x, y, writable); } @@ -35,22 +35,22 @@ KisRandomAccessor::~KisRandomAccessor() } -void KisRandomAccessor::moveTo(Q_INT32 x, Q_INT32 y) +void KisRandomAccessor::moveTo(TQ_INT32 x, TQ_INT32 y) { m_accessor->moveTo(x - m_offsetx, y - m_offsety); } -Q_UINT8* KisRandomAccessor::rawData() const +TQ_UINT8* KisRandomAccessor::rawData() const { return m_accessor->rawData(); } -const Q_UINT8* KisRandomAccessor::oldRawData() const +const TQ_UINT8* KisRandomAccessor::oldRawData() const { return m_accessor->oldRawData(); } -KisRandomAccessorPixel::KisRandomAccessorPixel(KisTiledDataManager *ktm, KisTiledDataManager *ktmselect, Q_INT32 x, Q_INT32 y, Q_INT32 offsetx, Q_INT32 offsety, bool writable) : +KisRandomAccessorPixel::KisRandomAccessorPixel(KisTiledDataManager *ktm, KisTiledDataManager *ktmselect, TQ_INT32 x, TQ_INT32 y, TQ_INT32 offsetx, TQ_INT32 offsety, bool writable) : KisRandomAccessor( ktm, x, y, offsetx, offsety, writable), KisRandomAccessorPixelTrait( this, (ktmselect) ? new KisRandomAccessor(ktm, x, y, offsetx, offsety, false) : 0 ) { diff --git a/krita/core/kis_random_accessor.h b/krita/core/kis_random_accessor.h index dddd94b6..118fc4fc 100644 --- a/krita/core/kis_random_accessor.h +++ b/krita/core/kis_random_accessor.h @@ -31,17 +31,17 @@ class KisTiledDataManager; class KisRandomAccessor{ public: - KisRandomAccessor(KisTiledDataManager *ktm, Q_INT32 x, Q_INT32 y, Q_INT32 offsetx, Q_INT32 offsety, bool writable); + KisRandomAccessor(KisTiledDataManager *ktm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 offsetx, TQ_INT32 offsety, bool writable); KisRandomAccessor(const KisRandomAccessor& rhs); ~KisRandomAccessor(); public: /// Move to a given x,y position, fetch tiles and data - void moveTo(Q_INT32 x, Q_INT32 y); - Q_UINT8* rawData() const; - const Q_UINT8* oldRawData() const; + void moveTo(TQ_INT32 x, TQ_INT32 y); + TQ_UINT8* rawData() const; + const TQ_UINT8* oldRawData() const; private: KisTiledRandomAccessorSP m_accessor; - Q_INT32 m_offsetx, m_offsety; + TQ_INT32 m_offsetx, m_offsety; }; class KisRandomAccessorPixelTrait { @@ -57,27 +57,27 @@ class KisRandomAccessorPixelTrait { { return (m_selectionAccessor) ? *(m_selectionAccessor->rawData()) > SELECTION_THRESHOLD : true; }; - inline Q_UINT8 operator[](int index) const + inline TQ_UINT8 operator[](int index) const { return m_underlyingAccessor->rawData()[index]; }; /** * Returns the degree of selectedness of the pixel. */ - inline Q_UINT8 selectedness() const + inline TQ_UINT8 selectedness() const { return (m_selectionAccessor) ? *(m_selectionAccessor->rawData()) : MAX_SELECTED; }; /** - * Returns the selectionmask from the current point; this is guaranteed + * Returns the selectiontqmask from the current point; this is guaranteed * to have the same number of consecutive pixels that the iterator has * at a given point. It return a 0 if there is no selection. */ - inline Q_UINT8 * selectionMask() const + inline TQ_UINT8 * selectionMask() const { return ( m_selectionAccessor ) ? m_selectionAccessor->rawData() : 0; } - inline void moveTo(Q_INT32 x, Q_INT32 y) { if(m_selectionAccessor) m_selectionAccessor->moveTo(x,y); } + inline void moveTo(TQ_INT32 x, TQ_INT32 y) { if(m_selectionAccessor) m_selectionAccessor->moveTo(x,y); } private: KisRandomAccessor* m_underlyingAccessor; @@ -86,9 +86,9 @@ class KisRandomAccessorPixelTrait { class KisRandomAccessorPixel : public KisRandomAccessor, public KisRandomAccessorPixelTrait { public: - KisRandomAccessorPixel(KisTiledDataManager *ktm, KisTiledDataManager *ktmselect, Q_INT32 x, Q_INT32 y, Q_INT32 offsetx, Q_INT32 offsety, bool writable); + KisRandomAccessorPixel(KisTiledDataManager *ktm, KisTiledDataManager *ktmselect, TQ_INT32 x, TQ_INT32 y, TQ_INT32 offsetx, TQ_INT32 offsety, bool writable); public: - inline void moveTo(Q_INT32 x, Q_INT32 y) { KisRandomAccessor::moveTo(x,y); KisRandomAccessorPixelTrait::moveTo(x,y); } + inline void moveTo(TQ_INT32 x, TQ_INT32 y) { KisRandomAccessor::moveTo(x,y); KisRandomAccessorPixelTrait::moveTo(x,y); } }; diff --git a/krita/core/kis_random_sub_accessor.cpp b/krita/core/kis_random_sub_accessor.cpp index 3b63f340..a1ce8aa4 100644 --- a/krita/core/kis_random_sub_accessor.cpp +++ b/krita/core/kis_random_sub_accessor.cpp @@ -32,51 +32,51 @@ KisRandomSubAccessorPixel::~KisRandomSubAccessorPixel() } -void KisRandomSubAccessorPixel::sampledOldRawData(Q_UINT8* dst) +void KisRandomSubAccessorPixel::sampledOldRawData(TQ_UINT8* dst) { - const Q_UINT8* pixels[4]; - Q_UINT8 weights[4]; + const TQ_UINT8* pixels[4]; + TQ_UINT8 weights[4]; int x = (int)floor(m_currentPoint.x()); int y = (int)floor(m_currentPoint.y()); double hsub = m_currentPoint.x() - x; if(hsub < 0.0 ) hsub = 1.0 + hsub; double vsub = m_currentPoint.y() - y; if(vsub < 0.0 ) vsub = 1.0 + vsub; - weights[0] = (int)qRound( ( 1.0 - hsub) * ( 1.0 - vsub) * 255 ); + weights[0] = (int)tqRound( ( 1.0 - hsub) * ( 1.0 - vsub) * 255 ); m_randomAccessor.moveTo(x, y); pixels[0] = m_randomAccessor.oldRawData(); - weights[1] = (int)qRound( ( 1.0 - vsub) * hsub * 255 ); + weights[1] = (int)tqRound( ( 1.0 - vsub) * hsub * 255 ); m_randomAccessor.moveTo(x+1, y); pixels[1] = m_randomAccessor.oldRawData(); - weights[2] = (int)qRound( vsub * ( 1.0 - hsub) * 255 ); + weights[2] = (int)tqRound( vsub * ( 1.0 - hsub) * 255 ); m_randomAccessor.moveTo(x, y+1); pixels[2] = m_randomAccessor.oldRawData(); - weights[3] = (int)qRound( hsub * vsub * 255 ); + weights[3] = (int)tqRound( hsub * vsub * 255 ); m_randomAccessor.moveTo(x+1, y+1); pixels[3] = m_randomAccessor.oldRawData(); m_device->colorSpace()->mixColors(pixels, weights, 4, dst); } -void KisRandomSubAccessorPixel::sampledRawData(Q_UINT8* dst) +void KisRandomSubAccessorPixel::sampledRawData(TQ_UINT8* dst) { - const Q_UINT8* pixels[4]; - Q_UINT8 weights[4]; + const TQ_UINT8* pixels[4]; + TQ_UINT8 weights[4]; int x = (int)floor(m_currentPoint.x()); int y = (int)floor(m_currentPoint.y()); double hsub = m_currentPoint.x() - x; if(hsub < 0.0 ) hsub = 1.0 + hsub; double vsub = m_currentPoint.y() - y; if(vsub < 0.0 ) vsub = 1.0 + vsub; - weights[0] = (int)qRound( ( 1.0 - hsub) * ( 1.0 - vsub) * 255 ); + weights[0] = (int)tqRound( ( 1.0 - hsub) * ( 1.0 - vsub) * 255 ); m_randomAccessor.moveTo(x, y); pixels[0] = m_randomAccessor.rawData(); - weights[1] = (int)qRound( ( 1.0 - vsub) * hsub * 255 ); + weights[1] = (int)tqRound( ( 1.0 - vsub) * hsub * 255 ); m_randomAccessor.moveTo(x+1, y); pixels[1] = m_randomAccessor.rawData(); - weights[2] = (int)qRound( vsub * ( 1.0 - hsub) * 255 ); + weights[2] = (int)tqRound( vsub * ( 1.0 - hsub) * 255 ); m_randomAccessor.moveTo(x, y+1); pixels[2] = m_randomAccessor.rawData(); - weights[3] = (int)qRound( hsub * vsub * 255 ); + weights[3] = (int)tqRound( hsub * vsub * 255 ); m_randomAccessor.moveTo(x+1, y+1); pixels[3] = m_randomAccessor.rawData(); m_device->colorSpace()->mixColors(pixels, weights, 4, dst); diff --git a/krita/core/kis_random_sub_accessor.h b/krita/core/kis_random_sub_accessor.h index 7beb7945..6ceb8345 100644 --- a/krita/core/kis_random_sub_accessor.h +++ b/krita/core/kis_random_sub_accessor.h @@ -31,8 +31,8 @@ class KisRandomSubAccessorPixel{ /** * Copy the sampled old value to destination */ - void sampledOldRawData(Q_UINT8* dst); - void sampledRawData(Q_UINT8* dst); + void sampledOldRawData(TQ_UINT8* dst); + void sampledRawData(TQ_UINT8* dst); inline void moveTo(double x, double y) { m_currentPoint.setX(x); m_currentPoint.setY(y); } inline void moveTo(const KisPoint& p ) { m_currentPoint = p; } private: diff --git a/krita/core/kis_rect.cc b/krita/core/kis_rect.cc index 892a5e32..175a07a9 100644 --- a/krita/core/kis_rect.cc +++ b/krita/core/kis_rect.cc @@ -21,8 +21,8 @@ #include "kis_rect.h" -QRect KisRect::qRect() const +TQRect KisRect::qRect() const { - return QRect(static_cast<int>(floor(left())), static_cast<int>(floor(top())), static_cast<int>(ceil(right()) - floor(left())), static_cast<int>(ceil(bottom()) - floor(top()))); + return TQRect(static_cast<int>(floor(left())), static_cast<int>(floor(top())), static_cast<int>(ceil(right()) - floor(left())), static_cast<int>(ceil(bottom()) - floor(top()))); } diff --git a/krita/core/kis_rect.h b/krita/core/kis_rect.h index 268b64eb..30a729c8 100644 --- a/krita/core/kis_rect.h +++ b/krita/core/kis_rect.h @@ -18,12 +18,12 @@ #ifndef KIS_RECT_H_ #define KIS_RECT_H_ -#include <qrect.h> +#include <tqrect.h> #include <KoRect.h> #include "kis_point.h" /** - * A double-based rect class that can return a QRect that encloses the KisRect. + * A double-based rect class that can return a TQRect that encloses the KisRect. */ class KisRect : public KoRect { @@ -32,18 +32,18 @@ public: KisRect() {} KisRect(double x, double y, double w, double h) : super(x, y, w, h) {} KisRect(const KisPoint& topLeft, const KisPoint& bottomRight) : super(topLeft, bottomRight) {} - KisRect(const QRect& qr) : super(qr.x(), qr.y(), qr.width(), qr.height()) {} + KisRect(const TQRect& qr) : super(qr.x(), qr.y(), qr.width(), qr.height()) {} KisRect(const KoRect& r) : super(r) {} /** - * Return the QRect that encloses this KisRect. + * Return the TQRect that encloses this KisRect. */ - QRect qRect() const; + TQRect qRect() const; private: // Use qRect() which uses ceil() and floor() to return a rectangle - // 'enclosing' the rectangle, whereas toQRect rounds the points. - QRect toQRect() const; + // 'enclosing' the rectangle, whereas toTQRect rounds the points. + TQRect toTQRect() const; }; #endif // KIS_RECT_H_ diff --git a/krita/core/kis_resource.cc b/krita/core/kis_resource.cc index 256ffae5..a856cbb1 100644 --- a/krita/core/kis_resource.cc +++ b/krita/core/kis_resource.cc @@ -18,7 +18,7 @@ #include "kis_resource.h" #include "kis_global.h" -KisResource::KisResource(const QString& filename) +KisResource::KisResource(const TQString& filename) { m_filename = filename; m_valid = false; @@ -28,22 +28,22 @@ KisResource::~KisResource() { } -QString KisResource::filename() const +TQString KisResource::filename() const { return m_filename; } -void KisResource::setFilename(const QString& filename) +void KisResource::setFilename(const TQString& filename) { m_filename = filename; } -QString KisResource::name() const +TQString KisResource::name() const { return m_name; } -void KisResource::setName(const QString& name) +void KisResource::setName(const TQString& name) { m_name = name; } diff --git a/krita/core/kis_resource.h b/krita/core/kis_resource.h index d798d3cd..6510be2c 100644 --- a/krita/core/kis_resource.h +++ b/krita/core/kis_resource.h @@ -18,9 +18,9 @@ #ifndef KIS_RESOURCE_H_ #define KIS_RESOURCE_H_ -#include <qimage.h> -#include <qobject.h> -#include <qstring.h> +#include <tqimage.h> +#include <tqobject.h> +#include <tqstring.h> /** @@ -29,9 +29,10 @@ * * This replaces the KisKrayon facility that used to be present in Krayon. */ -class KisResource : public QObject { - typedef QObject super; +class KisResource : public TQObject { + typedef TQObject super; Q_OBJECT + TQ_OBJECT public: @@ -41,7 +42,7 @@ public: * * @param filename the file name to save and load from. */ - KisResource(const QString& filename); + KisResource(const TQString& filename); virtual ~KisResource(); public: @@ -57,15 +58,15 @@ public: virtual bool save() = 0; /** - * Returns a QImage representing this resource. This image could be null. + * Returns a TQImage representing this resource. This image could be null. */ - virtual QImage img() = 0; + virtual TQImage img() = 0; public: - QString filename() const; - void setFilename(const QString& filename); - QString name() const; - void setName(const QString& name); + TQString filename() const; + void setFilename(const TQString& filename); + TQString name() const; + void setName(const TQString& name); bool valid() const; void setValid(bool valid); @@ -74,8 +75,8 @@ private: KisResource& operator=(const KisResource&); private: - QString m_name; - QString m_filename; + TQString m_name; + TQString m_filename; bool m_valid; }; diff --git a/krita/core/kis_rotate_visitor.cc b/krita/core/kis_rotate_visitor.cc index 4e703633..2a8bfd45 100644 --- a/krita/core/kis_rotate_visitor.cc +++ b/krita/core/kis_rotate_visitor.cc @@ -16,9 +16,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <math.h> -#include <qapplication.h> -#include <qwmatrix.h> -#include <qrect.h> +#include <tqapplication.h> +#include <tqwmatrix.h> +#include <tqrect.h> #include <kdebug.h> #include <klocale.h> @@ -37,7 +37,7 @@ void KisRotateVisitor::rotate(double angle, bool rotateAboutImageCentre, KisProg if (rotateAboutImageCentre) { centreOfRotation = KisPoint(m_dev->image()->width() / 2.0, m_dev->image()->height() / 2.0); } else { - QRect r = m_dev->exactBounds(); + TQRect r = m_dev->exactBounds(); centreOfRotation = KisPoint(r.x() + (r.width() / 2.0), r.y() + (r.height() / 2.0)); } @@ -54,7 +54,7 @@ void KisRotateVisitor::rotate(double angle, bool rotateAboutImageCentre, KisProg } KisPainter p(m_dev); - QRect r = rotated->extent(); + TQRect r = rotated->extent(); // OVER ipv COPY p.bitBlt(r.x(), r.y(), COMPOSITE_OVER, rotated, OPACITY_OPAQUE, r.x(), r.y(), r.width(), r.height()); @@ -69,7 +69,7 @@ void KisRotateVisitor::shear(double angleX, double angleY, KisProgressDisplayInt double thetaY = angleY * pi / 180; double shearY = tan(thetaY); - QRect r = m_dev->exactBounds(); + TQRect r = m_dev->exactBounds(); const int xShearSteps = r.height(); const int yShearSteps = r.width(); @@ -115,11 +115,11 @@ KisPaintDeviceSP KisRotateVisitor::rotateRight90(KisPaintDeviceSP src) dst->setX(src->getX()); dst->setY(src->getY()); - Q_INT32 pixelSize = src->pixelSize(); - QRect r = src->exactBounds(); - Q_INT32 x = 0; + TQ_INT32 pixelSize = src->pixelSize(); + TQRect r = src->exactBounds(); + TQ_INT32 x = 0; - for (Q_INT32 y = r.bottom(); y >= r.top(); --y) { + for (TQ_INT32 y = r.bottom(); y >= r.top(); --y) { KisHLineIteratorPixel hit = src->createHLineIterator(r.x(), y, r.width(), false); KisVLineIterator vit = dst->createVLineIterator(-y, r.x(), r.width(), true); @@ -141,11 +141,11 @@ KisPaintDeviceSP KisRotateVisitor::rotateLeft90(KisPaintDeviceSP src) { KisPaintDeviceSP dst = new KisPaintDevice(src->colorSpace(), "rotateleft90"); - Q_INT32 pixelSize = src->pixelSize(); - QRect r = src->exactBounds(); - Q_INT32 x = 0; + TQ_INT32 pixelSize = src->pixelSize(); + TQRect r = src->exactBounds(); + TQ_INT32 x = 0; - for (Q_INT32 y = r.top(); y <= r.bottom(); ++y) { + for (TQ_INT32 y = r.top(); y <= r.bottom(); ++y) { // Read the horizontal line from back to front, write onto the vertical column KisHLineIteratorPixel hit = src->createHLineIterator(r.x(), y, r.width(), false); KisVLineIterator vit = dst->createVLineIterator(y, -r.x() - r.width(), r.width(), true); @@ -171,10 +171,10 @@ KisPaintDeviceSP KisRotateVisitor::rotate180(KisPaintDeviceSP src) dst->setX(src->getX()); dst->setY(src->getY()); - Q_INT32 pixelSize = src->pixelSize(); - QRect r = src->exactBounds(); + TQ_INT32 pixelSize = src->pixelSize(); + TQRect r = src->exactBounds(); - for (Q_INT32 y = r.top(); y <= r.bottom(); ++y) { + for (TQ_INT32 y = r.top(); y <= r.bottom(); ++y) { KisHLineIteratorPixel srcIt = src->createHLineIterator(r.x(), y, r.width(), false); KisHLineIterator dstIt = dst->createHLineIterator( -r.x() - r.width(), -y, r.width(), true); @@ -202,7 +202,7 @@ KisPaintDeviceSP KisRotateVisitor::rotate(KisPaintDeviceSP src, double angle, Ki angle = angle + 360; } - QRect r = src->exactBounds(); + TQRect r = src->exactBounds(); const int xShearSteps = r.height(); const int yShearSteps = r.width(); @@ -265,8 +265,8 @@ KisPaintDeviceSP KisRotateVisitor::rotate(KisPaintDeviceSP src, double angle, Ki centreOfRotation.x() * cosAngle - centreOfRotation.y() * sinAngle, centreOfRotation.x() * sinAngle + centreOfRotation.y() * cosAngle); - dst->setX((Q_INT32)(dst->getX() + centreOfRotation.x() - rotatedCentreOfRotation.x())); - dst->setY((Q_INT32)(dst->getY() + centreOfRotation.y() - rotatedCentreOfRotation.y())); + dst->setX((TQ_INT32)(dst->getX() + centreOfRotation.x() - rotatedCentreOfRotation.x())); + dst->setY((TQ_INT32)(dst->getY() + centreOfRotation.y() - rotatedCentreOfRotation.y())); setProgressDone(); @@ -279,23 +279,23 @@ KisPaintDeviceSP KisRotateVisitor::xShear(KisPaintDeviceSP src, double shearX) dst->setX(src->getX()); dst->setY(src->getY()); - QRect r = src->exactBounds(); + TQRect r = src->exactBounds(); double displacement; - Q_INT32 displacementInt; + TQ_INT32 displacementInt; double weight; - for (Q_INT32 y = r.top(); y <= r.bottom(); y++) { + for (TQ_INT32 y = r.top(); y <= r.bottom(); y++) { //calculate displacement displacement = -y * shearX; - displacementInt = (Q_INT32)(floor(displacement)); + displacementInt = (TQ_INT32)(floor(displacement)); weight = displacement - displacementInt; - Q_UINT8 pixelWeights[2]; + TQ_UINT8 pixelWeights[2]; - pixelWeights[0] = static_cast<Q_UINT8>(weight * 255 + 0.5); + pixelWeights[0] = static_cast<TQ_UINT8>(weight * 255 + 0.5); pixelWeights[1] = 255 - pixelWeights[0]; KisHLineIteratorPixel srcIt = src->createHLineIterator(r.x(), y, r.width() + 1, false); @@ -304,7 +304,7 @@ KisPaintDeviceSP KisRotateVisitor::xShear(KisPaintDeviceSP src, double shearX) while (!srcIt.isDone()) { - const Q_UINT8 *pixelPtrs[2]; + const TQ_UINT8 *pixelPtrs[2]; pixelPtrs[0] = leftSrcIt.rawData(); pixelPtrs[1] = srcIt.rawData(); @@ -327,23 +327,23 @@ KisPaintDeviceSP KisRotateVisitor::yShear(KisPaintDeviceSP src, double shearY) dst->setX(src->getX()); dst->setY(src->getY()); - QRect r = src->exactBounds(); + TQRect r = src->exactBounds(); double displacement; - Q_INT32 displacementInt; + TQ_INT32 displacementInt; double weight; - for (Q_INT32 x = r.left(); x <= r.right(); x++) { + for (TQ_INT32 x = r.left(); x <= r.right(); x++) { //calculate displacement displacement = x * shearY; - displacementInt = (Q_INT32)(floor(displacement)); + displacementInt = (TQ_INT32)(floor(displacement)); weight = displacement - displacementInt; - Q_UINT8 pixelWeights[2]; + TQ_UINT8 pixelWeights[2]; - pixelWeights[0] = static_cast<Q_UINT8>(weight * 255 + 0.5); + pixelWeights[0] = static_cast<TQ_UINT8>(weight * 255 + 0.5); pixelWeights[1] = 255 - pixelWeights[0]; KisVLineIteratorPixel srcIt = src->createVLineIterator(x, r.y(), r.height() + 1, false); @@ -352,7 +352,7 @@ KisPaintDeviceSP KisRotateVisitor::yShear(KisPaintDeviceSP src, double shearY) while (!srcIt.isDone()) { - const Q_UINT8 *pixelPtrs[2]; + const TQ_UINT8 *pixelPtrs[2]; pixelPtrs[0] = leftSrcIt.rawData(); pixelPtrs[1] = srcIt.rawData(); @@ -369,7 +369,7 @@ KisPaintDeviceSP KisRotateVisitor::yShear(KisPaintDeviceSP src, double shearY) return dst; } -void KisRotateVisitor::initProgress(Q_INT32 totalSteps) +void KisRotateVisitor::initProgress(TQ_INT32 totalSteps) { if (!m_progress) return; @@ -388,7 +388,7 @@ void KisRotateVisitor::incrementProgress() if (!m_progress) return; m_progressStep++; - Q_INT32 progressPerCent = (m_progressStep * 100) / m_progressTotalSteps; + TQ_INT32 progressPerCent = (m_progressStep * 100) / m_progressTotalSteps; if (progressPerCent != m_lastProgressPerCent) { m_lastProgressPerCent = progressPerCent; diff --git a/krita/core/kis_rotate_visitor.h b/krita/core/kis_rotate_visitor.h index 19db35f4..ea23f84f 100644 --- a/krita/core/kis_rotate_visitor.h +++ b/krita/core/kis_rotate_visitor.h @@ -21,7 +21,7 @@ #include "kis_types.h" #include "kis_progress_subject.h" -class QRect; +class TQRect; class KisPaintDevice; class KisProgressDisplayInterface; @@ -46,14 +46,14 @@ private: bool m_cancelRequested; virtual void cancel() { m_cancelRequested = true; } - void initProgress(Q_INT32 totalSteps); + void initProgress(TQ_INT32 totalSteps); void incrementProgress(); void setProgressDone(); KisProgressDisplayInterface *m_progress; - Q_INT32 m_progressStep; - Q_INT32 m_progressTotalSteps; - Q_INT32 m_lastProgressPerCent; + TQ_INT32 m_progressStep; + TQ_INT32 m_progressTotalSteps; + TQ_INT32 m_lastProgressPerCent; KisPaintDeviceSP rotateRight90(KisPaintDeviceSP src); KisPaintDeviceSP rotateLeft90(KisPaintDeviceSP src); diff --git a/krita/core/kis_scale_visitor.cc b/krita/core/kis_scale_visitor.cc index 424db7c6..25ad47c4 100644 --- a/krita/core/kis_scale_visitor.cc +++ b/krita/core/kis_scale_visitor.cc @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qdatetime.h> +#include <tqdatetime.h> #include <kdebug.h> #include <klocale.h> @@ -29,60 +29,60 @@ void KisScaleWorker::run() { double fwidth = m_filterStrategy->support(); - QRect rect = m_dev -> exactBounds(); - Q_INT32 width = rect.width(); - Q_INT32 height = rect.height(); + TQRect rect = m_dev -> exactBounds(); + TQ_INT32 width = rect.width(); + TQ_INT32 height = rect.height(); m_pixelSize=m_dev -> pixelSize(); // compute size of target image if ( m_sx == 1.0F && m_sy == 1.0F ) { return; } - Q_INT32 targetW = QABS( qRound( m_sx * width ) ); - Q_INT32 targetH = QABS( qRound( m_sy * height ) ); + TQ_INT32 targetW = TQABS( tqRound( m_sx * width ) ); + TQ_INT32 targetH = TQABS( tqRound( m_sy * height ) ); - Q_UINT8* newData = new Q_UINT8[targetW * targetH * m_pixelSize ]; + TQ_UINT8* newData = new TQ_UINT8[targetW * targetH * m_pixelSize ]; Q_CHECK_PTR(newData); double* weight = new double[ m_pixelSize ]; /* filter calculation variables */ - Q_UINT8* pel = new Q_UINT8[ m_pixelSize ]; + TQ_UINT8* pel = new TQ_UINT8[ m_pixelSize ]; Q_CHECK_PTR(pel); - Q_UINT8 *pel2 = new Q_UINT8[ m_pixelSize ]; + TQ_UINT8 *pel2 = new TQ_UINT8[ m_pixelSize ]; Q_CHECK_PTR(pel2); bool* bPelDelta = new bool[ m_pixelSize ]; ContribList *contribX; ContribList contribY; - const Q_INT32 BLACK_PIXEL=0; - const Q_INT32 WHITE_PIXEL=255; + const TQ_INT32 BLACK_PIXEL=0; + const TQ_INT32 WHITE_PIXEL=255; // create intermediate row to hold vertical dst row zoom - Q_UINT8 * tmp = new Q_UINT8[ width * m_pixelSize ]; + TQ_UINT8 * tmp = new TQ_UINT8[ width * m_pixelSize ]; Q_CHECK_PTR(tmp); //create array of pointers to intermediate rows - Q_UINT8 **tmpRows = new Q_UINT8*[ height ]; + TQ_UINT8 **tmpRows = new TQ_UINT8*[ height ]; //create array of pointers to intermediate rows that are actually used simultaneously and allocate memory for the rows - Q_UINT8 **tmpRowsMem; + TQ_UINT8 **tmpRowsMem; if(m_sy < 1.0) { - tmpRowsMem = new Q_UINT8*[ (int)(fwidth / m_sy * 2 + 1) ]; + tmpRowsMem = new TQ_UINT8*[ (int)(fwidth / m_sy * 2 + 1) ]; for(int i = 0; i < (int)(fwidth / m_sy * 2 + 1); i++) { - tmpRowsMem[i] = new Q_UINT8[ width * m_pixelSize ]; + tmpRowsMem[i] = new TQ_UINT8[ width * m_pixelSize ]; Q_CHECK_PTR(tmpRowsMem[i]); } } else { - tmpRowsMem = new Q_UINT8*[ (int)(fwidth * 2 + 1) ]; + tmpRowsMem = new TQ_UINT8*[ (int)(fwidth * 2 + 1) ]; for(int i = 0; i < (int)(fwidth * 2 + 1); i++) { - tmpRowsMem[i] = new Q_UINT8[ width * m_pixelSize ]; + tmpRowsMem[i] = new TQ_UINT8[ width * m_pixelSize ]; Q_CHECK_PTR(tmpRowsMem[i]); } } @@ -94,7 +94,7 @@ void KisScaleWorker::run() calcContrib(&contribX[x], m_sx, fwidth, width, m_filterStrategy, x); } - QTime starttime = QTime::currentTime (); + TQTime starttime = TQTime::currentTime (); for(int y = 0; y < targetH; y++) { @@ -106,7 +106,7 @@ void KisScaleWorker::run() { if (!(contribY.p[srcpos].m_pixel < 0 || contribY.p[srcpos].m_pixel >= height)) { - tmpRows[contribY.p[srcpos].m_pixel] = new Q_UINT8[ width * m_pixelSize ]; + tmpRows[contribY.p[srcpos].m_pixel] = new TQ_UINT8[ width * m_pixelSize ]; //tmpRows[ contribY.p[srcpos].m_pixel ] = tmpRowsMem[ srcpos ]; m_dev ->readBytes(tmpRows[contribY.p[srcpos].m_pixel], 0, contribY.p[srcpos].m_pixel, width, 1); } @@ -133,8 +133,8 @@ void KisScaleWorker::run() } for(int channel = 0; channel < m_pixelSize; channel++){ - weight[channel] = bPelDelta[channel] ? static_cast<int>(qRound(weight[channel])) : pel[channel]; - tmp[ x * m_pixelSize + channel ] = static_cast<Q_UINT8>(CLAMP(weight[channel], BLACK_PIXEL, WHITE_PIXEL)); + weight[channel] = bPelDelta[channel] ? static_cast<int>(tqRound(weight[channel])) : pel[channel]; + tmp[ x * m_pixelSize + channel ] = static_cast<TQ_UINT8>(CLAMP(weight[channel], BLACK_PIXEL, WHITE_PIXEL)); } } /* next row in temp column */ delete[] contribY.p; @@ -156,7 +156,7 @@ void KisScaleWorker::run() } } for(int channel = 0; channel < m_pixelSize; channel++){ - weight[channel] = bPelDelta[channel] ? static_cast<int>(qRound(weight[channel])) : pel[channel]; + weight[channel] = bPelDelta[channel] ? static_cast<int>(tqRound(weight[channel])) : pel[channel]; int currentPos = (y*targetW+x) * m_pixelSize; // try to be at least a little efficient if (weight[channel]<0) newData[currentPos + channel] = 0; @@ -201,11 +201,11 @@ void KisScaleWorker::run() } } - QTime stoptime = QTime::currentTime (); + TQTime stoptime = TQTime::currentTime (); return; } -int KisScaleWorker::calcContrib(ContribList *contrib, double scale, double fwidth, int srcwidth, KisFilterStrategy* filterStrategy, Q_INT32 i) +int KisScaleWorker::calcContrib(ContribList *contrib, double scale, double fwidth, int srcwidth, KisFilterStrategy* filterStrategy, TQ_INT32 i) { //ContribList* contribX: receiver of contrib info //double m_sx: horizontal zooming scale @@ -219,7 +219,7 @@ int KisScaleWorker::calcContrib(ContribList *contrib, double scale, double fwidt double fscale; double center, begin, end; double weight; - Q_INT32 k, n; + TQ_INT32 k, n; if(scale < 1.0) { diff --git a/krita/core/kis_scale_visitor.h b/krita/core/kis_scale_visitor.h index e20ba2e0..afe358ad 100644 --- a/krita/core/kis_scale_visitor.h +++ b/krita/core/kis_scale_visitor.h @@ -42,13 +42,13 @@ class KisScaleWorker : public KisThread { /* Structs for the image rescaling routine */ class Contrib { public: - Q_INT32 m_pixel; + TQ_INT32 m_pixel; double m_weight; }; class ContribList { public: - Q_INT32 n; //number of contributors + TQ_INT32 n; //number of contributors Contrib *p; //pointer to list of contributions }; @@ -67,7 +67,7 @@ public: void run(); private: - Q_INT32 m_pixelSize; + TQ_INT32 m_pixelSize; KisPaintDevice * m_dev; double m_sx, m_sy; KisFilterStrategy * m_filterStrategy; @@ -81,7 +81,7 @@ private: * * Returns -1 if error, 0 otherwise. */ - int calcContrib(ContribList *contribX, double cale, double fwidth, int srcwidth, KisFilterStrategy *filterStrategy, Q_INT32 i); + int calcContrib(ContribList *contribX, double cale, double fwidth, int srcwidth, KisFilterStrategy *filterStrategy, TQ_INT32 i); ContribList * contrib; //array of contribution lists @@ -193,7 +193,7 @@ public: private: - QPtrList<KisThread> m_scalethreads; + TQPtrList<KisThread> m_scalethreads; KisImageSP m_img; double m_sx; double m_sy; diff --git a/krita/core/kis_selected_transaction.cc b/krita/core/kis_selected_transaction.cc index 78430a84..44eec697 100644 --- a/krita/core/kis_selected_transaction.cc +++ b/krita/core/kis_selected_transaction.cc @@ -20,7 +20,7 @@ #include "kis_selected_transaction.h" #include "kis_selection.h" -KisSelectedTransaction::KisSelectedTransaction(const QString& name, KisPaintDeviceSP device) : +KisSelectedTransaction::KisSelectedTransaction(const TQString& name, KisPaintDeviceSP device) : KisTransaction(name, device), m_device(device), m_hadSelection(device->hasSelection()) diff --git a/krita/core/kis_selected_transaction.h b/krita/core/kis_selected_transaction.h index 7d1182c0..c366f336 100644 --- a/krita/core/kis_selected_transaction.h +++ b/krita/core/kis_selected_transaction.h @@ -20,8 +20,8 @@ #define KIS_SELECTED_TRANSACTION_H_ #include <map> -#include <qglobal.h> -#include <qstring.h> +#include <tqglobal.h> +#include <tqstring.h> #include "kis_transaction.h" @@ -30,7 +30,7 @@ class KRITACORE_EXPORT KisSelectedTransaction : public KisTransaction { typedef KisTransaction super; public: - KisSelectedTransaction(const QString& name, KisPaintDeviceSP device); + KisSelectedTransaction(const TQString& name, KisPaintDeviceSP device); virtual ~KisSelectedTransaction(); public: diff --git a/krita/core/kis_selection.cc b/krita/core/kis_selection.cc index 9964a355..0150ecf2 100644 --- a/krita/core/kis_selection.cc +++ b/krita/core/kis_selection.cc @@ -16,11 +16,11 @@ * foundation, inc., 675 mass ave, cambridge, ma 02139, usa. */ -#include <qimage.h> +#include <tqimage.h> #include <kdebug.h> #include <klocale.h> -#include <qcolor.h> +#include <tqcolor.h> #include "kis_layer.h" #include "kis_debug_areas.h" @@ -35,9 +35,9 @@ #include "kis_selection.h" KisSelection::KisSelection(KisPaintDeviceSP dev) - : super(dev->parentLayer() + : super(dev->tqparentLayer() , KisMetaRegistry::instance()->csRegistry()->getAlpha8() - , (QString("selection for ") + dev->name()).latin1()) + , (TQString("selection for ") + dev->name()).latin1()) , m_parentPaintDevice(dev) , m_doCacheExactRect(false) , m_dirty(false) @@ -61,46 +61,46 @@ KisSelection::~KisSelection() { } -Q_UINT8 KisSelection::selected(Q_INT32 x, Q_INT32 y) +TQ_UINT8 KisSelection::selected(TQ_INT32 x, TQ_INT32 y) { KisHLineIteratorPixel iter = createHLineIterator(x, y, 1, false); - Q_UINT8 *pix = iter.rawData(); + TQ_UINT8 *pix = iter.rawData(); return *pix; } -void KisSelection::setSelected(Q_INT32 x, Q_INT32 y, Q_UINT8 s) +void KisSelection::setSelected(TQ_INT32 x, TQ_INT32 y, TQ_UINT8 s) { KisHLineIteratorPixel iter = createHLineIterator(x, y, 1, true); - Q_UINT8 *pix = iter.rawData(); + TQ_UINT8 *pix = iter.rawData(); *pix = s; } -QImage KisSelection::maskImage() +TQImage KisSelection::tqmaskImage() { - // If part of a KisAdjustmentLayer, there may be no parent device. - QImage img; - QRect bounds; + // If part of a KisAdjustmentLayer, there may be no tqparent device. + TQImage img; + TQRect bounds; if (m_parentPaintDevice) { bounds = m_parentPaintDevice->exactBounds(); bounds = bounds.intersect( m_parentPaintDevice->image()->bounds() ); - img = QImage(bounds.width(), bounds.height(), 32); + img = TQImage(bounds.width(), bounds.height(), 32); } else { - bounds = QRect( 0, 0, image()->width(), image()->height()); - img = QImage(bounds.width(), bounds.height(), 32); + bounds = TQRect( 0, 0, image()->width(), image()->height()); + img = TQImage(bounds.width(), bounds.height(), 32); } KisHLineIteratorPixel it = createHLineIterator(bounds.x(), bounds.y(), bounds.width(), false); for (int y2 = bounds.y(); y2 < bounds.height() - bounds.y(); ++y2) { int x2 = 0; while (!it.isDone()) { - Q_UINT8 s = MAX_SELECTED - *(it.rawData()); - Q_INT32 c = qRgb(s, s, s); + TQ_UINT8 s = MAX_SELECTED - *(it.rawData()); + TQ_INT32 c = tqRgb(s, s, s); img.setPixel(x2, y2, c); ++x2; ++it; @@ -109,32 +109,32 @@ QImage KisSelection::maskImage() } return img; } -void KisSelection::select(QRect r) +void KisSelection::select(TQRect r) { KisFillPainter painter(this); KisColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8(); - painter.fillRect(r, KisColor(Qt::white, cs), MAX_SELECTED); - Q_INT32 x, y, w, h; + painter.fillRect(r, KisColor(TQt::white, cs), MAX_SELECTED); + TQ_INT32 x, y, w, h; extent(x, y, w, h); } -void KisSelection::clear(QRect r) +void KisSelection::clear(TQRect r) { KisFillPainter painter(this); KisColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8(); - painter.fillRect(r, KisColor(Qt::white, cs), MIN_SELECTED); + painter.fillRect(r, KisColor(TQt::white, cs), MIN_SELECTED); } void KisSelection::clear() { - Q_UINT8 defPixel = MIN_SELECTED; + TQ_UINT8 defPixel = MIN_SELECTED; m_datamanager->setDefaultPixel(&defPixel); m_datamanager->clear(); } void KisSelection::invert() { - Q_INT32 x,y,w,h; + TQ_INT32 x,y,w,h; extent(x, y, w, h); KisRectIterator it = createRectIterator(x, y, w, h, true); @@ -145,28 +145,28 @@ void KisSelection::invert() *(it.rawData()) = MAX_SELECTED - *(it.rawData()); ++it; } - Q_UINT8 defPixel = MAX_SELECTED - *(m_datamanager->defaultPixel()); + TQ_UINT8 defPixel = MAX_SELECTED - *(m_datamanager->defaultPixel()); m_datamanager->setDefaultPixel(&defPixel); } -bool KisSelection::isTotallyUnselected(QRect r) +bool KisSelection::isTotallyUnselected(TQRect r) { if(*(m_datamanager->defaultPixel()) != MIN_SELECTED) return false; - QRect sr = selectedExactRect(); + TQRect sr = selectedExactRect(); return ! r.intersects(sr); } -bool KisSelection::isProbablyTotallyUnselected(QRect r) +bool KisSelection::isProbablyTotallyUnselected(TQRect r) { if(*(m_datamanager->defaultPixel()) != MIN_SELECTED) return false; - QRect sr = selectedRect(); + TQRect sr = selectedRect(); return ! r.intersects(sr); } -QRect KisSelection::selectedRect() const +TQRect KisSelection::selectedRect() const { if(*(m_datamanager->defaultPixel()) == MIN_SELECTED || !m_parentPaintDevice) return extent(); @@ -174,7 +174,7 @@ QRect KisSelection::selectedRect() const return extent().unite(m_parentPaintDevice->extent()); } -QRect KisSelection::selectedExactRect() const +TQRect KisSelection::selectedExactRect() const { if(m_doCacheExactRect) return m_cachedExactRect; @@ -201,42 +201,42 @@ void KisSelection::startCachingExactRect() m_doCacheExactRect = true; } -void KisSelection::paintUniformSelectionRegion(QImage img, const QRect& imageRect, const QRegion& uniformRegion) +void KisSelection::paintUniformSelectionRegion(TQImage img, const TQRect& imageRect, const TQRegion& uniformRegion) { Q_ASSERT(img.size() == imageRect.size()); - Q_ASSERT(imageRect.contains(uniformRegion.boundingRect())); + Q_ASSERT(imageRect.tqcontains(uniformRegion.boundingRect())); - if (img.isNull() || img.size() != imageRect.size() || !imageRect.contains(uniformRegion.boundingRect())) { + if (img.isNull() || img.size() != imageRect.size() || !imageRect.tqcontains(uniformRegion.boundingRect())) { return; } if (*m_datamanager->defaultPixel() == MIN_SELECTED) { - QRegion region = uniformRegion & QRegion(imageRect); + TQRegion region = uniformRegion & TQRegion(imageRect); if (!region.isEmpty()) { - QMemArray<QRect> rects = region.rects(); + TQMemArray<TQRect> rects = region.rects(); for (unsigned int i = 0; i < rects.count(); i++) { - QRect r = rects[i]; + TQRect r = rects[i]; - for (Q_INT32 y = 0; y < r.height(); ++y) { + for (TQ_INT32 y = 0; y < r.height(); ++y) { - QRgb *imagePixel = reinterpret_cast<QRgb *>(img.scanLine(r.y() - imageRect.y() + y)); + TQRgb *imagePixel = reinterpret_cast<TQRgb *>(img.scanLine(r.y() - imageRect.y() + y)); imagePixel += r.x() - imageRect.x(); - Q_INT32 numPixels = r.width(); + TQ_INT32 numPixels = r.width(); while (numPixels > 0) { - QRgb srcPixel = *imagePixel; - Q_UINT8 srcGrey = (qRed(srcPixel) + qGreen(srcPixel) + qBlue(srcPixel)) / 9; - Q_UINT8 srcAlpha = qAlpha(srcPixel); + TQRgb srcPixel = *imagePixel; + TQ_UINT8 srcGrey = (tqRed(srcPixel) + tqGreen(srcPixel) + tqBlue(srcPixel)) / 9; + TQ_UINT8 srcAlpha = tqAlpha(srcPixel); srcGrey = UINT8_MULT(srcGrey, srcAlpha); - Q_UINT8 dstAlpha = QMAX(srcAlpha, 192); + TQ_UINT8 dstAlpha = TQMAX(srcAlpha, 192); - QRgb dstPixel = qRgba(128 + srcGrey, 128 + srcGrey, 165 + srcGrey, dstAlpha); + TQRgb dstPixel = tqRgba(128 + srcGrey, 128 + srcGrey, 165 + srcGrey, dstAlpha); *imagePixel = dstPixel; ++imagePixel; @@ -248,111 +248,111 @@ void KisSelection::paintUniformSelectionRegion(QImage img, const QRect& imageRec } } -void KisSelection::paintSelection(QImage img, Q_INT32 imageRectX, Q_INT32 imageRectY, Q_INT32 imageRectWidth, Q_INT32 imageRectHeight) +void KisSelection::paintSelection(TQImage img, TQ_INT32 imageRectX, TQ_INT32 imageRectY, TQ_INT32 imageRectWidth, TQ_INT32 imageRectHeight) { - Q_ASSERT(img.size() == QSize(imageRectWidth, imageRectHeight)); + Q_ASSERT(img.size() == TQSize(imageRectWidth, imageRectHeight)); - if (img.isNull() || img.size() != QSize(imageRectWidth, imageRectHeight)) { + if (img.isNull() || img.size() != TQSize(imageRectWidth, imageRectHeight)) { return; } - QRect imageRect(imageRectX, imageRectY, imageRectWidth, imageRectHeight); - QRect selectionExtent = extent(); + TQRect imageRect(imageRectX, imageRectY, imageRectWidth, imageRectHeight); + TQRect selectionExtent = extent(); selectionExtent.setLeft(selectionExtent.left() - 1); selectionExtent.setTop(selectionExtent.top() - 1); selectionExtent.setWidth(selectionExtent.width() + 2); selectionExtent.setHeight(selectionExtent.height() + 2); - QRegion uniformRegion = QRegion(imageRect); - uniformRegion -= QRegion(selectionExtent); + TQRegion uniformRegion = TQRegion(imageRect); + uniformRegion -= TQRegion(selectionExtent); if (!uniformRegion.isEmpty()) { paintUniformSelectionRegion(img, imageRect, uniformRegion); } - QRect nonuniformRect = imageRect & selectionExtent; + TQRect nonuniformRect = imageRect & selectionExtent; if (!nonuniformRect.isEmpty()) { - const Q_INT32 imageRectOffsetX = nonuniformRect.x() - imageRectX; - const Q_INT32 imageRectOffsetY = nonuniformRect.y() - imageRectY; + const TQ_INT32 imageRectOffsetX = nonuniformRect.x() - imageRectX; + const TQ_INT32 imageRectOffsetY = nonuniformRect.y() - imageRectY; imageRectX = nonuniformRect.x(); imageRectY = nonuniformRect.y(); imageRectWidth = nonuniformRect.width(); imageRectHeight = nonuniformRect.height(); - const Q_INT32 NUM_SELECTION_ROWS = 3; + const TQ_INT32 NUM_SELECTION_ROWS = 3; - Q_UINT8 *selectionRow[NUM_SELECTION_ROWS]; + TQ_UINT8 *selectionRow[NUM_SELECTION_ROWS]; - Q_INT32 aboveRowIndex = 0; - Q_INT32 centreRowIndex = 1; - Q_INT32 belowRowIndex = 2; + TQ_INT32 aboveRowIndex = 0; + TQ_INT32 centreRowIndex = 1; + TQ_INT32 belowRowIndex = 2; - selectionRow[aboveRowIndex] = new Q_UINT8[imageRectWidth + 2]; - selectionRow[centreRowIndex] = new Q_UINT8[imageRectWidth + 2]; - selectionRow[belowRowIndex] = new Q_UINT8[imageRectWidth + 2]; + selectionRow[aboveRowIndex] = new TQ_UINT8[imageRectWidth + 2]; + selectionRow[centreRowIndex] = new TQ_UINT8[imageRectWidth + 2]; + selectionRow[belowRowIndex] = new TQ_UINT8[imageRectWidth + 2]; readBytes(selectionRow[centreRowIndex], imageRectX - 1, imageRectY - 1, imageRectWidth + 2, 1); readBytes(selectionRow[belowRowIndex], imageRectX - 1, imageRectY, imageRectWidth + 2, 1); - for (Q_INT32 y = 0; y < imageRectHeight; ++y) { + for (TQ_INT32 y = 0; y < imageRectHeight; ++y) { - Q_INT32 oldAboveRowIndex = aboveRowIndex; + TQ_INT32 oldAboveRowIndex = aboveRowIndex; aboveRowIndex = centreRowIndex; centreRowIndex = belowRowIndex; belowRowIndex = oldAboveRowIndex; readBytes(selectionRow[belowRowIndex], imageRectX - 1, imageRectY + y + 1, imageRectWidth + 2, 1); - const Q_UINT8 *aboveRow = selectionRow[aboveRowIndex] + 1; - const Q_UINT8 *centreRow = selectionRow[centreRowIndex] + 1; - const Q_UINT8 *belowRow = selectionRow[belowRowIndex] + 1; + const TQ_UINT8 *aboveRow = selectionRow[aboveRowIndex] + 1; + const TQ_UINT8 *centreRow = selectionRow[centreRowIndex] + 1; + const TQ_UINT8 *belowRow = selectionRow[belowRowIndex] + 1; - QRgb *imagePixel = reinterpret_cast<QRgb *>(img.scanLine(imageRectOffsetY + y)); + TQRgb *imagePixel = reinterpret_cast<TQRgb *>(img.scanLine(imageRectOffsetY + y)); imagePixel += imageRectOffsetX; - for (Q_INT32 x = 0; x < imageRectWidth; ++x) { + for (TQ_INT32 x = 0; x < imageRectWidth; ++x) { - Q_UINT8 centre = *centreRow; + TQ_UINT8 centre = *centreRow; if (centre != MAX_SELECTED) { // this is where we come if the pixels should be blue or bluish - QRgb srcPixel = *imagePixel; - Q_UINT8 srcGrey = (qRed(srcPixel) + qGreen(srcPixel) + qBlue(srcPixel)) / 9; - Q_UINT8 srcAlpha = qAlpha(srcPixel); + TQRgb srcPixel = *imagePixel; + TQ_UINT8 srcGrey = (tqRed(srcPixel) + tqGreen(srcPixel) + tqBlue(srcPixel)) / 9; + TQ_UINT8 srcAlpha = tqAlpha(srcPixel); // Colour influence is proportional to alphaPixel. srcGrey = UINT8_MULT(srcGrey, srcAlpha); - QRgb dstPixel; + TQRgb dstPixel; if (centre == MIN_SELECTED) { //this is where we come if the pixels should be blue (or red outline) - Q_UINT8 left = *(centreRow - 1); - Q_UINT8 right = *(centreRow + 1); - Q_UINT8 above = *aboveRow; - Q_UINT8 below = *belowRow; + TQ_UINT8 left = *(centreRow - 1); + TQ_UINT8 right = *(centreRow + 1); + TQ_UINT8 above = *aboveRow; + TQ_UINT8 below = *belowRow; // Stop unselected transparent areas from appearing the same // as selected transparent areas. - Q_UINT8 dstAlpha = QMAX(srcAlpha, 192); + TQ_UINT8 dstAlpha = TQMAX(srcAlpha, 192); // now for a simple outline based on 4-connectivity if (left != MIN_SELECTED || right != MIN_SELECTED || above != MIN_SELECTED || below != MIN_SELECTED) { - dstPixel = qRgba(255, 0, 0, dstAlpha); + dstPixel = tqRgba(255, 0, 0, dstAlpha); } else { - dstPixel = qRgba(128 + srcGrey, 128 + srcGrey, 165 + srcGrey, dstAlpha); + dstPixel = tqRgba(128 + srcGrey, 128 + srcGrey, 165 + srcGrey, dstAlpha); } } else { - dstPixel = qRgba(UINT8_BLEND(qRed(srcPixel), srcGrey + 128, centre), - UINT8_BLEND(qGreen(srcPixel), srcGrey + 128, centre), - UINT8_BLEND(qBlue(srcPixel), srcGrey + 165, centre), + dstPixel = tqRgba(UINT8_BLEND(tqRed(srcPixel), srcGrey + 128, centre), + UINT8_BLEND(tqGreen(srcPixel), srcGrey + 128, centre), + UINT8_BLEND(tqBlue(srcPixel), srcGrey + 165, centre), srcAlpha); } @@ -372,7 +372,7 @@ void KisSelection::paintSelection(QImage img, Q_INT32 imageRectX, Q_INT32 imageR } } -void KisSelection::paintSelection(QImage img, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize) +void KisSelection::paintSelection(TQImage img, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize) { if (img.isNull() || scaledImageRect.isEmpty() || scaledImageSize.isEmpty() || imageSize.isEmpty()) { return; @@ -384,10 +384,10 @@ void KisSelection::paintSelection(QImage img, const QRect& scaledImageRect, cons return; } - Q_INT32 imageWidth = imageSize.width(); - Q_INT32 imageHeight = imageSize.height(); + TQ_INT32 imageWidth = imageSize.width(); + TQ_INT32 imageHeight = imageSize.height(); - QRect selectionExtent = extent(); + TQRect selectionExtent = extent(); selectionExtent.setLeft(selectionExtent.left() - 1); selectionExtent.setTop(selectionExtent.top() - 1); @@ -397,63 +397,63 @@ void KisSelection::paintSelection(QImage img, const QRect& scaledImageRect, cons double xScale = static_cast<double>(scaledImageSize.width()) / imageWidth; double yScale = static_cast<double>(scaledImageSize.height()) / imageHeight; - QRect scaledSelectionExtent; + TQRect scaledSelectionExtent; scaledSelectionExtent.setLeft(static_cast<int>(selectionExtent.left() * xScale)); scaledSelectionExtent.setRight(static_cast<int>(ceil((selectionExtent.right() + 1) * xScale)) - 1); scaledSelectionExtent.setTop(static_cast<int>(selectionExtent.top() * yScale)); scaledSelectionExtent.setBottom(static_cast<int>(ceil((selectionExtent.bottom() + 1) * yScale)) - 1); - QRegion uniformRegion = QRegion(scaledImageRect); - uniformRegion -= QRegion(scaledSelectionExtent); + TQRegion uniformRegion = TQRegion(scaledImageRect); + uniformRegion -= TQRegion(scaledSelectionExtent); if (!uniformRegion.isEmpty()) { paintUniformSelectionRegion(img, scaledImageRect, uniformRegion); } - QRect nonuniformRect = scaledImageRect & scaledSelectionExtent; + TQRect nonuniformRect = scaledImageRect & scaledSelectionExtent; if (!nonuniformRect.isEmpty()) { - const Q_INT32 scaledImageRectXOffset = nonuniformRect.x() - scaledImageRect.x(); - const Q_INT32 scaledImageRectYOffset = nonuniformRect.y() - scaledImageRect.y(); + const TQ_INT32 scaledImageRectXOffset = nonuniformRect.x() - scaledImageRect.x(); + const TQ_INT32 scaledImageRectYOffset = nonuniformRect.y() - scaledImageRect.y(); - const Q_INT32 scaledImageRectX = nonuniformRect.x(); - const Q_INT32 scaledImageRectY = nonuniformRect.y(); - const Q_INT32 scaledImageRectWidth = nonuniformRect.width(); - const Q_INT32 scaledImageRectHeight = nonuniformRect.height(); + const TQ_INT32 scaledImageRectX = nonuniformRect.x(); + const TQ_INT32 scaledImageRectY = nonuniformRect.y(); + const TQ_INT32 scaledImageRectWidth = nonuniformRect.width(); + const TQ_INT32 scaledImageRectHeight = nonuniformRect.height(); - const Q_INT32 imageRowLeft = static_cast<Q_INT32>(scaledImageRectX / xScale); - const Q_INT32 imageRowRight = static_cast<Q_INT32>((ceil((scaledImageRectX + scaledImageRectWidth - 1 + 1) / xScale)) - 1); + const TQ_INT32 imageRowLeft = static_cast<TQ_INT32>(scaledImageRectX / xScale); + const TQ_INT32 imageRowRight = static_cast<TQ_INT32>((ceil((scaledImageRectX + scaledImageRectWidth - 1 + 1) / xScale)) - 1); - const Q_INT32 imageRowWidth = imageRowRight - imageRowLeft + 1; - const Q_INT32 imageRowStride = imageRowWidth + 2; + const TQ_INT32 imageRowWidth = imageRowRight - imageRowLeft + 1; + const TQ_INT32 imageRowStride = imageRowWidth + 2; - const Q_INT32 NUM_SELECTION_ROWS = 3; + const TQ_INT32 NUM_SELECTION_ROWS = 3; - Q_INT32 aboveRowIndex = 0; - Q_INT32 centreRowIndex = 1; - Q_INT32 belowRowIndex = 2; + TQ_INT32 aboveRowIndex = 0; + TQ_INT32 centreRowIndex = 1; + TQ_INT32 belowRowIndex = 2; - Q_INT32 aboveRowSrcY = -3; - Q_INT32 centreRowSrcY = -3; - Q_INT32 belowRowSrcY = -3; + TQ_INT32 aboveRowSrcY = -3; + TQ_INT32 centreRowSrcY = -3; + TQ_INT32 belowRowSrcY = -3; - Q_UINT8 *selectionRows = new Q_UINT8[imageRowStride * NUM_SELECTION_ROWS]; - Q_UINT8 *selectionRow[NUM_SELECTION_ROWS]; + TQ_UINT8 *selectionRows = new TQ_UINT8[imageRowStride * NUM_SELECTION_ROWS]; + TQ_UINT8 *selectionRow[NUM_SELECTION_ROWS]; selectionRow[0] = selectionRows + 1; selectionRow[1] = selectionRow[0] + imageRowStride; selectionRow[2] = selectionRow[0] + (2 * imageRowStride); - for (Q_INT32 y = 0; y < scaledImageRectHeight; ++y) { + for (TQ_INT32 y = 0; y < scaledImageRectHeight; ++y) { - Q_INT32 scaledY = scaledImageRectY + y; - Q_INT32 srcY = (scaledY * imageHeight) / scaledImageSize.height(); + TQ_INT32 scaledY = scaledImageRectY + y; + TQ_INT32 srcY = (scaledY * imageHeight) / scaledImageSize.height(); - Q_UINT8 *aboveRow; - Q_UINT8 *centreRow; - Q_UINT8 *belowRow; + TQ_UINT8 *aboveRow; + TQ_UINT8 *centreRow; + TQ_UINT8 *belowRow; if (srcY - 1 == aboveRowSrcY) { aboveRow = selectionRow[aboveRowIndex]; @@ -461,7 +461,7 @@ void KisSelection::paintSelection(QImage img, const QRect& scaledImageRect, cons belowRow = selectionRow[belowRowIndex]; } else if (srcY - 1 == centreRowSrcY) { - Q_INT32 oldAboveRowIndex = aboveRowIndex; + TQ_INT32 oldAboveRowIndex = aboveRowIndex; aboveRowIndex = centreRowIndex; centreRowIndex = belowRowIndex; @@ -475,8 +475,8 @@ void KisSelection::paintSelection(QImage img, const QRect& scaledImageRect, cons } else if (srcY - 1 == belowRowSrcY) { - Q_INT32 oldAboveRowIndex = aboveRowIndex; - Q_INT32 oldCentreRowIndex = centreRowIndex; + TQ_INT32 oldAboveRowIndex = aboveRowIndex; + TQ_INT32 oldCentreRowIndex = centreRowIndex; aboveRowIndex = belowRowIndex; centreRowIndex = oldAboveRowIndex; @@ -510,51 +510,51 @@ void KisSelection::paintSelection(QImage img, const QRect& scaledImageRect, cons centreRowSrcY = aboveRowSrcY + 1; belowRowSrcY = centreRowSrcY + 1; - QRgb *imagePixel = reinterpret_cast<QRgb *>(img.scanLine(scaledImageRectYOffset + y)); + TQRgb *imagePixel = reinterpret_cast<TQRgb *>(img.scanLine(scaledImageRectYOffset + y)); imagePixel += scaledImageRectXOffset; - for (Q_INT32 x = 0; x < scaledImageRectWidth; ++x) { + for (TQ_INT32 x = 0; x < scaledImageRectWidth; ++x) { - Q_INT32 scaledX = scaledImageRectX + x; - Q_INT32 srcX = (scaledX * imageWidth) / scaledImageSize.width(); + TQ_INT32 scaledX = scaledImageRectX + x; + TQ_INT32 srcX = (scaledX * imageWidth) / scaledImageSize.width(); - Q_UINT8 centre = *(centreRow + srcX - imageRowLeft); + TQ_UINT8 centre = *(centreRow + srcX - imageRowLeft); if (centre != MAX_SELECTED) { // this is where we come if the pixels should be blue or bluish - QRgb srcPixel = *imagePixel; - Q_UINT8 srcGrey = (qRed(srcPixel) + qGreen(srcPixel) + qBlue(srcPixel)) / 9; - Q_UINT8 srcAlpha = qAlpha(srcPixel); + TQRgb srcPixel = *imagePixel; + TQ_UINT8 srcGrey = (tqRed(srcPixel) + tqGreen(srcPixel) + tqBlue(srcPixel)) / 9; + TQ_UINT8 srcAlpha = tqAlpha(srcPixel); // Colour influence is proportional to alphaPixel. srcGrey = UINT8_MULT(srcGrey, srcAlpha); - QRgb dstPixel; + TQRgb dstPixel; if (centre == MIN_SELECTED) { //this is where we come if the pixels should be blue (or red outline) - Q_UINT8 left = *(centreRow + (srcX - imageRowLeft) - 1); - Q_UINT8 right = *(centreRow + (srcX - imageRowLeft) + 1); - Q_UINT8 above = *(aboveRow + (srcX - imageRowLeft)); - Q_UINT8 below = *(belowRow + (srcX - imageRowLeft)); + TQ_UINT8 left = *(centreRow + (srcX - imageRowLeft) - 1); + TQ_UINT8 right = *(centreRow + (srcX - imageRowLeft) + 1); + TQ_UINT8 above = *(aboveRow + (srcX - imageRowLeft)); + TQ_UINT8 below = *(belowRow + (srcX - imageRowLeft)); // Stop unselected transparent areas from appearing the same // as selected transparent areas. - Q_UINT8 dstAlpha = QMAX(srcAlpha, 192); + TQ_UINT8 dstAlpha = TQMAX(srcAlpha, 192); // now for a simple outline based on 4-connectivity if (left != MIN_SELECTED || right != MIN_SELECTED || above != MIN_SELECTED || below != MIN_SELECTED) { - dstPixel = qRgba(255, 0, 0, dstAlpha); + dstPixel = tqRgba(255, 0, 0, dstAlpha); } else { - dstPixel = qRgba(128 + srcGrey, 128 + srcGrey, 165 + srcGrey, dstAlpha); + dstPixel = tqRgba(128 + srcGrey, 128 + srcGrey, 165 + srcGrey, dstAlpha); } } else { - dstPixel = qRgba(UINT8_BLEND(qRed(srcPixel), srcGrey + 128, centre), - UINT8_BLEND(qGreen(srcPixel), srcGrey + 128, centre), - UINT8_BLEND(qBlue(srcPixel), srcGrey + 165, centre), + dstPixel = tqRgba(UINT8_BLEND(tqRed(srcPixel), srcGrey + 128, centre), + UINT8_BLEND(tqGreen(srcPixel), srcGrey + 128, centre), + UINT8_BLEND(tqBlue(srcPixel), srcGrey + 165, centre), srcAlpha); } @@ -569,7 +569,7 @@ void KisSelection::paintSelection(QImage img, const QRect& scaledImageRect, cons } } -void KisSelection::setDirty(const QRect& rc) +void KisSelection::setDirty(const TQRect& rc) { if (m_dirty) super::setDirty(rc); diff --git a/krita/core/kis_selection.h b/krita/core/kis_selection.h index 959be492..f41915da 100644 --- a/krita/core/kis_selection.h +++ b/krita/core/kis_selection.h @@ -18,7 +18,7 @@ #ifndef KIS_SELECTION_H_ #define KIS_SELECTION_H_ -#include <qrect.h> +#include <tqrect.h> #include "kis_types.h" #include "kis_paint_device.h" @@ -47,13 +47,13 @@ class KRITACORE_EXPORT KisSelection : public KisPaintDevice { public: /** * Create a new KisSelection - * @param dev the parent paint device. The selection will never be bigger than the parent + * @param dev the tqparent paint device. The selection will never be bigger than the tqparent * paint device. */ KisSelection(KisPaintDeviceSP dev); /** - * Create a new KisSelection. This selection will not have a parent paint device. + * Create a new KisSelection. This selection will not have a tqparent paint device. */ KisSelection(); @@ -65,22 +65,22 @@ public: virtual ~KisSelection(); // Returns selectedness, or 0 if invalid coordinates - Q_UINT8 selected(Q_INT32 x, Q_INT32 y); + TQ_UINT8 selected(TQ_INT32 x, TQ_INT32 y); - void setSelected(Q_INT32 x, Q_INT32 y, Q_UINT8 s); + void setSelected(TQ_INT32 x, TQ_INT32 y, TQ_UINT8 s); - QImage maskImage(); + TQImage tqmaskImage(); - void select(QRect r); + void select(TQRect r); void invert(); - void clear(QRect r); + void clear(TQRect r); void clear(); /// Tests if the the rect is totally outside the selection - bool isTotallyUnselected(QRect r); + bool isTotallyUnselected(TQRect r); /** * Tests if the the rect is totally outside the selection, but uses selectedRect @@ -88,63 +88,63 @@ public: * * XXX: This comment makes no sense anymore! (BSAR) */ - bool isProbablyTotallyUnselected(QRect r); + bool isProbablyTotallyUnselected(TQRect r); /** * Rough, but fastish way of determining the area * of the tiles used by the selection. */ - QRect selectedRect() const; + TQRect selectedRect() const; /** * Slow, but exact way of determining the rectangle * that encloses the selection */ - QRect selectedExactRect() const; + TQRect selectedExactRect() const; - void paintSelection(QImage img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); - void paintSelection(QImage img, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize); + void paintSelection(TQImage img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); + void paintSelection(TQImage img, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize); void startCachingExactRect(); void stopCachingExactRect(); - // if the parent layer is interested in keeping up to date with the dirtyness + // if the tqparent layer is interested in keeping up to date with the dirtyness // of this layer, set to true void setInterestedInDirtyness(bool b) { m_dirty = b; } bool interestedInDirtyness() const { return m_dirty; } - virtual void setDirty(const QRect & rc); + virtual void setDirty(const TQRect & rc); virtual void setDirty(); - inline KisPaintDeviceSP parentPaintDevice() { return m_parentPaintDevice; } + inline KisPaintDeviceSP tqparentPaintDevice() { return m_parentPaintDevice; } private: - void paintUniformSelectionRegion(QImage img, const QRect& imageRect, const QRegion& uniformRegion); + void paintUniformSelectionRegion(TQImage img, const TQRect& imageRect, const TQRegion& uniformRegion); private: // We don't want these methods to be used on selections: - void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const + void extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const { KisPaintDevice::extent(x,y,w,h); } - QRect extent() const { return KisPaintDevice::extent(); } + TQRect extent() const { return KisPaintDevice::extent(); } - void exactBounds(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const + void exactBounds(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const { return KisPaintDevice::exactBounds(x,y,w,h); } - QRect exactBounds() const + TQRect exactBounds() const { return KisPaintDevice::exactBounds(); } - QRect exactBoundsOldMethod() const + TQRect exactBoundsOldMethod() const { return KisPaintDevice::exactBoundsOldMethod(); } - QRect exactBoundsImprovedOldMethod() const + TQRect exactBoundsImprovedOldMethod() const { return KisPaintDevice::exactBoundsImprovedOldMethod(); } @@ -153,7 +153,7 @@ private: private: KisPaintDeviceSP m_parentPaintDevice; bool m_doCacheExactRect; - QRect m_cachedExactRect; + TQRect m_cachedExactRect; bool m_dirty; }; diff --git a/krita/core/kis_strategy_move.cc b/krita/core/kis_strategy_move.cc index bd99349b..7391777c 100644 --- a/krita/core/kis_strategy_move.cc +++ b/krita/core/kis_strategy_move.cc @@ -16,8 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qpoint.h> -#include <qcolor.h> +#include <tqpoint.h> +#include <tqcolor.h> #include <kaction.h> #include <kcommand.h> @@ -57,7 +57,7 @@ void KisStrategyMove::reset(KisCanvasSubject *subject) } } -void KisStrategyMove::startDrag(const QPoint& pos) +void KisStrategyMove::startDrag(const TQPoint& pos) { // pos is the user chosen handle point @@ -82,7 +82,7 @@ void KisStrategyMove::startDrag(const QPoint& pos) } } -void KisStrategyMove::drag(const QPoint& original) +void KisStrategyMove::drag(const TQPoint& original) { // original is the position of the user chosen handle point @@ -91,8 +91,8 @@ void KisStrategyMove::drag(const QPoint& original) KisLayerSP dev; if (img && (dev = img->activeLayer())) { - QPoint pos = original; - QRect rc; + TQPoint pos = original; + TQRect rc; pos -= m_dragStart; // convert to delta rc = dev->extent(); @@ -100,7 +100,7 @@ void KisStrategyMove::drag(const QPoint& original) dev->setY(dev->y() + pos.y()); rc = rc.unite(dev->extent()); - m_layerPosition = QPoint(dev->x(), dev->y()); + m_layerPosition = TQPoint(dev->x(), dev->y()); m_dragStart = original; dev->setDirty(rc); @@ -108,7 +108,7 @@ void KisStrategyMove::drag(const QPoint& original) } } -void KisStrategyMove::endDrag(const QPoint& pos, bool undo) +void KisStrategyMove::endDrag(const TQPoint& pos, bool undo) { if (m_subject && m_dragging) { KisImageSP img = m_subject->currentImg(); @@ -134,15 +134,15 @@ void KisStrategyMove::endDrag(const QPoint& pos, bool undo) } } -void KisStrategyMove::simpleMove(const QPoint& pt1, const QPoint& pt2) +void KisStrategyMove::simpleMove(const TQPoint& pt1, const TQPoint& pt2) { startDrag(pt1); endDrag(pt2); } -void KisStrategyMove::simpleMove(Q_INT32 x1, Q_INT32 y1, Q_INT32 x2, Q_INT32 y2) +void KisStrategyMove::simpleMove(TQ_INT32 x1, TQ_INT32 y1, TQ_INT32 x2, TQ_INT32 y2) { - startDrag(QPoint(x1, y1)); - endDrag(QPoint(x2, y2)); + startDrag(TQPoint(x1, y1)); + endDrag(TQPoint(x2, y2)); } diff --git a/krita/core/kis_strategy_move.h b/krita/core/kis_strategy_move.h index e3787866..c3535be9 100644 --- a/krita/core/kis_strategy_move.h +++ b/krita/core/kis_strategy_move.h @@ -19,8 +19,8 @@ #ifndef KIS_STRATEGY_MOVE_H_ #define KIS_STRATEGY_MOVE_H_ -#include <qpoint.h> -#include <qrect.h> +#include <tqpoint.h> +#include <tqrect.h> #include <koffice_export.h> @@ -35,11 +35,11 @@ public: public: void reset(KisCanvasSubject *subject); - void startDrag(const QPoint& pos); - void drag(const QPoint& pos); - void endDrag(const QPoint& pos, bool undo = true); - void simpleMove(const QPoint& pt1, const QPoint& pt2); - void simpleMove(Q_INT32 x1, Q_INT32 y1, Q_INT32 x2, Q_INT32 y2); + void startDrag(const TQPoint& pos); + void drag(const TQPoint& pos); + void endDrag(const TQPoint& pos, bool undo = true); + void simpleMove(const TQPoint& pt1, const TQPoint& pt2); + void simpleMove(TQ_INT32 x1, TQ_INT32 y1, TQ_INT32 x2, TQ_INT32 y2); private: KisStrategyMove(const KisStrategyMove&); @@ -48,10 +48,10 @@ private: private: KisCanvasController *m_controller; KisCanvasSubject *m_subject; - QRect m_deviceBounds; - QPoint m_dragStart; - QPoint m_layerStart; - QPoint m_layerPosition; + TQRect m_deviceBounds; + TQPoint m_dragStart; + TQPoint m_layerStart; + TQPoint m_layerPosition; bool m_dragging; }; diff --git a/krita/core/kis_substrate.h b/krita/core/kis_substrate.h index 96207747..274f2680 100644 --- a/krita/core/kis_substrate.h +++ b/krita/core/kis_substrate.h @@ -18,7 +18,7 @@ #ifndef KIS_SUBSTRATE_H #define KIS_SUBSTRATE_H -#include <qrect.h> +#include <tqrect.h> #include <ksharedptr.h> class KisImage; @@ -30,10 +30,10 @@ struct KisSubstratePixel { float smoothness; // determines how easily the painting tool "slips" over the surface float absorbency; // determines how much wetness the substrate can absorb. XXX: How about speed of absorbing? float density; // XXX? - Q_UINT8 r; //.Red component of reflectivity - Q_UINT8 g; // Green component of reflectivity - Q_UINT8 b; // Blue component of reflectivity - Q_UINT8 alpha; // For composition with the background + TQ_UINT8 r; //.Red component of reflectivity + TQ_UINT8 g; // Green component of reflectivity + TQ_UINT8 b; // Blue component of reflectivity + TQ_UINT8 alpha; // For composition with the background }; /** @@ -56,13 +56,13 @@ public: * Copy the pixel values in the specified rect into an array of Substrate. * Make sure the array is big enough! */ - virtual void getPixels(KisSubstratePixel * substrate, const QRect & rc) const = 0; + virtual void getPixels(KisSubstratePixel * substrate, const TQRect & rc) const = 0; /** * Copy the specified rect of substrate pixels onto the substrate. Make sure * the array is big enough. */ - virtual void writePixels(const KisSubstratePixel * substrate, const QRect & rc) = 0; + virtual void writePixels(const KisSubstratePixel * substrate, const TQRect & rc) = 0; /** * Read the value at the specified position into the given substrate pixel. */ diff --git a/krita/core/kis_thread.h b/krita/core/kis_thread.h index f26ebf8b..61feda24 100644 --- a/krita/core/kis_thread.h +++ b/krita/core/kis_thread.h @@ -19,22 +19,22 @@ #ifndef KIS_THREAD_ #define KIS_THREAD_ -#include <qthread.h> +#include <tqthread.h> #include <ksharedptr.h> /** - * A KisThread is a QThread that can be set in the canceled state. + * A KisThread is a TQThread that can be set in the canceled state. * Lengthy operations initiated in run() should regularly read the * canceled state and stop when it's set to true */ -class KisThread : public QThread { +class KisThread : public TQThread { public: /** * Create a new KisThread with the canceled state set to false */ - KisThread() : QThread(), m_canceled(false) {}; + KisThread() : TQThread(), m_canceled(false) {}; /** * Request the thread to cancel at the first opportunity. Note diff --git a/krita/core/kis_thread_pool.cc b/krita/core/kis_thread_pool.cc index 2f80a0ae..e617c8cb 100644 --- a/krita/core/kis_thread_pool.cc +++ b/krita/core/kis_thread_pool.cc @@ -115,18 +115,18 @@ void KisThreadPool::dequeue(KisThread * thread) m_poolMutex.lock(); - int i = m_threads.findRef(thread); + int i = m_threads.tqfindRef(thread); if (i >= 0) { t = m_threads.take(i); m_numberOfQueuedThreads--; } else { - i = m_runningThreads.findRef(thread); + i = m_runningThreads.tqfindRef(thread); if (i >= 0) { t = m_runningThreads.take(i); m_numberOfRunningThreads--; } else { - i = m_oldThreads.findRef(thread); + i = m_oldThreads.tqfindRef(thread); if (i >= 0) { t = m_oldThreads.take(i); } diff --git a/krita/core/kis_thread_pool.h b/krita/core/kis_thread_pool.h index 069cb5a5..904606bf 100644 --- a/krita/core/kis_thread_pool.h +++ b/krita/core/kis_thread_pool.h @@ -19,9 +19,9 @@ #ifndef KIS_THREAD_POOL_ #define KIS_THREAD_POOL_ -#include <qthread.h> -#include <qptrlist.h> -#include <qmutex.h> +#include <tqthread.h> +#include <tqptrlist.h> +#include <tqmutex.h> #include "kis_thread.h" @@ -54,14 +54,14 @@ private: KisThreadPool(const KisThreadPool&); KisThreadPool operator=(const KisThreadPool&); - QMutex m_poolMutex; + TQMutex m_poolMutex; int m_numberOfRunningThreads; int m_numberOfQueuedThreads; int m_maxThreads; int m_wait; - QPtrList<KisThread> m_threads; - QPtrList<KisThread> m_runningThreads; - QPtrList<KisThread> m_oldThreads; + TQPtrList<KisThread> m_threads; + TQPtrList<KisThread> m_runningThreads; + TQPtrList<KisThread> m_oldThreads; static KisThreadPool * m_singleton; }; diff --git a/krita/core/kis_transaction.cc b/krita/core/kis_transaction.cc index 10df1a8e..b755c597 100644 --- a/krita/core/kis_transaction.cc +++ b/krita/core/kis_transaction.cc @@ -27,13 +27,13 @@ class KisTransactionPrivate { public: - QString m_name; + TQString m_name; KisPaintDeviceSP m_device; KisMementoSP m_memento; }; -KisTransaction::KisTransaction(const QString& name, KisPaintDeviceSP device) +KisTransaction::KisTransaction(const TQString& name, KisPaintDeviceSP device) { m_private = new KisTransactionPrivate; @@ -57,12 +57,12 @@ void KisTransaction::execute() m_private->m_device->rollforward(m_private->m_memento); - QRect rc; - Q_INT32 x, y, width, height; + TQRect rc; + TQ_INT32 x, y, width, height; m_private->m_memento->extent(x,y,width,height); rc.setRect(x + m_private->m_device->getX(), y + m_private->m_device->getY(), width, height); - KisLayerSP l = m_private->m_device->parentLayer(); + KisLayerSP l = m_private->m_device->tqparentLayer(); if (l) l->setDirty(rc); } @@ -71,12 +71,12 @@ void KisTransaction::unexecute() Q_ASSERT(m_private->m_memento != 0); m_private->m_device->rollback(m_private->m_memento); - QRect rc; - Q_INT32 x, y, width, height; + TQRect rc; + TQ_INT32 x, y, width, height; m_private->m_memento->extent(x,y,width,height); rc.setRect(x + m_private->m_device->getX(), y + m_private->m_device->getY(), width, height); - KisLayerSP l = m_private->m_device->parentLayer(); + KisLayerSP l = m_private->m_device->tqparentLayer(); if (l) l->setDirty(rc); } @@ -88,7 +88,7 @@ void KisTransaction::unexecuteNoUpdate() m_private->m_device->rollback(m_private->m_memento); } -QString KisTransaction::name() const +TQString KisTransaction::name() const { return m_private->m_name; } diff --git a/krita/core/kis_transaction.h b/krita/core/kis_transaction.h index 0865c59b..521b0204 100644 --- a/krita/core/kis_transaction.h +++ b/krita/core/kis_transaction.h @@ -19,25 +19,25 @@ #ifndef KIS_TILE_COMMAND_H_ #define KIS_TILE_COMMAND_H_ -#include <qstring.h> +#include <tqstring.h> #include <kcommand.h> #include "kis_types.h" -class QRect; +class TQRect; class KisTransactionPrivate; class KisTransaction : public KCommand { public: - KisTransaction(const QString& name, KisPaintDeviceSP device); + KisTransaction(const TQString& name, KisPaintDeviceSP device); virtual ~KisTransaction(); public: virtual void execute(); virtual void unexecute(); virtual void unexecuteNoUpdate(); - virtual QString name() const; + virtual TQString name() const; private: KisTransactionPrivate * m_private; }; diff --git a/krita/core/kis_transform_visitor.h b/krita/core/kis_transform_visitor.h index 62f6b3e4..9e6f51c0 100644 --- a/krita/core/kis_transform_visitor.h +++ b/krita/core/kis_transform_visitor.h @@ -18,7 +18,7 @@ #ifndef KIS_TRANSFORM_VISITOR_H_ #define KIS_TRANSFORM_VISITOR_H_ -#include "qrect.h" +#include "tqrect.h" #include "klocale.h" @@ -41,7 +41,7 @@ public: KisTransformVisitor(KisImageSP img, double xscale, double yscale, double /*xshear*/, double /*yshear*/, double angle, - Q_INT32 tx, Q_INT32 ty, KisProgressDisplayInterface *progress, KisFilterStrategy *filter) + TQ_INT32 tx, TQ_INT32 ty, KisProgressDisplayInterface *progress, KisFilterStrategy *filter) : KisLayerVisitor() , m_sx(xscale) , m_sy(yscale) @@ -126,7 +126,7 @@ public: private: double m_sx, m_sy; - Q_INT32 m_tx, m_ty; + TQ_INT32 m_tx, m_ty; KisFilterStrategy *m_filter; double m_angle; KisProgressDisplayInterface *m_progress; diff --git a/krita/core/kis_transform_worker.cc b/krita/core/kis_transform_worker.cc index bc4dc609..fbc952ea 100644 --- a/krita/core/kis_transform_worker.cc +++ b/krita/core/kis_transform_worker.cc @@ -32,7 +32,7 @@ KisTransformWorker::KisTransformWorker(KisPaintDeviceSP dev, double xscale, double yscale, double xshear, double yshear, double rotation, - Q_INT32 xtranslate, Q_INT32 ytranslate, + TQ_INT32 xtranslate, TQ_INT32 ytranslate, KisProgressDisplayInterface *progress, KisFilterStrategy *filter, bool fixBorderAlpha) { m_dev= dev; @@ -51,8 +51,8 @@ KisTransformWorker::KisTransformWorker(KisPaintDeviceSP dev, double xscale, doub void KisTransformWorker::rotateNone(KisPaintDeviceSP src, KisPaintDeviceSP dst) { KisSelectionSP dstSelection; - Q_INT32 pixelSize = src->pixelSize(); - QRect r; + TQ_INT32 pixelSize = src->pixelSize(); + TQRect r; KisColorSpace *cs = src->colorSpace(); if(src->hasSelection()) @@ -69,7 +69,7 @@ void KisTransformWorker::rotateNone(KisPaintDeviceSP src, KisPaintDeviceSP dst) KisHLineIteratorPixel hit = src->createHLineIterator(r.x(), r.top(), r.width(), true); KisHLineIterator vit = dst->createHLineIterator(r.x(), r.top(), r.width(), true); KisHLineIterator dstSelIt = dstSelection->createHLineIterator(r.x(), r.top(), r.width(), true); - for (Q_INT32 i = 0; i < r.height(); ++i) { + for (TQ_INT32 i = 0; i < r.height(); ++i) { while (!hit.isDone()) { if (hit.isSelected()) { memcpy(vit.rawData(), hit.rawData(), pixelSize); @@ -102,8 +102,8 @@ void KisTransformWorker::rotateNone(KisPaintDeviceSP src, KisPaintDeviceSP dst) void KisTransformWorker::rotateRight90(KisPaintDeviceSP src, KisPaintDeviceSP dst) { KisSelectionSP dstSelection; - Q_INT32 pixelSize = src->pixelSize(); - QRect r; + TQ_INT32 pixelSize = src->pixelSize(); + TQRect r; KisColorSpace *cs = src->colorSpace(); if(src->hasSelection()) @@ -117,7 +117,7 @@ void KisTransformWorker::rotateRight90(KisPaintDeviceSP src, KisPaintDeviceSP ds dstSelection = new KisSelection(dst); // essentially a dummy to be deleted } - for (Q_INT32 y = r.bottom(); y >= r.top(); --y) { + for (TQ_INT32 y = r.bottom(); y >= r.top(); --y) { KisHLineIteratorPixel hit = src->createHLineIterator(r.x(), y, r.width(), true); KisVLineIterator vit = dst->createVLineIterator(-y, r.x(), r.width(), true); KisVLineIterator dstSelIt = dstSelection->createVLineIterator(-y, r.x(), r.width(), true); @@ -152,8 +152,8 @@ void KisTransformWorker::rotateLeft90(KisPaintDeviceSP src, KisPaintDeviceSP dst { kdDebug() << "rotateLeft90 called\n"; KisSelectionSP dstSelection; - Q_INT32 pixelSize = src->pixelSize(); - QRect r; + TQ_INT32 pixelSize = src->pixelSize(); + TQRect r; KisColorSpace *cs = src->colorSpace(); if(src->hasSelection()) @@ -166,9 +166,9 @@ void KisTransformWorker::rotateLeft90(KisPaintDeviceSP src, KisPaintDeviceSP dst r = src->exactBounds(); dstSelection = new KisSelection(dst); // essentially a dummy to be deleted } - Q_INT32 x = 0; + TQ_INT32 x = 0; - for (Q_INT32 y = r.top(); y <= r.bottom(); ++y) { + for (TQ_INT32 y = r.top(); y <= r.bottom(); ++y) { // Read the horizontal line from back to front, write onto the vertical column KisHLineIteratorPixel hit = src->createHLineIterator(r.x(), y, r.width(), true); KisVLineIterator vit = dst->createVLineIterator(y, -r.x() - r.width(), r.width(), true); @@ -206,8 +206,8 @@ void KisTransformWorker::rotate180(KisPaintDeviceSP src, KisPaintDeviceSP dst) { kdDebug() << "Rotating 180\n"; KisSelectionSP dstSelection; - Q_INT32 pixelSize = src->pixelSize(); - QRect r; + TQ_INT32 pixelSize = src->pixelSize(); + TQRect r; KisColorSpace *cs = src->colorSpace(); if(src->hasSelection()) @@ -221,7 +221,7 @@ void KisTransformWorker::rotate180(KisPaintDeviceSP src, KisPaintDeviceSP dst) dstSelection = new KisSelection(dst); // essentially a dummy to be deleted } - for (Q_INT32 y = r.top(); y <= r.bottom(); ++y) { + for (TQ_INT32 y = r.top(); y <= r.bottom(); ++y) { KisHLineIteratorPixel srcIt = src->createHLineIterator(r.x(), y, r.width(), true); KisHLineIterator dstIt = dst->createHLineIterator(-r.x() - r.width(), -y, r.width(), true); KisHLineIterator dstSelIt = dstSelection->createHLineIterator(-r.x() - r.width(), -y, r.width(), true); @@ -253,28 +253,28 @@ void KisTransformWorker::rotate180(KisPaintDeviceSP src, KisPaintDeviceSP dst) } } -template <class iter> iter createIterator(KisPaintDevice *dev, Q_INT32 start, Q_INT32 lineNum, Q_INT32 len); +template <class iter> iter createIterator(KisPaintDevice *dev, TQ_INT32 start, TQ_INT32 lineNum, TQ_INT32 len); template <> KisHLineIteratorPixel createIterator <KisHLineIteratorPixel> -(KisPaintDevice *dev, Q_INT32 start, Q_INT32 lineNum, Q_INT32 len) +(KisPaintDevice *dev, TQ_INT32 start, TQ_INT32 lineNum, TQ_INT32 len) { return dev->createHLineIterator(start, lineNum, len, true); } template <> KisVLineIteratorPixel createIterator <KisVLineIteratorPixel> -(KisPaintDevice *dev, Q_INT32 start, Q_INT32 lineNum, Q_INT32 len) +(KisPaintDevice *dev, TQ_INT32 start, TQ_INT32 lineNum, TQ_INT32 len) { return dev->createVLineIterator(lineNum, start, len, true); } -template <class iter> void calcDimensions (KisPaintDevice *dev, Q_INT32 &srcStart, Q_INT32 &srcLen, Q_INT32 &firstLine, Q_INT32 &numLines); +template <class iter> void calcDimensions (KisPaintDevice *dev, TQ_INT32 &srcStart, TQ_INT32 &srcLen, TQ_INT32 &firstLine, TQ_INT32 &numLines); template <> void calcDimensions <KisHLineIteratorPixel> -(KisPaintDevice *dev, Q_INT32 &srcStart, Q_INT32 &srcLen, Q_INT32 &firstLine, Q_INT32 &numLines) +(KisPaintDevice *dev, TQ_INT32 &srcStart, TQ_INT32 &srcLen, TQ_INT32 &firstLine, TQ_INT32 &numLines) { if(dev->hasSelection()) { - QRect r = dev->selection()->selectedExactRect(); + TQRect r = dev->selection()->selectedExactRect(); r.rect(&srcStart, &firstLine, &srcLen, &numLines); } else @@ -282,11 +282,11 @@ template <> void calcDimensions <KisHLineIteratorPixel> } template <> void calcDimensions <KisVLineIteratorPixel> -(KisPaintDevice *dev, Q_INT32 &srcStart, Q_INT32 &srcLen, Q_INT32 &firstLine, Q_INT32 &numLines) +(KisPaintDevice *dev, TQ_INT32 &srcStart, TQ_INT32 &srcLen, TQ_INT32 &firstLine, TQ_INT32 &numLines) { if(dev->hasSelection()) { - QRect r = dev->selection()->selectedExactRect(); + TQRect r = dev->selection()->selectedExactRect(); r.rect(&firstLine, &srcStart, &numLines, &srcLen); } else @@ -295,22 +295,22 @@ template <> void calcDimensions <KisVLineIteratorPixel> struct FilterValues { - Q_UINT8 numWeights; - Q_UINT8 *weight; + TQ_UINT8 numWeights; + TQ_UINT8 *weight; ~FilterValues() {delete [] weight;} }; -template <class T> void KisTransformWorker::transformPass(KisPaintDevice *src, KisPaintDevice *dst, double floatscale, double shear, Q_INT32 dx, KisFilterStrategy *filterStrategy, bool fixBorderAlpha) +template <class T> void KisTransformWorker::transformPass(KisPaintDevice *src, KisPaintDevice *dst, double floatscale, double shear, TQ_INT32 dx, KisFilterStrategy *filterStrategy, bool fixBorderAlpha) { - Q_INT32 lineNum,srcStart,firstLine,srcLen,numLines; - Q_INT32 center, begin, end; /* filter calculation variables */ - Q_UINT8 *data; - Q_UINT8 pixelSize = src->pixelSize(); + TQ_INT32 lineNum,srcStart,firstLine,srcLen,numLines; + TQ_INT32 center, begin, end; /* filter calculation variables */ + TQ_UINT8 *data; + TQ_UINT8 pixelSize = src->pixelSize(); KisSelectionSP dstSelection; KisColorSpace * cs = src->colorSpace(); - Q_INT32 scale; - Q_INT32 scaleDenom; - Q_INT32 shearFracOffset; + TQ_INT32 scale; + TQ_INT32 scaleDenom; + TQ_INT32 shearFracOffset; if(src->hasSelection()) dstSelection = dst->selection(); @@ -325,9 +325,9 @@ template <class T> void KisTransformWorker::transformPass(KisPaintDevice *src, K if(scaleDenom == 0) return; - Q_INT32 support = filterStrategy->intSupport(); - Q_INT32 dstLen, dstStart; - Q_INT32 invfscale = 256; + TQ_INT32 support = filterStrategy->intSupport(); + TQ_INT32 dstLen, dstStart; + TQ_INT32 invfscale = 256; // handle magnification/minification if(abs(scale) < scaleDenom) @@ -351,32 +351,32 @@ template <class T> void KisTransformWorker::transformPass(KisPaintDevice *src, K dstLen = scale; // Calculate extra length (in each side) needed due to shear - Q_INT32 extraLen = (support+256)>>8 + 1; + TQ_INT32 extraLen = (support+256)>>8 + 1; - Q_UINT8 *tmpLine = new Q_UINT8[(srcLen +2*extraLen)* pixelSize]; + TQ_UINT8 *tmpLine = new TQ_UINT8[(srcLen +2*extraLen)* pixelSize]; Q_CHECK_PTR(tmpLine); - Q_UINT8 *tmpSel = new Q_UINT8[srcLen+2*extraLen]; + TQ_UINT8 *tmpSel = new TQ_UINT8[srcLen+2*extraLen]; Q_CHECK_PTR(tmpSel); //allocate space for colors - const Q_UINT8 **colors = new const Q_UINT8 *[2*support+1]; + const TQ_UINT8 **colors = new const TQ_UINT8 *[2*support+1]; // Precalculate weights FilterValues *filterWeights = new FilterValues[256]; for(int center = 0; center<256; ++center) { - Q_INT32 begin = (255 + center - support)>>8; // takes ceiling by adding 255 - Q_INT32 span = ((center + support)>>8) - begin + 1; // takes floor to get end. Subtracts begin to get span - Q_INT32 t = (((begin<<8) - center) * invfscale)>>8; - Q_INT32 dt = invfscale; - filterWeights[center].weight = new Q_UINT8[span]; + TQ_INT32 begin = (255 + center - support)>>8; // takes ceiling by adding 255 + TQ_INT32 span = ((center + support)>>8) - begin + 1; // takes floor to get end. Subtracts begin to get span + TQ_INT32 t = (((begin<<8) - center) * invfscale)>>8; + TQ_INT32 dt = invfscale; + filterWeights[center].weight = new TQ_UINT8[span]; //printf("%d (",center); - Q_UINT32 sum=0; + TQ_UINT32 sum=0; for(int num = 0; num<span; ++num) { - Q_UINT32 tmpw = filterStrategy->intValueAt(t) * invfscale; + TQ_UINT32 tmpw = filterStrategy->intValueAt(t) * invfscale; tmpw >>=8; filterWeights[center].weight[num] = tmpw; @@ -426,10 +426,10 @@ template <class T> void KisTransformWorker::transformPass(KisPaintDevice *src, K // Build a temporary line T srcIt = createIterator <T>(src, srcStart - extraLen, lineNum, srcLen+2*extraLen); - Q_INT32 i = 0; + TQ_INT32 i = 0; while(!srcIt.isDone()) { - Q_UINT8 *data; + TQ_UINT8 *data; data = srcIt.rawData(); memcpy(&tmpLine[i*pixelSize], data, pixelSize); @@ -474,7 +474,7 @@ template <class T> void KisTransformWorker::transformPass(KisPaintDevice *src, K end = (center + support)>>8; // takes floor ////printf("sup=%d begin=%d end=%d",support,begin,end); - Q_UINT8 selectedness = tmpSel[center>>8]; + TQ_UINT8 selectedness = tmpSel[center>>8]; if(selectedness) { int num=0; @@ -524,7 +524,7 @@ bool KisTransformWorker::run() m_progress->setSubject(this, true, true); m_progressTotalSteps = 0; m_progressStep = 0; - QRect r; + TQRect r; if(m_dev->hasSelection()) r = m_dev->selection()->selectedExactRect(); else @@ -540,8 +540,8 @@ bool KisTransformWorker::run() double xshear = m_xshear; double yshear = m_yshear; double rotation = m_rotation; - Q_INT32 xtranslate = m_xtranslate; - Q_INT32 ytranslate = m_ytranslate; + TQ_INT32 xtranslate = m_xtranslate; + TQ_INT32 ytranslate = m_ytranslate; if(rotation < 0.0) rotation = -fmod(-rotation, 2*M_PI) + 2*M_PI; @@ -665,8 +665,8 @@ bool KisTransformWorker::run() rotateNone(tmpdev3, m_dev); } - if (m_dev->parentLayer()) { - m_dev->parentLayer()->setDirty(); + if (m_dev->tqparentLayer()) { + m_dev->tqparentLayer()->setDirty(); } //progress info emit notifyProgressDone(); diff --git a/krita/core/kis_transform_worker.h b/krita/core/kis_transform_worker.h index c357390e..a48b8589 100644 --- a/krita/core/kis_transform_worker.h +++ b/krita/core/kis_transform_worker.h @@ -35,7 +35,7 @@ class KisTransformWorker : public KisProgressSubject { public: KisTransformWorker(KisPaintDeviceSP dev, double xscale, double yscale, double xshear, double yshear, double rotation, - Q_INT32 xtranslate, Q_INT32 ytranslate, + TQ_INT32 xtranslate, TQ_INT32 ytranslate, KisProgressDisplayInterface *progress, KisFilterStrategy *filter, bool fixBorderAlpha=false); ~KisTransformWorker(); @@ -46,7 +46,7 @@ public: private: // XXX (BSAR): Why didn't we use the shared-pointer versions of the paint device classes? - template <class T> void transformPass(KisPaintDevice *src, KisPaintDevice *dst, double xscale, double shear, Q_INT32 dx, KisFilterStrategy *filterStrategy, bool fixBorderAlpha); + template <class T> void transformPass(KisPaintDevice *src, KisPaintDevice *dst, double xscale, double shear, TQ_INT32 dx, KisFilterStrategy *filterStrategy, bool fixBorderAlpha); public: void rotateNone(KisPaintDeviceSP src, KisPaintDeviceSP dst); @@ -58,16 +58,16 @@ private: KisPaintDeviceSP m_dev; double m_xscale, m_yscale; double m_xshear, m_yshear, m_rotation; - Q_INT32 m_xtranslate, m_ytranslate; + TQ_INT32 m_xtranslate, m_ytranslate; KisProgressDisplayInterface *m_progress; KisFilterStrategy *m_filter; // Implement KisProgressSubject bool m_cancelRequested; virtual void cancel() { m_cancelRequested = true; } - Q_INT32 m_progressTotalSteps; - Q_INT32 m_progressStep; - Q_INT32 m_progressScaler; - Q_INT32 m_lastProgressReport; + TQ_INT32 m_progressTotalSteps; + TQ_INT32 m_progressStep; + TQ_INT32 m_progressScaler; + TQ_INT32 m_lastProgressReport; bool m_fixBorderAlpha; }; diff --git a/krita/core/kis_types.h b/krita/core/kis_types.h index 94e066fc..9c668551 100644 --- a/krita/core/kis_types.h +++ b/krita/core/kis_types.h @@ -18,9 +18,9 @@ #ifndef KISTYPES_H_ #define KISTYPES_H_ -#include <qvaluevector.h> -#include <qmap.h> -#include <qpoint.h> +#include <tqvaluevector.h> +#include <tqmap.h> +#include <tqpoint.h> #include <ksharedptr.h> @@ -76,7 +76,7 @@ typedef KSharedPtr<KisHistogram> KisHistogramSP; class KisPaintOpFactory; typedef KSharedPtr<KisPaintOpFactory> KisPaintOpFactorySP; -typedef QValueVector<QPoint> vKisSegments; +typedef TQValueVector<TQPoint> vKisSegments; //class KisGuide; //typedef KSharedPtr<KisGuide> KisGuideSP; diff --git a/krita/core/kis_vec.h b/krita/core/kis_vec.h index 1706dd4e..08b9c541 100644 --- a/krita/core/kis_vec.h +++ b/krita/core/kis_vec.h @@ -23,7 +23,7 @@ #include <math.h> #include <cfloat> -#include <qpoint.h> +#include <tqpoint.h> #include "kis_point.h" /* @@ -36,7 +36,7 @@ class KisVector2D public: KisVector2D(); KisVector2D(double x, double y); - KisVector2D(const QPoint& p); + KisVector2D(const TQPoint& p); KisVector2D(const KisPoint& p); bool isNull() const; @@ -88,7 +88,7 @@ inline KisVector2D::KisVector2D() inline KisVector2D::KisVector2D(double x, double y) { m_x=x; m_y=y; } -inline KisVector2D::KisVector2D(const QPoint& p) +inline KisVector2D::KisVector2D(const TQPoint& p) { m_x=p.x(); m_y=p.y(); } diff --git a/krita/core/tests/kis_filter_configuration_tester.cc b/krita/core/tests/kis_filter_configuration_tester.cc index 10497692..6a4a2631 100644 --- a/krita/core/tests/kis_filter_configuration_tester.cc +++ b/krita/core/tests/kis_filter_configuration_tester.cc @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qapplication.h> +#include <tqapplication.h> #include <kdebug.h> #include <kunittest/runner.h> @@ -42,7 +42,7 @@ void KisFilterConfigurationTester::testCreation() KisFilterConfiguration * kfc = new KisFilterConfiguration("test", 1); if ( kfc == 0 ) failure("Could not create test filter configuration"); CHECK(kfc->version(), 1); - CHECK(kfc->name(), QString("test")); + CHECK(kfc->name(), TQString("test")); delete kfc; success("testCreation success"); @@ -52,12 +52,12 @@ void KisFilterConfigurationTester::testRoundTrip() { KisFilterConfiguration * kfc = new KisFilterConfiguration("test", 1); CHECK(kfc->version(), 1); - CHECK(kfc->name(), QString("test")); - QString s = kfc->toString(); + CHECK(kfc->name(), TQString("test")); + TQString s = kfc->toString(); delete kfc; kfc = new KisFilterConfiguration(s); CHECK(kfc->version(), 1); - CHECK(kfc->name(), QString("test")); + CHECK(kfc->name(), TQString("test")); delete kfc; success("testDeserializaton success"); } diff --git a/krita/core/tests/kis_image_tester.cpp b/krita/core/tests/kis_image_tester.cpp index ee180787..f660f394 100644 --- a/krita/core/tests/kis_image_tester.cpp +++ b/krita/core/tests/kis_image_tester.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qapplication.h> +#include <tqapplication.h> #include <kunittest/runner.h> #include <kunittest/module.h> @@ -51,20 +51,20 @@ void KisImageTester::mergeTests() KisColor mergedPixel = image->mergedPixel(0, 0); - QColor colour; - Q_UINT8 opacity; + TQColor colour; + TQ_UINT8 opacity; - mergedPixel.toQColor(&colour, &opacity); + mergedPixel.toTQColor(&colour, &opacity); CHECK(opacity, OPACITY_TRANSPARENT); KisPaintLayer * layer = new KisPaintLayer(image, "layer 1", OPACITY_OPAQUE); image->addLayer(layer, image->rootLayer(), 0); - layer->paintDevice()->setPixel(0, 0, QColor(255, 128, 64), OPACITY_OPAQUE); + layer->paintDevice()->setPixel(0, 0, TQColor(255, 128, 64), OPACITY_OPAQUE); mergedPixel = image->mergedPixel(0, 0); - mergedPixel.toQColor(&colour, &opacity); + mergedPixel.toTQColor(&colour, &opacity); CHECK(opacity, OPACITY_OPAQUE); CHECK(colour.red(), 255); @@ -74,10 +74,10 @@ void KisImageTester::mergeTests() KisPaintLayer * layer2 = new KisPaintLayer(image, "layer 2", OPACITY_OPAQUE / 2); image->addLayer(layer2, image->rootLayer(), layer); - layer2->paintDevice()->setPixel(0, 0, QColor(255, 255, 255), OPACITY_OPAQUE); + layer2->paintDevice()->setPixel(0, 0, TQColor(255, 255, 255), OPACITY_OPAQUE); mergedPixel = image->mergedPixel(0, 0); - mergedPixel.toQColor(&colour, &opacity); + mergedPixel.toTQColor(&colour, &opacity); CHECK(opacity, OPACITY_OPAQUE); CHECK(colour.red(), 255); diff --git a/krita/core/tiles/kis_memento.cc b/krita/core/tiles/kis_memento.cc index ea6ed722..aaec3724 100644 --- a/krita/core/tiles/kis_memento.cc +++ b/krita/core/tiles/kis_memento.cc @@ -20,7 +20,7 @@ #include "kis_tile.h" #include "kis_tile_global.h" -KisMemento::KisMemento(Q_UINT32 pixelSize) : KShared() +KisMemento::KisMemento(TQ_UINT32 pixelSize) : KShared() { m_hashTable = new KisTile * [1024]; Q_CHECK_PTR(m_hashTable); @@ -34,8 +34,8 @@ KisMemento::KisMemento(Q_UINT32 pixelSize) : KShared() m_redoHashTable [i] = 0; } m_numTiles = 0; - m_defPixel = new Q_UINT8[pixelSize]; - m_redoDefPixel = new Q_UINT8[pixelSize]; + m_defPixel = new TQ_UINT8[pixelSize]; + m_redoDefPixel = new TQ_UINT8[pixelSize]; m_valid = true; } @@ -87,12 +87,12 @@ void KisMemento::deleteAll(KisTile *tile) } } -void KisMemento::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const +void KisMemento::extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const { - Q_INT32 maxX = Q_INT32_MIN; - Q_INT32 maxY = Q_INT32_MIN; - x = Q_INT32_MAX; - y = Q_INT32_MAX; + TQ_INT32 maxX = TQ_INT32_MIN; + TQ_INT32 maxY = TQ_INT32_MIN; + x = TQ_INT32_MAX; + y = TQ_INT32_MAX; for(int i = 0; i < 1024; i++) { @@ -124,19 +124,19 @@ void KisMemento::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const h = maxY - y +1; } -QRect KisMemento::extent() const +TQRect KisMemento::extent() const { - Q_INT32 x; - Q_INT32 y; - Q_INT32 w; - Q_INT32 h; + TQ_INT32 x; + TQ_INT32 y; + TQ_INT32 w; + TQ_INT32 h; extent(x, y, w, h); - return QRect(x, y, w, h); + return TQRect(x, y, w, h); } -bool KisMemento::containsTile(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash) const +bool KisMemento::containsTile(TQ_INT32 col, TQ_INT32 row, TQ_UINT32 tileHash) const { const KisTile *tile = m_hashTable[tileHash]; diff --git a/krita/core/tiles/kis_memento.h b/krita/core/tiles/kis_memento.h index 696f8129..5942dc44 100644 --- a/krita/core/tiles/kis_memento.h +++ b/krita/core/tiles/kis_memento.h @@ -19,8 +19,8 @@ #ifndef KIS_MEMENTO_H_ #define KIS_MEMENTO_H_ -#include <qglobal.h> -#include <qrect.h> +#include <tqglobal.h> +#include <tqrect.h> #include <ksharedptr.h> @@ -33,7 +33,7 @@ typedef KSharedPtr<KisMemento> KisMementoSP; class KisMemento : public KShared { public: - KisMemento(Q_UINT32 pixelSize); + KisMemento(TQ_UINT32 pixelSize); ~KisMemento(); /* // For consolidating transactions @@ -42,10 +42,10 @@ public: virtual KisTransaction &operator+(const KisTransaction &, const KisTransaction &) = 0; */ - void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const; - QRect extent() const; + void extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const; + TQRect extent() const; - bool containsTile(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash) const; + bool containsTile(TQ_INT32 col, TQ_INT32 row, TQ_UINT32 tileHash) const; // For debugging use bool valid() const { return m_valid; } @@ -55,20 +55,20 @@ private: class DeletedTile { public: - DeletedTile(Q_INT32 col, Q_INT32 row, const DeletedTile *next) + DeletedTile(TQ_INT32 col, TQ_INT32 row, const DeletedTile *next) : m_col(col), m_row(row), m_next(next) { } - Q_INT32 col() const { return m_col; } - Q_INT32 row() const { return m_row; } + TQ_INT32 col() const { return m_col; } + TQ_INT32 row() const { return m_row; } const DeletedTile *next() const { return m_next; } private: - Q_INT32 m_col; - Q_INT32 m_row; + TQ_INT32 m_col; + TQ_INT32 m_row; const DeletedTile *m_next; }; @@ -81,7 +81,7 @@ private: ~DeletedTileList(); - void addTile(Q_INT32 col, Q_INT32 row) + void addTile(TQ_INT32 col, TQ_INT32 row) { DeletedTile *d = new DeletedTile(col, row, m_firstDeletedTile); Q_CHECK_PTR(d); @@ -100,7 +100,7 @@ private: DeletedTile *m_firstDeletedTile; }; - void addTileToDeleteOnRedo(Q_INT32 col, Q_INT32 row) + void addTileToDeleteOnRedo(TQ_INT32 col, TQ_INT32 row) { m_redoDelTilesList.addTile(col, row); } @@ -115,7 +115,7 @@ private: m_redoDelTilesList.clear(); } - void addTileToDeleteOnUndo(Q_INT32 col, Q_INT32 row) + void addTileToDeleteOnUndo(TQ_INT32 col, TQ_INT32 row) { m_undoDelTilesList.addTile(col, row); } @@ -133,12 +133,12 @@ private: friend class KisTiledDataManager; KisTiledDataManager *originator; KisTile **m_hashTable; - Q_UINT32 m_numTiles; + TQ_UINT32 m_numTiles; KisTile **m_redoHashTable; DeletedTileList m_redoDelTilesList; DeletedTileList m_undoDelTilesList; - Q_UINT8 *m_defPixel; - Q_UINT8 *m_redoDefPixel; + TQ_UINT8 *m_defPixel; + TQ_UINT8 *m_redoDefPixel; void deleteAll(KisTile *tile); bool m_valid; diff --git a/krita/core/tiles/kis_tile.cc b/krita/core/tiles/kis_tile.cc index 49d20cf6..86d55128 100644 --- a/krita/core/tiles/kis_tile.cc +++ b/krita/core/tiles/kis_tile.cc @@ -23,11 +23,11 @@ #include "kis_tileddatamanager.h" #include "kis_tilemanager.h" -const Q_INT32 KisTile::WIDTH = 64; -const Q_INT32 KisTile::HEIGHT = 64; +const TQ_INT32 KisTile::WIDTH = 64; +const TQ_INT32 KisTile::HEIGHT = 64; -KisTile::KisTile(Q_INT32 pixelSize, Q_INT32 col, Q_INT32 row, const Q_UINT8 *defPixel) +KisTile::KisTile(TQ_INT32 pixelSize, TQ_INT32 col, TQ_INT32 row, const TQ_UINT8 *defPixel) { m_pixelSize = pixelSize; m_data = 0; @@ -43,7 +43,7 @@ KisTile::KisTile(Q_INT32 pixelSize, Q_INT32 col, Q_INT32 row, const Q_UINT8 *def setData(defPixel); } -KisTile::KisTile(const KisTile& rhs, Q_INT32 col, Q_INT32 row) +KisTile::KisTile(const KisTile& rhs, TQ_INT32 col, TQ_INT32 row) { if (this != &rhs) { m_pixelSize = rhs.m_pixelSize; @@ -55,7 +55,7 @@ KisTile::KisTile(const KisTile& rhs, Q_INT32 col, Q_INT32 row) // Assure we have data to copy rhs.addReader(); - memcpy(m_data, rhs.m_data, WIDTH * HEIGHT * m_pixelSize * sizeof(Q_UINT8)); + memcpy(m_data, rhs.m_data, WIDTH * HEIGHT * m_pixelSize * sizeof(TQ_UINT8)); rhs.removeReader(); m_col = col; @@ -78,7 +78,7 @@ KisTile::KisTile(const KisTile& rhs) allocate(); rhs.addReader(); - memcpy(m_data, rhs.m_data, WIDTH * HEIGHT * m_pixelSize * sizeof(Q_UINT8)); + memcpy(m_data, rhs.m_data, WIDTH * HEIGHT * m_pixelSize * sizeof(TQ_UINT8)); rhs.removeReader(); KisTileManager::instance()->registerTile(this); @@ -111,7 +111,7 @@ void KisTile::setNext(KisTile *n) m_nextTile = n; } -Q_UINT8 *KisTile::data(Q_INT32 x, Q_INT32 y ) const +TQ_UINT8 *KisTile::data(TQ_INT32 x, TQ_INT32 y ) const { addReader(); removeReader(); @@ -122,10 +122,10 @@ Q_UINT8 *KisTile::data(Q_INT32 x, Q_INT32 y ) const return m_data + m_pixelSize * ( y * WIDTH + x ); } -void KisTile::setData(const Q_UINT8 *pixel) +void KisTile::setData(const TQ_UINT8 *pixel) { addReader(); - Q_UINT8 *dst = m_data; + TQ_UINT8 *dst = m_data; for(int i=0; i <WIDTH * HEIGHT;i++) { memcpy(dst, pixel, m_pixelSize); diff --git a/krita/core/tiles/kis_tile.h b/krita/core/tiles/kis_tile.h index d80b6e2c..f2d6f1e9 100644 --- a/krita/core/tiles/kis_tile.h +++ b/krita/core/tiles/kis_tile.h @@ -18,21 +18,21 @@ #ifndef KIS_TILE_H_ #define KIS_TILE_H_ -#include <qglobal.h> -#include <qrect.h> +#include <tqglobal.h> +#include <tqrect.h> class KisTiledDataManager; class KisTiledIterator; /** - * Provides abstraction to a tile. A tile contains + * Provides abstraction to a tile. A tile tqcontains * a part of a PaintDevice, but only the individual pixels * are accesable and that only via iterators. */ class KisTile { public: - KisTile(Q_INT32 pixelSize, Q_INT32 col, Q_INT32 row, const Q_UINT8 *defPixel); - KisTile(const KisTile& rhs, Q_INT32 col, Q_INT32 row); + KisTile(TQ_INT32 pixelSize, TQ_INT32 col, TQ_INT32 row, const TQ_UINT8 *defPixel); + KisTile(const KisTile& rhs, TQ_INT32 col, TQ_INT32 row); KisTile(const KisTile& rhs); ~KisTile(); @@ -40,18 +40,18 @@ public: void release(); void allocate(); - Q_UINT8 *data(Q_INT32 xoff, Q_INT32 yoff) const; - Q_UINT8 *data() const { return m_data; } + TQ_UINT8 *data(TQ_INT32 xoff, TQ_INT32 yoff) const; + TQ_UINT8 *data() const { return m_data; } - void setData(const Q_UINT8 *pixel); + void setData(const TQ_UINT8 *pixel); - Q_INT32 refCount() const; + TQ_INT32 refCount() const; void ref(); - Q_INT32 getRow() const { return m_row; } - Q_INT32 getCol() const { return m_col; } + TQ_INT32 getRow() const { return m_row; } + TQ_INT32 getCol() const { return m_col; } - QRect extent() const { return QRect(m_col * WIDTH, m_row * HEIGHT, WIDTH, HEIGHT); } + TQRect extent() const { return TQRect(m_col * WIDTH, m_row * HEIGHT, WIDTH, HEIGHT); } void setNext(KisTile *); KisTile *getNext() const { return m_nextTile; } @@ -61,7 +61,7 @@ public: // access to a tile in a const enviroment (like copyconstructor and so)! void addReader() const; void removeReader() const; - Q_INT32 readers() { return m_nReadlock; } + TQ_INT32 readers() { return m_nReadlock; } friend class KisTiledIterator; friend class KisTiledDataManager; @@ -71,16 +71,16 @@ private: KisTile& operator=(const KisTile&); private: - Q_UINT8 *m_data; - mutable Q_INT32 m_nReadlock; - Q_INT32 m_row; - Q_INT32 m_col; - Q_INT32 m_pixelSize; + TQ_UINT8 *m_data; + mutable TQ_INT32 m_nReadlock; + TQ_INT32 m_row; + TQ_INT32 m_col; + TQ_INT32 m_pixelSize; KisTile *m_nextTile; public: - static const Q_INT32 WIDTH; - static const Q_INT32 HEIGHT; + static const TQ_INT32 WIDTH; + static const TQ_INT32 HEIGHT; }; #endif // KIS_TILE_H_ diff --git a/krita/core/tiles/kis_tiled_random_accessor.cc b/krita/core/tiles/kis_tiled_random_accessor.cc index 52ec8634..159faf18 100644 --- a/krita/core/tiles/kis_tiled_random_accessor.cc +++ b/krita/core/tiles/kis_tiled_random_accessor.cc @@ -18,9 +18,9 @@ #include "kis_tiled_random_accessor.h" -const Q_UINT32 KisTiledRandomAccessor::CACHESIZE = 4; // Define the number of tiles we keep in cache +const TQ_UINT32 KisTiledRandomAccessor::CACHESIZE = 4; // Define the number of tiles we keep in cache -KisTiledRandomAccessor::KisTiledRandomAccessor(KisTiledDataManager *ktm, Q_INT32 x, Q_INT32 y, bool writable) : m_ktm(ktm), m_tilesCache(new KisTileInfo*[4]), m_tilesCacheSize(0), m_pixelSize (m_ktm->pixelSize()), m_writable(writable) +KisTiledRandomAccessor::KisTiledRandomAccessor(KisTiledDataManager *ktm, TQ_INT32 x, TQ_INT32 y, bool writable) : m_ktm(ktm), m_tilesCache(new KisTileInfo*[4]), m_tilesCacheSize(0), m_pixelSize (m_ktm->pixelSize()), m_writable(writable) { Q_ASSERT(ktm != 0); moveTo(x, y); @@ -37,7 +37,7 @@ KisTiledRandomAccessor::~KisTiledRandomAccessor() delete m_tilesCache; } -void KisTiledRandomAccessor::moveTo(Q_INT32 x, Q_INT32 y) +void KisTiledRandomAccessor::moveTo(TQ_INT32 x, TQ_INT32 y) { // Look in the cache if the tile if the data is available for( uint i = 0; i < m_tilesCacheSize; i++) @@ -46,7 +46,7 @@ void KisTiledRandomAccessor::moveTo(Q_INT32 x, Q_INT32 y) y >= m_tilesCache[i]->area_y1 && y <= m_tilesCache[i]->area_y2 ) { KisTileInfo* kti = m_tilesCache[i]; - Q_UINT32 offset = x - kti->area_x1 + (y -kti->area_y1) * KisTile::WIDTH; + TQ_UINT32 offset = x - kti->area_x1 + (y -kti->area_y1) * KisTile::WIDTH; offset *= m_pixelSize; m_data = kti->data + offset; m_oldData = kti->oldData + offset; @@ -67,10 +67,10 @@ void KisTiledRandomAccessor::moveTo(Q_INT32 x, Q_INT32 y) } else { m_tilesCacheSize++; } - Q_UINT32 col = xToCol( x ); - Q_UINT32 row = yToRow( y ); + TQ_UINT32 col = xToCol( x ); + TQ_UINT32 row = yToRow( y ); KisTileInfo* kti = fetchTileData(col, row); - Q_UINT32 offset = x - kti->area_x1 + (y - kti->area_y1) * KisTile::WIDTH; + TQ_UINT32 offset = x - kti->area_x1 + (y - kti->area_y1) * KisTile::WIDTH; offset *= m_pixelSize; m_data = kti->data + offset; m_oldData = kti->oldData + offset; @@ -79,13 +79,13 @@ void KisTiledRandomAccessor::moveTo(Q_INT32 x, Q_INT32 y) } -Q_UINT8 * KisTiledRandomAccessor::rawData() const +TQ_UINT8 * KisTiledRandomAccessor::rawData() const { return m_data; } -const Q_UINT8 * KisTiledRandomAccessor::oldRawData() const +const TQ_UINT8 * KisTiledRandomAccessor::oldRawData() const { #ifdef DEBUG kdWarning(!m_ktm->hasCurrentMemento(), DBG_AREA_TILES) << "Accessing oldRawData() when no transaction is in progress.\n"; @@ -93,7 +93,7 @@ const Q_UINT8 * KisTiledRandomAccessor::oldRawData() const return m_oldData; } -KisTiledRandomAccessor::KisTileInfo* KisTiledRandomAccessor::fetchTileData(Q_INT32 col, Q_INT32 row) +KisTiledRandomAccessor::KisTileInfo* KisTiledRandomAccessor::fetchTileData(TQ_INT32 col, TQ_INT32 row) { KisTileInfo* kti = new KisTileInfo; kti->tile = m_ktm->getTile(col, row, m_writable); diff --git a/krita/core/tiles/kis_tiled_random_accessor.h b/krita/core/tiles/kis_tiled_random_accessor.h index 7766f75c..23768ee6 100644 --- a/krita/core/tiles/kis_tiled_random_accessor.h +++ b/krita/core/tiles/kis_tiled_random_accessor.h @@ -18,8 +18,8 @@ #ifndef KIS_TILED_RANDOM_ACCESSOR_H #define KIS_TILED_RANDOM_ACCESSOR_H -#include <qrect.h> -#include <qvaluelist.h> +#include <tqrect.h> +#include <tqvaluelist.h> #include <ksharedptr.h> @@ -31,35 +31,35 @@ class KisTiledRandomAccessor : public KShared { struct KisTileInfo { KisTile* tile; KisTile* oldtile; - Q_UINT8* data; - const Q_UINT8* oldData; - Q_INT32 area_x1, area_y1, area_x2, area_y2; + TQ_UINT8* data; + const TQ_UINT8* oldData; + TQ_INT32 area_x1, area_y1, area_x2, area_y2; }; public: - KisTiledRandomAccessor(KisTiledDataManager *ktm, Q_INT32 x, Q_INT32 y, bool writable); + KisTiledRandomAccessor(KisTiledDataManager *ktm, TQ_INT32 x, TQ_INT32 y, bool writable); ~KisTiledRandomAccessor(); private: - inline Q_UINT32 xToCol(Q_UINT32 x) const { if (m_ktm) return m_ktm->xToCol(x); else return 0; }; - inline Q_UINT32 yToRow(Q_UINT32 y) const { if (m_ktm) return m_ktm->yToRow(y); else return 0; }; - KisTileInfo* fetchTileData(Q_INT32 col, Q_INT32 row); + inline TQ_UINT32 xToCol(TQ_UINT32 x) const { if (m_ktm) return m_ktm->xToCol(x); else return 0; }; + inline TQ_UINT32 yToRow(TQ_UINT32 y) const { if (m_ktm) return m_ktm->yToRow(y); else return 0; }; + KisTileInfo* fetchTileData(TQ_INT32 col, TQ_INT32 row); public: /// Move to a given x,y position, fetch tiles and data - void moveTo(Q_INT32 x, Q_INT32 y); - Q_UINT8* rawData() const; - const Q_UINT8* oldRawData() const; + void moveTo(TQ_INT32 x, TQ_INT32 y); + TQ_UINT8* rawData() const; + const TQ_UINT8* oldRawData() const; private: KisTiledDataManager *m_ktm; KisTileInfo** m_tilesCache; - Q_UINT32 m_tilesCacheSize; - Q_INT32 m_pixelSize; - Q_UINT8* m_data; - const Q_UINT8* m_oldData; + TQ_UINT32 m_tilesCacheSize; + TQ_INT32 m_pixelSize; + TQ_UINT8* m_data; + const TQ_UINT8* m_oldData; bool m_writable; - static const Q_UINT32 CACHESIZE; // Define the number of tiles we keep in cache + static const TQ_UINT32 CACHESIZE; // Define the number of tiles we keep in cache }; diff --git a/krita/core/tiles/kis_tileddatamanager.cc b/krita/core/tiles/kis_tileddatamanager.cc index 4372e487..629b1b38 100644 --- a/krita/core/tiles/kis_tileddatamanager.cc +++ b/krita/core/tiles/kis_tileddatamanager.cc @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qvaluevector.h> +#include <tqvaluevector.h> #include <kdebug.h> @@ -36,11 +36,11 @@ * Even though the matrix has grown it may still not contain tiles at specific positions. They are created on demand */ -KisTiledDataManager::KisTiledDataManager(Q_UINT32 pixelSize, const Q_UINT8 *defPixel) +KisTiledDataManager::KisTiledDataManager(TQ_UINT32 pixelSize, const TQ_UINT8 *defPixel) { m_pixelSize = pixelSize; - m_defPixel = new Q_UINT8[m_pixelSize]; + m_defPixel = new TQ_UINT8[m_pixelSize]; Q_CHECK_PTR(m_defPixel); memcpy(m_defPixel, defPixel, m_pixelSize); @@ -54,10 +54,10 @@ KisTiledDataManager::KisTiledDataManager(Q_UINT32 pixelSize, const Q_UINT8 *defP m_hashTable [i] = 0; m_numTiles = 0; m_currentMemento = 0; - m_extentMinX = Q_INT32_MAX; - m_extentMinY = Q_INT32_MAX; - m_extentMaxX = Q_INT32_MIN; - m_extentMaxY = Q_INT32_MIN; + m_extentMinX = TQ_INT32_MAX; + m_extentMinY = TQ_INT32_MAX; + m_extentMaxX = TQ_INT32_MIN; + m_extentMaxY = TQ_INT32_MIN; } KisTiledDataManager::KisTiledDataManager(const KisTiledDataManager & dm) @@ -65,7 +65,7 @@ KisTiledDataManager::KisTiledDataManager(const KisTiledDataManager & dm) { m_pixelSize = dm.m_pixelSize; - m_defPixel = new Q_UINT8[m_pixelSize]; + m_defPixel = new TQ_UINT8[m_pixelSize]; Q_CHECK_PTR(m_defPixel); memcpy(m_defPixel, dm.m_defPixel, m_pixelSize); @@ -123,7 +123,7 @@ KisTiledDataManager::~KisTiledDataManager() delete [] m_defPixel; } -void KisTiledDataManager::setDefaultPixel(const Q_UINT8 *defPixel) +void KisTiledDataManager::setDefaultPixel(const TQ_UINT8 *defPixel) { if (defPixel == 0) return; @@ -170,9 +170,9 @@ bool KisTiledDataManager::read(KoStore *store) //Q_ASSERT(store != 0); char str[80]; - Q_INT32 x,y,w,h; + TQ_INT32 x,y,w,h; - QIODevice *stream = store->device(); + TQIODevice *stream = store->device(); if (stream == 0) return false; //Q_ASSERT(stream != 0); @@ -180,7 +180,7 @@ bool KisTiledDataManager::read(KoStore *store) sscanf(str,"%u",&m_numTiles); - for(Q_UINT32 i = 0; i < m_numTiles; i++) + for(TQ_UINT32 i = 0; i < m_numTiles; i++) { stream->readLine(str, 79); sscanf(str,"%d,%d,%d,%d",&x,&y,&w,&h); @@ -188,9 +188,9 @@ bool KisTiledDataManager::read(KoStore *store) // the following is only correct as long as tile size is not changed // The first time we change tilesize the dimensions just read needs to be respected // but for now we just assume that tiles are the same size as ever. - Q_INT32 row = yToRow(y); - Q_INT32 col = xToCol(x); - Q_UINT32 tileHash = calcTileHash(col, row); + TQ_INT32 row = yToRow(y); + TQ_INT32 col = xToCol(x); + TQ_UINT32 tileHash = calcTileHash(col, row); KisTile *tile = new KisTile(m_pixelSize, col, row, m_defPixel); Q_CHECK_PTR(tile); @@ -207,7 +207,7 @@ bool KisTiledDataManager::read(KoStore *store) return true; } -void KisTiledDataManager::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const +void KisTiledDataManager::extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const { x = m_extentMinX; y = m_extentMinY; @@ -225,27 +225,27 @@ void KisTiledDataManager::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) } } -QRect KisTiledDataManager::extent() const +TQRect KisTiledDataManager::extent() const { - Q_INT32 x; - Q_INT32 y; - Q_INT32 w; - Q_INT32 h; + TQ_INT32 x; + TQ_INT32 y; + TQ_INT32 w; + TQ_INT32 h; extent(x, y, w, h); - return QRect(x, y, w, h); + return TQRect(x, y, w, h); } -void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::setExtent(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { - QRect newRect = QRect(x, y, w, h).normalize(); + TQRect newRect = TQRect(x, y, w, h).normalize(); //printRect("newRect", newRect); - QRect oldRect = QRect(m_extentMinX, m_extentMinY, m_extentMaxX - m_extentMinX + 1, m_extentMaxY - m_extentMinY + 1).normalize(); + TQRect oldRect = TQRect(m_extentMinX, m_extentMinY, m_extentMaxX - m_extentMinX + 1, m_extentMaxY - m_extentMinY + 1).normalize(); //printRect("oldRect", oldRect); // Do nothing if the desired size is bigger than we currently are: that is handled by the autoextending automatically - if (newRect.contains(oldRect)) return; + if (newRect.tqcontains(oldRect)) return; // Loop through all tiles, if a tile is wholly outside the extent, add to the memento, then delete it, // if the tile is partially outside the extent, clear the outside pixels to the default pixel. @@ -256,10 +256,10 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) while(tile) { - QRect tileRect = QRect(tile->getCol() * KisTile::WIDTH, tile->getRow() * KisTile::HEIGHT, KisTile::WIDTH, KisTile::HEIGHT); + TQRect tileRect = TQRect(tile->getCol() * KisTile::WIDTH, tile->getRow() * KisTile::HEIGHT, KisTile::WIDTH, KisTile::HEIGHT); //printRect("tileRect", tileRect); - if (newRect.contains(tileRect)) { + if (newRect.tqcontains(tileRect)) { // Completely inside, do nothing previousTile = tile; tile = tile->getNext(); @@ -270,7 +270,7 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) if (newRect.intersects(tileRect)) { // Create the intersection of the tile and new rect - QRect intersection = newRect.intersect(tileRect); + TQRect intersection = newRect.intersect(tileRect); //printRect("intersection", intersection); intersection.setRect(intersection.x() - tileRect.x(), intersection.y() - tileRect.y(), intersection.width(), intersection.height()); @@ -279,8 +279,8 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) tile->addReader(); for (int y = 0; y < KisTile::HEIGHT; ++y) { for (int x = 0; x < KisTile::WIDTH; ++x) { - if (!intersection.contains(x,y)) { - Q_UINT8 * ptr = tile->data(x, y); + if (!intersection.tqcontains(x,y)) { + TQ_UINT8 * ptr = tile->data(x, y); memcpy(ptr, m_defPixel, m_pixelSize); } } @@ -314,10 +314,10 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) void KisTiledDataManager::recalculateExtent() { - m_extentMinX = Q_INT32_MAX; - m_extentMinY = Q_INT32_MAX; - m_extentMaxX = Q_INT32_MIN; - m_extentMaxY = Q_INT32_MIN; + m_extentMinX = TQ_INT32_MAX; + m_extentMinY = TQ_INT32_MAX; + m_extentMaxX = TQ_INT32_MIN; + m_extentMaxY = TQ_INT32_MIN; // Loop through all tiles. for (int tileHash = 0; tileHash < 1024; tileHash++) @@ -332,29 +332,29 @@ void KisTiledDataManager::recalculateExtent() } } -void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UINT8 clearValue) +void KisTiledDataManager::clear(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, TQ_UINT8 clearValue) { if (w < 1 || h < 1) { return; } - Q_INT32 firstColumn = xToCol(x); - Q_INT32 lastColumn = xToCol(x + w - 1); + TQ_INT32 firstColumn = xToCol(x); + TQ_INT32 lastColumn = xToCol(x + w - 1); - Q_INT32 firstRow = yToRow(y); - Q_INT32 lastRow = yToRow(y + h - 1); + TQ_INT32 firstRow = yToRow(y); + TQ_INT32 lastRow = yToRow(y + h - 1); - QRect clearRect(x, y, w, h); + TQRect clearRect(x, y, w, h); - const Q_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; + const TQ_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; - for (Q_INT32 row = firstRow; row <= lastRow; ++row) { - for (Q_INT32 column = firstColumn; column <= lastColumn; ++column) { + for (TQ_INT32 row = firstRow; row <= lastRow; ++row) { + for (TQ_INT32 column = firstColumn; column <= lastColumn; ++column) { KisTile *tile = getTile(column, row, true); - QRect tileRect = tile->extent(); + TQRect tileRect = tile->extent(); - QRect clearTileRect = clearRect & tileRect; + TQRect clearTileRect = clearRect & tileRect; tile->addReader(); if (clearTileRect == tileRect) { @@ -362,8 +362,8 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UI memset(tile->data(), clearValue, KisTile::WIDTH * KisTile::HEIGHT * m_pixelSize); } else { - Q_UINT32 rowsRemaining = clearTileRect.height(); - Q_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); + TQ_UINT32 rowsRemaining = clearTileRect.height(); + TQ_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); while (rowsRemaining > 0) { memset(dst, clearValue, clearTileRect.width() * m_pixelSize); @@ -376,7 +376,7 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UI } } -void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const Q_UINT8 *clearPixel) +void KisTiledDataManager::clear(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *clearPixel) { Q_ASSERT(clearPixel != 0); @@ -386,7 +386,7 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons bool pixelBytesAreTheSame = true; - for (Q_UINT32 i = 0; i < m_pixelSize; ++i) { + for (TQ_UINT32 i = 0; i < m_pixelSize; ++i) { if (clearPixel[i] != clearPixel[0]) { pixelBytesAreTheSame = false; break; @@ -397,25 +397,25 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons clear(x, y, w, h, clearPixel[0]); } else { - Q_INT32 firstColumn = xToCol(x); - Q_INT32 lastColumn = xToCol(x + w - 1); + TQ_INT32 firstColumn = xToCol(x); + TQ_INT32 lastColumn = xToCol(x + w - 1); - Q_INT32 firstRow = yToRow(y); - Q_INT32 lastRow = yToRow(y + h - 1); + TQ_INT32 firstRow = yToRow(y); + TQ_INT32 lastRow = yToRow(y + h - 1); - QRect clearRect(x, y, w, h); + TQRect clearRect(x, y, w, h); - const Q_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; + const TQ_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; - Q_UINT8 *clearPixelData = 0; + TQ_UINT8 *clearPixelData = 0; if (w >= KisTile::WIDTH && h >= KisTile::HEIGHT) { // There might be a whole tile to be cleared so generate a cleared tile. - clearPixelData = new Q_UINT8[KisTile::WIDTH * KisTile::HEIGHT * m_pixelSize]; + clearPixelData = new TQ_UINT8[KisTile::WIDTH * KisTile::HEIGHT * m_pixelSize]; - Q_UINT8 *dst = clearPixelData; - Q_UINT32 pixelsRemaining = KisTile::WIDTH; + TQ_UINT8 *dst = clearPixelData; + TQ_UINT32 pixelsRemaining = KisTile::WIDTH; // Generate one row while (pixelsRemaining > 0) { @@ -424,7 +424,7 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons --pixelsRemaining; } - Q_UINT32 rowsRemaining = KisTile::HEIGHT - 1; + TQ_UINT32 rowsRemaining = KisTile::HEIGHT - 1; // Copy to the rest of the rows. while (rowsRemaining > 0) { @@ -436,12 +436,12 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons } else { // Generate one row - Q_UINT32 maxRunLength = QMIN(w, KisTile::WIDTH); + TQ_UINT32 maxRunLength = TQMIN(w, KisTile::WIDTH); - clearPixelData = new Q_UINT8[maxRunLength * m_pixelSize]; + clearPixelData = new TQ_UINT8[maxRunLength * m_pixelSize]; - Q_UINT8 *dst = clearPixelData; - Q_UINT32 pixelsRemaining = maxRunLength; + TQ_UINT8 *dst = clearPixelData; + TQ_UINT32 pixelsRemaining = maxRunLength; while (pixelsRemaining > 0) { memcpy(dst, clearPixel, m_pixelSize); @@ -450,13 +450,13 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons } } - for (Q_INT32 row = firstRow; row <= lastRow; ++row) { - for (Q_INT32 column = firstColumn; column <= lastColumn; ++column) { + for (TQ_INT32 row = firstRow; row <= lastRow; ++row) { + for (TQ_INT32 column = firstColumn; column <= lastColumn; ++column) { KisTile *tile = getTile(column, row, true); - QRect tileRect = tile->extent(); + TQRect tileRect = tile->extent(); - QRect clearTileRect = clearRect & tileRect; + TQRect clearTileRect = clearRect & tileRect; if (clearTileRect == tileRect) { @@ -466,9 +466,9 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons tile->removeReader(); } else { - Q_UINT32 rowsRemaining = clearTileRect.height(); + TQ_UINT32 rowsRemaining = clearTileRect.height(); tile->addReader(); - Q_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); + TQ_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); while (rowsRemaining > 0) { memcpy(dst, clearPixelData, clearTileRect.width() * m_pixelSize); @@ -506,21 +506,21 @@ void KisTiledDataManager::clear() m_numTiles = 0; // Set the extent correctly - m_extentMinX = Q_INT32_MAX; - m_extentMinY = Q_INT32_MAX; - m_extentMaxX = Q_INT32_MIN; - m_extentMaxY = Q_INT32_MIN; + m_extentMinX = TQ_INT32_MAX; + m_extentMinY = TQ_INT32_MAX; + m_extentMaxX = TQ_INT32_MIN; + m_extentMaxY = TQ_INT32_MIN; } -void KisTiledDataManager::paste(KisDataManagerSP data, Q_INT32 sx, Q_INT32 sy, Q_INT32 dx, Q_INT32 dy, - Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::paste(KisDataManagerSP data, TQ_INT32 sx, TQ_INT32 sy, TQ_INT32 dx, TQ_INT32 dy, + TQ_INT32 w, TQ_INT32 h) { //CBR_MISSING sx=sy=dx=dy=w=h;data=0; } -Q_UINT32 KisTiledDataManager::calcTileHash(Q_INT32 col, Q_INT32 row) +TQ_UINT32 KisTiledDataManager::calcTileHash(TQ_INT32 col, TQ_INT32 row) { return ((row << 5) + (col & 0x1F)) & 0x3FF; } @@ -692,7 +692,7 @@ void KisTiledDataManager::deleteTiles(const KisMemento::DeletedTile *d) { while (d) { - Q_UINT32 tileHash = calcTileHash(d->col(), d->row()); + TQ_UINT32 tileHash = calcTileHash(d->col(), d->row()); KisTile *curTile = m_hashTable[tileHash]; KisTile *preTile = 0; while(curTile) @@ -721,7 +721,7 @@ void KisTiledDataManager::deleteTiles(const KisMemento::DeletedTile *d) recalculateExtent(); } -void KisTiledDataManager::ensureTileMementoed(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash, const KisTile *refTile) +void KisTiledDataManager::ensureTileMementoed(TQ_INT32 col, TQ_INT32 row, TQ_UINT32 tileHash, const KisTile *refTile) { if (refTile == 0) return; //Q_ASSERT(refTile != 0); @@ -751,7 +751,7 @@ void KisTiledDataManager::ensureTileMementoed(Q_INT32 col, Q_INT32 row, Q_UINT32 m_currentMemento->m_numTiles++; } -void KisTiledDataManager::updateExtent(Q_INT32 col, Q_INT32 row) +void KisTiledDataManager::updateExtent(TQ_INT32 col, TQ_INT32 row) { if(m_extentMinX > col * KisTile::WIDTH) m_extentMinX = col * KisTile::WIDTH; @@ -763,9 +763,9 @@ void KisTiledDataManager::updateExtent(Q_INT32 col, Q_INT32 row) m_extentMaxY = (row+1) * KisTile::HEIGHT - 1; } -KisTile *KisTiledDataManager::getTile(Q_INT32 col, Q_INT32 row, bool writeAccess) +KisTile *KisTiledDataManager::getTile(TQ_INT32 col, TQ_INT32 row, bool writeAccess) { - Q_UINT32 tileHash = calcTileHash(col, row); + TQ_UINT32 tileHash = calcTileHash(col, row); // Lookup tile in hash table KisTile *tile = m_hashTable[tileHash]; @@ -806,7 +806,7 @@ KisTile *KisTiledDataManager::getTile(Q_INT32 col, Q_INT32 row, bool writeAccess return tile; } -KisTile *KisTiledDataManager::getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def) +KisTile *KisTiledDataManager::getOldTile(TQ_INT32 col, TQ_INT32 row, KisTile *def) { KisTile *tile = 0; @@ -816,7 +816,7 @@ KisTile *KisTiledDataManager::getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def) if (!m_currentMemento->valid()) return def; //Q_ASSERT(m_currentMemento->valid()); - Q_UINT32 tileHash = calcTileHash(col, row); + TQ_UINT32 tileHash = calcTileHash(col, row); tile = m_currentMemento->m_hashTable[tileHash]; while (tile != 0) { @@ -833,48 +833,48 @@ KisTile *KisTiledDataManager::getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def) return tile; } -Q_UINT8* KisTiledDataManager::pixelPtr(Q_INT32 x, Q_INT32 y, bool writable) +TQ_UINT8* KisTiledDataManager::pixelPtr(TQ_INT32 x, TQ_INT32 y, bool writable) { // Ahem, this is a bit not as good. The point is, this function needs the tile data, // but it might be swapped out. This code swaps it in, but at function exit it might - // be swapped out again! THIS MAKES THE RETURNED POINTER QUITE VOLATILE + // be swapped out again! THIS MAKES THE RETURNED POINTER TQUITE VOLATILE return pixelPtrSafe(x, y, writable) -> data(); } -KisTileDataWrapperSP KisTiledDataManager::pixelPtrSafe(Q_INT32 x, Q_INT32 y, bool writable) { - Q_INT32 row = yToRow(y); - Q_INT32 col = xToCol(x); +KisTileDataWrapperSP KisTiledDataManager::pixelPtrSafe(TQ_INT32 x, TQ_INT32 y, bool writable) { + TQ_INT32 row = yToRow(y); + TQ_INT32 col = xToCol(x); // calc limits within the tile - Q_INT32 yInTile = y - row * KisTile::HEIGHT; - Q_INT32 xInTile = x - col * KisTile::WIDTH; - Q_INT32 offset = m_pixelSize * (yInTile * KisTile::WIDTH + xInTile); + TQ_INT32 yInTile = y - row * KisTile::HEIGHT; + TQ_INT32 xInTile = x - col * KisTile::WIDTH; + TQ_INT32 offset = m_pixelSize * (yInTile * KisTile::WIDTH + xInTile); KisTile *tile = getTile(col, row, writable); return new KisTileDataWrapper(tile, offset); } -const Q_UINT8* KisTiledDataManager::pixel(Q_INT32 x, Q_INT32 y) +const TQ_UINT8* KisTiledDataManager::pixel(TQ_INT32 x, TQ_INT32 y) { return pixelPtr(x, y, false); } -Q_UINT8* KisTiledDataManager::writablePixel(Q_INT32 x, Q_INT32 y) +TQ_UINT8* KisTiledDataManager::writablePixel(TQ_INT32 x, TQ_INT32 y) { return pixelPtr(x, y, true); } -void KisTiledDataManager::setPixel(Q_INT32 x, Q_INT32 y, const Q_UINT8 * data) +void KisTiledDataManager::setPixel(TQ_INT32 x, TQ_INT32 y, const TQ_UINT8 * data) { - Q_UINT8 *pixel = pixelPtr(x, y, true); + TQ_UINT8 *pixel = pixelPtr(x, y, true); memcpy(pixel, data, m_pixelSize); } -void KisTiledDataManager::readBytes(Q_UINT8 * data, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::readBytes(TQ_UINT8 * data, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h) { if (data == 0) return; //Q_ASSERT(data != 0); @@ -884,33 +884,33 @@ void KisTiledDataManager::readBytes(Q_UINT8 * data, if (h < 0) h = 0; - Q_INT32 dstY = 0; - Q_INT32 srcY = y; - Q_INT32 rowsRemaining = h; + TQ_INT32 dstY = 0; + TQ_INT32 srcY = y; + TQ_INT32 rowsRemaining = h; while (rowsRemaining > 0) { - Q_INT32 dstX = 0; - Q_INT32 srcX = x; - Q_INT32 columnsRemaining = w; - Q_INT32 numContiguousSrcRows = numContiguousRows(srcY, srcX, srcX + w - 1); + TQ_INT32 dstX = 0; + TQ_INT32 srcX = x; + TQ_INT32 columnsRemaining = w; + TQ_INT32 numContiguousSrcRows = numContiguousRows(srcY, srcX, srcX + w - 1); - Q_INT32 rows = QMIN(numContiguousSrcRows, rowsRemaining); + TQ_INT32 rows = TQMIN(numContiguousSrcRows, rowsRemaining); while (columnsRemaining > 0) { - Q_INT32 numContiguousSrcColumns = numContiguousColumns(srcX, srcY, srcY + rows - 1); + TQ_INT32 numContiguousSrcColumns = numContiguousColumns(srcX, srcY, srcY + rows - 1); - Q_INT32 columns = QMIN(numContiguousSrcColumns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousSrcColumns, columnsRemaining); KisTileDataWrapperSP tileData = pixelPtrSafe(srcX, srcY, false); - const Q_UINT8 *srcData = tileData -> data(); - Q_INT32 srcRowStride = rowStride(srcX, srcY); + const TQ_UINT8 *srcData = tileData -> data(); + TQ_INT32 srcRowStride = rowStride(srcX, srcY); - Q_UINT8 *dstData = data + ((dstX + (dstY * w)) * m_pixelSize); - Q_INT32 dstRowStride = w * m_pixelSize; + TQ_UINT8 *dstData = data + ((dstX + (dstY * w)) * m_pixelSize); + TQ_INT32 dstRowStride = w * m_pixelSize; - for (Q_INT32 row = 0; row < rows; row++) { + for (TQ_INT32 row = 0; row < rows; row++) { memcpy(dstData, srcData, columns * m_pixelSize); dstData += dstRowStride; srcData += srcRowStride; @@ -929,9 +929,9 @@ void KisTiledDataManager::readBytes(Q_UINT8 * data, } -void KisTiledDataManager::writeBytes(const Q_UINT8 * bytes, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::writeBytes(const TQ_UINT8 * bytes, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h) { if (bytes == 0) return; //Q_ASSERT(bytes != 0); @@ -943,34 +943,34 @@ void KisTiledDataManager::writeBytes(const Q_UINT8 * bytes, if (h < 0) h = 0; - Q_INT32 srcY = 0; - Q_INT32 dstY = y; - Q_INT32 rowsRemaining = h; + TQ_INT32 srcY = 0; + TQ_INT32 dstY = y; + TQ_INT32 rowsRemaining = h; while (rowsRemaining > 0) { - Q_INT32 srcX = 0; - Q_INT32 dstX = x; - Q_INT32 columnsRemaining = w; - Q_INT32 numContiguousdstRows = numContiguousRows(dstY, dstX, dstX + w - 1); + TQ_INT32 srcX = 0; + TQ_INT32 dstX = x; + TQ_INT32 columnsRemaining = w; + TQ_INT32 numContiguousdstRows = numContiguousRows(dstY, dstX, dstX + w - 1); - Q_INT32 rows = QMIN(numContiguousdstRows, rowsRemaining); + TQ_INT32 rows = TQMIN(numContiguousdstRows, rowsRemaining); while (columnsRemaining > 0) { - Q_INT32 numContiguousdstColumns = numContiguousColumns(dstX, dstY, dstY + rows - 1); + TQ_INT32 numContiguousdstColumns = numContiguousColumns(dstX, dstY, dstY + rows - 1); - Q_INT32 columns = QMIN(numContiguousdstColumns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousdstColumns, columnsRemaining); - //Q_UINT8 *dstData = writablePixel(dstX, dstY); + //TQ_UINT8 *dstData = writablePixel(dstX, dstY); KisTileDataWrapperSP tileData = pixelPtrSafe(dstX, dstY, true); - Q_UINT8 *dstData = tileData->data(); - Q_INT32 dstRowStride = rowStride(dstX, dstY); + TQ_UINT8 *dstData = tileData->data(); + TQ_INT32 dstRowStride = rowStride(dstX, dstY); - const Q_UINT8 *srcData = bytes + ((srcX + (srcY * w)) * m_pixelSize); - Q_INT32 srcRowStride = w * m_pixelSize; + const TQ_UINT8 *srcData = bytes + ((srcX + (srcY * w)) * m_pixelSize); + TQ_INT32 srcRowStride = w * m_pixelSize; - for (Q_INT32 row = 0; row < rows; row++) { + for (TQ_INT32 row = 0; row < rows; row++) { memcpy(dstData, srcData, columns * m_pixelSize); srcData += srcRowStride; dstData += dstRowStride; @@ -987,9 +987,9 @@ void KisTiledDataManager::writeBytes(const Q_UINT8 * bytes, } } -Q_INT32 KisTiledDataManager::numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT32 maxY) +TQ_INT32 KisTiledDataManager::numContiguousColumns(TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY) { - Q_INT32 numColumns; + TQ_INT32 numColumns; Q_UNUSED(minY); Q_UNUSED(maxY); @@ -1003,9 +1003,9 @@ Q_INT32 KisTiledDataManager::numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT return numColumns; } -Q_INT32 KisTiledDataManager::numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 maxX) +TQ_INT32 KisTiledDataManager::numContiguousRows(TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX) { - Q_INT32 numRows; + TQ_INT32 numRows; Q_UNUSED(minX); Q_UNUSED(maxX); @@ -1019,7 +1019,7 @@ Q_INT32 KisTiledDataManager::numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 return numRows; } -Q_INT32 KisTiledDataManager::rowStride(Q_INT32 x, Q_INT32 y) +TQ_INT32 KisTiledDataManager::rowStride(TQ_INT32 x, TQ_INT32 y) { Q_UNUSED(x); Q_UNUSED(y); @@ -1027,12 +1027,12 @@ Q_INT32 KisTiledDataManager::rowStride(Q_INT32 x, Q_INT32 y) return KisTile::WIDTH * m_pixelSize; } -Q_INT32 KisTiledDataManager::numTiles(void) const +TQ_INT32 KisTiledDataManager::numTiles(void) const { return m_numTiles; } -KisTileDataWrapper::KisTileDataWrapper(KisTile* tile, Q_INT32 offset) +KisTileDataWrapper::KisTileDataWrapper(KisTile* tile, TQ_INT32 offset) : m_tile(tile), m_offset(offset) { m_tile->addReader(); diff --git a/krita/core/tiles/kis_tileddatamanager.h b/krita/core/tiles/kis_tileddatamanager.h index d4976080..20d78085 100644 --- a/krita/core/tiles/kis_tileddatamanager.h +++ b/krita/core/tiles/kis_tileddatamanager.h @@ -18,8 +18,8 @@ #ifndef KIS_TILEDDATAMANAGER_H_ #define KIS_TILEDDATAMANAGER_H_ -#include <qglobal.h> -#include <qvaluevector.h> +#include <tqglobal.h> +#include <tqvaluevector.h> #include <ksharedptr.h> @@ -39,11 +39,11 @@ class KoStore; class KisTileDataWrapper : public KShared { KisTile* m_tile; - Q_INT32 m_offset; + TQ_INT32 m_offset; public: - KisTileDataWrapper(KisTile* tile, Q_INT32 offset); + KisTileDataWrapper(KisTile* tile, TQ_INT32 offset); virtual ~KisTileDataWrapper(); - Q_UINT8* data() const { return m_tile->data() + m_offset; } + TQ_UINT8* data() const { return m_tile->data() + m_offset; } }; typedef KSharedPtr<KisTileDataWrapper> KisTileDataWrapperSP; @@ -61,13 +61,13 @@ typedef KSharedPtr<KisTileDataWrapper> KisTileDataWrapperSP; * that may allow deferred loading. * * A datamanager knows nothing about the type of pixel data except - * how many Q_UINT8's a single pixel takes. + * how many TQ_UINT8's a single pixel takes. */ class KisTiledDataManager : public KShared { protected: - KisTiledDataManager(Q_UINT32 pixelSize, const Q_UINT8 *defPixel); + KisTiledDataManager(TQ_UINT32 pixelSize, const TQ_UINT8 *defPixel); ~KisTiledDataManager(); KisTiledDataManager(const KisTiledDataManager &dm); KisTiledDataManager & operator=(const KisTiledDataManager &dm); @@ -81,8 +81,8 @@ protected: protected: - void setDefaultPixel(const Q_UINT8 *defPixel); - const Q_UINT8 * defaultPixel() const { return m_defPixel;}; + void setDefaultPixel(const TQ_UINT8 *defPixel); + const TQ_UINT8 * defaultPixel() const { return m_defPixel;}; KisMementoSP getMemento(); void rollback(KisMementoSP memento); @@ -101,24 +101,24 @@ protected: protected: - Q_UINT32 pixelSize(); + TQ_UINT32 pixelSize(); - void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const; - QRect extent() const; + void extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const; + TQRect extent() const; - void setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + void setExtent(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); protected: - void clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UINT8 clearValue); - void clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const Q_UINT8 *clearPixel); + void clear(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, TQ_UINT8 clearValue); + void clear(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *clearPixel); void clear(); protected: - void paste(KisDataManagerSP data, Q_INT32 sx, Q_INT32 sy, Q_INT32 dx, Q_INT32 dy, - Q_INT32 w, Q_INT32 h); + void paste(KisDataManagerSP data, TQ_INT32 sx, TQ_INT32 sy, TQ_INT32 dx, TQ_INT32 dy, + TQ_INT32 w, TQ_INT32 h); protected: @@ -127,87 +127,87 @@ protected: /** * Get a read-only pointer to pixel (x, y). */ - const Q_UINT8* pixel(Q_INT32 x, Q_INT32 y); + const TQ_UINT8* pixel(TQ_INT32 x, TQ_INT32 y); /** * Get a read-write pointer to pixel (x, y). */ - Q_UINT8* writablePixel(Q_INT32 x, Q_INT32 y); + TQ_UINT8* writablePixel(TQ_INT32 x, TQ_INT32 y); /** * write the specified data to x, y. There is no checking on pixelSize! */ - void setPixel(Q_INT32 x, Q_INT32 y, const Q_UINT8 * data); + void setPixel(TQ_INT32 x, TQ_INT32 y, const TQ_UINT8 * data); /** * Copy the bytes in the specified rect to a vector. The caller is responsible * for managing the vector. */ - void readBytes(Q_UINT8 * bytes, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h); + void readBytes(TQ_UINT8 * bytes, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h); /** * Copy the bytes in the vector to the specified rect. If there are bytes left * in the vector after filling the rect, they will be ignored. If there are * not enough bytes, the rest of the rect will be filled with the default value * given (by default, 0); */ - void writeBytes(const Q_UINT8 * bytes, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h); + void writeBytes(const TQ_UINT8 * bytes, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h); /// Get the number of contiguous columns starting at x, valid for all values /// of y between minY and maxY. - Q_INT32 numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT32 maxY); + TQ_INT32 numContiguousColumns(TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY); /// Get the number of contiguous rows starting at y, valid for all values /// of x between minX and maxX. - Q_INT32 numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 maxX); + TQ_INT32 numContiguousRows(TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX); /// Get the row stride at pixel (x, y). This is the number of bytes to add to a /// pointer to pixel (x, y) to access (x, y + 1). - Q_INT32 rowStride(Q_INT32 x, Q_INT32 y); + TQ_INT32 rowStride(TQ_INT32 x, TQ_INT32 y); // For debugging use - Q_INT32 numTiles() const; + TQ_INT32 numTiles() const; private: - Q_UINT32 m_pixelSize; - Q_UINT32 m_numTiles; + TQ_UINT32 m_pixelSize; + TQ_UINT32 m_numTiles; KisTile *m_defaultTile; KisTile **m_hashTable; KisMementoSP m_currentMemento; - Q_INT32 m_extentMinX; - Q_INT32 m_extentMinY; - Q_INT32 m_extentMaxX; - Q_INT32 m_extentMaxY; - Q_UINT8 *m_defPixel; + TQ_INT32 m_extentMinX; + TQ_INT32 m_extentMinY; + TQ_INT32 m_extentMaxX; + TQ_INT32 m_extentMaxY; + TQ_UINT8 *m_defPixel; private: - void ensureTileMementoed(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash, const KisTile *refTile); - KisTile *getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def); - KisTile *getTile(Q_INT32 col, Q_INT32 row, bool writeAccess); - Q_UINT32 calcTileHash(Q_INT32 col, Q_INT32 row); - void updateExtent(Q_INT32 col, Q_INT32 row); + void ensureTileMementoed(TQ_INT32 col, TQ_INT32 row, TQ_UINT32 tileHash, const KisTile *refTile); + KisTile *getOldTile(TQ_INT32 col, TQ_INT32 row, KisTile *def); + KisTile *getTile(TQ_INT32 col, TQ_INT32 row, bool writeAccess); + TQ_UINT32 calcTileHash(TQ_INT32 col, TQ_INT32 row); + void updateExtent(TQ_INT32 col, TQ_INT32 row); void recalculateExtent(); void deleteTiles(const KisMemento::DeletedTile *deletedTileList); - Q_INT32 xToCol(Q_INT32 x) const; - Q_INT32 yToRow(Q_INT32 y) const; - void getContiguousColumnsAndRows(Q_INT32 x, Q_INT32 y, Q_INT32 *columns, Q_INT32 *rows); - Q_UINT8* pixelPtr(Q_INT32 x, Q_INT32 y, bool writable); - KisTileDataWrapperSP pixelPtrSafe(Q_INT32 x, Q_INT32 y, bool writable); + TQ_INT32 xToCol(TQ_INT32 x) const; + TQ_INT32 yToRow(TQ_INT32 y) const; + void getContiguousColumnsAndRows(TQ_INT32 x, TQ_INT32 y, TQ_INT32 *columns, TQ_INT32 *rows); + TQ_UINT8* pixelPtr(TQ_INT32 x, TQ_INT32 y, bool writable); + KisTileDataWrapperSP pixelPtrSafe(TQ_INT32 x, TQ_INT32 y, bool writable); }; -inline Q_UINT32 KisTiledDataManager::pixelSize() +inline TQ_UINT32 KisTiledDataManager::pixelSize() { return m_pixelSize; } -inline Q_INT32 KisTiledDataManager::xToCol(Q_INT32 x) const +inline TQ_INT32 KisTiledDataManager::xToCol(TQ_INT32 x) const { if (x >= 0) { return x / KisTile::WIDTH; @@ -216,7 +216,7 @@ inline Q_INT32 KisTiledDataManager::xToCol(Q_INT32 x) const } } -inline Q_INT32 KisTiledDataManager::yToRow(Q_INT32 y) const +inline TQ_INT32 KisTiledDataManager::yToRow(TQ_INT32 y) const { if (y >= 0) { return y / KisTile::HEIGHT; diff --git a/krita/core/tiles/kis_tiledhlineiterator.cc b/krita/core/tiles/kis_tiledhlineiterator.cc index 37a1195e..cf023c1e 100644 --- a/krita/core/tiles/kis_tiledhlineiterator.cc +++ b/krita/core/tiles/kis_tiledhlineiterator.cc @@ -22,7 +22,7 @@ #include "kis_tile_global.h" #include "kis_tilediterator.h" -KisTiledHLineIterator::KisTiledHLineIterator( KisTiledDataManager *ndevice, Q_INT32 x, Q_INT32 y, Q_INT32 w, bool writable) : +KisTiledHLineIterator::KisTiledHLineIterator( KisTiledDataManager *ndevice, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable) : KisTiledIterator(ndevice), m_right(x+w-1), m_left(x) { @@ -137,7 +137,7 @@ void KisTiledHLineIterator::prevTile() } } -Q_INT32 KisTiledHLineIterator::nConseqHPixels() const +TQ_INT32 KisTiledHLineIterator::nConseqHPixels() const { return m_rightInTile - m_xInTile + 1; } diff --git a/krita/core/tiles/kis_tilediterator.cc b/krita/core/tiles/kis_tilediterator.cc index 5806a82a..b60e9a50 100644 --- a/krita/core/tiles/kis_tilediterator.cc +++ b/krita/core/tiles/kis_tilediterator.cc @@ -89,13 +89,13 @@ KisTiledIterator& KisTiledIterator::operator=(const KisTiledIterator& rhs) return *this; } -Q_UINT8 * KisTiledIterator::rawData() const +TQ_UINT8 * KisTiledIterator::rawData() const { return m_data + m_offset; } -const Q_UINT8 * KisTiledIterator::oldRawData() const +const TQ_UINT8 * KisTiledIterator::oldRawData() const { #ifdef DEBUG // Warn if we're misusing oldRawData(). If there's no memento, oldRawData is the same @@ -105,7 +105,7 @@ const Q_UINT8 * KisTiledIterator::oldRawData() const return m_oldData + m_offset; } -void KisTiledIterator::fetchTileData(Q_INT32 col, Q_INT32 row) +void KisTiledIterator::fetchTileData(TQ_INT32 col, TQ_INT32 row) { if (m_tile) m_tile->removeReader(); diff --git a/krita/core/tiles/kis_tilediterator.h b/krita/core/tiles/kis_tilediterator.h index 02431f4b..958876cd 100644 --- a/krita/core/tiles/kis_tilediterator.h +++ b/krita/core/tiles/kis_tilediterator.h @@ -18,7 +18,7 @@ #ifndef KIS_TILED_ITERATOR_H_ #define KIS_TILED_ITERATOR_H_ -#include <qglobal.h> +#include <tqglobal.h> #include <ksharedptr.h> @@ -32,22 +32,22 @@ class KRITACORE_EXPORT KisTiledIterator : public KShared { protected: KisTiledDataManager *m_ktm; - Q_INT32 m_pixelSize; // bytes per pixel - Q_INT32 m_x; // current x position - Q_INT32 m_y; // cirrent y position - Q_INT32 m_row; // row in tilemgr - Q_INT32 m_col; // col in tilemgr - Q_UINT8 *m_data; - Q_UINT8 *m_oldData; - Q_INT32 m_offset; + TQ_INT32 m_pixelSize; // bytes per pixel + TQ_INT32 m_x; // current x position + TQ_INT32 m_y; // cirrent y position + TQ_INT32 m_row; // row in tilemgr + TQ_INT32 m_col; // col in tilemgr + TQ_UINT8 *m_data; + TQ_UINT8 *m_oldData; + TQ_INT32 m_offset; KisTile *m_tile; KisTile* m_oldTile; bool m_writable; protected: - inline Q_UINT32 xToCol(Q_UINT32 x) const { if (m_ktm) return m_ktm->xToCol(x); else return 0; }; - inline Q_UINT32 yToRow(Q_UINT32 y) const { if (m_ktm) return m_ktm->yToRow(y); else return 0; }; - void fetchTileData(Q_INT32 col, Q_INT32 row); + inline TQ_UINT32 xToCol(TQ_UINT32 x) const { if (m_ktm) return m_ktm->xToCol(x); else return 0; }; + inline TQ_UINT32 yToRow(TQ_UINT32 y) const { if (m_ktm) return m_ktm->yToRow(y); else return 0; }; + void fetchTileData(TQ_INT32 col, TQ_INT32 row); public: KisTiledIterator( KisTiledDataManager *ktm); @@ -57,16 +57,16 @@ public: public: // current x position - Q_INT32 x() const { return m_x; }; + TQ_INT32 x() const { return m_x; }; // cirrent y position - Q_INT32 y() const { return m_y; }; + TQ_INT32 y() const { return m_y; }; /// Returns a pointer to the pixel data. Do NOT interpret the data - leave that to a colorstrategy - Q_UINT8 *rawData() const; + TQ_UINT8 *rawData() const; /// Returns a pointer to the pixel data as it was at the moment tof he last memento creation. - const Q_UINT8 * oldRawData() const; + const TQ_UINT8 * oldRawData() const; }; /** @@ -78,13 +78,13 @@ class KRITACORE_EXPORT KisTiledRectIterator : public KisTiledIterator public: /// do not call constructor directly use factory method in KisDataManager instead. - KisTiledRectIterator( KisTiledDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, bool writable); + KisTiledRectIterator( KisTiledDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, bool writable); KisTiledRectIterator(const KisTiledRectIterator&); KisTiledRectIterator& operator=(const KisTiledRectIterator&); ~KisTiledRectIterator(); public: - Q_INT32 nConseqPixels() const; + TQ_INT32 nConseqPixels() const; /// Advances a number of pixels until it reaches the end of the rect KisTiledRectIterator & operator+=(int n); @@ -100,20 +100,20 @@ public: protected: - Q_INT32 m_left; - Q_INT32 m_top; - Q_INT32 m_w; - Q_INT32 m_h; - Q_INT32 m_topRow; - Q_INT32 m_bottomRow; - Q_INT32 m_leftCol; - Q_INT32 m_rightCol; - Q_INT32 m_xInTile; - Q_INT32 m_yInTile; - Q_INT32 m_leftInTile; - Q_INT32 m_rightInTile; - Q_INT32 m_topInTile; - Q_INT32 m_bottomInTile; + TQ_INT32 m_left; + TQ_INT32 m_top; + TQ_INT32 m_w; + TQ_INT32 m_h; + TQ_INT32 m_topRow; + TQ_INT32 m_bottomRow; + TQ_INT32 m_leftCol; + TQ_INT32 m_rightCol; + TQ_INT32 m_xInTile; + TQ_INT32 m_yInTile; + TQ_INT32 m_leftInTile; + TQ_INT32 m_rightInTile; + TQ_INT32 m_topInTile; + TQ_INT32 m_bottomInTile; bool m_beyondEnd; private: @@ -129,7 +129,7 @@ class KRITACORE_EXPORT KisTiledHLineIterator : public KisTiledIterator public: /// do not call constructor directly use factory method in KisDataManager instead. - KisTiledHLineIterator( KisTiledDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, bool writable); + KisTiledHLineIterator( KisTiledDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable); KisTiledHLineIterator(const KisTiledHLineIterator&); KisTiledHLineIterator& operator=(const KisTiledHLineIterator&); ~KisTiledHLineIterator(); @@ -140,7 +140,7 @@ public: /// Returns the number of consequtive horizontal pixels that we point at /// This is useful for optimizing - Q_INT32 nConseqHPixels() const; + TQ_INT32 nConseqHPixels() const; /// Advances a number of pixels until it reaches the end of the line KisTiledHLineIterator & operator+=(int); @@ -155,14 +155,14 @@ public: void nextRow(); protected: - Q_INT32 m_right; - Q_INT32 m_left; - Q_INT32 m_leftCol; - Q_INT32 m_rightCol; - Q_INT32 m_xInTile; - Q_INT32 m_yInTile; - Q_INT32 m_leftInTile; - Q_INT32 m_rightInTile; + TQ_INT32 m_right; + TQ_INT32 m_left; + TQ_INT32 m_leftCol; + TQ_INT32 m_rightCol; + TQ_INT32 m_xInTile; + TQ_INT32 m_yInTile; + TQ_INT32 m_leftInTile; + TQ_INT32 m_rightInTile; private: void nextTile(); @@ -178,7 +178,7 @@ class KRITACORE_EXPORT KisTiledVLineIterator : public KisTiledIterator public: /// do not call constructor directly use factory method in KisDataManager instead. - KisTiledVLineIterator( KisTiledDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 h, bool writable); + KisTiledVLineIterator( KisTiledDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable); KisTiledVLineIterator(const KisTiledVLineIterator&); KisTiledVLineIterator& operator=(const KisTiledVLineIterator&); ~KisTiledVLineIterator(); @@ -197,14 +197,14 @@ public: void nextCol(); protected: - Q_INT32 m_top; - Q_INT32 m_bottom; - Q_INT32 m_topRow; - Q_INT32 m_bottomRow; - Q_INT32 m_xInTile; - Q_INT32 m_yInTile; - Q_INT32 m_topInTile; - Q_INT32 m_bottomInTile; + TQ_INT32 m_top; + TQ_INT32 m_bottom; + TQ_INT32 m_topRow; + TQ_INT32 m_bottomRow; + TQ_INT32 m_xInTile; + TQ_INT32 m_yInTile; + TQ_INT32 m_topInTile; + TQ_INT32 m_bottomInTile; private: void nextTile(); diff --git a/krita/core/tiles/kis_tiledrectiterator.cc b/krita/core/tiles/kis_tiledrectiterator.cc index 73146504..8f0f7ed1 100644 --- a/krita/core/tiles/kis_tiledrectiterator.cc +++ b/krita/core/tiles/kis_tiledrectiterator.cc @@ -22,8 +22,8 @@ #include "kis_tile_global.h" #include "kis_tilediterator.h" -KisTiledRectIterator::KisTiledRectIterator( KisTiledDataManager *ndevice, Q_INT32 nleft, - Q_INT32 ntop, Q_INT32 nw, Q_INT32 nh, bool writable) : +KisTiledRectIterator::KisTiledRectIterator( KisTiledDataManager *ndevice, TQ_INT32 nleft, + TQ_INT32 ntop, TQ_INT32 nw, TQ_INT32 nh, bool writable) : KisTiledIterator(ndevice), m_left(nleft), m_top(ntop), @@ -118,7 +118,7 @@ KisTiledRectIterator::~KisTiledRectIterator( ) { } -Q_INT32 KisTiledRectIterator::nConseqPixels() const +TQ_INT32 KisTiledRectIterator::nConseqPixels() const { if(m_leftInTile || (m_rightInTile != KisTile::WIDTH - 1)) return m_rightInTile - m_xInTile + 1; diff --git a/krita/core/tiles/kis_tiledvlineiterator.cc b/krita/core/tiles/kis_tiledvlineiterator.cc index 5b6270e1..bcd85d70 100644 --- a/krita/core/tiles/kis_tiledvlineiterator.cc +++ b/krita/core/tiles/kis_tiledvlineiterator.cc @@ -22,7 +22,7 @@ #include "kis_tile_global.h" #include "kis_tilediterator.h" -KisTiledVLineIterator::KisTiledVLineIterator( KisTiledDataManager *ndevice, Q_INT32 x, Q_INT32 y, Q_INT32 h, bool writable) : +KisTiledVLineIterator::KisTiledVLineIterator( KisTiledDataManager *ndevice, TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable) : KisTiledIterator(ndevice), m_bottom(y + h - 1) { diff --git a/krita/core/tiles/kis_tilemanager.cc b/krita/core/tiles/kis_tilemanager.cc index 0ac968fd..49fe7f06 100644 --- a/krita/core/tiles/kis_tilemanager.cc +++ b/krita/core/tiles/kis_tilemanager.cc @@ -25,9 +25,9 @@ #include <string.h> #include <fcntl.h> -#include <qmutex.h> -#include <qthread.h> -#include <qfile.h> +#include <tqmutex.h> +#include <tqthread.h> +#include <tqfile.h> #include <kstaticdeleter.h> #include <kglobal.h> @@ -54,8 +54,8 @@ KisTileManager::KisTileManager() { // Hardcoded (at the moment only?): 4 pools of 1000 tiles each m_tilesPerPool = 1000; - m_pools = new Q_UINT8*[4]; - m_poolPixelSizes = new Q_INT32[4]; + m_pools = new TQ_UINT8*[4]; + m_poolPixelSizes = new TQ_INT32[4]; m_poolFreeList = new PoolFreeList[4]; for (int i = 0; i < 4; i++) { m_pools[i] = 0; @@ -74,8 +74,8 @@ KisTileManager::KisTileManager() { counter = 0; - m_poolMutex = new QMutex(true); - m_swapMutex = new QMutex(true); + m_poolMutex = new TQMutex(true); + m_swapMutex = new TQMutex(true); } KisTileManager::~KisTileManager() { @@ -157,11 +157,11 @@ void KisTileManager::deregisterTile(KisTile* tile) { m_swapMutex->lock(); - if (!m_tileMap.contains(tile)) { + if (!m_tileMap.tqcontains(tile)) { m_swapMutex->unlock(); return; } - // Q_ASSERT(m_tileMap.contains(tile)); + // Q_ASSERT(m_tileMap.tqcontains(tile)); TileInfo* info = m_tileMap[tile]; @@ -352,16 +352,16 @@ void KisTileManager::toSwap(TileInfo* info) { } //memcpy(data, tile->m_data, info->size); - QFile* file = info->file->file(); + TQFile* file = info->file->file(); if(!file) { - kdWarning() << "Opening the file as QFile failed" << endl; + kdWarning() << "Opening the file as TQFile failed" << endl; m_swapForbidden = true; m_swapMutex->unlock(); return; } int fd = file->handle(); - Q_UINT8* data = 0; + TQ_UINT8* data = 0; if (!kritaMmap(data, 0, info->size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, info->filePos)) { kdWarning() << "Initial mmap failed" << endl; @@ -411,9 +411,9 @@ void KisTileManager::doSwapping() #if 1 // enable this to enable swapping - Q_UINT32 count = QMIN(m_swappableList.size(), m_swappiness); + TQ_UINT32 count = TQMIN(m_swappableList.size(), m_swappiness); - for (Q_UINT32 i = 0; i < count && !m_swapForbidden; i++) { + for (TQ_UINT32 i = 0; i < count && !m_swapForbidden; i++) { toSwap(m_swappableList.front()); m_swappableList.front()->validNode = false; m_swappableList.pop_front(); @@ -449,20 +449,20 @@ void KisTileManager::printInfo() kdDebug(DBG_AREA_TILES) << endl; } -Q_UINT8* KisTileManager::requestTileData(Q_INT32 pixelSize) +TQ_UINT8* KisTileManager::requestTileData(TQ_INT32 pixelSize) { m_swapMutex->lock(); - Q_UINT8* data = findTileFor(pixelSize); + TQ_UINT8* data = findTileFor(pixelSize); if ( data ) { m_swapMutex->unlock(); return data; } m_swapMutex->unlock(); - return new Q_UINT8[m_tileSize * pixelSize]; + return new TQ_UINT8[m_tileSize * pixelSize]; } -void KisTileManager::dontNeedTileData(Q_UINT8* data, Q_INT32 pixelSize) +void KisTileManager::dontNeedTileData(TQ_UINT8* data, TQ_INT32 pixelSize) { m_poolMutex->lock(); if (isPoolTile(data, pixelSize)) { @@ -472,14 +472,14 @@ void KisTileManager::dontNeedTileData(Q_UINT8* data, Q_INT32 pixelSize) m_poolMutex->unlock(); } -Q_UINT8* KisTileManager::findTileFor(Q_INT32 pixelSize) +TQ_UINT8* KisTileManager::findTileFor(TQ_INT32 pixelSize) { m_poolMutex->lock(); for (int i = 0; i < 4; i++) { if (m_poolPixelSizes[i] == pixelSize) { if (!m_poolFreeList[i].isEmpty()) { - Q_UINT8* data = m_poolFreeList[i].front(); + TQ_UINT8* data = m_poolFreeList[i].front(); m_poolFreeList[i].pop_front(); m_poolMutex->unlock(); return data; @@ -488,7 +488,7 @@ Q_UINT8* KisTileManager::findTileFor(Q_INT32 pixelSize) if (m_pools[i] == 0) { // allocate new pool m_poolPixelSizes[i] = pixelSize; - m_pools[i] = new Q_UINT8[pixelSize * m_tileSize * m_tilesPerPool]; + m_pools[i] = new TQ_UINT8[pixelSize * m_tileSize * m_tilesPerPool]; // j = 1 because we return the first element, so no need to add it to the freelist for (int j = 1; j < m_tilesPerPool; j++) m_poolFreeList[i].append(&m_pools[i][j * pixelSize * m_tileSize]); @@ -501,7 +501,7 @@ Q_UINT8* KisTileManager::findTileFor(Q_INT32 pixelSize) return 0; } -bool KisTileManager::isPoolTile(Q_UINT8* data, Q_INT32 pixelSize) { +bool KisTileManager::isPoolTile(TQ_UINT8* data, TQ_INT32 pixelSize) { if (data == 0) return false; @@ -521,7 +521,7 @@ bool KisTileManager::isPoolTile(Q_UINT8* data, Q_INT32 pixelSize) { return false; } -void KisTileManager::reclaimTileToPool(Q_UINT8* data, Q_INT32 pixelSize) { +void KisTileManager::reclaimTileToPool(TQ_UINT8* data, TQ_INT32 pixelSize) { m_poolMutex->lock(); for (int i = 0; i < 4; i++) { if (m_poolPixelSizes[i] == pixelSize) @@ -543,12 +543,12 @@ void KisTileManager::configChanged() { m_swapMutex->unlock(); } -bool KisTileManager::kritaMmap(Q_UINT8*& result, void *start, size_t length, +bool KisTileManager::kritaMmap(TQ_UINT8*& result, void *start, size_t length, int prot, int flags, int fd, off_t offset) { - result = (Q_UINT8*) mmap(start, length, prot, flags, fd, offset); + result = (TQ_UINT8*) mmap(start, length, prot, flags, fd, offset); // Same here for warning and GUI - if (result == (Q_UINT8*)-1) { + if (result == (TQ_UINT8*)-1) { kdWarning(DBG_AREA_TILES) << "mmap failed: errno is " << errno << "; we're probably going to crash very soon now...\n"; // Try to ignore what happened and carry on, but unlikely that we'll get diff --git a/krita/core/tiles/kis_tilemanager.h b/krita/core/tiles/kis_tilemanager.h index a66ca634..bce60ca4 100644 --- a/krita/core/tiles/kis_tilemanager.h +++ b/krita/core/tiles/kis_tilemanager.h @@ -20,10 +20,10 @@ #include <sys/types.h> -#include <qglobal.h> -#include <qmap.h> -#include <qvaluelist.h> -#include <qmutex.h> +#include <tqglobal.h> +#include <tqmap.h> +#include <tqvaluelist.h> +#include <tqmutex.h> #include <ktempfile.h> @@ -54,8 +54,8 @@ public: // Tile management void maySwapTile(const KisTile* tile); public: // Pool management - Q_UINT8* requestTileData(Q_INT32 pixelSize); - void dontNeedTileData(Q_UINT8* data, Q_INT32 pixelSize); + TQ_UINT8* requestTileData(TQ_INT32 pixelSize); + void dontNeedTileData(TQ_UINT8* data, TQ_INT32 pixelSize); public: // Configuration void configChanged(); @@ -84,37 +84,37 @@ private: // being used in the swap for this tile (may be larger!) // The file points to 0 if it is not swapped, and to the relevant TempFile otherwise struct TileInfo { KisTile *tile; KTempFile* file; off_t filePos; int size; int fsize; - QValueList<TileInfo*>::iterator node; + TQValueList<TileInfo*>::iterator node; bool inMem; bool onFile; bool mmapped; bool validNode; }; typedef struct { KTempFile* file; off_t filePos; int size; } FreeInfo; - typedef QMap<const KisTile*, TileInfo*> TileMap; - typedef QValueList<TileInfo*> TileList; - typedef QValueList<FreeInfo*> FreeList; - typedef QValueVector<FreeList> FreeListList; - typedef QValueList<Q_UINT8*> PoolFreeList; - typedef QValueList<TempFile> FileList; + typedef TQMap<const KisTile*, TileInfo*> TileMap; + typedef TQValueList<TileInfo*> TileList; + typedef TQValueList<FreeInfo*> FreeList; + typedef TQValueVector<FreeList> FreeListList; + typedef TQValueList<TQ_UINT8*> PoolFreeList; + typedef TQValueList<TempFile> FileList; TileMap m_tileMap; TileList m_swappableList; FreeListList m_freeLists; FileList m_files; - Q_INT32 m_maxInMem; - Q_INT32 m_currentInMem; - Q_UINT32 m_swappiness; - Q_INT32 m_tileSize; // size of a tile if it used 1 byte per pixel + TQ_INT32 m_maxInMem; + TQ_INT32 m_currentInMem; + TQ_UINT32 m_swappiness; + TQ_INT32 m_tileSize; // size of a tile if it used 1 byte per pixel unsigned long m_bytesInMem; unsigned long m_bytesTotal; - Q_UINT8 **m_pools; - Q_INT32 *m_poolPixelSizes; - Q_INT32 m_tilesPerPool; + TQ_UINT8 **m_pools; + TQ_INT32 *m_poolPixelSizes; + TQ_INT32 m_tilesPerPool; PoolFreeList *m_poolFreeList; - QMutex * m_poolMutex; - QMutex * m_swapMutex; + TQMutex * m_poolMutex; + TQMutex * m_swapMutex; // This is the constant that we will use to see if we want to add a new tempfile - // We use 1<<30 (one gigabyte) because apparently 32bit systems don't really like very + // We use 1<<30 (one gigabyte) because aptqparently 32bit systems don't really like very // large files. static const long MaxSwapFileSize = 1<<30; // For debugging purposes: 1<<20 is a megabyte @@ -126,13 +126,13 @@ private: void toSwap(TileInfo* info); void doSwapping(); void printInfo(); - Q_UINT8* findTileFor(Q_INT32 pixelSize); - bool isPoolTile(Q_UINT8* data, Q_INT32 pixelSize); - void reclaimTileToPool(Q_UINT8* data, Q_INT32 pixelSize); + TQ_UINT8* findTileFor(TQ_INT32 pixelSize); + bool isPoolTile(TQ_UINT8* data, TQ_INT32 pixelSize); + void reclaimTileToPool(TQ_UINT8* data, TQ_INT32 pixelSize); // Mmap wrapper that prints warnings on error. The result is stored in the *& result // the return value is true on succes, false on failure. Other args as in man mmap - bool kritaMmap(Q_UINT8*& result, void *start, size_t length, + bool kritaMmap(TQ_UINT8*& result, void *start, size_t length, int prot, int flags, int fd, off_t offset); }; diff --git a/krita/core/tiles/tests/kis_tiled_data_tester.cpp b/krita/core/tiles/tests/kis_tiled_data_tester.cpp index 2d7fbe05..15d3e50b 100644 --- a/krita/core/tiles/tests/kis_tiled_data_tester.cpp +++ b/krita/core/tiles/tests/kis_tiled_data_tester.cpp @@ -30,27 +30,27 @@ KUNITTEST_MODULE_REGISTER_TESTER( KisTiledDataTester ); #define TEST_PIXEL_SIZE 4 -static Q_UINT8 defaultPixel[TEST_PIXEL_SIZE] = {0, 0, 0, OPACITY_TRANSPARENT}; +static TQ_UINT8 defaultPixel[TEST_PIXEL_SIZE] = {0, 0, 0, OPACITY_TRANSPARENT}; void KisTiledDataTester::allTests() { KisDataManager *dm = new KisDataManager(TEST_PIXEL_SIZE, defaultPixel); - Q_INT32 extentX; - Q_INT32 extentY; - Q_INT32 extentWidth; - Q_INT32 extentHeight; + TQ_INT32 extentX; + TQ_INT32 extentY; + TQ_INT32 extentWidth; + TQ_INT32 extentHeight; dm->extent(extentX, extentY, extentWidth, extentHeight); CHECK(extentWidth, 0); CHECK(extentHeight, 0); - const Q_UINT8 *readOnlyPixel = dm->pixel(KisTile::WIDTH/2, KisTile::HEIGHT/2); + const TQ_UINT8 *readOnlyPixel = dm->pixel(KisTile::WIDTH/2, KisTile::HEIGHT/2); dm->extent(extentX, extentY, extentWidth, extentHeight); CHECK(extentWidth, 0); CHECK(extentHeight, 0); - Q_UINT8 *writablePixel = dm->writablePixel(KisTile::WIDTH/2, KisTile::HEIGHT/2); + TQ_UINT8 *writablePixel = dm->writablePixel(KisTile::WIDTH/2, KisTile::HEIGHT/2); dm->extent(extentX, extentY, extentWidth, extentHeight); CHECK(extentX, 0); CHECK(extentY, 0); |