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/kis_fill_painter.cc | |
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/kis_fill_painter.cc')
-rw-r--r-- | krita/core/kis_fill_painter.cc | 70 |
1 files changed, 35 insertions, 35 deletions
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; |