diff options
Diffstat (limited to 'krita/core/kis_paint_device.cc')
-rw-r--r-- | krita/core/kis_paint_device.cc | 330 |
1 files changed, 165 insertions, 165 deletions
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); } |