summaryrefslogtreecommitdiffstats
path: root/krita/ui/kis_part_layer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'krita/ui/kis_part_layer.cc')
-rw-r--r--krita/ui/kis_part_layer.cc88
1 files changed, 44 insertions, 44 deletions
diff --git a/krita/ui/kis_part_layer.cc b/krita/ui/kis_part_layer.cc
index f34f6ebc..233841e3 100644
--- a/krita/ui/kis_part_layer.cc
+++ b/krita/ui/kis_part_layer.cc
@@ -16,10 +16,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include "qpaintdevice.h"
-#include "qpixmap.h"
-#include "qimage.h"
-#include "qpainter.h"
+#include "tqpaintdevice.h"
+#include "tqpixmap.h"
+#include "tqimage.h"
+#include "tqpainter.h"
#include <klocale.h>
@@ -37,7 +37,7 @@
#include "kis_paint_device.h"
#include <kis_meta_registry.h>
-KisChildDoc::KisChildDoc ( KisDoc * kisDoc, const QRect & rect, KoDocument * childDoc )
+KisChildDoc::KisChildDoc ( KisDoc * kisDoc, const TQRect & rect, KoDocument * childDoc )
: KoDocumentChild( kisDoc, childDoc, rect )
, m_doc(kisDoc)
, m_partLayer(0)
@@ -54,7 +54,7 @@ KisChildDoc::KisChildDoc ( KisDoc * kisDoc )
KisChildDoc::~KisChildDoc ()
{
// XXX doesn't this get deleted by itself or by anything else? Certainly looks so
- // (otherwise I get a double deletion of a QObject, and krita crashes)
+ // (otherwise I get a double deletion of a TQObject, and krita crashes)
//delete m_doc;
}
@@ -80,33 +80,33 @@ void KisPartLayerImpl::childActivated(KoDocumentChild* child)
{
// Clear the image, so that if we move the part while activated, no ghosts show up
if (!m_activated && child == m_doc) {
- QRect rect = extent();
+ TQRect rect = extent();
m_activated = true;
setDirty(rect);
- QPtrList<KoView> views = child->parentDocument()->views();
+ TQPtrList<KoView> views = child->tqparentDocument()->views();
Q_ASSERT(views.count());
// XXX iterate over views
- connect(views.at(0), SIGNAL(activated(bool)),
- this, SLOT(childDeactivated(bool)));
+ connect(views.at(0), TQT_SIGNAL(activated(bool)),
+ this, TQT_SLOT(childDeactivated(bool)));
}
}
// Called when another layer is made inactive
void KisPartLayerImpl::childDeactivated(bool activated)
{
- // We probably changed, notify the image that it needs to repaint where we currently updated
- // We use the original geometry
+ // We probably changed, notify the image that it needs to tqrepaint where we currently updated
+ // We use the original tqgeometry
if (m_activated && !activated /* no clue, but debugging suggests it is false here */) {
- QPtrList<KoView> views = m_doc->parentDocument()->views();
+ TQPtrList<KoView> views = m_doc->tqparentDocument()->views();
Q_ASSERT(views.count());
- views.at(0)->disconnect(SIGNAL(activated(bool)));
+ views.at(0)->disconnect(TQT_SIGNAL(activated(bool)));
m_activated = false;
- setDirty(m_doc->geometry());
+ setDirty(m_doc->tqgeometry());
}
}
-void KisPartLayerImpl::setX(Q_INT32 x) {
- QRect rect = m_doc->geometry();
+void KisPartLayerImpl::setX(TQ_INT32 x) {
+ TQRect rect = m_doc->tqgeometry();
// KisPaintDevice::move moves to absolute coordinates, not relative. Work around that here,
// since the part is not necesarily started at (0,0)
@@ -114,8 +114,8 @@ void KisPartLayerImpl::setX(Q_INT32 x) {
m_doc->setGeometry(rect);
}
-void KisPartLayerImpl::setY(Q_INT32 y) {
- QRect rect = m_doc->geometry();
+void KisPartLayerImpl::setY(TQ_INT32 y) {
+ TQRect rect = m_doc->tqgeometry();
// KisPaintDevice::move moves to absolute coordinates, not relative. Work around that here,
// since the part is not necesarily started at (0,0)
@@ -123,14 +123,14 @@ void KisPartLayerImpl::setY(Q_INT32 y) {
m_doc->setGeometry(rect);
}
-void KisPartLayerImpl::paintSelection(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) {
+void KisPartLayerImpl::paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) {
uchar *j = img.bits();
- QRect rect = m_doc->geometry();
+ TQRect rect = m_doc->tqgeometry();
for (int y2 = y; y2 < h + y; ++y2) {
for (int x2 = x; x2 < w + x; ++x2) {
- if (!rect.contains(x2, y2)) {
- Q_UINT8 g = (*(j + 0) + *(j + 1 ) + *(j + 2 )) / 9;
+ if (!rect.tqcontains(x2, y2)) {
+ TQ_UINT8 g = (*(j + 0) + *(j + 1 ) + *(j + 2 )) / 9;
*(j+0) = 165+g;
*(j+1) = 128+g;
*(j+2) = 128+g;
@@ -141,31 +141,31 @@ void KisPartLayerImpl::paintSelection(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32
}
-KisPaintDeviceSP KisPartLayerImpl::prepareProjection(KisPaintDeviceSP projection, const QRect& r)
+KisPaintDeviceSP KisPartLayerImpl::prepareProjection(KisPaintDeviceSP projection, const TQRect& r)
{
if (!m_doc || !m_doc->document() || m_activated) return 0;
m_cache->clear();
- QRect intersection(r.intersect(exactBounds()));
+ TQRect intersection(r.intersect(exactBounds()));
if (intersection.isEmpty())
return m_cache;
// XXX: have a look at the comments and see if they still truthfully represent the code :/
// We know the embedded part's size through the ChildDoc
// We move it to (0,0), since that is what we will start painting from in paintEverything.
- QRect embedRect(intersection);
+ TQRect embedRect(intersection);
embedRect.moveBy(- exactBounds().x(), - exactBounds().y());
- QRect paintRect(exactBounds());
+ TQRect paintRect(exactBounds());
paintRect.moveBy(- exactBounds().x(), - exactBounds().y());
- QPixmap pm1(projection->convertToQImage(0 /*srgb XXX*/,
+ TQPixmap pm1(projection->convertToTQImage(0 /*srgb XXX*/,
intersection.x(), intersection.y(),
intersection.width(), intersection.height()));
- QPixmap pm2(extent().width(), extent().height());
+ TQPixmap pm2(extent().width(), extent().height());
copyBlt(&pm2, embedRect.x(), embedRect.y(), &pm1,
0, 0, embedRect.width(), embedRect.height());
- QPainter painter(&pm2);
+ TQPainter painter(&pm2);
painter.setClipRect(embedRect);
// KWord's KWPartFrameSet::drawFrameContents has some interesting remarks concerning
@@ -177,32 +177,32 @@ KisPaintDeviceSP KisPartLayerImpl::prepareProjection(KisPaintDeviceSP projection
copyBlt(&pm1, 0, 0, &pm2,
embedRect.x(), embedRect.y(), embedRect.width(), embedRect.height());
- QImage qimg = pm1.convertToImage();
+ TQImage qimg = pm1.convertToImage();
//assume the part is sRGB for now, and that "" is sRGB
// And we need to paint offsetted
- m_cache->convertFromQImage(qimg, "", intersection.left(), intersection.top());
+ m_cache->convertFromTQImage(qimg, "", intersection.left(), intersection.top());
return m_cache;
}
-QImage KisPartLayerImpl::createThumbnail(Q_INT32 w, Q_INT32 h) {
- QRect bounds(exactBounds());
- QPixmap pm(w, h);
- QPainter painter(&pm);
+TQImage KisPartLayerImpl::createThumbnail(TQ_INT32 w, TQ_INT32 h) {
+ TQRect bounds(exactBounds());
+ TQPixmap pm(w, h);
+ TQPainter painter(&pm);
- painter.fillRect(0, 0, w, h, Qt::white);
+ painter.fillRect(0, 0, w, h, TQt::white);
painter.scale(w / bounds.width(), h / bounds.height());
m_doc->document()->paintEverything(painter, bounds);
- QImage qimg = pm.convertToImage();
+ TQImage qimg = pm.convertToImage();
return qimg;
}
-bool KisPartLayerImpl::saveToXML(QDomDocument doc, QDomElement elem)
+bool KisPartLayerImpl::saveToXML(TQDomDocument doc, TQDomElement elem)
{
- QDomElement embeddedElement = doc.createElement("layer");
+ TQDomElement embeddedElement = doc.createElement("layer");
embeddedElement.setAttribute("name", name());
// x and y are loaded from the rect element in the embedded object tag
@@ -216,7 +216,7 @@ bool KisPartLayerImpl::saveToXML(QDomDocument doc, QDomElement elem)
embeddedElement.setAttribute("layertype", "partlayer");
elem.appendChild(embeddedElement);
- QDomElement objectElem = childDoc()->save(doc);
+ TQDomElement objectElem = childDoc()->save(doc);
embeddedElement.appendChild(objectElem);
return true;
@@ -240,10 +240,10 @@ bool KisConnectPartLayerVisitor::visit(KisGroupLayer *layer) {
bool KisConnectPartLayerVisitor::visit(KisPartLayer *layer) {
if (m_connect) {
- QObject::connect(m_view, SIGNAL(childActivated(KoDocumentChild*)),
- layer, SLOT(childActivated(KoDocumentChild*)));
+ TQObject::connect(m_view, TQT_SIGNAL(childActivated(KoDocumentChild*)),
+ layer, TQT_SLOT(childActivated(KoDocumentChild*)));
} else {
- QObject::disconnect(m_view, SIGNAL(childActivated(KoDocumentChild*)), layer, 0 );
+ TQObject::disconnect(m_view, TQT_SIGNAL(childActivated(KoDocumentChild*)), layer, 0 );
}
return true;