summaryrefslogtreecommitdiffstats
path: root/krita/core/kis_image.cc
diff options
context:
space:
mode:
Diffstat (limited to 'krita/core/kis_image.cc')
-rw-r--r--krita/core/kis_image.cc312
1 files changed, 156 insertions, 156 deletions
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()) {