diff options
Diffstat (limited to 'kolourpaint/tools')
-rw-r--r-- | kolourpaint/tools/kptoolairspray.cpp | 14 | ||||
-rw-r--r-- | kolourpaint/tools/kptoolautocrop.cpp | 22 | ||||
-rw-r--r-- | kolourpaint/tools/kptoolclear.cpp | 2 | ||||
-rw-r--r-- | kolourpaint/tools/kptoolcrop.cpp | 2 | ||||
-rw-r--r-- | kolourpaint/tools/kptoolpen.cpp | 82 | ||||
-rw-r--r-- | kolourpaint/tools/kptoolpen.h | 4 | ||||
-rw-r--r-- | kolourpaint/tools/kptoolpolygon.cpp | 60 | ||||
-rw-r--r-- | kolourpaint/tools/kptoolrectangle.cpp | 78 | ||||
-rw-r--r-- | kolourpaint/tools/kptoolrectangle.h | 12 |
9 files changed, 138 insertions, 138 deletions
diff --git a/kolourpaint/tools/kptoolairspray.cpp b/kolourpaint/tools/kptoolairspray.cpp index 022c534d..f8aabce1 100644 --- a/kolourpaint/tools/kptoolairspray.cpp +++ b/kolourpaint/tools/kptoolairspray.cpp @@ -314,7 +314,7 @@ void kpToolAirSprayCommand::addPoints (const TQPointArray &points) TQPixmap pixmap = document ()->getPixmapAt (docRect); TQBitmap tqmask; - TQPainter painter, tqmaskPainter; + TQPainter painter, maskPainter; if (m_color.isOpaque ()) { @@ -325,8 +325,8 @@ void kpToolAirSprayCommand::addPoints (const TQPointArray &points) if (pixmap.tqmask () || m_color.isTransparent ()) { tqmask = kpPixmapFX::getNonNullMask (pixmap); - tqmaskPainter.begin (&tqmask); - tqmaskPainter.setPen (m_color.tqmaskColor ()); + maskPainter.begin (&tqmask); + maskPainter.setPen (m_color.maskColor ()); } for (int i = 0; i < (int) points.count (); i++) @@ -337,12 +337,12 @@ void kpToolAirSprayCommand::addPoints (const TQPointArray &points) if (painter.isActive ()) painter.drawPoint (pt); - if (tqmaskPainter.isActive ()) - tqmaskPainter.drawPoint (pt); + if (maskPainter.isActive ()) + maskPainter.drawPoint (pt); } - if (tqmaskPainter.isActive ()) - tqmaskPainter.end (); + if (maskPainter.isActive ()) + maskPainter.end (); if (painter.isActive ()) painter.end (); diff --git a/kolourpaint/tools/kptoolautocrop.cpp b/kolourpaint/tools/kptoolautocrop.cpp index 0d103af7..d8c8100f 100644 --- a/kolourpaint/tools/kptoolautocrop.cpp +++ b/kolourpaint/tools/kptoolautocrop.cpp @@ -654,7 +654,7 @@ void kpToolAutoCropCommand::unexecute () return; TQPixmap pixmap (m_oldWidth, m_oldHeight); - TQBitmap tqmaskBitmap; + TQBitmap maskBitmap; // restore the position of the centre image kpPixmapFX::setPixmapAt (&pixmap, m_contentsRect, @@ -663,7 +663,7 @@ void kpToolAutoCropCommand::unexecute () // draw the borders TQPainter painter (&pixmap); - TQPainter tqmaskPainter; + TQPainter maskPainter; const kpToolAutoCropBorder *borders [] = { @@ -699,14 +699,14 @@ void kpToolAutoCropCommand::unexecute () } else { - if (tqmaskBitmap.isNull ()) + if (maskBitmap.isNull ()) { // TODO: dangerous when a painter is active on pixmap? - tqmaskBitmap = kpPixmapFX::getNonNullMask (pixmap); - tqmaskPainter.begin (&tqmaskBitmap); + maskBitmap = kpPixmapFX::getNonNullMask (pixmap); + maskPainter.begin (&maskBitmap); } - tqmaskPainter.fillRect ((*b)->rect (), TQt::color0/*transparent*/); + maskPainter.fillRect ((*b)->rect (), TQt::color0/*transparent*/); } } else @@ -721,7 +721,7 @@ void kpToolAutoCropCommand::unexecute () if (*p) { // TODO: We should really edit the tqmask here. Due to good - // luck (if "tqmaskBitmap" is initialized above, this region + // luck (if "maskBitmap" is initialized above, this region // will be marked as opaque in the tqmask; if it's not // initialized, we will be opaque by default), we // don't actually have to edit the tqmask but this is @@ -731,13 +731,13 @@ void kpToolAutoCropCommand::unexecute () } } - if (tqmaskPainter.isActive ()) - tqmaskPainter.end (); + if (maskPainter.isActive ()) + maskPainter.end (); painter.end (); - if (!tqmaskBitmap.isNull ()) - pixmap.setMask (tqmaskBitmap); + if (!maskBitmap.isNull ()) + pixmap.setMask (maskBitmap); if (!m_actOnSelection) diff --git a/kolourpaint/tools/kptoolclear.cpp b/kolourpaint/tools/kptoolclear.cpp index b6fa2eab..7b1a775b 100644 --- a/kolourpaint/tools/kptoolclear.cpp +++ b/kolourpaint/tools/kptoolclear.cpp @@ -108,7 +108,7 @@ void kpToolClearCommand::execute () kpPixmapFX::fill (&newPixmap, m_newColor); // TODO: maybe disable Image/Clear if transparent colour if (m_newColor.isOpaque ()) - newPixmap.setMask (sel->tqmaskForOwnType ()); + newPixmap.setMask (sel->maskForOwnType ()); sel->setPixmap (newPixmap); } diff --git a/kolourpaint/tools/kptoolcrop.cpp b/kolourpaint/tools/kptoolcrop.cpp index e5483a90..e3916121 100644 --- a/kolourpaint/tools/kptoolcrop.cpp +++ b/kolourpaint/tools/kptoolcrop.cpp @@ -167,7 +167,7 @@ void kpToolCropSetImageCommand::execute () kpPixmapFX::paintMaskTransparentWithBrush (&newDocPixmap, TQPoint (0, 0), - m_fromSelection.tqmaskForOwnType ()); + m_fromSelection.maskForOwnType ()); kpPixmapFX::paintPixmapAt (&newDocPixmap, TQPoint (0, 0), diff --git a/kolourpaint/tools/kptoolpen.cpp b/kolourpaint/tools/kptoolpen.cpp index 5c7ff6ea..57e19527 100644 --- a/kolourpaint/tools/kptoolpen.cpp +++ b/kolourpaint/tools/kptoolpen.cpp @@ -179,7 +179,7 @@ void kpToolPen::end () if (vm) { if (vm->tempPixmap () && vm->tempPixmap ()->isBrush ()) - vm->tqinvalidateTempPixmap (); + vm->invalidateTempPixmap (); if (m_mode & (SquareBrushes | DiverseBrushes)) vm->unsetCursor (); @@ -218,7 +218,7 @@ void kpToolPen::beginDraw () // user starts drawing in the background color, we don't want to leave // the cursor in the foreground colour -- just hide it in all cases // to avoid confusion - viewManager ()->tqinvalidateTempPixmap (); + viewManager ()->invalidateTempPixmap (); setUserMessage (cancelUserMessage ()); } @@ -282,15 +282,15 @@ void kpToolPen::hover (const TQPoint &point) setUserShapePoints (point); } -bool kpToolPen::wash (TQPainter *painter, TQPainter *tqmaskPainter, +bool kpToolPen::wash (TQPainter *painter, TQPainter *maskPainter, const TQImage &image, const kpColor &colorToReplace, const TQRect &imageRect, int plotx, int ploty) { - return wash (painter, tqmaskPainter, image, colorToReplace, imageRect, hotRect (plotx, ploty)); + return wash (painter, maskPainter, image, colorToReplace, imageRect, hotRect (plotx, ploty)); } -bool kpToolPen::wash (TQPainter *painter, TQPainter *tqmaskPainter, +bool kpToolPen::wash (TQPainter *painter, TQPainter *maskPainter, const TQImage &image, const kpColor &colorToReplace, const TQRect &imageRect, const TQRect &drawRect) @@ -308,8 +308,8 @@ bool kpToolPen::wash (TQPainter *painter, TQPainter *tqmaskPainter, { \ if (painter && painter->isActive ()) \ painter->drawLine (startDrawX, y, x - 1, y); \ - if (tqmaskPainter && tqmaskPainter->isActive ()) \ - tqmaskPainter->drawLine (startDrawX, y, x - 1, y); \ + if (maskPainter && maskPainter->isActive ()) \ + maskPainter->drawLine (startDrawX, y, x - 1, y); \ didSomething = true; \ startDrawX = -1; \ } @@ -388,8 +388,8 @@ void kpToolPen::globalDraw () kpToolPenCommand *cmd = new kpToolPenCommand ( i18n ("Color Eraser"), mainWindow ()); - TQPainter painter, tqmaskPainter; - TQBitmap tqmaskBitmap; + TQPainter painter, maskPainter; + TQBitmap maskBitmap; if (backgroundColor ().isOpaque ()) { @@ -400,16 +400,16 @@ void kpToolPen::globalDraw () if (backgroundColor ().isTransparent () || document ()->pixmap ()->tqmask ()) { - tqmaskBitmap = kpPixmapFX::getNonNullMask (*document ()->pixmap ()); - tqmaskPainter.begin (&tqmaskBitmap); + maskBitmap = kpPixmapFX::getNonNullMask (*document ()->pixmap ()); + maskPainter.begin (&maskBitmap); - tqmaskPainter.setPen (backgroundColor ().tqmaskColor ()); + maskPainter.setPen (backgroundColor ().maskColor ()); } const TQImage image = kpPixmapFX::convertToImage (*document ()->pixmap ()); TQRect rect = document ()->rect (); - const bool didSomething = wash (&painter, &tqmaskPainter, image, + const bool didSomething = wash (&painter, &maskPainter, image, foregroundColor ()/*replace foreground*/, rect, rect); @@ -417,13 +417,13 @@ void kpToolPen::globalDraw () if (painter.isActive ()) painter.end (); - if (tqmaskPainter.isActive ()) - tqmaskPainter.end (); + if (maskPainter.isActive ()) + maskPainter.end (); if (didSomething) { - if (!tqmaskBitmap.isNull ()) - document ()->pixmap ()->setMask (tqmaskBitmap); + if (!maskBitmap.isNull ()) + document ()->pixmap ()->setMask (maskBitmap); document ()->slotContentsChanged (rect); @@ -519,8 +519,8 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const #if DEBUG_KP_TOOL_PEN kdDebug () << "\tconvert to image: " << timer.restart () << "ms" << endl; #endif - TQPainter painter, tqmaskPainter; - TQBitmap tqmaskBitmap; + TQPainter painter, maskPainter; + TQBitmap maskBitmap; if (color (m_mouseButton).isOpaque ()) { @@ -531,12 +531,12 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const if (color (m_mouseButton).isTransparent () || pixmap.tqmask ()) { - tqmaskBitmap = kpPixmapFX::getNonNullMask (pixmap); - tqmaskPainter.begin (&tqmaskBitmap); - tqmaskPainter.setPen (color (m_mouseButton).tqmaskColor ()); + maskBitmap = kpPixmapFX::getNonNullMask (pixmap); + maskPainter.begin (&maskBitmap); + maskPainter.setPen (color (m_mouseButton).maskColor ()); } - bool didSomething = wash (&painter, &tqmaskPainter, + bool didSomething = wash (&painter, &maskPainter, image, color (1 - m_mouseButton)/*color to tqreplace*/, rect, rect); @@ -544,13 +544,13 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const if (painter.isActive ()) painter.end (); - if (tqmaskPainter.isActive ()) - tqmaskPainter.end (); + if (maskPainter.isActive ()) + maskPainter.end (); if (didSomething) { - if (!tqmaskBitmap.isNull ()) - pixmap.setMask (tqmaskBitmap); + if (!maskBitmap.isNull ()) + pixmap.setMask (maskBitmap); #if DEBUG_KP_TOOL_PEN kdDebug () << "\twashed: " << timer.restart () << "ms" << endl; @@ -594,9 +594,9 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const bool transparent = c.isTransparent (); TQPixmap pixmap = document ()->getPixmapAt (rect); - TQBitmap tqmaskBitmap; + TQBitmap maskBitmap; - TQPainter painter, tqmaskPainter; + TQPainter painter, maskPainter; if (m_mode & (DrawsPixels | WashesPixmaps)) { @@ -608,9 +608,9 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const if (transparent || pixmap.tqmask ()) { - tqmaskBitmap = kpPixmapFX::getNonNullMask (pixmap); - tqmaskPainter.begin (&tqmaskBitmap); - tqmaskPainter.setPen (c.tqmaskColor ()); + maskBitmap = kpPixmapFX::getNonNullMask (pixmap); + maskPainter.begin (&maskBitmap); + maskPainter.setPen (c.maskColor ()); } } @@ -635,8 +635,8 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const if (painter.isActive ()) painter.drawLine (sp, ep); - if (tqmaskPainter.isActive ()) - tqmaskPainter.drawLine (sp, ep); + if (maskPainter.isActive ()) + maskPainter.drawLine (sp, ep); didSomething = true; } @@ -678,7 +678,7 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const if (m_mode & WashesPixmaps) { - if (wash (&painter, &tqmaskPainter, image, + if (wash (&painter, &maskPainter, image, colorToReplace, rect, plotx + rect.left (), ploty + rect.top ())) { @@ -746,7 +746,7 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const if (m_mode & WashesPixmaps) { - if (wash (&painter, &tqmaskPainter, image, + if (wash (&painter, &maskPainter, image, colorToReplace, rect, plotx + rect.left (), oldploty + rect.top ())) { @@ -774,7 +774,7 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const if (m_mode & WashesPixmaps) { - if (wash (&painter, &tqmaskPainter, image, + if (wash (&painter, &maskPainter, image, colorToReplace, rect, plotx + rect.left (), ploty + rect.top ())) { @@ -806,8 +806,8 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const if (painter.isActive ()) painter.end (); - if (tqmaskPainter.isActive ()) - tqmaskPainter.end (); + if (maskPainter.isActive ()) + maskPainter.end (); #if DEBUG_KP_TOOL_PEN if (m_mode & WashesPixmaps) @@ -824,8 +824,8 @@ void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const if (didSomething) { - if (!tqmaskBitmap.isNull ()) - pixmap.setMask (tqmaskBitmap); + if (!maskBitmap.isNull ()) + pixmap.setMask (maskBitmap); // draw onto doc document ()->setPixmapAt (pixmap, rect.topLeft ()); diff --git a/kolourpaint/tools/kptoolpen.h b/kolourpaint/tools/kptoolpen.h index 77d7c33c..acee1265 100644 --- a/kolourpaint/tools/kptoolpen.h +++ b/kolourpaint/tools/kptoolpen.h @@ -103,11 +103,11 @@ private slots: void slotEraserSizeChanged (int size); private: - bool wash (TQPainter *painter, TQPainter *tqmaskPainter, + bool wash (TQPainter *painter, TQPainter *maskPainter, const TQImage &image, const kpColor &colorToReplace, const TQRect &imageRect, int plotx, int ploty); - bool wash (TQPainter *painter, TQPainter *tqmaskPainter, + bool wash (TQPainter *painter, TQPainter *maskPainter, const TQImage &image, const kpColor &colorToReplace, const TQRect &imageRect, const TQRect &drawRect); diff --git a/kolourpaint/tools/kptoolpolygon.cpp b/kolourpaint/tools/kptoolpolygon.cpp index 0e298759..5a074bb6 100644 --- a/kolourpaint/tools/kptoolpolygon.cpp +++ b/kolourpaint/tools/kptoolpolygon.cpp @@ -81,7 +81,7 @@ static const char *pointArrayToString (const TQPointArray &pointArray) static TQPen makeMaskPen (const kpColor &color, int lineWidth, Qt::PenStyle lineStyle) { - return TQPen (color.tqmaskColor (), + return TQPen (color.maskColor (), lineWidth == 1 ? 0/*closer to looking width 1*/ : lineWidth, lineStyle, Qt::RoundCap, Qt::RoundJoin); } @@ -103,7 +103,7 @@ static TQBrush makeMaskBrush (const kpColor &foregroundColor, kpToolWidgetFillStyle *toolWidgetFillStyle) { if (toolWidgetFillStyle) - return toolWidgetFillStyle->tqmaskBrush (foregroundColor, backgroundColor); + return toolWidgetFillStyle->maskBrush (foregroundColor, backgroundColor); else return Qt::NoBrush; } @@ -155,33 +155,33 @@ static TQPixmap pixmap (const TQPixmap &oldPixmap, // draw TQPen pen = makePen (foregroundColor, lineWidth, lineStyle), - tqmaskPen = makeMaskPen (foregroundColor, lineWidth, lineStyle); + maskPen = makeMaskPen (foregroundColor, lineWidth, lineStyle); TQBrush brush = makeBrush (foregroundColor, backgroundColor, toolWidgetFillStyle), - tqmaskBrush = makeMaskBrush (foregroundColor, backgroundColor, toolWidgetFillStyle); + maskBrush = makeMaskBrush (foregroundColor, backgroundColor, toolWidgetFillStyle); TQPixmap pixmap = oldPixmap; - TQBitmap tqmaskBitmap; + TQBitmap maskBitmap; - TQPainter painter, tqmaskPainter; + TQPainter painter, maskPainter; if (pixmap.tqmask () || - (tqmaskPen.style () != TQt::NoPen && - tqmaskPen.color () == TQt::color0/*transparent*/) || - (tqmaskBrush.style () != TQt::NoBrush && - tqmaskBrush.color () == TQt::color0/*transparent*/)) + (maskPen.style () != TQt::NoPen && + maskPen.color () == TQt::color0/*transparent*/) || + (maskBrush.style () != TQt::NoBrush && + maskBrush.color () == TQt::color0/*transparent*/)) { - tqmaskBitmap = kpPixmapFX::getNonNullMask (pixmap); - tqmaskPainter.begin (&tqmaskBitmap); - tqmaskPainter.setPen (tqmaskPen); - tqmaskPainter.setBrush (tqmaskBrush); + maskBitmap = kpPixmapFX::getNonNullMask (pixmap); + maskPainter.begin (&maskBitmap); + maskPainter.setPen (maskPen); + maskPainter.setBrush (maskBrush); #if DEBUG_KP_TOOL_POLYGON && 0 - kdDebug () << "\ttqmaskPainter begin because:" << endl + kdDebug () << "\tmaskPainter begin because:" << endl << "\t\tpixmap.tqmask=" << pixmap.tqmask () << endl - << "\t\t(tqmaskPenStyle!=NoPen)=" << (tqmaskPen.style () != TQt::NoPen) << endl - << "\t\t(tqmaskPenColor==trans)=" << (tqmaskPen.color () == TQt::color0) << endl - << "\t\t(tqmaskBrushStyle!=NoBrush)=" << (tqmaskBrush.style () != TQt::NoBrush) << endl - << "\t\t(tqmaskBrushColor==trans)=" << (tqmaskBrush.color () == TQt::color0) << endl; + << "\t\t(maskPenStyle!=NoPen)=" << (maskPen.style () != TQt::NoPen) << endl + << "\t\t(maskPenColor==trans)=" << (maskPen.color () == TQt::color0) << endl + << "\t\t(maskBrushStyle!=NoBrush)=" << (maskBrush.style () != TQt::NoBrush) << endl + << "\t\t(maskBrushColor==trans)=" << (maskBrush.color () == TQt::color0) << endl; #endif } @@ -204,8 +204,8 @@ static TQPixmap pixmap (const TQPixmap &oldPixmap, if (painter.isActive ()) \ painter . cmd ; \ \ - if (tqmaskPainter.isActive ()) \ - tqmaskPainter . cmd ; \ + if (maskPainter.isActive ()) \ + maskPainter . cmd ; \ } // SYNC: TQt bug @@ -240,9 +240,9 @@ static TQPixmap pixmap (const TQPixmap &oldPixmap, painter.setRasterOp (TQt::XorROP); } - if (tqmaskPainter.isActive ()) + if (maskPainter.isActive ()) { - TQPen XORpen = tqmaskPainter.pen (); + TQPen XORpen = maskPainter.pen (); // TODO??? #if 0 @@ -252,7 +252,7 @@ static TQPixmap pixmap (const TQPixmap &oldPixmap, XORpen.setColor (TQt::color0/*transparent*/); #endif - tqmaskPainter.setPen (XORpen); + maskPainter.setPen (XORpen); } PAINTER_CALL (drawLine (pointsInRect [0], pointsInRect [count - 1])); @@ -288,11 +288,11 @@ static TQPixmap pixmap (const TQPixmap &oldPixmap, if (painter.isActive ()) painter.end (); - if (tqmaskPainter.isActive ()) - tqmaskPainter.end (); + if (maskPainter.isActive ()) + maskPainter.end (); - if (!tqmaskBitmap.isNull ()) - pixmap.setMask (tqmaskBitmap); + if (!maskBitmap.isNull ()) + pixmap.setMask (maskBitmap); return pixmap; } @@ -671,7 +671,7 @@ void kpToolPolygon::cancelShape () endDraw (TQPoint (), TQRect ()); commandHistory ()->undo (); #else - viewManager ()->tqinvalidateTempPixmap (); + viewManager ()->invalidateTempPixmap (); #endif m_points.resize (0); @@ -781,7 +781,7 @@ void kpToolPolygon::endShape (const TQPoint &, const TQRect &) if (!hasBegunShape ()) return; - viewManager ()->tqinvalidateTempPixmap (); + viewManager ()->invalidateTempPixmap (); TQRect boundingRect = kpTool::neededRect (m_points.boundingRect (), m_lineWidth); diff --git a/kolourpaint/tools/kptoolrectangle.cpp b/kolourpaint/tools/kptoolrectangle.cpp index ea749da6..491e0fae 100644 --- a/kolourpaint/tools/kptoolrectangle.cpp +++ b/kolourpaint/tools/kptoolrectangle.cpp @@ -53,39 +53,39 @@ static TQPixmap pixmap (const kpToolRectangle::Mode mode, kpDocument *document, const TQRect &rect, const TQPoint &startPoint, const TQPoint &endPoint, - const TQPen &pen, const TQPen &tqmaskPen, - const TQBrush &brush, const TQBrush &tqmaskBrush) + const TQPen &pen, const TQPen &maskPen, + const TQBrush &brush, const TQBrush &maskBrush) { TQPixmap pixmap = document->getPixmapAt (rect); - TQBitmap tqmaskBitmap; + TQBitmap maskBitmap; - TQPainter painter, tqmaskPainter; + TQPainter painter, maskPainter; #if DEBUG_KP_TOOL_RECTANGLE && 1 kdDebug () << "pixmap: rect=" << rect << " startPoint=" << startPoint << " endPoint=" << endPoint << endl; - kdDebug () << "\tm: p=" << (tqmaskPen.style () != TQt::NoPen) - << " b=" << (tqmaskBrush.style () != TQt::NoBrush) + kdDebug () << "\tm: p=" << (maskPen.style () != TQt::NoPen) + << " b=" << (maskBrush.style () != TQt::NoBrush) << " o: p=" << (pen.style () != TQt::NoPen) << " b=" << (brush.style () != TQt::NoBrush) << endl; - kdDebug () << "\ttqmaskPen.color()=" << (int *) tqmaskPen.color ().rgb () + kdDebug () << "\tmaskPen.color()=" << (int *) maskPen.color ().rgb () << " transparent=" << (int *) TQt::color0.rgb ()/*transparent*/ << endl; #endif if (pixmap.tqmask () || - (tqmaskPen.style () != TQt::NoPen && - tqmaskPen.color () == TQt::color0/*transparent*/) || - (tqmaskBrush.style () != TQt::NoBrush && - tqmaskBrush.color () == TQt::color0/*transparent*/)) + (maskPen.style () != TQt::NoPen && + maskPen.color () == TQt::color0/*transparent*/) || + (maskBrush.style () != TQt::NoBrush && + maskBrush.color () == TQt::color0/*transparent*/)) { - tqmaskBitmap = kpPixmapFX::getNonNullMask (pixmap); - tqmaskPainter.begin (&tqmaskBitmap); - tqmaskPainter.setPen (tqmaskPen); - tqmaskPainter.setBrush (tqmaskBrush); + maskBitmap = kpPixmapFX::getNonNullMask (pixmap); + maskPainter.begin (&maskBitmap); + maskPainter.setPen (maskPen); + maskPainter.setBrush (maskBrush); } if (pen.style () != TQt::NoPen || @@ -101,8 +101,8 @@ static TQPixmap pixmap (const kpToolRectangle::Mode mode, if (painter.isActive ()) \ painter . cmd ; \ \ - if (tqmaskPainter.isActive ()) \ - tqmaskPainter . cmd ; \ + if (maskPainter.isActive ()) \ + maskPainter . cmd ; \ } if (startPoint != endPoint) @@ -144,11 +144,11 @@ static TQPixmap pixmap (const kpToolRectangle::Mode mode, if (painter.isActive ()) painter.end (); - if (tqmaskPainter.isActive ()) - tqmaskPainter.end (); + if (maskPainter.isActive ()) + maskPainter.end (); - if (!tqmaskBitmap.isNull ()) - pixmap.setMask (tqmaskBitmap); + if (!maskBitmap.isNull ()) + pixmap.setMask (maskBitmap); return pixmap; } @@ -231,7 +231,7 @@ void kpToolRectangle::slotBackgroundColorChanged (const kpColor &) // private void kpToolRectangle::updatePen (int mouseButton) { - TQColor tqmaskPenColor = color (mouseButton).tqmaskColor (); + TQColor maskPenColor = color (mouseButton).maskColor (); if (!m_toolWidgetLineWidth) { @@ -239,7 +239,7 @@ void kpToolRectangle::updatePen (int mouseButton) m_pen [mouseButton] = TQPen (color (mouseButton).toTQColor ()); else m_pen [mouseButton] = TQPen(Qt::NoPen); - m_tqmaskPen [mouseButton] = TQPen (tqmaskPenColor); + m_maskPen [mouseButton] = TQPen (maskPenColor); } else { @@ -251,7 +251,7 @@ void kpToolRectangle::updatePen (int mouseButton) } else m_pen [mouseButton] = TQPen(Qt::NoPen); - m_tqmaskPen [mouseButton] = TQPen (tqmaskPenColor, + m_maskPen [mouseButton] = TQPen (maskPenColor, m_toolWidgetLineWidth->lineWidth (), TQt::SolidLine); } @@ -270,14 +270,14 @@ void kpToolRectangle::updateBrush (int mouseButton) color (mouseButton)/*foreground colour*/, color (1 - mouseButton)/*background colour*/); - m_tqmaskBrush [mouseButton] = m_toolWidgetFillStyle->tqmaskBrush ( + m_maskBrush [mouseButton] = m_toolWidgetFillStyle->maskBrush ( color (mouseButton)/*foreground colour*/, color (1 - mouseButton)/*background colour*/); } else { m_brush [mouseButton] = TQBrush(Qt::NoBrush); - m_tqmaskBrush [mouseButton] = TQBrush(Qt::NoBrush); + m_maskBrush [mouseButton] = TQBrush(Qt::NoBrush); } } @@ -437,7 +437,7 @@ void kpToolRectangle::applyModifiers () m_toolRectangleRectWithoutLineWidth = rect; m_toolRectangleRect = kpTool::neededRect (rect, TQMAX (m_pen [m_mouseButton].width (), - m_tqmaskPen [m_mouseButton].width ())); + m_maskPen [m_mouseButton].width ())); } void kpToolRectangle::beginDraw () @@ -451,8 +451,8 @@ void kpToolRectangle::updateShape () TQPixmap newPixmap = pixmap (m_mode, document (), m_toolRectangleRect, m_toolRectangleStartPoint, m_toolRectangleEndPoint, - m_pen [m_mouseButton], m_tqmaskPen [m_mouseButton], - m_brush [m_mouseButton], m_tqmaskBrush [m_mouseButton]); + m_pen [m_mouseButton], m_maskPen [m_mouseButton], + m_brush [m_mouseButton], m_maskBrush [m_mouseButton]); kpTempPixmap newTempPixmap (false/*always display*/, kpTempPixmap::SetPixmap/*render mode*/, m_toolRectangleRect.topLeft (), @@ -511,7 +511,7 @@ void kpToolRectangle::cancelShape () endDraw (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); mainWindow ()->commandHistory ()->undo (); #else - viewManager ()->tqinvalidateTempPixmap (); + viewManager ()->invalidateTempPixmap (); #endif setUserMessage (i18n ("Let go of all the mouse buttons.")); @@ -527,13 +527,13 @@ void kpToolRectangle::endDraw (const TQPoint &, const TQRect &) applyModifiers (); // TODO: flicker - viewManager ()->tqinvalidateTempPixmap (); + viewManager ()->invalidateTempPixmap (); mainWindow ()->commandHistory ()->addCommand ( new kpToolRectangleCommand (m_mode, - m_pen [m_mouseButton], m_tqmaskPen [m_mouseButton], - m_brush [m_mouseButton], m_tqmaskBrush [m_mouseButton], + m_pen [m_mouseButton], m_maskPen [m_mouseButton], + m_brush [m_mouseButton], m_maskBrush [m_mouseButton], m_toolRectangleRect, m_toolRectangleStartPoint, m_toolRectangleEndPoint, mainWindow ())); @@ -546,15 +546,15 @@ void kpToolRectangle::endDraw (const TQPoint &, const TQRect &) */ kpToolRectangleCommand::kpToolRectangleCommand (kpToolRectangle::Mode mode, - const TQPen &pen, const TQPen &tqmaskPen, - const TQBrush &brush, const TQBrush &tqmaskBrush, + const TQPen &pen, const TQPen &maskPen, + const TQBrush &brush, const TQBrush &maskBrush, const TQRect &rect, const TQPoint &startPoint, const TQPoint &endPoint, kpMainWindow *mainWindow) : kpCommand (mainWindow), m_mode (mode), - m_pen (pen), m_tqmaskPen (tqmaskPen), - m_brush (brush), m_tqmaskBrush (tqmaskBrush), + m_pen (pen), m_maskPen (maskPen), + m_brush (brush), m_maskBrush (maskBrush), m_rect (rect), m_startPoint (startPoint), m_endPoint (endPoint), @@ -612,8 +612,8 @@ void kpToolRectangleCommand::execute () doc->setPixmapAt (pixmap (m_mode, doc, m_rect, m_startPoint, m_endPoint, - m_pen, m_tqmaskPen, - m_brush, m_tqmaskBrush), + m_pen, m_maskPen, + m_brush, m_maskBrush), m_rect.topLeft ()); } diff --git a/kolourpaint/tools/kptoolrectangle.h b/kolourpaint/tools/kptoolrectangle.h index 03ade5a7..e41b5d47 100644 --- a/kolourpaint/tools/kptoolrectangle.h +++ b/kolourpaint/tools/kptoolrectangle.h @@ -103,10 +103,10 @@ private: kpToolWidgetFillStyle *m_toolWidgetFillStyle; void updatePen (int mouseButton); - TQPen m_pen [2], m_tqmaskPen [2]; + TQPen m_pen [2], m_maskPen [2]; void updateBrush (int mouseButton); - TQBrush m_brush [2], m_tqmaskBrush [2]; + TQBrush m_brush [2], m_maskBrush [2]; void applyModifiers (); TQPoint m_toolRectangleStartPoint, m_toolRectangleEndPoint; @@ -117,8 +117,8 @@ class kpToolRectangleCommand : public kpCommand { public: kpToolRectangleCommand (kpToolRectangle::Mode mode, - const TQPen &pen, const TQPen &tqmaskPen, - const TQBrush &brush, const TQBrush &tqmaskBrush, + const TQPen &pen, const TQPen &maskPen, + const TQBrush &brush, const TQBrush &maskBrush, const TQRect &rect, const TQPoint &startPoint, const TQPoint &endPoint, kpMainWindow *mainWindow); @@ -133,8 +133,8 @@ public: private: kpToolRectangle::Mode m_mode; - TQPen m_pen, m_tqmaskPen; - TQBrush m_brush, m_tqmaskBrush; + TQPen m_pen, m_maskPen; + TQBrush m_brush, m_maskBrush; TQRect m_rect; TQPoint m_startPoint, m_endPoint; TQPixmap *m_oldPixmapPtr; |