diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
commit | 11f31c37e5fa4889d9989f10272f44845449cb7b (patch) | |
tree | 4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/editors/notation/NotePixmapFactory.cpp | |
parent | 832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff) | |
download | rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.tar.gz rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.zip |
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/editors/notation/NotePixmapFactory.cpp')
-rw-r--r-- | src/gui/editors/notation/NotePixmapFactory.cpp | 470 |
1 files changed, 235 insertions, 235 deletions
diff --git a/src/gui/editors/notation/NotePixmapFactory.cpp b/src/gui/editors/notation/NotePixmapFactory.cpp index c2a99ee..b41ecae 100644 --- a/src/gui/editors/notation/NotePixmapFactory.cpp +++ b/src/gui/editors/notation/NotePixmapFactory.cpp @@ -56,20 +56,20 @@ #include "NoteStyle.h" #include <kglobal.h> #include <kmessagebox.h> -#include <qbitmap.h> -#include <qcolor.h> -#include <qfile.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qimage.h> -#include <qpainter.h> -#include <qpen.h> -#include <qpixmap.h> -#include <qpointarray.h> -#include <qpoint.h> -#include <qrect.h> -#include <qstring.h> -#include <qwmatrix.h> +#include <tqbitmap.h> +#include <tqcolor.h> +#include <tqfile.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqpixmap.h> +#include <tqpointarray.h> +#include <tqpoint.h> +#include <tqrect.h> +#include <tqstring.h> +#include <tqwmatrix.h> namespace Rosegarden @@ -82,7 +82,7 @@ static clock_t makeNotesTime = 0; static int drawBeamsCount = 0; static int drawBeamsBeamCount = 0; -class NotePixmapCache : public std::map<CharName, QCanvasPixmap*> +class NotePixmapCache : public std::map<CharName, TQCanvasPixmap*> { // nothing to add -- just so we can predeclare it in the header }; @@ -94,23 +94,23 @@ const char* const NotePixmapFactory::defaultTimeSigFontFamily = "Bitstream Vera NotePixmapFactory::NotePixmapFactory(std::string fontName, int size) : m_selected(false), m_shaded(false), - m_tupletCountFont(defaultSerifFontFamily, 8, QFont::Bold), + m_tupletCountFont(defaultSerifFontFamily, 8, TQFont::Bold), m_tupletCountFontMetrics(m_tupletCountFont), - m_textMarkFont(defaultSerifFontFamily, 8, QFont::Bold, true), + m_textMarkFont(defaultSerifFontFamily, 8, TQFont::Bold, true), m_textMarkFontMetrics(m_textMarkFont), - m_fingeringFont(defaultSerifFontFamily, 8, QFont::Bold), + m_fingeringFont(defaultSerifFontFamily, 8, TQFont::Bold), m_fingeringFontMetrics(m_fingeringFont), - m_timeSigFont(defaultTimeSigFontFamily, 8, QFont::Bold), + m_timeSigFont(defaultTimeSigFontFamily, 8, TQFont::Bold), m_timeSigFontMetrics(m_timeSigFont), - m_bigTimeSigFont(defaultTimeSigFontFamily, 12, QFont::Normal), + m_bigTimeSigFont(defaultTimeSigFontFamily, 12, TQFont::Normal), m_bigTimeSigFontMetrics(m_bigTimeSigFont), - m_ottavaFont(defaultSerifFontFamily, 8, QFont::Normal, true), + m_ottavaFont(defaultSerifFontFamily, 8, TQFont::Normal, true), m_ottavaFontMetrics(m_ottavaFont), - m_clefOttavaFont(defaultSerifFontFamily, 8, QFont::Normal), + m_clefOttavaFont(defaultSerifFontFamily, 8, TQFont::Normal), m_clefOttavaFontMetrics(m_ottavaFont), - m_trackHeaderFont(defaultSansSerifFontFamily, 10, QFont::Normal), + m_trackHeaderFont(defaultSansSerifFontFamily, 10, TQFont::Normal), m_trackHeaderFontMetrics(m_trackHeaderFont), - m_trackHeaderBoldFont(defaultSansSerifFontFamily, 10, QFont::Bold), + m_trackHeaderBoldFont(defaultSansSerifFontFamily, 10, TQFont::Bold), m_trackHeaderBoldFontMetrics(m_trackHeaderBoldFont), m_generatedPixmap(0), m_generatedMask(0), @@ -136,13 +136,13 @@ NotePixmapFactory::NotePixmapFactory(const NotePixmapFactory &npf) : m_timeSigFontMetrics(m_timeSigFont), m_bigTimeSigFont(npf.m_bigTimeSigFont), m_bigTimeSigFontMetrics(m_bigTimeSigFont), - m_ottavaFont(defaultSerifFontFamily, 8, QFont::Normal, true), + m_ottavaFont(defaultSerifFontFamily, 8, TQFont::Normal, true), m_ottavaFontMetrics(m_ottavaFont), - m_clefOttavaFont(defaultSerifFontFamily, 8, QFont::Normal), + m_clefOttavaFont(defaultSerifFontFamily, 8, TQFont::Normal), m_clefOttavaFontMetrics(m_ottavaFont), - m_trackHeaderFont(defaultSansSerifFontFamily, 10, QFont::Normal), + m_trackHeaderFont(defaultSansSerifFontFamily, 10, TQFont::Normal), m_trackHeaderFontMetrics(m_trackHeaderFont), - m_trackHeaderBoldFont(defaultSansSerifFontFamily, 10, QFont::Bold), + m_trackHeaderBoldFont(defaultSansSerifFontFamily, 10, TQFont::Bold), m_trackHeaderBoldFontMetrics(m_trackHeaderBoldFont), m_generatedPixmap(0), m_generatedMask(0), @@ -162,23 +162,23 @@ NotePixmapFactory::operator=(const NotePixmapFactory &npf) m_selected = npf.m_selected; m_shaded = npf.m_shaded; m_timeSigFont = npf.m_timeSigFont; - m_timeSigFontMetrics = QFontMetrics(m_timeSigFont); + m_timeSigFontMetrics = TQFontMetrics(m_timeSigFont); m_bigTimeSigFont = npf.m_bigTimeSigFont; - m_bigTimeSigFontMetrics = QFontMetrics(m_bigTimeSigFont); + m_bigTimeSigFontMetrics = TQFontMetrics(m_bigTimeSigFont); m_tupletCountFont = npf.m_tupletCountFont; - m_tupletCountFontMetrics = QFontMetrics(m_tupletCountFont); + m_tupletCountFontMetrics = TQFontMetrics(m_tupletCountFont); m_textMarkFont = npf.m_textMarkFont; - m_textMarkFontMetrics = QFontMetrics(m_textMarkFont); + m_textMarkFontMetrics = TQFontMetrics(m_textMarkFont); m_fingeringFont = npf.m_fingeringFont; - m_fingeringFontMetrics = QFontMetrics(m_fingeringFont); + m_fingeringFontMetrics = TQFontMetrics(m_fingeringFont); m_ottavaFont = npf.m_ottavaFont; - m_ottavaFontMetrics = QFontMetrics(m_ottavaFont); + m_ottavaFontMetrics = TQFontMetrics(m_ottavaFont); m_clefOttavaFont = npf.m_clefOttavaFont; - m_clefOttavaFontMetrics = QFontMetrics(m_clefOttavaFont); + m_clefOttavaFontMetrics = TQFontMetrics(m_clefOttavaFont); m_trackHeaderFont = npf.m_trackHeaderFont; - m_trackHeaderFontMetrics = QFontMetrics(m_trackHeaderFont); + m_trackHeaderFontMetrics = TQFontMetrics(m_trackHeaderFont); m_trackHeaderBoldFont = npf.m_trackHeaderBoldFont; - m_trackHeaderBoldFontMetrics = QFontMetrics(m_trackHeaderBoldFont); + m_trackHeaderBoldFontMetrics = TQFontMetrics(m_trackHeaderBoldFont); init(npf.m_font->getName(), npf.m_font->getSize()); m_dottedRestCache->clear(); m_textFontCache.clear(); @@ -224,7 +224,7 @@ NotePixmapFactory::init(std::string fontName, int size) // Resize the fonts, because the original constructor used point // sizes only and we want pixels - QFont timeSigFont(defaultTimeSigFontFamily), + TQFont timeSigFont(defaultTimeSigFontFamily), textFont(defaultSerifFontFamily); KConfig* config = kapp->config(); config->setGroup(NotationViewConfigGroup); @@ -232,43 +232,43 @@ NotePixmapFactory::init(std::string fontName, int size) m_timeSigFont = config->readFontEntry("timesigfont", &timeSigFont); m_timeSigFont.setBold(true); m_timeSigFont.setPixelSize(size * 5 / 2); - m_timeSigFontMetrics = QFontMetrics(m_timeSigFont); + m_timeSigFontMetrics = TQFontMetrics(m_timeSigFont); m_bigTimeSigFont = config->readFontEntry("timesigfont", &timeSigFont); m_bigTimeSigFont.setPixelSize(size * 4 + 2); - m_bigTimeSigFontMetrics = QFontMetrics(m_bigTimeSigFont); + m_bigTimeSigFontMetrics = TQFontMetrics(m_bigTimeSigFont); m_tupletCountFont = config->readFontEntry("textfont", &textFont); m_tupletCountFont.setBold(true); m_tupletCountFont.setPixelSize(size * 2); - m_tupletCountFontMetrics = QFontMetrics(m_tupletCountFont); + m_tupletCountFontMetrics = TQFontMetrics(m_tupletCountFont); m_textMarkFont = config->readFontEntry("textfont", &textFont); m_textMarkFont.setBold(true); m_textMarkFont.setItalic(true); m_textMarkFont.setPixelSize(size * 2); - m_textMarkFontMetrics = QFontMetrics(m_textMarkFont); + m_textMarkFontMetrics = TQFontMetrics(m_textMarkFont); m_fingeringFont = config->readFontEntry("textfont", &textFont); m_fingeringFont.setBold(true); m_fingeringFont.setPixelSize(size * 5 / 3); - m_fingeringFontMetrics = QFontMetrics(m_fingeringFont); + m_fingeringFontMetrics = TQFontMetrics(m_fingeringFont); m_ottavaFont = config->readFontEntry("textfont", &textFont); m_ottavaFont.setPixelSize(size * 2); - m_ottavaFontMetrics = QFontMetrics(m_ottavaFont); + m_ottavaFontMetrics = TQFontMetrics(m_ottavaFont); m_clefOttavaFont = config->readFontEntry("textfont", &textFont); m_clefOttavaFont.setPixelSize(getLineSpacing() * 3 / 2); - m_clefOttavaFontMetrics = QFontMetrics(m_clefOttavaFont); + m_clefOttavaFontMetrics = TQFontMetrics(m_clefOttavaFont); m_trackHeaderFont = config->readFontEntry("sansfont", &m_trackHeaderFont); m_trackHeaderFont.setPixelSize(12); - m_trackHeaderFontMetrics = QFontMetrics(m_trackHeaderFont); + m_trackHeaderFontMetrics = TQFontMetrics(m_trackHeaderFont); m_trackHeaderBoldFont = m_trackHeaderFont; m_trackHeaderBoldFont.setBold(true); - m_trackHeaderBoldFontMetrics = QFontMetrics(m_trackHeaderBoldFont); + m_trackHeaderBoldFontMetrics = TQFontMetrics(m_trackHeaderBoldFont); } NotePixmapFactory::~NotePixmapFactory() @@ -290,9 +290,9 @@ NotePixmapFactory::getSize() const } QPixmap -NotePixmapFactory::toQPixmap(QCanvasPixmap* cp) +NotePixmapFactory::toQPixmap(TQCanvasPixmap* cp) { - QPixmap p = *cp; + TQPixmap p = *cp; delete cp; return p; } @@ -317,7 +317,7 @@ NotePixmapFactory::dumpStats(std::ostream &s) (void)s; // avoid warnings } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeNotePixmap(const NotePixmapParameters ¶ms) { Profiler profiler("NotePixmapFactory::makeNotePixmap"); @@ -325,7 +325,7 @@ NotePixmapFactory::makeNotePixmap(const NotePixmapParameters ¶ms) drawNoteAux(params, 0, 0, 0); - QPoint hotspot(m_left, m_above + m_noteBodyHeight / 2); + TQPoint hotspot(m_left, m_above + m_noteBodyHeight / 2); //#define ROSE_DEBUG_NOTE_PIXMAP_FACTORY #ifdef ROSE_DEBUG_NOTE_PIXMAP_FACTORY @@ -354,7 +354,7 @@ NotePixmapFactory::makeNotePixmap(const NotePixmapParameters ¶ms) void NotePixmapFactory::drawNote(const NotePixmapParameters ¶ms, - QPainter &painter, int x, int y) + TQPainter &painter, int x, int y) { Profiler profiler("NotePixmapFactory::drawNote"); m_inPrinterMethod = true; @@ -364,7 +364,7 @@ NotePixmapFactory::drawNote(const NotePixmapParameters ¶ms, void NotePixmapFactory::drawNoteAux(const NotePixmapParameters ¶ms, - QPainter *painter, int x, int y) + TQPainter *painter, int x, int y) { NoteFont::CharacterType charType = m_inPrinterMethod ? NoteFont::Printer : NoteFont::Screen; @@ -471,7 +471,7 @@ NotePixmapFactory::drawNoteAux(const NotePixmapParameters ¶ms, } } - QPoint startPoint, endPoint; + TQPoint startPoint, endPoint; if (isStemmed && params.m_drawStem) { makeRoomForStemAndFlags(drawFlag ? flagCount : 0, stemLength, params, startPoint, endPoint); @@ -526,7 +526,7 @@ NotePixmapFactory::drawNoteAux(const NotePixmapParameters ¶ms, params.m_inRange ? PlainColour : OutRangeColour, inverted); - QPoint bodyLocation(m_left - m_borderX, + TQPoint bodyLocation(m_left - m_borderX, m_above - m_borderY + getStaffLineThickness() / 2); if (params.m_shifted) { if (params.m_stemGoesUp) { @@ -603,7 +603,7 @@ NotePixmapFactory::drawNoteAux(const NotePixmapParameters ¶ms, } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeNoteHaloPixmap(const NotePixmapParameters ¶ms) { int nbh0 = getNoteBodyHeight(); @@ -614,19 +614,19 @@ NotePixmapFactory::makeNoteHaloPixmap(const NotePixmapParameters ¶ms) createPixmapAndMask(nbw + nbw0, nbh + nbh0); drawNoteHalo(0, 0, nbw + nbw0, nbh + nbh0); - return makeCanvasPixmap(QPoint(nbw0 / 2, nbh0)); + return makeCanvasPixmap(TQPoint(nbw0 / 2, nbh0)); } void NotePixmapFactory::drawNoteHalo(int x, int y, int w, int h) { - m_p->painter().setPen(QPen(QColor(GUIPalette::CollisionHaloHue, + m_p->painter().setPen(TQPen(TQColor(GUIPalette::CollisionHaloHue, GUIPalette::CollisionHaloSaturation, - 255, QColor::Hsv), 1)); - m_p->painter().setBrush(QColor(GUIPalette::CollisionHaloHue, + 255, TQColor::Hsv), 1)); + m_p->painter().setBrush(TQColor(GUIPalette::CollisionHaloHue, GUIPalette::CollisionHaloSaturation, - 255, QColor::Hsv)); + 255, TQColor::Hsv)); m_p->drawEllipse(x, y, w, h); } @@ -699,7 +699,7 @@ NotePixmapFactory::makeRoomForAccidental(Accidental a, NoteCharacter ac (m_font->getCharacter(m_style->getAccidentalCharName(a))); - QPoint ah(m_font->getHotspot(m_style->getAccidentalCharName(a))); + TQPoint ah(m_font->getHotspot(m_style->getAccidentalCharName(a))); m_left += ac.getWidth() + (m_noteBodyWidth / 4 - m_borderX); @@ -725,7 +725,7 @@ NotePixmapFactory::makeRoomForAccidental(Accidental a, NoteCharacter acSharp (m_font->getCharacter(m_style->getAccidentalCharName (Accidentals::Sharp))); - QPoint ahSharp + TQPoint ahSharp (m_font->getHotspot(m_style->getAccidentalCharName (Accidentals::Sharp))); step = std::max(step, acSharp.getWidth() - ahSharp.x()); @@ -753,7 +753,7 @@ NotePixmapFactory::drawAccidental(Accidental a, bool cautionary) NoteCharacter ac = getCharacter (m_style->getAccidentalCharName(a), PlainColour, false); - QPoint ah(m_font->getHotspot(m_style->getAccidentalCharName(a))); + TQPoint ah(m_font->getHotspot(m_style->getAccidentalCharName(a))); int ax = 0; @@ -792,8 +792,8 @@ NotePixmapFactory::makeRoomForMarks(bool isStemmed, } else { // Inefficient to do this here _and_ in drawMarks, but // text marks are not all that common - QString text = strtoqstr(Marks::getTextFromMark(*i)); - QRect bounds = m_textMarkFontMetrics.boundingRect(text); + TQString text = strtoqstr(Marks::getTextFromMark(*i)); + TQRect bounds = m_textMarkFontMetrics.boundingRect(text); height += bounds.height() + gap; if (bounds.width() > width) width = bounds.width(); @@ -836,8 +836,8 @@ NotePixmapFactory::makeRoomForMarks(bool isStemmed, } else { // Inefficient to do this here _and_ in drawMarks - QString text = strtoqstr(Marks::getFingeringFromMark(*i)); - QRect bounds = m_fingeringFontMetrics.boundingRect(text); + TQString text = strtoqstr(Marks::getFingeringFromMark(*i)); + TQRect bounds = m_fingeringFontMetrics.boundingRect(text); height += bounds.height() + gap + 3; if (bounds.width() > width) width = bounds.width(); @@ -888,8 +888,8 @@ NotePixmapFactory::drawMarks(bool isStemmed, } else { - QString text = strtoqstr(Marks::getTextFromMark(*i)); - QRect bounds = m_textMarkFontMetrics.boundingRect(text); + TQString text = strtoqstr(Marks::getTextFromMark(*i)); + TQRect bounds = m_textMarkFontMetrics.boundingRect(text); m_p->painter().setFont(m_textMarkFont); if (!m_inPrinterMethod) @@ -973,8 +973,8 @@ NotePixmapFactory::drawMarks(bool isStemmed, } } else { - QString text = strtoqstr(Marks::getFingeringFromMark(*i)); - QRect bounds = m_fingeringFontMetrics.boundingRect(text); + TQString text = strtoqstr(Marks::getFingeringFromMark(*i)); + TQRect bounds = m_fingeringFontMetrics.boundingRect(text); m_p->painter().setFont(m_fingeringFont); if (!m_inPrinterMethod) @@ -1107,7 +1107,7 @@ NotePixmapFactory::drawLegerLines(const NotePixmapParameters ¶ms) void NotePixmapFactory::makeRoomForStemAndFlags(int flagCount, int stemLength, const NotePixmapParameters ¶ms, - QPoint &s0, QPoint &s1) + TQPoint &s0, TQPoint &s1) { // The coordinates we set in s0 and s1 are relative to (m_above, m_left) @@ -1194,7 +1194,7 @@ NotePixmapFactory::makeRoomForStemAndFlags(int flagCount, int stemLength, void NotePixmapFactory::drawFlags(int flagCount, const NotePixmapParameters ¶ms, - const QPoint &, const QPoint &s1) + const TQPoint &, const TQPoint &s1) { if (flagCount < 1) return ; @@ -1219,7 +1219,7 @@ NotePixmapFactory::drawFlags(int flagCount, return ; } - QPoint hotspot = flagChar.getHotspot(); + TQPoint hotspot = flagChar.getHotspot(); NoteCharacter oneFlagChar; bool foundOne = @@ -1270,7 +1270,7 @@ NotePixmapFactory::drawFlags(int flagCount, } else { // the normal case - QPoint hotspot = flagChar.getHotspot(); + TQPoint hotspot = flagChar.getHotspot(); int y = m_above + s1.y(); if (!params.m_stemGoesUp) @@ -1282,7 +1282,7 @@ NotePixmapFactory::drawFlags(int flagCount, void NotePixmapFactory::drawStem(const NotePixmapParameters ¶ms, - const QPoint &s0, const QPoint &s1, + const TQPoint &s0, const TQPoint &s1, int shortening) { if (params.m_stemGoesUp) @@ -1336,7 +1336,7 @@ NotePixmapFactory::drawShallowLine(int x0, int y0, int x1, int y1, } } else { Profiler profiler("NotePixmapFactory::drawShallowLine(polygon)"); - QPointArray qp(4); + TQPointArray qp(4); qp.setPoint(0, x0, y0); qp.setPoint(1, x0, y0 + thickness); qp.setPoint(2, x1, y1 + thickness); @@ -1352,14 +1352,14 @@ NotePixmapFactory::drawShallowLine(int x0, int y0, int x1, int y1, int dv = y1 - y0; int dh = x1 - x0; - static std::vector<QColor> colours, selectedColours; + static std::vector<TQColor> colours, selectedColours; if (colours.size() == 0) { int h, s, v; - QColor c = GUIPalette::getColour(GUIPalette::SelectedElement); + TQColor c = GUIPalette::getColour(GUIPalette::SelectedElement); c.hsv(&h, &s, &v); for (int step = 0; step < 256; step += (step == 0 ? 63 : 64)) { - colours.push_back(QColor( -1, 0, step, QColor::Hsv)); - selectedColours.push_back(QColor(h, 255 - step, v, QColor::Hsv)); + colours.push_back(TQColor( -1, 0, step, TQColor::Hsv)); + selectedColours.push_back(TQColor(h, 255 - step, v, TQColor::Hsv)); } } @@ -1444,7 +1444,7 @@ NotePixmapFactory::drawShallowLine(int x0, int y0, int x1, int y1, } void -NotePixmapFactory::drawBeams(const QPoint &s1, +NotePixmapFactory::drawBeams(const TQPoint &s1, const NotePixmapParameters ¶ms, int beamCount) { @@ -1521,7 +1521,7 @@ NotePixmapFactory::drawBeams(const QPoint &s1, } void -NotePixmapFactory::drawSlashes(const QPoint &s0, +NotePixmapFactory::drawSlashes(const TQPoint &s0, const NotePixmapParameters ¶ms, int slashCount) { @@ -1587,9 +1587,9 @@ NotePixmapFactory::drawTuplingLine(const NotePixmapParameters ¶ms) int thickness = getStaffLineThickness() * 3 / 2; int countSpace = thickness * 2; - QString count; + TQString count; count.setNum(params.m_tupletCount); - QRect cr = m_tupletCountFontMetrics.boundingRect(count); + TQRect cr = m_tupletCountFontMetrics.boundingRect(count); int tlw = params.m_tuplingLineWidth; int indent = m_noteBodyWidth / 2; @@ -1722,7 +1722,7 @@ NotePixmapFactory::drawTie(bool above, int length, int shift) // We can't request a smooth slur here, because that always involves // creating a new pixmap - QPoint hotspot; + TQPoint hotspot; drawSlurAux(length, 0, above, false, true, false, hotspot, &m_p->painter(), x, @@ -1733,7 +1733,7 @@ NotePixmapFactory::drawTie(bool above, int length, int shift) #endif } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeRestPixmap(const NotePixmapParameters ¶ms) { Profiler profiler("NotePixmapFactory::makeRestPixmap"); @@ -1759,19 +1759,19 @@ NotePixmapFactory::makeRestPixmap(const NotePixmapParameters ¶ms) NotePixmapCache::iterator ci(m_dottedRestCache->find(charName)); if (ci != m_dottedRestCache->end()) return new QCanvasPixmap - (*ci->second, QPoint(ci->second->offsetX(), + (*ci->second, TQPoint(ci->second->offsetX(), ci->second->offsetY())); else encache = true; } } - QPoint hotspot(m_font->getHotspot(charName)); + TQPoint hotspot(m_font->getHotspot(charName)); drawRestAux(params, hotspot, 0, 0, 0); - QCanvasPixmap* canvasMap = makeCanvasPixmap(hotspot); + TQCanvasPixmap* canvasMap = makeCanvasPixmap(hotspot); if (encache) { - m_dottedRestCache->insert(std::pair<CharName, QCanvasPixmap*> + m_dottedRestCache->insert(std::pair<CharName, TQCanvasPixmap*> (charName, new QCanvasPixmap (*canvasMap, hotspot))); } @@ -1780,18 +1780,18 @@ NotePixmapFactory::makeRestPixmap(const NotePixmapParameters ¶ms) void NotePixmapFactory::drawRest(const NotePixmapParameters ¶ms, - QPainter &painter, int x, int y) + TQPainter &painter, int x, int y) { Profiler profiler("NotePixmapFactory::drawRest"); m_inPrinterMethod = true; - QPoint hotspot; // unused + TQPoint hotspot; // unused drawRestAux(params, hotspot, &painter, x, y); m_inPrinterMethod = false; } void NotePixmapFactory::drawRestAux(const NotePixmapParameters ¶ms, - QPoint &hotspot, QPainter *painter, int x, int y) + TQPoint &hotspot, TQPainter *painter, int x, int y) { CharName charName(m_style->getRestCharName(params.m_noteType, params.m_restOutsideStave)); @@ -1862,7 +1862,7 @@ NotePixmapFactory::drawRestAux(const NotePixmapParameters ¶ms, } } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeClefPixmap(const Clef &clef) { Profiler profiler("NotePixmapFactory::makeClefPixmap"); @@ -1880,8 +1880,8 @@ NotePixmapFactory::makeClefPixmap(const Clef &clef) else if (adjustedOctave < 8) adjustedOctave++; - QString text = QString("%1").arg(adjustedOctave); - QRect rect = m_clefOttavaFontMetrics.boundingRect(text); + TQString text = TQString("%1").arg(adjustedOctave); + TQRect rect = m_clefOttavaFontMetrics.boundingRect(text); createPixmapAndMask(plain.getWidth(), plain.getHeight() + rect.height()); @@ -1901,26 +1901,26 @@ NotePixmapFactory::makeClefPixmap(const Clef &clef) rect.height(), text); m_p->painter().setPen(Qt::black); - QPoint hotspot(plain.getHotspot()); + TQPoint hotspot(plain.getHotspot()); if (oct > 0) hotspot.setY(hotspot.y() + rect.height()); return makeCanvasPixmap(hotspot, true); } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makePedalDownPixmap() { return getCharacter(NoteCharacterNames::PEDAL_MARK, PlainColour, false) .getCanvasPixmap(); } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makePedalUpPixmap() { return getCharacter(NoteCharacterNames::PEDAL_UP_MARK, PlainColour, false) .getCanvasPixmap(); } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeUnknownPixmap() { Profiler profiler("NotePixmapFactory::makeUnknownPixmap"); @@ -1928,26 +1928,26 @@ NotePixmapFactory::makeUnknownPixmap() .getCanvasPixmap(); } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeToolbarPixmap(const char *name, bool menuSize) { - QString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); - QString fileBase = pixmapDir + "/toolbar/"; + TQString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); + TQString fileBase = pixmapDir + "/toolbar/"; if (menuSize) fileBase += "menu-"; fileBase += name; - if (QFile(fileBase + ".png").exists()) { - return new QCanvasPixmap(fileBase + ".png"); - } else if (QFile(fileBase + ".xpm").exists()) { - return new QCanvasPixmap(fileBase + ".xpm"); + if (TQFile(fileBase + ".png").exists()) { + return new TQCanvasPixmap(fileBase + ".png"); + } else if (TQFile(fileBase + ".xpm").exists()) { + return new TQCanvasPixmap(fileBase + ".xpm"); } else if (menuSize) { return makeToolbarPixmap(name, false); } else { // this will fail, but we don't want to return a null pointer - return new QCanvasPixmap(fileBase + ".png"); + return new TQCanvasPixmap(fileBase + ".png"); } } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeNoteMenuPixmap(timeT duration, timeT &errorReturn) { @@ -1965,14 +1965,14 @@ NotePixmapFactory::makeNoteMenuPixmap(timeT duration, } } - QString noteName = NotationStrings::getReferenceName(nearestNote); + TQString noteName = NotationStrings::getReferenceName(nearestNote); if (triplet) noteName = "3-" + noteName; noteName = "menu-" + noteName; return makeToolbarPixmap(noteName); } -QCanvasPixmap * +TQCanvasPixmap * NotePixmapFactory::makeMarkMenuPixmap(Mark mark) { if (mark == Marks::Sforzando || @@ -1995,7 +1995,7 @@ NotePixmapFactory::makeMarkMenuPixmap(Mark mark) } } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeKeyPixmap(const Key &key, const Clef &clef, Key previousKey) @@ -2090,10 +2090,10 @@ NotePixmapFactory::makeKeyPixmap(const Key &key, return makeCanvasPixmap(m_pointZero); } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeClefDisplayPixmap(const Clef &clef) { - QCanvasPixmap* clefPixmap = makeClefPixmap(clef); + TQCanvasPixmap* clefPixmap = makeClefPixmap(clef); int lw = getLineSpacing(); int width = clefPixmap->width() + 6 * getNoteBodyWidth(); @@ -2115,7 +2115,7 @@ NotePixmapFactory::makeClefDisplayPixmap(const Clef &clef) return makeCanvasPixmap(m_pointZero); } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeKeyDisplayPixmap(const Key &key, const Clef &clef) { std::vector<int> ah = key.getAccidentalHeights(clef); @@ -2124,9 +2124,9 @@ NotePixmapFactory::makeKeyDisplayPixmap(const Key &key, const Clef &clef) NoteCharacterNames::SHARP : NoteCharacterNames::FLAT); - QCanvasPixmap* clefPixmap = makeClefPixmap(clef); - QPixmap accidentalPixmap(*m_font->getCharacter(charName).getPixmap()); - QPoint hotspot(m_font->getHotspot(charName)); + TQCanvasPixmap* clefPixmap = makeClefPixmap(clef); + TQPixmap accidentalPixmap(*m_font->getCharacter(charName).getPixmap()); + TQPoint hotspot(m_font->getHotspot(charName)); int lw = getLineSpacing(); int delta = accidentalPixmap.width() - hotspot.x(); @@ -2176,7 +2176,7 @@ NotePixmapFactory::getClefAndKeyWidth(const Key &key, const Clef &clef) return width; } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeTrackHeaderPixmap( int width, int height, TrackHeader *header) { @@ -2188,14 +2188,14 @@ NotePixmapFactory::makeTrackHeaderPixmap( int lw = getLineSpacing(); int h; - QColor colour; + TQColor colour; int maxDelta = getAccidentalWidth(Sharp); // Staff Y position inside the whole header int offset = (height - 10 * lw -1) / 2; // Draw staff lines - m_p->painter().setPen(QPen(Qt::black, getStaffLineThickness())); + m_p->painter().setPen(TQPen(Qt::black, getStaffLineThickness())); for (h = 0; h <= 8; h += 2) { int y = (lw * 3) + ((8 - h) * lw) / 2; m_p->drawLine(maxDelta/2, y + offset, m_generatedWidth - maxDelta/2, y + offset); @@ -2228,8 +2228,8 @@ NotePixmapFactory::makeTrackHeaderPixmap( else if (adjustedOctave < 8) adjustedOctave++; - QString text = QString("%1").arg(adjustedOctave); - QRect rect = m_clefOttavaFontMetrics.boundingRect(text); + TQString text = TQString("%1").arg(adjustedOctave); + TQRect rect = m_clefOttavaFontMetrics.boundingRect(text); m_p->painter().setPen(colour); @@ -2258,7 +2258,7 @@ NotePixmapFactory::makeTrackHeaderPixmap( NoteCharacter accident = m_font->getCharacterColoured(charName, hue, val, NoteFont::Screen, false); - QPoint hotspot(m_font->getHotspot(charName)); + TQPoint hotspot(m_font->getHotspot(charName)); int delta = accident.getWidth() - hotspot.x(); int x = clefChar.getWidth() + maxDelta; @@ -2275,14 +2275,14 @@ NotePixmapFactory::makeTrackHeaderPixmap( m_p->painter().setFont(m_trackHeaderFont); // m_p->maskPainter().setFont(m_trackHeaderFont); - QString text; - QString textLine; + TQString text; + TQString textLine; int charHeight = m_trackHeaderFontMetrics.height(); int charWidth = m_trackHeaderFontMetrics.maxWidth(); - const QString transposeText = header->getTransposeText(); - QRect bounds = m_trackHeaderBoldFontMetrics.boundingRect(transposeText); + const TQString transposeText = header->getTransposeText(); + TQRect bounds = m_trackHeaderBoldFontMetrics.boundingRect(transposeText); int transposeWidth = bounds.width(); @@ -2338,7 +2338,7 @@ NotePixmapFactory::makeTrackHeaderPixmap( int lowerTextY = m_generatedHeight - 4 // -4 : adjust - (numberOfTextLines - l) * getTrackHeaderTextLineSpacing(); - QString textLine = getOneLine(text, width - charWidth / 2); + TQString textLine = getOneLine(text, width - charWidth / 2); if (textLine.isEmpty()) break; if ((l == numberOfTextLines) && !text.isEmpty()) { @@ -2363,9 +2363,9 @@ NotePixmapFactory::getTrackHeaderNTL(int height) } int -NotePixmapFactory::getTrackHeaderTextWidth(QString str) +NotePixmapFactory::getTrackHeaderTextWidth(TQString str) { - QRect bounds = m_trackHeaderFontMetrics.boundingRect(str); + TQRect bounds = m_trackHeaderFontMetrics.boundingRect(str); return bounds.width(); } @@ -2377,17 +2377,17 @@ NotePixmapFactory::getTrackHeaderTextLineSpacing() } QString -NotePixmapFactory::getOneLine(QString &text, int width) +NotePixmapFactory::getOneLine(TQString &text, int width) { - QString str; + TQString str; int n; // Immediately stop if string is empty or only contains white spaces ... - if (text.stripWhiteSpace().isEmpty()) return QString(""); + if (text.stripWhiteSpace().isEmpty()) return TQString(""); // ... or if width is too small. if (width < m_trackHeaderFontMetrics.boundingRect(text.left(1)).width()) - return QString(""); + return TQString(""); // Get a first approx. string length int totalLength = text.length(); @@ -2399,7 +2399,7 @@ NotePixmapFactory::getOneLine(QString &text, int width) if (n == 0) { str = text; - text = QString(""); + text = TQString(""); } else { str = text.left(n); text.remove(0, n); @@ -2408,7 +2408,7 @@ NotePixmapFactory::getOneLine(QString &text, int width) return str; } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makePitchDisplayPixmap(int p, const Clef &clef, bool useSharps) { @@ -2418,7 +2418,7 @@ NotePixmapFactory::makePitchDisplayPixmap(int p, const Clef &clef, Accidental accidental(pitch.getAccidental(useSharps)); NotePixmapParameters params(Note::Crotchet, 0, accidental); - QCanvasPixmap* clefPixmap = makeClefPixmap(clef); + TQCanvasPixmap* clefPixmap = makeClefPixmap(clef); int lw = getLineSpacing(); int width = getClefWidth(Clef::Bass) + 10 * getNoteBodyWidth(); @@ -2438,7 +2438,7 @@ NotePixmapFactory::makePitchDisplayPixmap(int p, const Clef &clef, params.setIsOnLine(h % 2 == 0); params.setSelected(m_selected); - QCanvasPixmap *notePixmap = makeNotePixmap(params); + TQCanvasPixmap *notePixmap = makeNotePixmap(params); int pixmapHeight = lw * 12 + 1; int yoffset = lw * 3; @@ -2473,7 +2473,7 @@ NotePixmapFactory::makePitchDisplayPixmap(int p, const Clef &clef, return makeCanvasPixmap(m_pointZero); } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makePitchDisplayPixmap(int p, const Clef &clef, int octave, int step) { @@ -2483,7 +2483,7 @@ NotePixmapFactory::makePitchDisplayPixmap(int p, const Clef &clef, Accidental accidental = pitch.getDisplayAccidental(Key("C major")); NotePixmapParameters params(Note::Crotchet, 0, accidental); - QCanvasPixmap* clefPixmap = makeClefPixmap(clef); + TQCanvasPixmap* clefPixmap = makeClefPixmap(clef); int lw = getLineSpacing(); int width = getClefWidth(Clef::Bass) + 10 * getNoteBodyWidth(); @@ -2505,7 +2505,7 @@ NotePixmapFactory::makePitchDisplayPixmap(int p, const Clef &clef, params.setIsOnLine(h % 2 == 0); params.setSelected(m_selected); - QCanvasPixmap *notePixmap = makeNotePixmap(params); + TQCanvasPixmap *notePixmap = makeNotePixmap(params); int pixmapHeight = lw * 12 + 1; int yoffset = lw * 3; @@ -2540,17 +2540,17 @@ NotePixmapFactory::makePitchDisplayPixmap(int p, const Clef &clef, return makeCanvasPixmap(m_pointZero); } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeHairpinPixmap(int length, bool isCrescendo) { Profiler profiler("NotePixmapFactory::makeHairpinPixmap"); drawHairpinAux(length, isCrescendo, 0, 0, 0); - return makeCanvasPixmap(QPoint(0, m_generatedHeight / 2)); + return makeCanvasPixmap(TQPoint(0, m_generatedHeight / 2)); } void NotePixmapFactory::drawHairpin(int length, bool isCrescendo, - QPainter &painter, int x, int y) + TQPainter &painter, int x, int y) { Profiler profiler("NotePixmapFactory::drawHairpin"); m_inPrinterMethod = true; @@ -2560,7 +2560,7 @@ NotePixmapFactory::drawHairpin(int length, bool isCrescendo, void NotePixmapFactory::drawHairpinAux(int length, bool isCrescendo, - QPainter *painter, int x, int y) + TQPainter *painter, int x, int y) { int nbh = getNoteBodyHeight(); int nbw = getNoteBodyWidth(); @@ -2610,7 +2610,7 @@ NotePixmapFactory::drawHairpinAux(int length, bool isCrescendo, } } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeSlurPixmap(int length, int dy, bool above, bool phrasing) { Profiler profiler("NotePixmapFactory::makeSlurPixmap"); @@ -2619,7 +2619,7 @@ NotePixmapFactory::makeSlurPixmap(int length, int dy, bool above, bool phrasing) // sizing so that any horizontal part was rescaled down to exactly // 1 pixel wide instead of blurring bool smooth = m_font->isSmooth() && getNoteBodyHeight() > 5; - QPoint hotspot; + TQPoint hotspot; if (length < getNoteBodyWidth()*2) length = getNoteBodyWidth() * 2; drawSlurAux(length, dy, above, smooth, false, phrasing, hotspot, 0, 0, 0); @@ -2628,22 +2628,22 @@ NotePixmapFactory::makeSlurPixmap(int length, int dy, bool above, bool phrasing) if (smooth) { - QImage i = m_generatedPixmap->convertToImage(); + TQImage i = m_generatedPixmap->convertToImage(); if (i.depth() == 1) i = i.convertDepth(32); i = i.smoothScale(i.width() / 2, i.height() / 2); delete m_generatedPixmap; delete m_generatedMask; - QPixmap newPixmap(i); - QCanvasPixmap *p = new QCanvasPixmap(newPixmap, hotspot); + TQPixmap newPixmap(i); + TQCanvasPixmap *p = new TQCanvasPixmap(newPixmap, hotspot); p->setMask(PixmapFunctions::generateMask(newPixmap, Qt::white.rgb())); return p; } else { - QCanvasPixmap *p = new QCanvasPixmap(*m_generatedPixmap, hotspot); + TQCanvasPixmap *p = new TQCanvasPixmap(*m_generatedPixmap, hotspot); p->setMask(PixmapFunctions::generateMask(*m_generatedPixmap, Qt::white.rgb())); delete m_generatedPixmap; @@ -2654,10 +2654,10 @@ NotePixmapFactory::makeSlurPixmap(int length, int dy, bool above, bool phrasing) void NotePixmapFactory::drawSlur(int length, int dy, bool above, bool phrasing, - QPainter &painter, int x, int y) + TQPainter &painter, int x, int y) { Profiler profiler("NotePixmapFactory::drawSlur"); - QPoint hotspot; + TQPoint hotspot; m_inPrinterMethod = true; if (length < getNoteBodyWidth()*2) length = getNoteBodyWidth() * 2; @@ -2668,10 +2668,10 @@ NotePixmapFactory::drawSlur(int length, int dy, bool above, bool phrasing, void NotePixmapFactory::drawSlurAux(int length, int dy, bool above, bool smooth, bool flat, bool phrasing, - QPoint &hotspot, QPainter *painter, int x, int y) + TQPoint &hotspot, TQPainter *painter, int x, int y) { - QWMatrix::TransformationMode mode = QWMatrix::transformationMode(); - QWMatrix::setTransformationMode(QWMatrix::Points); + TQWMatrix::TransformationMode mode = TQWMatrix::transformationMode(); + TQWMatrix::setTransformationMode(TQWMatrix::Points); int thickness = getStaffLineThickness() * 2; if (phrasing) @@ -2707,7 +2707,7 @@ NotePixmapFactory::drawSlurAux(int length, int dy, bool above, my = -my; bool havePixmap = false; - QPoint topLeft, bottomRight; + TQPoint topLeft, bottomRight; if (smooth) thickness += 2; @@ -2717,31 +2717,31 @@ NotePixmapFactory::drawSlurAux(int length, int dy, bool above, Spline::PointList pl; if (!phrasing) { - pl.push_back(QPoint(length / 6, my)); - pl.push_back(QPoint(length - length / 6, my)); + pl.push_back(TQPoint(length / 6, my)); + pl.push_back(TQPoint(length - length / 6, my)); } else { - pl.push_back(QPoint(abs(my) / 4, my / 3)); - pl.push_back(QPoint(length / 6, my)); + pl.push_back(TQPoint(abs(my) / 4, my / 3)); + pl.push_back(TQPoint(length / 6, my)); if (theta > 1) { - pl.push_back(QPoint(length * 3 / 8, my * 3 / 2)); + pl.push_back(TQPoint(length * 3 / 8, my * 3 / 2)); } else if (theta < -1) { - pl.push_back(QPoint(length * 5 / 8, my * 3 / 2)); + pl.push_back(TQPoint(length * 5 / 8, my * 3 / 2)); } else { - pl.push_back(QPoint(length / 2, my * 4 / 3)); + pl.push_back(TQPoint(length / 2, my * 4 / 3)); } - pl.push_back(QPoint(length - length / 6, my)); - pl.push_back(QPoint(length - abs(my) / 4, my / 3)); + pl.push_back(TQPoint(length - length / 6, my)); + pl.push_back(TQPoint(length - abs(my) / 4, my / 3)); } Spline::PointList *polyPoints = Spline::calculate - (QPoint(0, y0), QPoint(length - 1, y0), pl, topLeft, bottomRight); + (TQPoint(0, y0), TQPoint(length - 1, y0), pl, topLeft, bottomRight); if (!havePixmap) { int width = bottomRight.x() - topLeft.x(); int height = bottomRight.y() - topLeft.y() + thickness - 1 + abs(dy); - hotspot = QPoint(0, -topLeft.y() + (dy < 0 ? -dy : 0)); + hotspot = TQPoint(0, -topLeft.y() + (dy < 0 ? -dy : 0)); // NOTATION_DEBUG << "slur: bottomRight (" << bottomRight.x() << "," << bottomRight.y() << "), topLeft (" << topLeft.x() << "," << topLeft.y() << "), width " << width << ", height " << height << ", hotspot (" << hotspot.x() << "," << hotspot.y() << "), dy " << dy << ", thickness " << thickness << endl; @@ -2773,7 +2773,7 @@ NotePixmapFactory::drawSlurAux(int length, int dy, bool above, smooth ? height*2 + thickness*2 : height + thickness, width, height); - QWMatrix m; + TQWMatrix m; if (smooth) m.translate(2 * hotspot.x(), 2 * hotspot.y()); else @@ -2800,7 +2800,7 @@ NotePixmapFactory::drawSlurAux(int length, int dy, bool above, } */ int ppc = polyPoints->size(); - QPointArray qp(ppc); + TQPointArray qp(ppc); for (int j = 0; j < ppc; ++j) { qp.setPoint(j, (*polyPoints)[j].x(), (*polyPoints)[j].y()); @@ -2838,7 +2838,7 @@ NotePixmapFactory::drawSlurAux(int length, int dy, bool above, m_p->painter().setPen(Qt::black); } - QWMatrix::setTransformationMode(mode); + TQWMatrix::setTransformationMode(mode); if (painter) { painter->restore(); @@ -2847,18 +2847,18 @@ NotePixmapFactory::drawSlurAux(int length, int dy, bool above, } } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeOttavaPixmap(int length, int octavesUp) { Profiler profiler("NotePixmapFactory::makeOttavaPixmap"); m_inPrinterMethod = false; drawOttavaAux(length, octavesUp, 0, 0, 0); - return makeCanvasPixmap(QPoint(0, m_generatedHeight - 1)); + return makeCanvasPixmap(TQPoint(0, m_generatedHeight - 1)); } void NotePixmapFactory::drawOttava(int length, int octavesUp, - QPainter &painter, int x, int y) + TQPainter &painter, int x, int y) { Profiler profiler("NotePixmapFactory::drawOttava"); m_inPrinterMethod = true; @@ -2868,12 +2868,12 @@ NotePixmapFactory::drawOttava(int length, int octavesUp, void NotePixmapFactory::drawOttavaAux(int length, int octavesUp, - QPainter *painter, int x, int y) + TQPainter *painter, int x, int y) { int height = m_ottavaFontMetrics.height(); int backpedal = 0; - QString label; - QRect r; + TQString label; + TQRect r; if (octavesUp == 2 || octavesUp == -2) { label = "15ma "; @@ -2895,7 +2895,7 @@ NotePixmapFactory::drawOttavaAux(int length, int octavesUp, } int thickness = getStemThickness(); - QPen pen(Qt::black, thickness, Qt::DotLine); + TQPen pen(Qt::black, thickness, Qt::DotLine); if (m_selected) { m_p->painter().setPen(GUIPalette::getColour(GUIPalette::SelectedElement)); @@ -2931,9 +2931,9 @@ NotePixmapFactory::drawOttavaAux(int length, int octavesUp, m_p->drawLine(x1, y0, x1, y1); - m_p->painter().setPen(QPen()); + m_p->painter().setPen(TQPen()); if (!m_inPrinterMethod) - m_p->maskPainter().setPen(QPen()); + m_p->maskPainter().setPen(TQPen()); if (painter) { painter->restore(); @@ -2962,13 +2962,13 @@ NotePixmapFactory::drawBracket(int length, bool left, bool curly, int x, int y) if (left) moff = -moff; - QPoint topLeft, bottomRight; + TQPoint topLeft, bottomRight; for (int i = 0; i < thickness; ++i) { Spline::PointList pl; - pl.push_back(QPoint((int)moff, m1)); - pl.push_back(QPoint((int)moff, m2)); + pl.push_back(TQPoint((int)moff, m1)); + pl.push_back(TQPoint((int)moff, m2)); /* NOTATION_DEBUG << "bracket spline controls: " << moff << "," << m1 << ", " << moff << "," << m2 << "; end points " @@ -2976,10 +2976,10 @@ NotePixmapFactory::drawBracket(int length, bool left, bool curly, int x, int y) << endl; */ Spline::PointList *polyPoints = Spline::calculate - (QPoint(off0, 0), QPoint(off0, length - 1), pl, topLeft, bottomRight); + (TQPoint(off0, 0), TQPoint(off0, length - 1), pl, topLeft, bottomRight); int ppc = polyPoints->size(); - QPointArray qp(ppc); + TQPointArray qp(ppc); /* NOTATION_DEBUG << "bracket spline polypoints: " << endl; for (int j = 0; j < ppc; ++j) { @@ -3007,7 +3007,7 @@ NotePixmapFactory::drawBracket(int length, bool left, bool curly, int x, int y) } } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeTimeSigPixmap(const TimeSignature& sig) { Profiler profiler("NotePixmapFactory::makeTimeSigPixmap"); @@ -3026,11 +3026,11 @@ NotePixmapFactory::makeTimeSigPixmap(const TimeSignature& sig) if (getCharacter(charName, character, PlainColour, false)) { createPixmapAndMask(character.getWidth(), character.getHeight()); m_p->drawNoteCharacter(0, 0, character); - return makeCanvasPixmap(QPoint(0, character.getHeight() / 2)); + return makeCanvasPixmap(TQPoint(0, character.getHeight() / 2)); } - QString c("c"); - QRect r = m_bigTimeSigFontMetrics.boundingRect(c); + TQString c("c"); + TQRect r = m_bigTimeSigFontMetrics.boundingRect(c); int dy = getLineSpacing() / 4; createPixmapAndMask(r.width(), r.height() + dy*2); @@ -3057,14 +3057,14 @@ NotePixmapFactory::makeTimeSigPixmap(const TimeSignature& sig) } m_p->painter().setPen(Qt::black); - return makeCanvasPixmap(QPoint(0, r.height() / 2 + dy)); + return makeCanvasPixmap(TQPoint(0, r.height() / 2 + dy)); } else { int numerator = sig.getNumerator(), denominator = sig.getDenominator(); - QString numS, denomS; + TQString numS, denomS; numS.setNum(numerator); denomS.setNum(denominator); @@ -3104,11 +3104,11 @@ NotePixmapFactory::makeTimeSigPixmap(const TimeSignature& sig) denominator /= 10; } - return makeCanvasPixmap(QPoint(0, height / 2)); + return makeCanvasPixmap(TQPoint(0, height / 2)); } - QRect numR = m_timeSigFontMetrics.boundingRect(numS); - QRect denomR = m_timeSigFontMetrics.boundingRect(denomS); + TQRect numR = m_timeSigFontMetrics.boundingRect(numS); + TQRect denomR = m_timeSigFontMetrics.boundingRect(denomS); int width = std::max(numR.width(), denomR.width()) + 2; int x; @@ -3132,7 +3132,7 @@ NotePixmapFactory::makeTimeSigPixmap(const TimeSignature& sig) m_p->painter().setPen(Qt::black); - return makeCanvasPixmap(QPoint(0, denomR.height() + + return makeCanvasPixmap(TQPoint(0, denomR.height() + (getNoteBodyHeight() / 4) - 1), true); } @@ -3142,7 +3142,7 @@ int NotePixmapFactory::getTimeSigWidth(const TimeSignature &sig) const { if (sig.isCommon()) { - QRect r(m_bigTimeSigFontMetrics.boundingRect("c")); + TQRect r(m_bigTimeSigFontMetrics.boundingRect("c")); return r.width() + 2; } else { @@ -3150,13 +3150,13 @@ int NotePixmapFactory::getTimeSigWidth(const TimeSignature &sig) const int numerator = sig.getNumerator(), denominator = sig.getDenominator(); - QString numS, denomS; + TQString numS, denomS; numS.setNum(numerator); denomS.setNum(denominator); - QRect numR = m_timeSigFontMetrics.boundingRect(numS); - QRect denomR = m_timeSigFontMetrics.boundingRect(denomS); + TQRect numR = m_timeSigFontMetrics.boundingRect(numS); + TQRect denomR = m_timeSigFontMetrics.boundingRect(denomS); int width = std::max(numR.width(), denomR.width()) + 2; return width; @@ -3189,7 +3189,7 @@ NotePixmapFactory::getTextFont(const Text &text) const * LilyPondDirective: Very small sans-serif, in a green box */ - int weight = QFont::Normal; + int weight = TQFont::Normal; bool italic = false; bool large = false; bool tiny = false; @@ -3199,7 +3199,7 @@ NotePixmapFactory::getTextFont(const Text &text) const type == Text::LocalTempo || type == Text::LocalDirection || type == Text::Chord) { - weight = QFont::Bold; + weight = TQFont::Bold; } if (type == Text::Dynamic || @@ -3221,18 +3221,18 @@ NotePixmapFactory::getTextFont(const Text &text) const KConfig* config = kapp->config(); - QFont textFont; + TQFont textFont; if (serif) { - textFont = QFont(defaultSerifFontFamily); + textFont = TQFont(defaultSerifFontFamily); textFont = config->readFontEntry("textfont", &textFont); } else { - textFont = QFont(defaultSansSerifFontFamily); + textFont = TQFont(defaultSansSerifFontFamily); textFont = config->readFontEntry("sansfont", &textFont); } - textFont.setStyleStrategy(QFont::StyleStrategy(QFont::PreferDefault | - QFont::PreferMatch)); + textFont.setStyleStrategy(TQFont::StyleStrategy(TQFont::PreferDefault | + TQFont::PreferMatch)); int size; if (large) @@ -3245,7 +3245,7 @@ NotePixmapFactory::getTextFont(const Text &text) const size = (getLineSpacing() * 3) / 2; textFont.setPixelSize(size); - textFont.setStyleHint(serif ? QFont::Serif : QFont::SansSerif); + textFont.setStyleHint(serif ? TQFont::Serif : TQFont::SansSerif); textFont.setWeight(weight); textFont.setItalic(italic); @@ -3260,7 +3260,7 @@ NotePixmapFactory::getTextFont(const Text &text) const return textFont; } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeTextPixmap(const Text &text) { Profiler profiler("NotePixmapFactory::makeTextPixmap"); @@ -3273,10 +3273,10 @@ NotePixmapFactory::makeTextPixmap(const Text &text) } drawTextAux(text, 0, 0, 0); - return makeCanvasPixmap(QPoint(2, 2), true); + return makeCanvasPixmap(TQPoint(2, 2), true); } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeGuitarChordPixmap(const Guitar::Fingering &fingering, int x, int y) @@ -3300,12 +3300,12 @@ NotePixmapFactory::makeGuitarChordPixmap(const Guitar::Fingering &fingering, Guitar::NoteSymbols ns(Guitar::Fingering::DEFAULT_NB_STRINGS, FingeringBox::DEFAULT_NB_DISPLAYED_FRETS); Guitar::NoteSymbols::drawFingeringPixmap(fingering, ns, &(m_p->painter())); - return makeCanvasPixmap(QPoint (x, y), true); + return makeCanvasPixmap(TQPoint (x, y), true); } void NotePixmapFactory::drawText(const Text &text, - QPainter &painter, int x, int y) + TQPainter &painter, int x, int y) { Profiler profiler("NotePixmapFactory::drawText"); @@ -3316,7 +3316,7 @@ NotePixmapFactory::drawText(const Text &text, if (type == Text::Annotation || type == Text::LilyPondDirective) { - QCanvasPixmap *map = makeAnnotationPixmap(text, (type == Text::LilyPondDirective)); + TQCanvasPixmap *map = makeAnnotationPixmap(text, (type == Text::LilyPondDirective)); painter.drawPixmap(x, y, *map); return ; } @@ -3328,11 +3328,11 @@ NotePixmapFactory::drawText(const Text &text, void NotePixmapFactory::drawTextAux(const Text &text, - QPainter *painter, int x, int y) + TQPainter *painter, int x, int y) { - QString s(strtoqstr(text.getText())); - QFont textFont(getTextFont(text)); - QFontMetrics textMetrics(textFont); + TQString s(strtoqstr(text.getText())); + TQFont textFont(getTextFont(text)); + TQFontMetrics textMetrics(textFont); int offset = 2; int width = textMetrics.width(s) + 2 * offset; @@ -3364,19 +3364,19 @@ NotePixmapFactory::drawTextAux(const Text &text, } } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeAnnotationPixmap(const Text &text) { return makeAnnotationPixmap(text, false); } -QCanvasPixmap* +TQCanvasPixmap* NotePixmapFactory::makeAnnotationPixmap(const Text &text, const bool isLilyPondDirective) { - QString s(strtoqstr(text.getText())); + TQString s(strtoqstr(text.getText())); - QFont textFont(getTextFont(text)); - QFontMetrics textMetrics(textFont); + TQFont textFont(getTextFont(text)); + TQFontMetrics textMetrics(textFont); int annotationWidth = getLineSpacing() * 16; int annotationHeight = getLineSpacing() * 6; @@ -3385,7 +3385,7 @@ NotePixmapFactory::makeAnnotationPixmap(const Text &text, const bool isLilyPondD int bottomGap = getLineSpacing() / 3 + 1; int sideGap = getLineSpacing() / 4 + 1; - QRect r = textMetrics.boundingRect + TQRect r = textMetrics.boundingRect (0, 0, annotationWidth, annotationHeight, Qt::WordBreak, s); int pixmapWidth = r.width() + sideGap * 2; @@ -3411,18 +3411,18 @@ NotePixmapFactory::makeAnnotationPixmap(const Text &text, const bool isLilyPondD m_p->drawRect(0, 0, pixmapWidth, pixmapHeight); m_p->painter().setBrush(Qt::black); - m_p->painter().drawText(QRect(sideGap, topGap, + m_p->painter().drawText(TQRect(sideGap, topGap, annotationWidth + sideGap, pixmapHeight - bottomGap), Qt::WordBreak, s); /* unnecessary following the rectangle draw - m_pm.drawText(QRect(sideGap, topGap, + m_pm.drawText(TQRect(sideGap, topGap, annotationWidth + sideGap, annotationHeight + topGap), Qt::WordBreak, s); */ - return makeCanvasPixmap(QPoint(0, 0)); + return makeCanvasPixmap(TQPoint(0, 0)); } void @@ -3436,8 +3436,8 @@ NotePixmapFactory::createPixmapAndMask(int width, int height, m_generatedWidth = width; m_generatedHeight = height; - m_generatedPixmap = new QPixmap(width, height); - m_generatedMask = new QBitmap(maskWidth, maskHeight); + m_generatedPixmap = new TQPixmap(width, height); + m_generatedMask = new TQBitmap(maskWidth, maskHeight); static unsigned long total = 0; total += width * height; @@ -3456,12 +3456,12 @@ NotePixmapFactory::createPixmapAndMask(int width, int height, m_p->maskPainter().setBrush(Qt::white); } -QCanvasPixmap* -NotePixmapFactory::makeCanvasPixmap(QPoint hotspot, bool generateMask) +TQCanvasPixmap* +NotePixmapFactory::makeCanvasPixmap(TQPoint hotspot, bool generateMask) { m_p->end(); - QCanvasPixmap* p = new QCanvasPixmap(*m_generatedPixmap, hotspot); + TQCanvasPixmap* p = new TQCanvasPixmap(*m_generatedPixmap, hotspot); if (generateMask) { p->setMask(PixmapFunctions::generateMask(*p)); @@ -3682,7 +3682,7 @@ int NotePixmapFactory::getKeyWidth(const Key &key, int NotePixmapFactory::getTextWidth(const Text &text) const { - QFontMetrics metrics(getTextFont(text)); + TQFontMetrics metrics(getTextFont(text)); return metrics.boundingRect(strtoqstr(text.getText())).width() + 4; } |