diff options
Diffstat (limited to 'krita/ui/kis_cursor.cc')
-rw-r--r-- | krita/ui/kis_cursor.cc | 208 |
1 files changed, 104 insertions, 104 deletions
diff --git a/krita/ui/kis_cursor.cc b/krita/ui/kis_cursor.cc index 0b0b6ea5..33c6ae04 100644 --- a/krita/ui/kis_cursor.cc +++ b/krita/ui/kis_cursor.cc @@ -19,10 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qbitmap.h> -#include <qcursor.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqcursor.h> +#include <tqimage.h> +#include <tqpainter.h> #include <kcursor.h> #include <kiconloader.h> @@ -34,76 +34,76 @@ KisCursor::KisCursor() {} /* - * Predefined Qt cursors + * Predefined TQt cursors */ -QCursor KisCursor::arrowCursor() +TQCursor KisCursor::arrowCursor() { - return Qt::arrowCursor; + return TQt::arrowCursor; } -QCursor KisCursor::upArrowCursor() +TQCursor KisCursor::upArrowCursor() { - return Qt::upArrowCursor; + return TQt::upArrowCursor; } -QCursor KisCursor::crossCursor() +TQCursor KisCursor::crossCursor() { - return Qt::crossCursor; + return TQt::crossCursor; } -QCursor KisCursor::waitCursor() +TQCursor KisCursor::waitCursor() { - return Qt::waitCursor; + return TQt::waitCursor; } -QCursor KisCursor::ibeamCursor() +TQCursor KisCursor::ibeamCursor() { - return Qt::ibeamCursor; + return TQt::ibeamCursor; } -QCursor KisCursor::sizeVerCursor() +TQCursor KisCursor::sizeVerCursor() { - return Qt::sizeVerCursor; + return TQt::sizeVerCursor; } -QCursor KisCursor::sizeHorCursor() +TQCursor KisCursor::sizeHorCursor() { - return Qt::sizeHorCursor; + return TQt::sizeHorCursor; } -QCursor KisCursor::sizeBDiagCursor() +TQCursor KisCursor::sizeBDiagCursor() { - return Qt::sizeBDiagCursor; + return TQt::sizeBDiagCursor; } -QCursor KisCursor::sizeFDiagCursor() +TQCursor KisCursor::sizeFDiagCursor() { - return Qt::sizeFDiagCursor; + return TQt::sizeFDiagCursor; } -QCursor KisCursor::sizeAllCursor() +TQCursor KisCursor::sizeAllCursor() { - return Qt::sizeAllCursor; + return TQt::sizeAllCursor; } -QCursor KisCursor::blankCursor() +TQCursor KisCursor::blankCursor() { - return Qt::blankCursor; + return TQt::blankCursor; } -QCursor KisCursor::splitVCursor() +TQCursor KisCursor::splitVCursor() { - return Qt::splitVCursor; + return TQt::splitVCursor; } -QCursor KisCursor::splitHCursor() +TQCursor KisCursor::splitHCursor() { - return Qt::splitHCursor; + return TQt::splitHCursor; } -QCursor KisCursor::pointingHandCursor() +TQCursor KisCursor::pointingHandCursor() { - return Qt::pointingHandCursor; + return TQt::pointingHandCursor; } @@ -111,7 +111,7 @@ QCursor KisCursor::pointingHandCursor() * Existing custom KimageShop cursors. Use the 'load' function for all new cursors. */ -QCursor KisCursor::pickerCursor() +TQCursor KisCursor::pickerCursor() { static unsigned char picker_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x34, 0x00, 0x00, 0x7a, @@ -121,14 +121,14 @@ QCursor KisCursor::pickerCursor() 0x20, 0x07, 0x00, 0x90, 0x03, 0x00, 0xc8, 0x01, 0x00, 0xe4, 0x00, 0x00, 0x74, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00}; - QBitmap picker_bitmap(24, 24, picker_bits, true); - QBitmap picker_mask = picker_bitmap.createHeuristicMask( false ); + TQBitmap picker_bitmap(24, 24, picker_bits, true); + TQBitmap picker_tqmask = picker_bitmap.createHeuristicMask( false ); - return QCursor( picker_bitmap, picker_mask, 1, 22 ); + return TQCursor( picker_bitmap, picker_tqmask, 1, 22 ); } -QCursor KisCursor::pickerPlusCursor() +TQCursor KisCursor::pickerPlusCursor() { static unsigned char pickerplus_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x34, 0x00, 0x00, 0x7a, @@ -138,14 +138,14 @@ QCursor KisCursor::pickerPlusCursor() 0x20, 0x07, 0x0c, 0x90, 0x83, 0x7f, 0xc8, 0x81, 0x7f, 0xe4, 0x00, 0x0c, 0x74, 0x00, 0x0c, 0x32, 0x00, 0x0c, 0x0a, 0x00, 0x0c, 0x00, 0x00, 0x00}; - QBitmap picker_bitmap(24, 24, pickerplus_bits, true); - QBitmap picker_mask = picker_bitmap.createHeuristicMask( false ); + TQBitmap picker_bitmap(24, 24, pickerplus_bits, true); + TQBitmap picker_tqmask = picker_bitmap.createHeuristicMask( false ); - return QCursor( picker_bitmap, picker_mask, 1, 22 ); + return TQCursor( picker_bitmap, picker_tqmask, 1, 22 ); } -QCursor KisCursor::pickerMinusCursor() +TQCursor KisCursor::pickerMinusCursor() { static unsigned char pickerminus_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x34, 0x00, 0x00, 0x7a, @@ -155,15 +155,15 @@ QCursor KisCursor::pickerMinusCursor() 0x20, 0x07, 0x00, 0x90, 0xc3, 0x7f, 0xc8, 0xc1, 0x7f, 0xe4, 0x00, 0x00, 0x74, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00}; - QBitmap picker_bitmap(24, 24, pickerminus_bits, true); - QBitmap picker_mask = picker_bitmap.createHeuristicMask( false ); + TQBitmap picker_bitmap(24, 24, pickerminus_bits, true); + TQBitmap picker_tqmask = picker_bitmap.createHeuristicMask( false ); - return QCursor( picker_bitmap, picker_mask, 1, 22 ); + return TQCursor( picker_bitmap, picker_tqmask, 1, 22 ); } -QCursor KisCursor::penCursor() +TQCursor KisCursor::penCursor() { static unsigned char pen_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x7d, @@ -173,13 +173,13 @@ QCursor KisCursor::penCursor() 0xd0, 0x0f, 0x00, 0x88, 0x07, 0x00, 0x88, 0x03, 0x00, 0xe4, 0x01, 0x00, 0x7c, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00}; - QBitmap pen_bitmap( 24, 24, pen_bits, true ); - QBitmap pen_mask = pen_bitmap.createHeuristicMask( false ); + TQBitmap pen_bitmap( 24, 24, pen_bits, true ); + TQBitmap pen_tqmask = pen_bitmap.createHeuristicMask( false ); - return QCursor( pen_bitmap, pen_mask, 1, 22 ); + return TQCursor( pen_bitmap, pen_tqmask, 1, 22 ); } -QCursor KisCursor::brushCursor() +TQCursor KisCursor::brushCursor() { static unsigned char brush_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x68, 0x00, @@ -191,13 +191,13 @@ QCursor KisCursor::brushCursor() 0xd0, 0x0f, 0x00, 0x00, 0xe8, 0x07, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - QBitmap brush_bitmap( 25, 23, brush_bits, true ); - QBitmap brush_mask = brush_bitmap.createHeuristicMask( false ); + TQBitmap brush_bitmap( 25, 23, brush_bits, true ); + TQBitmap brush_tqmask = brush_bitmap.createHeuristicMask( false ); - return QCursor( brush_bitmap, brush_mask, 1, 21 ); + return TQCursor( brush_bitmap, brush_tqmask, 1, 21 ); } -QCursor KisCursor::airbrushCursor() +TQCursor KisCursor::airbrushCursor() { static unsigned char airbrush_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x68, 0x00, 0x00, 0x74, @@ -207,13 +207,13 @@ QCursor KisCursor::airbrushCursor() 0xd0, 0xff, 0x31, 0xe8, 0xf7, 0x30, 0xf4, 0x03, 0x18, 0xfc, 0x01, 0x0c, 0xf8, 0x00, 0x06, 0x76, 0x00, 0x03, 0x36, 0x00, 0x03, 0x00, 0x00, 0x00}; - QBitmap airbrush_bitmap( 24, 24, airbrush_bits, true ); - QBitmap airbrush_mask = airbrush_bitmap.createHeuristicMask( false ); + TQBitmap airbrush_bitmap( 24, 24, airbrush_bits, true ); + TQBitmap airbrush_tqmask = airbrush_bitmap.createHeuristicMask( false ); - return QCursor( airbrush_bitmap, airbrush_mask, 1, 22 ); + return TQCursor( airbrush_bitmap, airbrush_tqmask, 1, 22 ); } -QCursor KisCursor::eraserCursor() +TQCursor KisCursor::eraserCursor() { static unsigned char eraser_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1d, 0x00, @@ -225,13 +225,13 @@ QCursor KisCursor::eraserCursor() 0xe2, 0x0f, 0x00, 0x00, 0xc4, 0x07, 0x00, 0x00, 0x88, 0x03, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - QBitmap eraser_bitmap( 25, 24, eraser_bits, true ); - QBitmap eraser_mask = eraser_bitmap.createHeuristicMask( false ); + TQBitmap eraser_bitmap( 25, 24, eraser_bits, true ); + TQBitmap eraser_tqmask = eraser_bitmap.createHeuristicMask( false ); - return QCursor( eraser_bitmap, eraser_mask, 7, 22 ); + return TQCursor( eraser_bitmap, eraser_tqmask, 7, 22 ); } -QCursor KisCursor::fillerCursor() +TQCursor KisCursor::fillerCursor() { static unsigned char filler_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x28, 0x00, @@ -241,13 +241,13 @@ QCursor KisCursor::fillerCursor() 0x9c, 0x01, 0x05, 0x1c, 0x82, 0x02, 0x18, 0x4c, 0x01, 0x18, 0xb0, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00}; - QBitmap filler_bitmap( 22, 22, filler_bits, true ); - QBitmap filler_mask = filler_bitmap.createHeuristicMask( false ); + TQBitmap filler_bitmap( 22, 22, filler_bits, true ); + TQBitmap filler_tqmask = filler_bitmap.createHeuristicMask( false ); - return QCursor( filler_bitmap, filler_mask, 3, 20 ); + return TQCursor( filler_bitmap, filler_tqmask, 3, 20 ); } -QCursor KisCursor::colorChangerCursor() +TQCursor KisCursor::colorChangerCursor() { static unsigned char colorChanger_bits[] = { 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x10, 0x01, 0x0e, 0x08, 0x02, 0x11, @@ -257,13 +257,13 @@ QCursor KisCursor::colorChangerCursor() 0xe8, 0x3d, 0x17, 0xd0, 0x3c, 0x10, 0x20, 0x38, 0x08, 0x40, 0x00, 0x06, 0x80, 0x81, 0x01, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00}; - QBitmap colorChanger_bitmap( 24, 23, colorChanger_bits, true ); - QBitmap colorChanger_mask = colorChanger_bitmap.createHeuristicMask( false ); + TQBitmap colorChanger_bitmap( 24, 23, colorChanger_bits, true ); + TQBitmap colorChanger_tqmask = colorChanger_bitmap.createHeuristicMask( false ); - return QCursor( colorChanger_bitmap, colorChanger_mask, 12, 10 ); + return TQCursor( colorChanger_bitmap, colorChanger_tqmask, 12, 10 ); } -QCursor KisCursor::zoomCursor() +TQCursor KisCursor::zoomCursor() { static unsigned char zoom_bits[] = { 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0xf0, 0x3f, 0x00, 0x38, 0x70, 0x00, @@ -273,13 +273,13 @@ QCursor KisCursor::zoomCursor() 0x00, 0xc0, 0x17, 0x00, 0x80, 0x2f, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00}; - QBitmap zoom_bitmap( 24, 23, zoom_bits, true ); - QBitmap zoom_mask = zoom_bitmap.createHeuristicMask( false ); + TQBitmap zoom_bitmap( 24, 23, zoom_bits, true ); + TQBitmap zoom_tqmask = zoom_bitmap.createHeuristicMask( false ); - return QCursor( zoom_bitmap, zoom_mask, 9, 8 ); + return TQCursor( zoom_bitmap, zoom_tqmask, 9, 8 ); } -QCursor KisCursor::moveCursor() +TQCursor KisCursor::moveCursor() { static unsigned char move_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x7e, 0x00, @@ -289,18 +289,18 @@ QCursor KisCursor::moveCursor() 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00}; - QBitmap move_bitmap( 24, 24, move_bits, true ); - QBitmap move_mask = move_bitmap.createHeuristicMask( false ); + TQBitmap move_bitmap( 24, 24, move_bits, true ); + TQBitmap move_tqmask = move_bitmap.createHeuristicMask( false ); - return QCursor( move_bitmap, move_mask, 12, 11 ); + return TQCursor( move_bitmap, move_tqmask, 12, 11 ); } -QCursor KisCursor::handCursor() +TQCursor KisCursor::handCursor() { return KCursor::handCursor(); } -QCursor KisCursor::selectCursor() +TQCursor KisCursor::selectCursor() { static unsigned char select_bits[] = { 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, @@ -310,65 +310,65 @@ QCursor KisCursor::selectCursor() 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00}; - QBitmap select_bitmap(23, 23, select_bits, true); - QBitmap select_mask = select_bitmap.createHeuristicMask( false ); + TQBitmap select_bitmap(23, 23, select_bits, true); + TQBitmap select_tqmask = select_bitmap.createHeuristicMask( false ); - return QCursor( select_bitmap, select_mask, 11, 11 ); + return TQCursor( select_bitmap, select_tqmask, 11, 11 ); } -QCursor KisCursor::openHandCursor() +TQCursor KisCursor::openHandCursor() { return load("openhand_cursor.xpm"); } -QCursor KisCursor::closedHandCursor() +TQCursor KisCursor::closedHandCursor() { return load("closedhand_cursor.xpm"); } -QCursor KisCursor::rotateCursor() +TQCursor KisCursor::rotateCursor() { return load("rotate_cursor.xpm"); } -QCursor KisCursor::load(const QString & iconName, int hotspotX, int hotspotY) +TQCursor KisCursor::load(const TQString & iconName, int hotspotX, int hotspotY) { - QString filename = KisFactory::instance()->dirs()->findResource("kis_pics", iconName); - QImage cursorImage; + TQString filename = KisFactory::instance()->dirs()->findResource("kis_pics", iconName); + TQImage cursorImage; cursorImage.load(filename); Q_ASSERT(!cursorImage.isNull()); Q_ASSERT(cursorImage.hasAlphaBuffer()); - QBitmap bitmap(cursorImage.width(), cursorImage.height()); - QBitmap mask(cursorImage.width(), cursorImage.height()); + TQBitmap bitmap(cursorImage.width(), cursorImage.height()); + TQBitmap tqmask(cursorImage.width(), cursorImage.height()); - QPainter bitmapPainter(&bitmap); - QPainter maskPainter(&mask); + TQPainter bitmapPainter(&bitmap); + TQPainter tqmaskPainter(&tqmask); - for (Q_INT32 x = 0; x < cursorImage.width(); ++x) { - for (Q_INT32 y = 0; y < cursorImage.height(); ++y) { + for (TQ_INT32 x = 0; x < cursorImage.width(); ++x) { + for (TQ_INT32 y = 0; y < cursorImage.height(); ++y) { - QRgb pixel = cursorImage.pixel(x, y); + TQRgb pixel = cursorImage.pixel(x, y); - if (qAlpha(pixel) < 128) { - bitmapPainter.setPen(Qt::color0); - maskPainter.setPen(Qt::color0); + if (tqAlpha(pixel) < 128) { + bitmapPainter.setPen(TQt::color0); + tqmaskPainter.setPen(TQt::color0); } else { - maskPainter.setPen(Qt::color1); + tqmaskPainter.setPen(TQt::color1); - if (qGray(pixel) < 128) { - bitmapPainter.setPen(Qt::color1); + if (tqGray(pixel) < 128) { + bitmapPainter.setPen(TQt::color1); } else { - bitmapPainter.setPen(Qt::color0); + bitmapPainter.setPen(TQt::color0); } } bitmapPainter.drawPoint(x, y); - maskPainter.drawPoint(x, y); + tqmaskPainter.drawPoint(x, y); } } - return QCursor(bitmap, mask, hotspotX, hotspotY); + return TQCursor(bitmap, tqmask, hotspotX, hotspotY); } |