diff options
Diffstat (limited to 'kturtle/src')
-rw-r--r-- | kturtle/src/canvas.cpp | 130 | ||||
-rw-r--r-- | kturtle/src/canvas.h | 30 | ||||
-rw-r--r-- | kturtle/src/dialogs.cpp | 70 | ||||
-rw-r--r-- | kturtle/src/dialogs.h | 54 | ||||
-rw-r--r-- | kturtle/src/executer.cpp | 32 | ||||
-rw-r--r-- | kturtle/src/executer.h | 16 | ||||
-rw-r--r-- | kturtle/src/kturtle.cpp | 306 | ||||
-rw-r--r-- | kturtle/src/kturtle.h | 34 | ||||
-rw-r--r-- | kturtle/src/lexer.cpp | 38 | ||||
-rw-r--r-- | kturtle/src/lexer.h | 20 | ||||
-rw-r--r-- | kturtle/src/parser.cpp | 12 | ||||
-rw-r--r-- | kturtle/src/parser.h | 10 | ||||
-rw-r--r-- | kturtle/src/token.h | 8 | ||||
-rw-r--r-- | kturtle/src/translate.cpp | 26 | ||||
-rw-r--r-- | kturtle/src/translate.h | 12 | ||||
-rw-r--r-- | kturtle/src/treenode.cpp | 6 | ||||
-rw-r--r-- | kturtle/src/treenode.h | 10 | ||||
-rw-r--r-- | kturtle/src/value.cpp | 14 | ||||
-rw-r--r-- | kturtle/src/value.h | 14 |
19 files changed, 421 insertions, 421 deletions
diff --git a/kturtle/src/canvas.cpp b/kturtle/src/canvas.cpp index 871c1614..38281956 100644 --- a/kturtle/src/canvas.cpp +++ b/kturtle/src/canvas.cpp @@ -53,7 +53,7 @@ #include <cmath> -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> #include <klocale.h> @@ -75,10 +75,10 @@ const double DEG2RAD = 3.14159265358979323846/180; // BEGIN public methods -Canvas::Canvas(QWidget *parent, const char *name) : QCanvasView(0, parent, name) +Canvas::Canvas(TQWidget *parent, const char *name) : TQCanvasView(0, parent, name) { // Create a new canvas for this view - canvas = new QCanvas(parent); + canvas = new TQCanvas(parent); canvas->setAdvancePeriod(250); // refresh-rate in [ms] // set initial values @@ -95,10 +95,10 @@ Canvas::~Canvas() } -QPixmap* Canvas::canvas2Pixmap() +TQPixmap* Canvas::canvas2Pixmap() { - pixmap = QPixmap( canvas->width(), canvas->height() ); - QPainter painter(&pixmap); + pixmap = TQPixmap( canvas->width(), canvas->height() ); + TQPainter painter(&pixmap); canvas->drawArea(canvas->rect(), &painter); return &pixmap; } @@ -111,8 +111,8 @@ QPixmap* Canvas::canvas2Pixmap() void Canvas::slotClear() { - QCanvasItemList list = canvas->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList list = canvas->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { // kill everything but the turtle (who lives on a seperate layer) @@ -122,8 +122,8 @@ void Canvas::slotClear() void Canvas::slotClearSpriteToo() { - QCanvasItemList list = canvas->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList list = canvas->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { if (*it) delete *it; @@ -138,7 +138,7 @@ void Canvas::slotGo(double x, double y) if ( wrap && !canvas->onCanvas(intX, intY) ) { - QPoint offsetPoint = offset(intX, intY); + TQPoint offsetPoint = offset(intX, intY); posX = x - ( offsetPoint.x() * canvasWidth ); posY = y - ( offsetPoint.y() * canvasHeight ); } @@ -156,7 +156,7 @@ void Canvas::slotGoX(double x) int intPosY = ROUND2INT(posY); if ( wrap && !canvas->onCanvas(intX, intPosY) ) { - QPoint offsetPoint = offset(intX, intPosY); + TQPoint offsetPoint = offset(intX, intPosY); posX = x - ( offsetPoint.x() * canvasWidth ); } else posX = x; @@ -169,7 +169,7 @@ void Canvas::slotGoY(double y) int intPosX = ROUND2INT(posX); if ( wrap && !canvas->onCanvas(intPosX, intY) ) { - QPoint offsetPoint = offset(intPosX, intY); + TQPoint offsetPoint = offset(intPosX, intY); posY = y - ( offsetPoint.y() * canvasHeight ); } else posY = y; @@ -243,7 +243,7 @@ void Canvas::slotSetFgColor(int r, int g, int b) void Canvas::slotSetBgColor(int r, int g, int b) { - canvas->setBackgroundColor( QColor(r, g, b) ); + canvas->setBackgroundColor( TQColor(r, g, b) ); } void Canvas::slotResizeCanvas(int x, int y) @@ -285,16 +285,16 @@ void Canvas::slotSpriteChange(int x) sprite->move(ROUND2INT(posX - sprite->width()/2), ROUND2INT(posY - sprite->height()/2)); } -void Canvas::slotPrint(QString text) +void Canvas::slotPrint(TQString text) { - QCanvasText* t = new QCanvasText(text, font, canvas); + TQCanvasText* t = new TQCanvasText(text, font, canvas); // text does not do the wrapping, never... sorry - t->setColor( QColor(fgR, fgG, fgB) ); + t->setColor( TQColor(fgR, fgG, fgB) ); t->move(ROUND2INT(posX), ROUND2INT(posY)); t->show(); } -void Canvas::slotFontType(QString family, QString extra) +void Canvas::slotFontType(TQString family, TQString extra) { font.setFamily(family); font.setBold( extra.contains("bold") > 0 ); @@ -338,7 +338,7 @@ void Canvas::initValues() canvasWidth = Settings::canvasWidth(); canvasHeight = Settings::canvasHeight(); // colors - canvas->setBackgroundColor( QColor(255, 255, 255) ); // background + canvas->setBackgroundColor( TQColor(255, 255, 255) ); // background fgR = 0; // pencolor (forground) fgG = 0; fgB = 0; @@ -347,7 +347,7 @@ void Canvas::initValues() pen = true; wrap = true; direction = 0; - font = QFont("serif", 18); + font = TQFont("serif", 18); // the position posX = canvasWidth / 2; posY = canvasHeight / 2; @@ -364,26 +364,26 @@ void Canvas::lineShell(double xa, double ya, double xb, double yb) // line can fallback into this function in case of cutLoop == true cutLoop = false; // Reset the loop detection memory - prevStartPos3 = prevStartPos2 = prevStartPos1 = prevEndPos3 = prevEndPos2 = prevEndPos1 = QPoint(0, 0); + prevStartPos3 = prevStartPos2 = prevStartPos1 = prevEndPos3 = prevEndPos2 = prevEndPos1 = TQPoint(0, 0); // and go! line(xa, ya, xb, yb); } void Canvas::line(double xa, double ya, double xb, double yb) { - QCanvasLine* l = new QCanvasLine(canvas); + TQCanvasLine* l = new TQCanvasLine(canvas); int intXa = ROUND2INT(xa); int intYa = ROUND2INT(ya); int intXb = ROUND2INT(xb); int intYb = ROUND2INT(yb); l->setPoints(intXa, intYa, intXb, intYb); - l->setPen( QPen(QColor(fgR, fgG, fgB), penWidth, SolidLine) ); + l->setPen( TQPen(TQColor(fgR, fgG, fgB), penWidth, SolidLine) ); l->setZ(1); l->show(); // kdDebug(0)<<"Canvas::line(); xa:"<<xa<<", ya:"<<ya<<", xb:"<<xb<<", yb:"<<yb<<endl; if ( wrap && !canvas->onCanvas( ROUND2INT(xb), ROUND2INT(yb) ) ) { - if (endlessLoop( QPoint(intXa, intYa), QPoint(intXb, intYb) ) == true) // detect for endless loop + if (endlessLoop( TQPoint(intXa, intYa), TQPoint(intXb, intYb) ) == true) // detect for endless loop { slotCenter(); kdDebug(0)<<"Canvas::line(): ENDLESS LOOP DETECTED, BROKE THE LOOP"<<endl; @@ -391,8 +391,8 @@ void Canvas::line(double xa, double ya, double xb, double yb) return; } - QPoint translation = translationFactor(xa, ya, xb, yb); - if (translation == QPoint(0, 0) ) + TQPoint translation = translationFactor(xa, ya, xb, yb); + if (translation == TQPoint(0, 0) ) { // this could never happen in theory kdDebug(0)<<"Canvas::line(): ***********ERRORRR***********"<<endl; @@ -409,7 +409,7 @@ void Canvas::line(double xa, double ya, double xb, double yb) } } -bool Canvas::endlessLoop(QPoint begin, QPoint end) +bool Canvas::endlessLoop(TQPoint begin, TQPoint end) { // kdDebug(0)<<"prevStartPos3: "<<prevStartPos3<<", prevStartPos2: "<<prevStartPos2<<", prevStartPos1: "<<prevStartPos1<<", prevStartPos0: "<<begin<<", prevEndPos3: "<<prevEndPos3<<", prevEndPos2: "<<prevEndPos2<<", prevEndPos1: "<<prevEndPos1<<", prevEndPos0: "<<end<<endl; if ( prevStartPos2 == begin && prevStartPos3 == prevStartPos1 && @@ -417,7 +417,7 @@ bool Canvas::endlessLoop(QPoint begin, QPoint end) { // this is to break the horrible endless loop bug that i cannot fix... // i need more simple reproductions of this bug to really find it - // for now i say it is something with QCanvas but i'm likely wrong on thisone + // for now i say it is something with TQCanvas but i'm likely wrong on thisone // kdDebug(0)<<"Canvas::endlessLoop TRUE!!"<<endl; return true; } @@ -442,31 +442,31 @@ bool Canvas::pointInRange(double px, double py, double xa, double ya, double xb, return false; } -QPoint Canvas::offset(int x, int y) +TQPoint Canvas::offset(int x, int y) { // This funktion makes is easy to read since deviding int's is a weird thing: // int x = 5 / 2, outputs: x = 2, with: 5 % 2 = 1 (the rest value) if (x < 0) x = x - canvasWidth; if (y < 0) y = y - canvasHeight; - QPoint offsetPoint( x / canvasWidth, y / canvasHeight); + TQPoint offsetPoint( x / canvasWidth, y / canvasHeight); return offsetPoint; } -QPoint Canvas::translationFactor(double xa, double ya, double xb, double yb) +TQPoint Canvas::translationFactor(double xa, double ya, double xb, double yb) { - // this class returns a QPoint which can be used to properly 'wrap' a line - QPoint crossPoint[4]; // under wicked circumstances we can need this + // this class returns a TQPoint which can be used to properly 'wrap' a line + TQPoint crossPoint[4]; // under wicked circumstances we can need this // namely when crossing both corners, we have 4 bordercrossings - QPoint translate[4]; + TQPoint translate[4]; int i = 0; if ( (xb - xa) > -0.00001 && (xb - xa) < 0.00001 ) // check for an infinite tangent (direction coefficient) { i++; - translate[i] = QPoint( 0, 1 ); - crossPoint[i] = QPoint( ROUND2INT(xa), 0 ); + translate[i] = TQPoint( 0, 1 ); + crossPoint[i] = TQPoint( ROUND2INT(xa), 0 ); i++; - translate[i] = QPoint(0,-1 ); - crossPoint[i] = QPoint( ROUND2INT(xa), canvasHeight ); + translate[i] = TQPoint(0,-1 ); + crossPoint[i] = TQPoint( ROUND2INT(xa), canvasHeight ); } else { @@ -487,32 +487,32 @@ QPoint Canvas::translationFactor(double xa, double ya, double xb, double yb) if ( 0 <= x_sT && x_sT <= canvasWidth && pointInRange(x_sT, 0, xa, ya, xb, yb) ) { i++; - translate[i] = QPoint( 0, 1 ); - crossPoint[i] = QPoint( ROUND2INT(x_sT), 0 ); + translate[i] = TQPoint( 0, 1 ); + crossPoint[i] = TQPoint( ROUND2INT(x_sT), 0 ); } if ( 0 <= x_sB && x_sB <= canvasWidth && pointInRange(x_sB, canvasHeight, xa, ya, xb, yb) ) { i++; - translate[i] = QPoint( 0,-1 ); - crossPoint[i] = QPoint( ROUND2INT(x_sB), ROUND2INT(canvasHeight) ); + translate[i] = TQPoint( 0,-1 ); + crossPoint[i] = TQPoint( ROUND2INT(x_sB), ROUND2INT(canvasHeight) ); } if ( 0 <= y_sL && y_sL <= canvasHeight && pointInRange(0, y_sL, xa, ya, xb, yb) ) { i++; - translate[i] = QPoint( 1, 0 ); - crossPoint[i] = QPoint( 0, ROUND2INT(y_sL) ); + translate[i] = TQPoint( 1, 0 ); + crossPoint[i] = TQPoint( 0, ROUND2INT(y_sL) ); } if ( 0 <= y_sR && y_sR <= canvasHeight && pointInRange(canvasWidth, y_sR, xa, ya, xb, yb) ) { i++; - translate[i] = QPoint(-1, 0 ); - crossPoint[i] = QPoint( ROUND2INT(canvasWidth), ROUND2INT(y_sR) ); + translate[i] = TQPoint(-1, 0 ); + crossPoint[i] = TQPoint( ROUND2INT(canvasWidth), ROUND2INT(y_sR) ); } if ( i == 0 ) { // kdDebug(0)<<"Canvas::translationFactor: FIRST NO BORDER CROSSINGS DETECTED"<<endl; - QPoint returnValue = QPoint(0, 0); // initiate the returnValue + TQPoint returnValue = TQPoint(0, 0); // initiate the returnValue // Here a fallback if the line has no crossings points with any borders. // This mostly happens because of unlucky rounding, when this happens the line is nearly // crossing a corner of the canvas. @@ -521,22 +521,22 @@ QPoint Canvas::translationFactor(double xa, double ya, double xb, double yb) // This, luckily, allmost never happens. if ( -2 <= x_sT && x_sT <= (canvasWidth + 2) && pointInRange(x_sT, 0, xa, ya, xb, yb) ) { - returnValue = returnValue + QPoint(0, 1); + returnValue = returnValue + TQPoint(0, 1); } if ( -2 <= x_sB && x_sB <= (canvasWidth + 2) && pointInRange(x_sB, canvasHeight, xa, ya, xb, yb) ) { - returnValue = returnValue + QPoint(0,-1); + returnValue = returnValue + TQPoint(0,-1); } if ( -2 <= y_sL && y_sL <= (canvasHeight + 2) && pointInRange(0, y_sL, xa, ya, xb, yb) ) { - returnValue = returnValue + QPoint(1, 0); + returnValue = returnValue + TQPoint(1, 0); } if ( -2 <= y_sR && y_sR <= (canvasHeight + 2) && pointInRange(canvasWidth, y_sR, xa, ya, xb, yb) ) { - returnValue = returnValue + QPoint(-1, 0); + returnValue = returnValue + TQPoint(-1, 0); } - if ( returnValue == QPoint(0, 0) ) + if ( returnValue == TQPoint(0, 0) ) { // kdDebug(0)<<"Canvas::translationFactor: *****This shouldn't happen (1) *****"<<endl; // and this doesnt happen, that why +3 and -3 are ok values and the code above works. @@ -545,7 +545,7 @@ QPoint Canvas::translationFactor(double xa, double ya, double xb, double yb) } } - QPoint returnValue = QPoint(0, 0); // a new returnValue QPoint gets inited + TQPoint returnValue = TQPoint(0, 0); // a new returnValue TQPoint gets inited if (i == 1) { // only one border crossing, this is normal when the start point @@ -558,8 +558,8 @@ QPoint Canvas::translationFactor(double xa, double ya, double xb, double yb) // more than one border crossing starting point if of the canvas // we now have to find out which crossing occurs 'first' to know how to translate the line // NOTE2SELF: the line does NOT have to start on the canvas!! - QPoint endPos( ROUND2INT(xb), ROUND2INT(yb)); - int smallestSize = ( QPoint( ROUND2INT(xa), ROUND2INT(ya) ) - endPos ).manhattanLength(); + TQPoint endPos( ROUND2INT(xb), ROUND2INT(yb)); + int smallestSize = ( TQPoint( ROUND2INT(xa), ROUND2INT(ya) ) - endPos ).manhattanLength(); // smallestSize is initiated to the total size of the line for (int ii = 1; ii <= i; ii++) { @@ -574,12 +574,12 @@ QPoint Canvas::translationFactor(double xa, double ya, double xb, double yb) else if (testSize == smallestSize) // this only happens on corners { // kdDebug(0)<<"Canvas::translationFactor: CORNER EXCEPTION"<<endl; - returnValue = QPoint(0, 0); - if (xb < 0) returnValue = returnValue + QPoint( 1, 0); - else if (xb > canvasWidth) returnValue = returnValue + QPoint(-1, 0); + returnValue = TQPoint(0, 0); + if (xb < 0) returnValue = returnValue + TQPoint( 1, 0); + else if (xb > canvasWidth) returnValue = returnValue + TQPoint(-1, 0); - if (yb < 0) returnValue = returnValue + QPoint( 0, 1); - else if (yb > canvasHeight) returnValue = returnValue + QPoint( 0,-1); + if (yb < 0) returnValue = returnValue + TQPoint( 0, 1); + else if (yb > canvasHeight) returnValue = returnValue + TQPoint( 0,-1); return returnValue; } @@ -595,14 +595,14 @@ QPoint Canvas::translationFactor(double xa, double ya, double xb, double yb) // Sprite related methods: -void Canvas::loadSpriteFrames(QString name) +void Canvas::loadSpriteFrames(TQString name) { // read the pixmaps name.0001.png, name.0002.png, ..., name.0035.png: the different rotations // #0000 for 0 or 360, #0001 for 10, #0002 for 20, ..., #0018 for 180, etc. // WARNING if the dir doesnt exists the app will crash!!! // This will be fixed in qt3.3 and in the current qt-copy - QPixmap turtlePix = QPixmap(locate("data","kturtle/pics/turtle.0000.png") ); + TQPixmap turtlePix = TQPixmap(locate("data","kturtle/pics/turtle.0000.png") ); if ( turtlePix.isNull() ) { KMessageBox::sorry( this, @@ -610,10 +610,10 @@ void Canvas::loadSpriteFrames(QString name) "Please check your installation."), i18n("Error") ); return; } - QString spritePath = locate("data","kturtle/pics/"+name+".0000.png"); + TQString spritePath = locate("data","kturtle/pics/"+name+".0000.png"); spritePath.remove(".0000.png"); - spriteFrames = new QCanvasPixmapArray(spritePath+".%1.png", 36); - sprite = new QCanvasSprite(spriteFrames, canvas); + spriteFrames = new TQCanvasPixmapArray(spritePath+".%1.png", 36); + sprite = new TQCanvasSprite(spriteFrames, canvas); sprite->setZ(250); } diff --git a/kturtle/src/canvas.h b/kturtle/src/canvas.h index 349e610d..0dd5bb13 100644 --- a/kturtle/src/canvas.h +++ b/kturtle/src/canvas.h @@ -19,7 +19,7 @@ #ifndef _CANVAS_H_ #define _CANVAS_H_ -#include <qcanvas.h> +#include <tqcanvas.h> class Canvas : public QCanvasView @@ -27,10 +27,10 @@ class Canvas : public QCanvasView Q_OBJECT public: - Canvas(QWidget *parent = 0, const char *name = 0); + Canvas(TQWidget *parent = 0, const char *name = 0); ~Canvas(); - QPixmap* canvas2Pixmap(); + TQPixmap* canvas2Pixmap(); public slots: @@ -56,8 +56,8 @@ class Canvas : public QCanvasView void slotSpritePress(); void slotSpriteChange(int x); - void slotPrint(QString text); - void slotFontType(QString family, QString extra); + void slotPrint(TQString text); + void slotFontType(TQString family, TQString extra); void slotFontSize(int px); void slotWrapOn(); void slotWrapOff(); @@ -73,20 +73,20 @@ class Canvas : public QCanvasView void line(double xa, double ya, double xb, double yb); void lineShell(double xa, double ya, double xb, double yb); - bool endlessLoop(QPoint begin, QPoint end); + bool endlessLoop(TQPoint begin, TQPoint end); bool pointInRange(double px, double py, double xa, double ya, double xb, double yb); - QPoint offset(int x, int y); - QPoint translationFactor(double xa, double ya, double xb, double yb); + TQPoint offset(int x, int y); + TQPoint translationFactor(double xa, double ya, double xb, double yb); - void loadSpriteFrames(QString name); + void loadSpriteFrames(TQString name); void updateSpritePos(); void updateSpriteAngle(); - QCanvas *canvas; - QPixmap pixmap; - QCanvasSprite *sprite; - QCanvasPixmapArray *spriteFrames; - QFont font; + TQCanvas *canvas; + TQPixmap pixmap; + TQCanvasSprite *sprite; + TQCanvasPixmapArray *spriteFrames; + TQFont font; double posX, posY; int canvasWidth, canvasHeight; int penWidth; @@ -95,7 +95,7 @@ class Canvas : public QCanvasView bool pen; bool wrap; bool cutLoop; - QPoint prevStartPos3, prevStartPos2, prevStartPos1, prevEndPos3, prevEndPos2, prevEndPos1; + TQPoint prevStartPos3, prevStartPos2, prevStartPos1, prevEndPos3, prevEndPos2, prevEndPos1; }; #endif // _CANVAS_H_ diff --git a/kturtle/src/dialogs.cpp b/kturtle/src/dialogs.cpp index 044f36f4..fcc6322d 100644 --- a/kturtle/src/dialogs.cpp +++ b/kturtle/src/dialogs.cpp @@ -25,11 +25,11 @@ // BEGIN class ErrorMessage dialog -ErrorMessage::ErrorMessage (QWidget *parent) +ErrorMessage::ErrorMessage (TQWidget *parent) : KDialogBase (parent, "errorDialog", false, 0, KDialogBase::Close | KDialogBase::Help | KDialogBase::User1, KDialogBase::Close, true, i18n("Help on &Error") ) { - connect( this, SIGNAL( user1Clicked() ), this, SLOT( showHelpOnError() ) ); - connect( this, SIGNAL( helpClicked() ), this, SLOT( errorMessageHelp() ) ); + connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT( showHelpOnError() ) ); + connect( this, TQT_SIGNAL( helpClicked() ), this, TQT_SLOT( errorMessageHelp() ) ); setCaption( i18n("Error Dialog") ); setButtonWhatsThis( KDialogBase::Close, i18n("Closes this error dialog") ); setButtonWhatsThis( KDialogBase::Help, i18n("Click here to read more on this error dialog in KTurtle's Handbook.") ); @@ -37,24 +37,24 @@ ErrorMessage::ErrorMessage (QWidget *parent) setButtonWhatsThis( KDialogBase::User1, i18n("Click here for help regarding the error you selected in the list. This button will not work when no error is selected.") ); setButtonTip( KDialogBase::User1, i18n("Click here for help regarding the error you selected.") ); - QWidget *baseWidget = new QWidget(this); + TQWidget *baseWidget = new TQWidget(this); setMainWidget(baseWidget); - baseLayout = new QVBoxLayout(baseWidget); + baseLayout = new TQVBoxLayout(baseWidget); - label = new QLabel(baseWidget); + label = new TQLabel(baseWidget); label->setText( i18n("In this list you find the error(s) that resulted from running your Logo code. \nGood luck!") ); // \nYou can select an error and click the 'Help on Error' button for help. label->setScaledContents(true); baseLayout->addWidget(label); - spacer = new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Fixed ); + spacer = new TQSpacerItem( 10, 10, TQSizePolicy::Minimum, TQSizePolicy::Fixed ); baseLayout->addItem(spacer); - errTable = new QTable(0, 3, baseWidget); - errTable->setSelectionMode(QTable::SingleRow); + errTable = new TQTable(0, 3, baseWidget); + errTable->setSelectionMode(TQTable::SingleRow); errTable->setReadOnly(true); errTable->setShowGrid(false); - errTable->setFocusStyle(QTable::FollowStyle); + errTable->setFocusStyle(TQTable::FollowStyle); errTable->setLeftMargin(0); errTable->horizontalHeader()->setLabel( 0, i18n("number") ); @@ -76,7 +76,7 @@ ErrorMessage::ErrorMessage (QWidget *parent) } -void ErrorMessage::slotAddError(Token& t, const QString& s, uint c) +void ErrorMessage::slotAddError(Token& t, const TQString& s, uint c) { errorData err; err.code = c; @@ -87,8 +87,8 @@ void ErrorMessage::slotAddError(Token& t, const QString& s, uint c) Token currentToken = err.tok; kdDebug(0)<<"ErrorMessage::slotAddError(); >> "<<err.msg<<" <<, token: '"<<currentToken.look<<"', @ ("<<currentToken.start.row<<", "<<currentToken.start.col<<") - ("<<currentToken.end.row<<", "<<currentToken.end.col<<"), tok-number:"<<currentToken.type<<endl; errTable->insertRows(0); - errTable->setText( 0, 0, QString::number(errCount) ); // put the count in a hidden field for reference - errTable->setText( 0, 1, QString::number(err.tok.start.row) ); + errTable->setText( 0, 0, TQString::number(errCount) ); // put the count in a hidden field for reference + errTable->setText( 0, 1, TQString::number(err.tok.start.row) ); errTable->setText( 0, 2, err.msg ); errCount++; @@ -107,7 +107,7 @@ void ErrorMessage::display() enableButton (KDialogBase::User1, false); errTable->sortColumn(0, true, true); show(); - connect( errTable, SIGNAL( selectionChanged() ), this, SLOT( updateSelection() ) ); + connect( errTable, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( updateSelection() ) ); } void ErrorMessage::updateSelection() @@ -140,29 +140,29 @@ void ErrorMessage::errorMessageHelp() // BEGIN class ColorPicker dialog -ColorPicker::ColorPicker(QWidget *parent) +ColorPicker::ColorPicker(TQWidget *parent) : KDialogBase(parent, "colorpicker", false, i18n("Color Picker"), KDialogBase::Close | KDialogBase::Help | KDialogBase::User1, KDialogBase::Close, true ) { // connect to help - connect( this, SIGNAL( helpClicked() ), SLOT( slotColorPickerHelp() ) ); + connect( this, TQT_SIGNAL( helpClicked() ), TQT_SLOT( slotColorPickerHelp() ) ); // for toggling convenience - connect( this, SIGNAL( finished() ), SLOT( slotEmitVisibility() ) ); + connect( this, TQT_SIGNAL( finished() ), TQT_SLOT( slotEmitVisibility() ) ); // Create the top level page and its layout - BaseWidget = new QWidget(this); + BaseWidget = new TQWidget(this); setMainWidget(BaseWidget); // the User1 button: setButtonText( KDialogBase::User1, i18n("Insert Color Code at Cursor") ); - connect( this, SIGNAL( user1Clicked() ), SLOT( slotEmitColorCode() ) ); + connect( this, TQT_SIGNAL( user1Clicked() ), TQT_SLOT( slotEmitColorCode() ) ); - QVBoxLayout *vlayout = new QVBoxLayout(BaseWidget); + TQVBoxLayout *vlayout = new TQVBoxLayout(BaseWidget); vlayout->addSpacing(5); // spacing on top // the palette and value selector go into a H-box - QHBoxLayout *h1layout = new QHBoxLayout(BaseWidget); + TQHBoxLayout *h1layout = new TQHBoxLayout(BaseWidget); vlayout->addLayout(h1layout); h1layout->addSpacing(10); // space on the left border @@ -170,19 +170,19 @@ ColorPicker::ColorPicker(QWidget *parent) hsSelector = new KHSSelector(BaseWidget); // the color (SH) selector hsSelector->setMinimumSize(300, 150); h1layout->addWidget(hsSelector); - connect( hsSelector, SIGNAL( valueChanged(int, int) ), SLOT( slotSelectorChanged(int, int) ) ); + connect( hsSelector, TQT_SIGNAL( valueChanged(int, int) ), TQT_SLOT( slotSelectorChanged(int, int) ) ); h1layout->addSpacing(5); // space in between valuePal = new KValueSelector(BaseWidget); // the darkness (V) pal valuePal->setFixedWidth(30); h1layout->addWidget(valuePal); - connect( valuePal, SIGNAL( valueChanged(int) ), SLOT( slotPalChanged(int) ) ); + connect( valuePal, TQT_SIGNAL( valueChanged(int) ), TQT_SLOT( slotPalChanged(int) ) ); vlayout->addSpacing(15); // space in between the top and the bottom widgets // the patch and the codegenerator also go into a H-box - QHBoxLayout *h2layout = new QHBoxLayout(BaseWidget); + TQHBoxLayout *h2layout = new TQHBoxLayout(BaseWidget); vlayout->addLayout(h2layout); h2layout->addSpacing(10); // space on the left border @@ -194,16 +194,16 @@ ColorPicker::ColorPicker(QWidget *parent) h2layout->addSpacing(10); // space in between // the label and the codegenerator go in a V-box - QVBoxLayout *v2layout = new QVBoxLayout(BaseWidget); + TQVBoxLayout *v2layout = new TQVBoxLayout(BaseWidget); h2layout->addLayout(v2layout); - copyable = new QLabel(i18n("Color code:"), BaseWidget); // tha label + copyable = new TQLabel(i18n("Color code:"), BaseWidget); // tha label v2layout->addWidget(copyable); - colorcode = new QLineEdit(BaseWidget); // the code generator + colorcode = new TQLineEdit(BaseWidget); // the code generator colorcode->setReadOnly(true); v2layout->addWidget(colorcode); - connect( colorcode, SIGNAL( selectionChanged() ), SLOT( slotReselect() ) ); + connect( colorcode, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( slotReselect() ) ); h2layout->addSpacing(5); // spacing on the right border @@ -239,7 +239,7 @@ void ColorPicker::updatePatch() void ColorPicker::updateColorCode() { color.getRgb(&r, &g, &b); - colorcode->setText( QString("%1, %2, %3").arg(r).arg(g).arg(b) ); + colorcode->setText( TQString("%1, %2, %3").arg(r).arg(g).arg(b) ); colorcode->selectAll(); } @@ -269,9 +269,9 @@ void ColorPicker::slotPalChanged(int v_) void ColorPicker::slotReselect() { // reselect by selectAll(), but make sure no looping occurs - disconnect( colorcode, SIGNAL( selectionChanged() ), 0, 0 ); + disconnect( colorcode, TQT_SIGNAL( selectionChanged() ), 0, 0 ); colorcode->selectAll(); - connect( colorcode, SIGNAL( selectionChanged() ), SLOT( slotReselect() ) ); + connect( colorcode, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( slotReselect() ) ); } void ColorPicker::slotEmitVisibility() @@ -297,17 +297,17 @@ void ColorPicker::slotColorPickerHelp() // BEGIN class RestartOrBack dialog -RestartOrBack::RestartOrBack (QWidget *parent) +RestartOrBack::RestartOrBack (TQWidget *parent) : KDialogBase (parent, "rbDialog", true, 0, KDialogBase::User1 | KDialogBase::User2, KDialogBase::User2, false, i18n("&Restart"), i18n("&Back") ) { setPlainCaption( i18n("Finished Execution") ); setButtonWhatsThis( KDialogBase::User1, i18n("Click here to restart the current logo program.") ); setButtonWhatsThis( KDialogBase::User2, i18n("Click here to switch back to the edit mode.") ); - QWidget *baseWidget = new QWidget(this); + TQWidget *baseWidget = new TQWidget(this); setMainWidget(baseWidget); - baseLayout = new QVBoxLayout(baseWidget); + baseLayout = new TQVBoxLayout(baseWidget); - label = new QLabel(baseWidget); + label = new TQLabel(baseWidget); label->setText( i18n("Execution was finished without errors.\nWhat do you want to do next?") ); label->setScaledContents(true); baseLayout->addWidget(label); diff --git a/kturtle/src/dialogs.h b/kturtle/src/dialogs.h index dd4f2474..0a421d49 100644 --- a/kturtle/src/dialogs.h +++ b/kturtle/src/dialogs.h @@ -27,12 +27,12 @@ #define _DIALOGS_H_ -#include <qlayout.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qstring.h> -#include <qtable.h> -#include <qvaluelist.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqstring.h> +#include <tqtable.h> +#include <tqvaluelist.h> #include <kdialogbase.h> #include <kcolordialog.h> @@ -46,7 +46,7 @@ struct errorData { uint code; Token tok; - QString msg; + TQString msg; }; @@ -55,7 +55,7 @@ class ErrorMessage : public KDialogBase Q_OBJECT public: - ErrorMessage(QWidget *parent); + ErrorMessage(TQWidget *parent); ~ErrorMessage() {} bool containsErrors(); @@ -63,7 +63,7 @@ class ErrorMessage : public KDialogBase void display(); public slots: - void slotAddError(Token&, const QString&, uint code); + void slotAddError(Token&, const TQString&, uint code); void updateSelection(); private slots: @@ -75,17 +75,17 @@ class ErrorMessage : public KDialogBase void setSelection(uint, uint, uint, uint); private: - typedef QValueList<errorData> errorList; + typedef TQValueList<errorData> errorList; errorList errList; - QTable *errTable; + TQTable *errTable; uint errCount; errorData currentError; protected: - QDialog *dialog; - QVBoxLayout *baseLayout; - QLabel *label; - QSpacerItem *spacer; + TQDialog *dialog; + TQVBoxLayout *baseLayout; + TQLabel *label; + TQSpacerItem *spacer; }; // END @@ -99,13 +99,13 @@ class ColorPicker : public KDialogBase Q_OBJECT public: - ColorPicker(QWidget *parent); + ColorPicker(TQWidget *parent); virtual ~ColorPicker() {} signals: void visible(bool); // for toggling convenience - void ColorCode(QString); + void ColorCode(TQString); private: @@ -114,16 +114,16 @@ class ColorPicker : public KDialogBase void updatePatch(); void updateColorCode(); - QWidget *BaseWidget; + TQWidget *BaseWidget; KHSSelector *hsSelector; KValueSelector *valuePal; - QVBoxLayout *vlayout; - QHBoxLayout *h1layout; - QHBoxLayout *h2layout; + TQVBoxLayout *vlayout; + TQHBoxLayout *h1layout; + TQHBoxLayout *h2layout; KColorPatch *patch; - QLabel *copyable; - QLineEdit *colorcode; - QColor color; + TQLabel *copyable; + TQLineEdit *colorcode; + TQColor color; int h, s, v, r, g, b; @@ -151,12 +151,12 @@ class RestartOrBack : public KDialogBase Q_OBJECT public: - RestartOrBack (QWidget *parent); + RestartOrBack (TQWidget *parent); ~RestartOrBack() {} protected: - QVBoxLayout *baseLayout; - QLabel *label; + TQVBoxLayout *baseLayout; + TQLabel *label; }; // END diff --git a/kturtle/src/executer.cpp b/kturtle/src/executer.cpp index f7058146..e50c64a5 100644 --- a/kturtle/src/executer.cpp +++ b/kturtle/src/executer.cpp @@ -23,7 +23,7 @@ #include <unistd.h> // for usleep(); #include <stdlib.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kapplication.h> #include <kdebug.h> @@ -206,7 +206,7 @@ void Executer::execute(TreeNode* node) void Executer::createFunction(TreeNode* node) { - QString funcname = node->getLook(); + TQString funcname = node->getLook(); functionTable[funcname] = node; //store for later use } @@ -214,7 +214,7 @@ void Executer::createFunction(TreeNode* node) //execute a function void Executer::execFunction(TreeNode* node) { - QString funcname = node->getLook(); + TQString funcname = node->getLook(); // locate function node functable::iterator p = functionTable.find(funcname); @@ -249,7 +249,7 @@ void Executer::execFunction(TreeNode* node) // execute the parameters which can be expressions execute(*pfrom); - QString idname = (*pto)->getLook(); + TQString idname = (*pto)->getLook(); funcSymTable[idname] = (*pfrom)->getValue(); ++pto; } @@ -324,8 +324,8 @@ void Executer::execForEach(TreeNode* node) execute(expr1); execute(expr2); - QString expStr1 = expr1->getValue().String(); - QString expStr2 = expr2->getValue().String(); + TQString expStr1 = expr1->getValue().String(); + TQString expStr2 = expr2->getValue().String(); bBreak = false; @@ -351,7 +351,7 @@ void Executer::execFor(TreeNode* node) TreeNode* stopNode = node->thirdChild(); TreeNode* statements = node->fourthChild(); - QString name = id->getLook(); + TQString name = id->getLook(); execute(startNode); //assign startval to id @@ -636,13 +636,13 @@ void Executer::execMinus(TreeNode* node) } -QString Executer::runCommand(const QString& command) +TQString Executer::runCommand(const TQString& command) { FILE *pstream; if ( ( pstream = popen( command.ascii(), "r" ) ) == NULL ) return (""); - QString Line; + TQString Line; char buf[100]; while( fgets(buf, sizeof(buf), pstream) !=NULL) { @@ -658,7 +658,7 @@ QString Executer::runCommand(const QString& command) void Executer::execRun(TreeNode* node) { - QString cmd = exec2getValue( node->firstChild() ).String(); + TQString cmd = exec2getValue( node->firstChild() ).String(); node->setValue( runCommand(cmd) ); } @@ -958,7 +958,7 @@ void Executer::execInputWindow(TreeNode* node) { if ( !checkParameterQuantity(node, 1, 5060) ) return; - QString value = node->firstChild()->getValue().String(); + TQString value = node->firstChild()->getValue().String(); emit InputDialog(value); node->setType(constantNode); @@ -980,7 +980,7 @@ void Executer::execPrint(TreeNode* node) return; } TreeNode::iterator i; - QString str = ""; + TQString str = ""; for (i = node->begin(); i != node->end(); ++i) { execute(*i); // execute expression @@ -994,9 +994,9 @@ void Executer::execFontType(TreeNode* node) // if not 2 params go staight to the checkParam, diplay the error, and return to prevent a crash if ( !checkParameterQuantity(node, 2, 5060) && !checkParameterType(node, stringValue, 5060) ) return; - QString extra; - if (node->size() == 2) QString extra = node->secondChild()->getValue().String(); - QString family = node->firstChild()->getValue().String(); + TQString extra; + if (node->size() == 2) TQString extra = node->secondChild()->getValue().String(); + TQString family = node->firstChild()->getValue().String(); emit FontType(family, extra); } @@ -1015,7 +1015,7 @@ void Executer::startWaiting(int msec) { bStopWaiting = false; // call a timer that sets stopWaiting to true when it runs - QTimer::singleShot( msec, this, SLOT( slotStopWaiting() ) ); + TQTimer::singleShot( msec, this, TQT_SLOT( slotStopWaiting() ) ); while (bStopWaiting == false) { if (bAbort) return; // waits need to be interrupted by the stop action diff --git a/kturtle/src/executer.h b/kturtle/src/executer.h index ac9a1f1b..d4ecdb77 100644 --- a/kturtle/src/executer.h +++ b/kturtle/src/executer.h @@ -26,8 +26,8 @@ #include "treenode.h" -typedef map<QString,Value> symtable; -typedef map<QString,TreeNode*> functable; +typedef map<TQString,Value> symtable; +typedef map<TQString,TreeNode*> functable; typedef stack<Value> runstack; @@ -47,11 +47,11 @@ class Executer : public QObject signals: void Finished(); - void ErrorMsg(Token&, const QString&, uint code); + void ErrorMsg(Token&, const TQString&, uint code); void setSelection(uint, uint, uint, uint); - void InputDialog(QString& value); - void MessageDialog(QString text); + void InputDialog(TQString& value); + void MessageDialog(TQString text); void Clear(); void Go(double x, double y); @@ -73,8 +73,8 @@ class Executer : public QObject void SpriteHide(); void SpritePress(); void SpriteChange(int x); - void Print(QString text); - void FontType(QString family, QString extra); + void Print(TQString text); + void FontType(TQString family, TQString extra); void FontSize(int px); void WrapOn(); void WrapOff(); @@ -154,7 +154,7 @@ class Executer : public QObject Value exec2getValue (TreeNode*); - QString runCommand(const QString&); + TQString runCommand(const TQString&); bool checkParameterQuantity(TreeNode*, uint quantity, int errorCode); bool checkParameterType(TreeNode*, int valueType, int errorCode); diff --git a/kturtle/src/kturtle.cpp b/kturtle/src/kturtle.cpp index 2cc7c5ff..d90228a6 100644 --- a/kturtle/src/kturtle.cpp +++ b/kturtle/src/kturtle.cpp @@ -20,12 +20,12 @@ #include <stdlib.h> -#include <qbutton.h> -#include <qregexp.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qtimer.h> -#include <qwhatsthis.h> +#include <tqbutton.h> +#include <tqregexp.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqtimer.h> +#include <tqwhatsthis.h> #include <kapplication.h> #include <kconfigdialog.h> @@ -123,59 +123,59 @@ void MainWindow::setupActions() KActionCollection *ac = actionCollection(); // abbreviation // File actions - KStdAction::openNew(this, SLOT(slotNewFile()), ac); - openExAction = new KAction(i18n("Open Exa&mples..."), "bookmark_folder", CTRL+Key_E, this, SLOT(slotOpenExample()), ac, "open_examples"); - KStdAction::open(this, SLOT(slotOpenFile()), ac); - m_recentFiles = KStdAction::openRecent(this, SLOT(slotOpenFile(const KURL&)), ac); - KStdAction::save(this, SLOT(slotSaveFile()), ac); - KStdAction::saveAs(this, SLOT(slotSaveAs()), ac); - new KAction(i18n("Save &Canvas..."), 0, 0, this, SLOT(slotSaveCanvas()), ac, "save_canvas"); - speed = new KSelectAction(i18n("Execution Speed"), 0, ALT+Key_S, this, SLOT( slotChangeSpeed() ), ac, "speed"); - QStringList speeds; speeds << i18n("Full Speed") << i18n("Slow") << i18n("Slower") << i18n("Slowest"); + KStdAction::openNew(this, TQT_SLOT(slotNewFile()), ac); + openExAction = new KAction(i18n("Open Exa&mples..."), "bookmark_folder", CTRL+Key_E, this, TQT_SLOT(slotOpenExample()), ac, "open_examples"); + KStdAction::open(this, TQT_SLOT(slotOpenFile()), ac); + m_recentFiles = KStdAction::openRecent(this, TQT_SLOT(slotOpenFile(const KURL&)), ac); + KStdAction::save(this, TQT_SLOT(slotSaveFile()), ac); + KStdAction::saveAs(this, TQT_SLOT(slotSaveAs()), ac); + new KAction(i18n("Save &Canvas..."), 0, 0, this, TQT_SLOT(slotSaveCanvas()), ac, "save_canvas"); + speed = new KSelectAction(i18n("Execution Speed"), 0, ALT+Key_S, this, TQT_SLOT( slotChangeSpeed() ), ac, "speed"); + TQStringList speeds; speeds << i18n("Full Speed") << i18n("Slow") << i18n("Slower") << i18n("Slowest"); speed->setItems(speeds); speed->setCurrentItem(0); - run = new KAction(i18n("&Execute Commands"), "gear", ALT+Key_Return, this, SLOT( slotExecute() ), ac, "run"); - pause = new KToggleAction(i18n("Pause E&xecution"), "player_pause", Key_Pause, this, SLOT( slotPauseExecution() ), ac, "pause"); + run = new KAction(i18n("&Execute Commands"), "gear", ALT+Key_Return, this, TQT_SLOT( slotExecute() ), ac, "run"); + pause = new KToggleAction(i18n("Pause E&xecution"), "player_pause", Key_Pause, this, TQT_SLOT( slotPauseExecution() ), ac, "pause"); pause->setChecked(false); pause->setEnabled(false); - stop = new KAction(i18n("Stop E&xecution"), "stop", Key_Escape, this, SLOT( slotAbortExecution() ), ac, "stop"); + stop = new KAction(i18n("Stop E&xecution"), "stop", Key_Escape, this, TQT_SLOT( slotAbortExecution() ), ac, "stop"); stop->setEnabled(false); - KStdAction::print(this, SLOT(slotPrint()), ac); - KStdAction::quit(this, SLOT(close()), ac); + KStdAction::print(this, TQT_SLOT(slotPrint()), ac); + KStdAction::quit(this, TQT_SLOT(close()), ac); // Edit actions - KStdAction::undo(this, SLOT(slotUndo()), ac); - KStdAction::redo(this, SLOT(slotRedo()), ac); - KStdAction::cut(this, SLOT(slotCut()), ac); - KStdAction::copy(this, SLOT(slotCopy()), ac); - KStdAction::paste(this, SLOT(slotPaste()), ac); - KStdAction::selectAll(this, SLOT(slotSelectAll()), ac); - KStdAction::deselect(this, SLOT(slotClearSelection()), ac); - new KToggleAction(i18n("Toggle Insert"), Key_Insert, this, SLOT(slotToggleInsert()), ac, "set_insert"); - KStdAction::find(this, SLOT(slotFind()), ac); - KStdAction::findNext(this, SLOT(slotFindNext()), ac); - KStdAction::findPrev(this, SLOT(slotFindPrevious()), ac); - KStdAction::replace(this, SLOT(slotReplace()), ac); + KStdAction::undo(this, TQT_SLOT(slotUndo()), ac); + KStdAction::redo(this, TQT_SLOT(slotRedo()), ac); + KStdAction::cut(this, TQT_SLOT(slotCut()), ac); + KStdAction::copy(this, TQT_SLOT(slotCopy()), ac); + KStdAction::paste(this, TQT_SLOT(slotPaste()), ac); + KStdAction::selectAll(this, TQT_SLOT(slotSelectAll()), ac); + KStdAction::deselect(this, TQT_SLOT(slotClearSelection()), ac); + new KToggleAction(i18n("Toggle Insert"), Key_Insert, this, TQT_SLOT(slotToggleInsert()), ac, "set_insert"); + KStdAction::find(this, TQT_SLOT(slotFind()), ac); + KStdAction::findNext(this, TQT_SLOT(slotFindNext()), ac); + KStdAction::findPrev(this, TQT_SLOT(slotFindPrevious()), ac); + KStdAction::replace(this, TQT_SLOT(slotReplace()), ac); // View actions - new KToggleAction(i18n("Show &Line Numbers"), 0, Key_F11, this, SLOT(slotToggleLineNumbers()), ac, "line_numbers"); - m_fullscreen = KStdAction::fullScreen(this, SLOT(slotToggleFullscreen()), ac, this, "full_screen"); + new KToggleAction(i18n("Show &Line Numbers"), 0, Key_F11, this, TQT_SLOT(slotToggleLineNumbers()), ac, "line_numbers"); + m_fullscreen = KStdAction::fullScreen(this, TQT_SLOT(slotToggleFullscreen()), ac, this, "full_screen"); m_fullscreen->setChecked(b_fullscreen); // Tools actions - colorpicker = new KToggleAction(i18n("&Color Picker"), "colorize", ALT+Key_C, this, SLOT(slotColorPicker()), ac, "color_picker"); - new KAction(i18n("&Indent"), "indent", CTRL+Key_I, this, SLOT(slotIndent()), ac, "edit_indent"); - new KAction(i18n("&Unindent"), "unindent", CTRL+SHIFT+Key_I, this, SLOT(slotUnIndent()), ac, "edit_unindent"); - new KAction(i18n("Cl&ean Indentation"), 0, 0, this, SLOT(slotCleanIndent()), ac, "edit_cleanIndent"); - new KAction(i18n("Co&mment"), 0, CTRL+Key_D, this, SLOT(slotComment()), ac, "edit_comment"); - new KAction(i18n("Unc&omment"), 0, CTRL+SHIFT+Key_D, this, SLOT(slotUnComment()), ac, "edit_uncomment"); + colorpicker = new KToggleAction(i18n("&Color Picker"), "colorize", ALT+Key_C, this, TQT_SLOT(slotColorPicker()), ac, "color_picker"); + new KAction(i18n("&Indent"), "indent", CTRL+Key_I, this, TQT_SLOT(slotIndent()), ac, "edit_indent"); + new KAction(i18n("&Unindent"), "unindent", CTRL+SHIFT+Key_I, this, TQT_SLOT(slotUnIndent()), ac, "edit_unindent"); + new KAction(i18n("Cl&ean Indentation"), 0, 0, this, TQT_SLOT(slotCleanIndent()), ac, "edit_cleanIndent"); + new KAction(i18n("Co&mment"), 0, CTRL+Key_D, this, TQT_SLOT(slotComment()), ac, "edit_comment"); + new KAction(i18n("Unc&omment"), 0, CTRL+SHIFT+Key_D, this, TQT_SLOT(slotUnComment()), ac, "edit_uncomment"); // Settings actions - KStdAction::preferences( this, SLOT(slotSettings()), ac ); - new KAction(i18n("&Configure Editor..."), "configure", 0, this, SLOT(slotEditor()), ac, "set_confdlg"); + KStdAction::preferences( this, TQT_SLOT(slotSettings()), ac ); + new KAction(i18n("&Configure Editor..."), "configure", 0, this, TQT_SLOT(slotEditor()), ac, "set_confdlg"); // Help actions - ContextHelp = new KAction(0, 0, Key_F2, this, SLOT(slotContextHelp()), ac, "context_help"); + ContextHelp = new KAction(0, 0, Key_F2, this, TQT_SLOT(slotContextHelp()), ac, "context_help"); slotContextHelpUpdate(); // this sets the label of this action // other @@ -185,13 +185,13 @@ void MainWindow::setupActions() void MainWindow::setupEditor() { - editorDock = new QDockWindow(this); + editorDock = new TQDockWindow(this); editorDock->setNewLine(true); editorDock->setFixedExtentWidth(250); editorDock->setFixedExtentHeight(150); editorDock->setResizeEnabled(true); - editorDock->setFrameShape(QFrame::ToolBarPanel); - QWhatsThis::add( editorDock, i18n( "This is the code editor, here you type the Logo commands to instruct the turtle. You can also open an existing Logo program with File->Open Examples... or File->Open." ) ); + editorDock->setFrameShape(TQFrame::ToolBarPanel); + TQWhatsThis::add( editorDock, i18n( "This is the code editor, here you type the Logo commands to instruct the turtle. You can also open an existing Logo program with File->Open Examples... or File->Open." ) ); moveDockWindow(editorDock, Qt::DockLeft); editor = doc->createView (editorDock, 0L); // editorInterface is the editor interface which allows us to access the text in the part @@ -204,9 +204,9 @@ void MainWindow::setupEditor() slotSetHighlightstyle( Settings::logoLanguage() ); // allow the cursor position to be indicated in the statusbar - connect( editor, SIGNAL(cursorPositionChanged()), this, SLOT(slotCursorStatusBar()) ); + connect( editor, TQT_SIGNAL(cursorPositionChanged()), this, TQT_SLOT(slotCursorStatusBar()) ); // and update the context help menu item - connect( editor, SIGNAL(cursorPositionChanged()), this, SLOT(slotContextHelpUpdate()) ); + connect( editor, TQT_SIGNAL(cursorPositionChanged()), this, TQT_SLOT(slotContextHelpUpdate()) ); translate = new Translate(); } @@ -227,16 +227,16 @@ void MainWindow::setupStatusBar() void MainWindow::setupCanvas() { - baseWidget = new QWidget(this); + baseWidget = new TQWidget(this); setCentralWidget(baseWidget); - baseLayout = new QGridLayout(baseWidget, 0, 0); + baseLayout = new TQGridLayout(baseWidget, 0, 0); canvasView = new Canvas(baseWidget); baseLayout->addWidget(canvasView, 0, 0, AlignCenter); baseLayout->setRowStretch(0, 1); // this apperntly fixes a pre-usefull scrollbars bug baseLayout->setColStretch(0, 1); - QWhatsThis::add( canvasView, i18n("This is the canvas, here the turtle draws a picture.") ); + TQWhatsThis::add( canvasView, i18n("This is the canvas, here the turtle draws a picture.") ); canvasView->show(); - connect( canvasView, SIGNAL( CanvasResized() ), this, SLOT( slotUpdateCanvas() ) ); + connect( canvasView, TQT_SIGNAL( CanvasResized() ), this, TQT_SLOT( slotUpdateCanvas() ) ); } // END @@ -245,7 +245,7 @@ void MainWindow::setupCanvas() // BEGIN staturbar related functions -void MainWindow::slotStatusBar(QString text, int id) +void MainWindow::slotStatusBar(TQString text, int id) { text = " " + text + " "; // help the layout statusBar()->changeItem(text, id); @@ -256,7 +256,7 @@ void MainWindow::slotCursorStatusBar() uint cursorLine; uint cursorCol; dynamic_cast<KTextEditor::ViewCursorInterface*>(editor)->cursorPositionReal(&cursorLine, &cursorCol); - QString linenumber = i18n(" Line: %1 Column: %2 ").arg(cursorLine + 1).arg(cursorCol + 1); + TQString linenumber = i18n(" Line: %1 Column: %2 ").arg(cursorLine + 1).arg(cursorCol + 1); statusBar()->changeItem(linenumber, IDS_LINECOLUMN); } @@ -292,7 +292,7 @@ void MainWindow::slotOpenFile(const KURL &urlRef) KURL url = urlRef; if ( url.isEmpty() ) { - url = KFileDialog::getOpenURL( QString(":logo_dir"), QString("*.logo|") + i18n("Logo Files"), this, i18n("Open Logo File") ); + url = KFileDialog::getOpenURL( TQString(":logo_dir"), TQString("*.logo|") + i18n("Logo Files"), this, i18n("Open Logo File") ); } loadFile(url); } @@ -301,7 +301,7 @@ void MainWindow::slotOpenExample() { KURL url; url.setPath( locate("data", "kturtle/examples/" + Settings::logoLanguage() + "/") ); - url = KFileDialog::getOpenURL( url.path(), QString("*.logo|") + i18n("Logo Examples Files"), this, i18n("Open Logo Example File") ); + url = KFileDialog::getOpenURL( url.path(), TQString("*.logo|") + i18n("Logo Examples Files"), this, i18n("Open Logo Example File") ); loadFile(url); } @@ -309,7 +309,7 @@ void MainWindow::loadFile(const KURL &url) { if ( !url.isEmpty() ) { - QFile file( url.path() ); + TQFile file( url.path() ); if ( file.open(IO_ReadOnly) ) { if ( editor->document()->isModified() ) @@ -324,8 +324,8 @@ void MainWindow::loadFile(const KURL &url) return; } } - QTextStream stream(&file); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(&file); + stream.setEncoding(TQTextStream::UnicodeUTF8); editorInterface->setText( stream.read() ); file.close(); m_recentFiles->addURL(url); @@ -357,13 +357,13 @@ void MainWindow::slotSaveAs() KURL url; while (true) { - url = KFileDialog::getSaveURL( QString(":logo_dir"), QString("*.logo|") + i18n("Logo Files"), this, i18n("Save As") ); + url = KFileDialog::getSaveURL( TQString(":logo_dir"), TQString("*.logo|") + i18n("Logo Files"), this, i18n("Save As") ); if ( url.isEmpty() ) // cancelled the save dialog { slotStatusBar(i18n("Saving aborted."), IDS_STATUS); return; } - if ( QFile( url.path() ).exists() ) + if ( TQFile( url.path() ).exists() ) { int result = KMessageBox::warningContinueCancel ( this, i18n("A program named \"%1\" already exists in this folder. " @@ -398,10 +398,10 @@ void MainWindow::slotSaveCanvas() KURL url; while (true) { - url = KFileDialog::getSaveURL( QString(":logo_dir"), QString("*.png|") + + url = KFileDialog::getSaveURL( TQString(":logo_dir"), TQString("*.png|") + i18n("Pictures"), this, i18n("Save Canvas as Picture") ); if ( url.isEmpty() ) return; // when cancelled the KFiledialog? - if ( QFile( url.path() ).exists() ) + if ( TQFile( url.path() ).exists() ) { int result = KMessageBox::warningContinueCancel( this, i18n("A picture named \"%1\" already in this folder. " @@ -412,10 +412,10 @@ void MainWindow::slotSaveCanvas() break; } - QString type( KImageIO::type( url.path() ) ); + TQString type( KImageIO::type( url.path() ) ); if ( type.isNull() ) type = "PNG"; bool ok = false; - QPixmap* pixmap = canvasView->canvas2Pixmap(); + TQPixmap* pixmap = canvasView->canvas2Pixmap(); if ( url.isLocalFile() ) { KSaveFile saveFile( url.path() ); @@ -453,8 +453,8 @@ void MainWindow::slotPrint() KPrinter printer; if ( printer.setup(this) ) { - QPainter painter(&printer); - QPixmap *CanvasPic = canvasView->canvas2Pixmap(); + TQPainter painter(&printer); + TQPixmap *CanvasPic = canvasView->canvas2Pixmap(); painter.drawPixmap(0, 0, *CanvasPic); } return; @@ -522,13 +522,13 @@ void MainWindow::slotExecute() kdDebug(0)<<"############## PARSING STARTED ##############"<<endl; kapp->processEvents(); errMsg = new ErrorMessage(this); // create an empty errorDialog - QString txt = editorInterface->text() + "\x0a\x0a"; // parser expects input to have 2 delimiting newlines - QTextIStream in(&txt); // create the stream + TQString txt = editorInterface->text() + "\x0a\x0a"; // parser expects input to have 2 delimiting newlines + TQTextIStream in(&txt); // create the stream Parser parser(in); // pass the reference to the stream to the parse object - connect(&parser, SIGNAL( ErrorMsg(Token&, const QString&, uint) ), - errMsg, SLOT( slotAddError(Token&, const QString&, uint) ) ); - connect( errMsg, SIGNAL(setSelection(uint, uint, uint, uint) ), - this, SLOT(slotSetSelection(uint, uint, uint, uint) ) ); + connect(&parser, TQT_SIGNAL( ErrorMsg(Token&, const TQString&, uint) ), + errMsg, TQT_SLOT( slotAddError(Token&, const TQString&, uint) ) ); + connect( errMsg, TQT_SIGNAL(setSelection(uint, uint, uint, uint) ), + this, TQT_SLOT(slotSetSelection(uint, uint, uint, uint) ) ); parser.parse(); // and GO! TreeNode* root = parser.getTree(); // when finished parsing get the nodeTree kdDebug(0)<<"############## PARSING FINISHED ##############"<<endl; @@ -541,42 +541,42 @@ void MainWindow::slotExecute() kdDebug(0)<<"############## EXECUTION STARTED ##############"<<endl; exe = new Executer(root); // make Executer object, 'exe', and pass it the nodeTree - connect(this, SIGNAL( changeSpeed(int) ), exe, SLOT(slotChangeSpeed(int) ) ); - connect(this, SIGNAL( unpauseExecution() ), exe, SLOT( slotStopPausing() ) ); - connect( exe, SIGNAL( setSelection(uint, uint, uint, uint) ), - this, SLOT ( slotSetSelection(uint, uint, uint, uint) ) ); - connect( exe, SIGNAL( ErrorMsg(Token&, const QString&, uint) ), - errMsg, SLOT ( slotAddError(Token&, const QString&, uint) ) ); - connect( exe, SIGNAL( InputDialog(QString&) ), this, SLOT( slotInputDialog(QString&) ) ); - connect( exe, SIGNAL( MessageDialog(QString) ), this, SLOT( slotMessageDialog(QString) ) ); + connect(this, TQT_SIGNAL( changeSpeed(int) ), exe, TQT_SLOT(slotChangeSpeed(int) ) ); + connect(this, TQT_SIGNAL( unpauseExecution() ), exe, TQT_SLOT( slotStopPausing() ) ); + connect( exe, TQT_SIGNAL( setSelection(uint, uint, uint, uint) ), + this, TQT_SLOT ( slotSetSelection(uint, uint, uint, uint) ) ); + connect( exe, TQT_SIGNAL( ErrorMsg(Token&, const TQString&, uint) ), + errMsg, TQT_SLOT ( slotAddError(Token&, const TQString&, uint) ) ); + connect( exe, TQT_SIGNAL( InputDialog(TQString&) ), this, TQT_SLOT( slotInputDialog(TQString&) ) ); + connect( exe, TQT_SIGNAL( MessageDialog(TQString) ), this, TQT_SLOT( slotMessageDialog(TQString) ) ); // Connect the signals form Executer to the slots from Canvas: - connect( exe, SIGNAL( Clear() ), canvasView, SLOT( slotClear() ) ); - connect( exe, SIGNAL( Go(double, double) ), canvasView, SLOT( slotGo(double, double) ) ); - connect( exe, SIGNAL( GoX(double) ), canvasView, SLOT( slotGoX(double) ) ); - connect( exe, SIGNAL( GoY(double) ), canvasView, SLOT( slotGoY(double) ) ); - connect( exe, SIGNAL( Forward(double) ), canvasView, SLOT( slotForward(double) ) ); - connect( exe, SIGNAL( Backward(double) ), canvasView, SLOT( slotBackward(double) ) ); - connect( exe, SIGNAL( Direction(double) ), canvasView, SLOT( slotDirection(double) ) ); - connect( exe, SIGNAL( TurnLeft(double) ), canvasView, SLOT( slotTurnLeft(double) ) ); - connect( exe, SIGNAL( TurnRight(double) ), canvasView, SLOT( slotTurnRight(double) ) ); - connect( exe, SIGNAL( Center() ), canvasView, SLOT( slotCenter() ) ); - connect( exe, SIGNAL( SetPenWidth(int) ), canvasView, SLOT( slotSetPenWidth(int) ) ); - connect( exe, SIGNAL( PenUp() ), canvasView, SLOT( slotPenUp() ) ); - connect( exe, SIGNAL( PenDown() ), canvasView, SLOT( slotPenDown() ) ); - connect( exe, SIGNAL( SetFgColor(int, int, int) ), canvasView, SLOT( slotSetFgColor(int, int, int) ) ); - connect( exe, SIGNAL( SetBgColor(int, int, int) ), canvasView, SLOT( slotSetBgColor(int, int, int) ) ); - connect( exe, SIGNAL( ResizeCanvas(int, int) ), canvasView, SLOT( slotResizeCanvas(int, int) ) ); - connect( exe, SIGNAL( SpriteShow() ), canvasView, SLOT( slotSpriteShow() ) ); - connect( exe, SIGNAL( SpriteHide() ), canvasView, SLOT( slotSpriteHide() ) ); - connect( exe, SIGNAL( SpritePress() ), canvasView, SLOT( slotSpritePress() ) ); - connect( exe, SIGNAL( SpriteChange(int) ), canvasView, SLOT( slotSpriteChange(int) ) ); - connect( exe, SIGNAL( Print(QString) ), canvasView, SLOT( slotPrint(QString) ) ); - connect( exe, SIGNAL( FontType(QString, QString) ), canvasView, SLOT( slotFontType(QString, QString) ) ); - connect( exe, SIGNAL( FontSize(int) ), canvasView, SLOT( slotFontSize(int) ) ); - connect( exe, SIGNAL( WrapOn() ), canvasView, SLOT( slotWrapOn() ) ); - connect( exe, SIGNAL( WrapOff() ), canvasView, SLOT( slotWrapOff() ) ); - connect( exe, SIGNAL( Reset() ), canvasView, SLOT( slotReset() ) ); + connect( exe, TQT_SIGNAL( Clear() ), canvasView, TQT_SLOT( slotClear() ) ); + connect( exe, TQT_SIGNAL( Go(double, double) ), canvasView, TQT_SLOT( slotGo(double, double) ) ); + connect( exe, TQT_SIGNAL( GoX(double) ), canvasView, TQT_SLOT( slotGoX(double) ) ); + connect( exe, TQT_SIGNAL( GoY(double) ), canvasView, TQT_SLOT( slotGoY(double) ) ); + connect( exe, TQT_SIGNAL( Forward(double) ), canvasView, TQT_SLOT( slotForward(double) ) ); + connect( exe, TQT_SIGNAL( Backward(double) ), canvasView, TQT_SLOT( slotBackward(double) ) ); + connect( exe, TQT_SIGNAL( Direction(double) ), canvasView, TQT_SLOT( slotDirection(double) ) ); + connect( exe, TQT_SIGNAL( TurnLeft(double) ), canvasView, TQT_SLOT( slotTurnLeft(double) ) ); + connect( exe, TQT_SIGNAL( TurnRight(double) ), canvasView, TQT_SLOT( slotTurnRight(double) ) ); + connect( exe, TQT_SIGNAL( Center() ), canvasView, TQT_SLOT( slotCenter() ) ); + connect( exe, TQT_SIGNAL( SetPenWidth(int) ), canvasView, TQT_SLOT( slotSetPenWidth(int) ) ); + connect( exe, TQT_SIGNAL( PenUp() ), canvasView, TQT_SLOT( slotPenUp() ) ); + connect( exe, TQT_SIGNAL( PenDown() ), canvasView, TQT_SLOT( slotPenDown() ) ); + connect( exe, TQT_SIGNAL( SetFgColor(int, int, int) ), canvasView, TQT_SLOT( slotSetFgColor(int, int, int) ) ); + connect( exe, TQT_SIGNAL( SetBgColor(int, int, int) ), canvasView, TQT_SLOT( slotSetBgColor(int, int, int) ) ); + connect( exe, TQT_SIGNAL( ResizeCanvas(int, int) ), canvasView, TQT_SLOT( slotResizeCanvas(int, int) ) ); + connect( exe, TQT_SIGNAL( SpriteShow() ), canvasView, TQT_SLOT( slotSpriteShow() ) ); + connect( exe, TQT_SIGNAL( SpriteHide() ), canvasView, TQT_SLOT( slotSpriteHide() ) ); + connect( exe, TQT_SIGNAL( SpritePress() ), canvasView, TQT_SLOT( slotSpritePress() ) ); + connect( exe, TQT_SIGNAL( SpriteChange(int) ), canvasView, TQT_SLOT( slotSpriteChange(int) ) ); + connect( exe, TQT_SIGNAL( Print(TQString) ), canvasView, TQT_SLOT( slotPrint(TQString) ) ); + connect( exe, TQT_SIGNAL( FontType(TQString, TQString) ), canvasView, TQT_SLOT( slotFontType(TQString, TQString) ) ); + connect( exe, TQT_SIGNAL( FontSize(int) ), canvasView, TQT_SLOT( slotFontSize(int) ) ); + connect( exe, TQT_SIGNAL( WrapOn() ), canvasView, TQT_SLOT( slotWrapOn() ) ); + connect( exe, TQT_SIGNAL( WrapOff() ), canvasView, TQT_SLOT( slotWrapOff() ) ); + connect( exe, TQT_SIGNAL( Reset() ), canvasView, TQT_SLOT( slotReset() ) ); // START EXECUTION on the selected speed, and use the feedbacked boolean value slotChangeSpeed(); @@ -625,7 +625,7 @@ void MainWindow::finishExecution() if (speed->currentItem() == 0) slotClearSelection(); // if coming from fullscreen-mode show the editor, menu- and statusbar - if (b_fullscreen) QTimer::singleShot( 1000, this, SLOT( slotFinishedFullScreenExecution() ) ); + if (b_fullscreen) TQTimer::singleShot( 1000, this, TQT_SLOT( slotFinishedFullScreenExecution() ) ); } void MainWindow::slotChangeSpeed() @@ -636,12 +636,12 @@ void MainWindow::slotChangeSpeed() // slots for logo functions that need to use the MainWindow class: -void MainWindow::slotInputDialog(QString& value) +void MainWindow::slotInputDialog(TQString& value) { value = KInputDialog::getText(i18n("Input"), value); } -void MainWindow::slotMessageDialog(QString text) +void MainWindow::slotMessageDialog(TQString text) { KMessageBox::information( this, text, i18n("Message") ); } @@ -658,7 +658,7 @@ void MainWindow::slotEditor() a->activate(); } -void MainWindow::slotSetHighlightstyle(QString langCode) +void MainWindow::slotSetHighlightstyle(TQString langCode) { KTextEditor::HighlightingInterface *hli = dynamic_cast<KTextEditor::HighlightingInterface*>(doc); for (uint i = 0; i < hli->hlModeCount(); i++) @@ -781,7 +781,7 @@ void MainWindow::slotToggleLineNumbers() a->activate(); } -void MainWindow::slotInsertText(QString str) +void MainWindow::slotInsertText(TQString str) { uint StartLine, StartCol, EndLine, EndCol; dynamic_cast<KTextEditor::ViewCursorInterface*>(editor)->cursorPositionReal(&StartLine, &StartCol); @@ -813,10 +813,10 @@ void MainWindow::slotToggleFullscreen() else if ( isFullScreen() ) showNormal(); } -bool MainWindow::event(QEvent* e) +bool MainWindow::event(TQEvent* e) { // executes updateFullScreen() after a ShowFullScreen or ShowNormal event got triggered - if (e->type() == QEvent::ShowFullScreen || e->type() == QEvent::ShowNormal) updateFullScreen(); + if (e->type() == TQEvent::ShowFullScreen || e->type() == TQEvent::ShowNormal) updateFullScreen(); return KMainWindow::event(e); } @@ -833,9 +833,9 @@ void MainWindow::slotFinishedFullScreenExecution() if ( errMsg->containsErrors() ) slotBackToFullScreen(); // straight back to edit if there where errors else { - connect( restartOrBackDialog, SIGNAL( user1Clicked() ), this, SLOT( slotRestartFullScreen() ) ); - connect( restartOrBackDialog, SIGNAL( user2Clicked() ), this, SLOT( slotBackToFullScreen() ) ); - connect( restartOrBackDialog, SIGNAL( finished() ), this, SLOT( slotBackToFullScreen() ) ); + connect( restartOrBackDialog, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT( slotRestartFullScreen() ) ); + connect( restartOrBackDialog, TQT_SIGNAL( user2Clicked() ), this, TQT_SLOT( slotBackToFullScreen() ) ); + connect( restartOrBackDialog, TQT_SIGNAL( finished() ), this, TQT_SLOT( slotBackToFullScreen() ) ); restartOrBackDialog->show(); restartOrBackDialog->move(50, 50); } @@ -870,21 +870,21 @@ void MainWindow::slotSettings() // Create a new dialog with the same name as the above checking code. KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self() ); // connect the help - connect( dialog, SIGNAL( helpClicked() ), this, SLOT( slotSettingsHelp() ) ); + connect( dialog, TQT_SIGNAL( helpClicked() ), this, TQT_SLOT( slotSettingsHelp() ) ); // making the filling for the 'General' settings dept. - general = new QWidget(); - QGridLayout *generalLayout = new QGridLayout( general, 1, 1, 11, 6, "generalLayout"); - WidthHeightBox = new QGroupBox( i18n("Initial Canvas Size"), general ); + general = new TQWidget(); + TQGridLayout *generalLayout = new TQGridLayout( general, 1, 1, 11, 6, "generalLayout"); + WidthHeightBox = new TQGroupBox( i18n("Initial Canvas Size"), general ); WidthHeightBox->setColumnLayout(0, Qt::Vertical ); WidthHeightBox->layout()->setSpacing( 6 ); WidthHeightBox->layout()->setMargin( 11 ); - QVBoxLayout *WidthHeightBoxLayout = new QVBoxLayout( WidthHeightBox->layout() ); + TQVBoxLayout *WidthHeightBoxLayout = new TQVBoxLayout( WidthHeightBox->layout() ); WidthHeightBoxLayout->setAlignment( Qt::AlignTop ); - QHBoxLayout *layout3 = new QHBoxLayout( 0, 0, 6, "layout3"); - QVBoxLayout *layout2 = new QVBoxLayout( 0, 0, 6, "layout2"); + TQHBoxLayout *layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); + TQVBoxLayout *layout2 = new TQVBoxLayout( 0, 0, 6, "layout2"); - QVBoxLayout *layout1 = new QVBoxLayout( 0, 0, 6, "layout1"); + TQVBoxLayout *layout1 = new TQVBoxLayout( 0, 0, 6, "layout1"); kcfg_CanvasWidth = new KIntNumInput( WidthHeightBox, "kcfg_CanvasWidth" ); kcfg_CanvasWidth->setValue( 400 ); @@ -898,65 +898,65 @@ void MainWindow::slotSettings() kcfg_CanvasHeight->setReferencePoint( 1 ); layout1->addWidget( kcfg_CanvasHeight ); - WidthLabel = new QLabel( kcfg_CanvasWidth, i18n("Canvas &width:"), WidthHeightBox ); + WidthLabel = new TQLabel( kcfg_CanvasWidth, i18n("Canvas &width:"), WidthHeightBox ); layout2->addWidget( WidthLabel ); - HeightLabel = new QLabel( kcfg_CanvasHeight, i18n("Ca&nvas height:"), WidthHeightBox ); + HeightLabel = new TQLabel( kcfg_CanvasHeight, i18n("Ca&nvas height:"), WidthHeightBox ); layout2->addWidget( HeightLabel ); layout3->addLayout( layout2 ); layout3->addLayout( layout1 ); WidthHeightBoxLayout->addLayout( layout3 ); - QLabel* WidthHeightLabel = new QLabel(i18n("You need to restart before these settings have effect"), WidthHeightBox); + TQLabel* WidthHeightLabel = new TQLabel(i18n("You need to restart before these settings have effect"), WidthHeightBox); WidthHeightBoxLayout->addWidget( WidthHeightLabel ); generalLayout->addWidget( WidthHeightBox, 0, 0 ); - general->resize( QSize(234, 109).expandedTo(minimumSizeHint()) ); + general->resize( TQSize(234, 109).expandedTo(minimumSizeHint()) ); dialog->addPage( general, i18n("General"), "package_settings", i18n("General Settings") ); // making the filling for the 'Language' settings dept. - QWidget *language = new QWidget(); - QGridLayout *languageLayout = new QGridLayout( language, 1, 1, 11, 6, "Form1Layout"); - QGroupBox *groupBox1 = new QGroupBox( language, "groupBox1" ); + TQWidget *language = new TQWidget(); + TQGridLayout *languageLayout = new TQGridLayout( language, 1, 1, 11, 6, "Form1Layout"); + TQGroupBox *groupBox1 = new TQGroupBox( language, "groupBox1" ); groupBox1->setColumnLayout(0, Qt::Vertical ); groupBox1->layout()->setSpacing( 6 ); groupBox1->layout()->setMargin( 11 ); - QGridLayout *groupBox1Layout = new QGridLayout( groupBox1->layout() ); + TQGridLayout *groupBox1Layout = new TQGridLayout( groupBox1->layout() ); groupBox1Layout->setAlignment( Qt::AlignTop ); - QVBoxLayout *layout4 = new QVBoxLayout( 0, 0, 6, "layout4"); + TQVBoxLayout *layout4 = new TQVBoxLayout( 0, 0, 6, "layout4"); kcfg_LanguageComboBox = new KComboBox(groupBox1, "kcfg_LanguageComboBox"); kcfg_LanguageComboBox->setEditable(false); - QStringList LogoLanguageList = Settings::logoLanguageList(); + TQStringList LogoLanguageList = Settings::logoLanguageList(); // Add the full language names to the items - for ( QStringList::Iterator it = LogoLanguageList.begin(); it != LogoLanguageList.end(); ++it ) { + for ( TQStringList::Iterator it = LogoLanguageList.begin(); it != LogoLanguageList.end(); ++it ) { *it = KGlobal::locale()->twoAlphaToLanguageName( (*it).left(2) ) + " (" + *it + ")"; } kcfg_LanguageComboBox->insertStringList(LogoLanguageList); - LanguageLabel = new QLabel(kcfg_LanguageComboBox, i18n("&Select the language for the Logo commands:"), groupBox1); + LanguageLabel = new TQLabel(kcfg_LanguageComboBox, i18n("&Select the language for the Logo commands:"), groupBox1); layout4->addWidget( LanguageLabel ); layout4->addWidget( kcfg_LanguageComboBox ); LanguageLabel->setBuddy( kcfg_LanguageComboBox ); groupBox1Layout->addLayout( layout4, 0, 0 ); languageLayout->addWidget( groupBox1, 0, 0 ); - language->resize( QSize(373, 80).expandedTo(minimumSizeHint()) ); + language->resize( TQSize(373, 80).expandedTo(minimumSizeHint()) ); dialog->addPage( language, i18n("Language"), "locale", i18n("Language Settings") ); // When the user clicks OK or Apply we want to update our settings. - connect( dialog, SIGNAL( settingsChanged() ), this, SLOT( slotUpdateSettings() ) ); + connect( dialog, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT( slotUpdateSettings() ) ); // Display the dialog is there where errors. - dialog->setInitialSize( QSize(550, 300) ); + dialog->setInitialSize( TQSize(550, 300) ); dialog->show(); } void MainWindow::slotUpdateSettings() { // get the selected language as a language code - QString selectedLogoLanguage = kcfg_LanguageComboBox->currentText().section( "(", -1, -1 ).remove(")"); + TQString selectedLogoLanguage = kcfg_LanguageComboBox->currentText().section( "(", -1, -1 ).remove(")"); // update the settings Settings::setLogoLanguage( selectedLogoLanguage ); Settings::setLanguageComboBox( kcfg_LanguageComboBox->currentItem() ); @@ -1012,7 +1012,7 @@ void MainWindow::slotContextHelp() kdDebug(0)<<"help requested on this text: "<<helpKeyword<<endl; - QString helpWord; + TQString helpWord; if ( helpKeyword == i18n("<no keyword>") ) { KMessageBox::information( this, i18n("There is currently no text under the cursor to get help on."), i18n("Nothing Under Cursor") ); @@ -1042,7 +1042,7 @@ void MainWindow::slotContextHelp() kapp->invokeHelp(helpWord, "", ""); - QString help2statusBar; + TQString help2statusBar; if ( helpKeyword.startsWith("<") ) help2statusBar = helpKeyword; else help2statusBar = i18n("\"%1\"").arg(helpKeyword); slotStatusBar(i18n("Displaying help on %1").arg(help2statusBar), IDS_STATUS); @@ -1052,7 +1052,7 @@ void MainWindow::slotContextHelpUpdate() { uint row, col; dynamic_cast<KTextEditor::ViewCursorInterface*>(editor)->cursorPositionReal(&row, &col); - QString line = dynamic_cast<KTextEditor::EditInterface*>(doc)->textLine(row); + TQString line = dynamic_cast<KTextEditor::EditInterface*>(doc)->textLine(row); // two shortcuts so we dont do all the CPU intensive regexp stuff when it not needed if ( line.stripWhiteSpace().startsWith("#") ) @@ -1073,7 +1073,7 @@ void MainWindow::slotContextHelpUpdate() pos = 0; if ( line.contains('"') ) { - QRegExp delimitedStrings("(\"[^\"\\\\\\r\\n]*(\\\\.[^\"\\\\\\r\\n]*)*\")"); + TQRegExp delimitedStrings("(\"[^\"\\\\\\r\\n]*(\\\\.[^\"\\\\\\r\\n]*)*\")"); while ( delimitedStrings.search(line, pos) != -1 ) { // kdDebug(0)<<"stringsearch: >>"<<pos<<"<<"<<endl; @@ -1091,7 +1091,7 @@ void MainWindow::slotContextHelpUpdate() // except for "strings" this regexp effectively separates logo code in 'words' (in a very broad meaning) - QRegExp splitter("(([^ ,+\\-*/()=<>[!]|(?!==|<=|>=|!=))*)|(([ ,+\\-*/()=<>[!]|==|<=|>=|!=))"); + TQRegExp splitter("(([^ ,+\\-*/()=<>[!]|(?!==|<=|>=|!=))*)|(([ ,+\\-*/()=<>[!]|==|<=|>=|!=))"); pos = 0; while (splitter.search(line, pos) != -1) @@ -1101,7 +1101,7 @@ void MainWindow::slotContextHelpUpdate() if ( col < (uint)start ) break; if ( col >= (uint)start && col < (uint)(start+length) ) { - QString cursorWord = line.mid( (uint)start, (uint)length ); + TQString cursorWord = line.mid( (uint)start, (uint)length ); kdDebug(0)<<"cursorWord: '"<<cursorWord<<"'"<<endl; kdDebug(0)<<"(translate->name2key( cursorWord.lower() )): '"<<translate->name2key( cursorWord.lower() )<<"'"<<endl; @@ -1112,13 +1112,13 @@ void MainWindow::slotContextHelpUpdate() else if ( !translate->name2key( cursorWord.lower() ).isEmpty() ) helpKeyword = cursorWord; else if ( !translate->alias2key( cursorWord.lower() ).isEmpty() ) helpKeyword = cursorWord; - else if ( cursorWord.find( QRegExp("[\\d.]+") ) == 0 ) helpKeyword = i18n("<number>"); + else if ( cursorWord.find( TQRegExp("[\\d.]+") ) == 0 ) helpKeyword = i18n("<number>"); - else if ( cursorWord.find( QRegExp("[+\\-*/\\(\\)]") ) == 0 ) helpKeyword = i18n("<math>"); + else if ( cursorWord.find( TQRegExp("[+\\-*/\\(\\)]") ) == 0 ) helpKeyword = i18n("<math>"); - else if ( cursorWord == QString("=") ) helpKeyword = i18n("<assignment>"); + else if ( cursorWord == TQString("=") ) helpKeyword = i18n("<assignment>"); - else if ( cursorWord.find( QRegExp("==|<|>|<=|>=|!=") ) == 0 ) helpKeyword = i18n("<question>"); + else if ( cursorWord.find( TQRegExp("==|<|>|<=|>=|!=") ) == 0 ) helpKeyword = i18n("<question>"); // if we come here we either have an ID of some sort or an error // all we can do is try to catch some errors (TODO) and then... @@ -1150,8 +1150,8 @@ void MainWindow::slotColorPicker() { picker = new ColorPicker(this); if(picker == 0) return; // safety - connect( picker, SIGNAL( visible(bool) ), colorpicker, SLOT( setChecked(bool) ) ); - connect( picker, SIGNAL( ColorCode(QString) ), this, SLOT( slotInsertText(QString) ) ); + connect( picker, TQT_SIGNAL( visible(bool) ), colorpicker, TQT_SLOT( setChecked(bool) ) ); + connect( picker, TQT_SIGNAL( ColorCode(TQString) ), this, TQT_SLOT( slotInsertText(TQString) ) ); } // if picker is not 0, there is a colorpickerdialog which only needs to be shown OR hidden if ( picker->isHidden() ) diff --git a/kturtle/src/kturtle.h b/kturtle/src/kturtle.h index 8ffd55df..3e52215e 100644 --- a/kturtle/src/kturtle.h +++ b/kturtle/src/kturtle.h @@ -24,7 +24,7 @@ #endif -#include <qgroupbox.h> +#include <tqgroupbox.h> #include <kcombobox.h> #include <klineedit.h> @@ -70,11 +70,11 @@ class MainWindow : public KParts::MainWindow void slotPauseExecution(); void slotAbortExecution(); void slotChangeSpeed(); - void slotInputDialog(QString& value); - void slotMessageDialog(QString text); + void slotInputDialog(TQString& value); + void slotMessageDialog(TQString text); void slotEditor(); - void slotSetHighlightstyle(QString langCode); + void slotSetHighlightstyle(TQString langCode); void slotUndo(); void slotRedo(); void slotCut(); @@ -87,7 +87,7 @@ class MainWindow : public KParts::MainWindow void slotFindPrevious(); void slotReplace(); void slotToggleInsert(); - void slotInsertText(QString); + void slotInsertText(TQString); void slotToggleLineNumbers(); void slotIndent(); void slotUnIndent(); @@ -104,7 +104,7 @@ class MainWindow : public KParts::MainWindow void slotContextHelp(); void slotContextHelpUpdate(); - void slotStatusBar(QString text, int place); + void slotStatusBar(TQString text, int place); void slotCursorStatusBar(); void slotToggleFullscreen(); @@ -130,12 +130,12 @@ class MainWindow : public KParts::MainWindow void readConfig(KConfig *config); void updateFullScreen(); - virtual bool event(QEvent* e); + virtual bool event(TQEvent* e); Canvas *canvasView; - QWidget *baseWidget; - QGridLayout *baseLayout; - QDockWindow *editorDock; + TQWidget *baseWidget; + TQGridLayout *baseLayout; + TQDockWindow *editorDock; Executer *exe; ErrorMessage *errMsg; ColorPicker *picker; @@ -162,20 +162,20 @@ class MainWindow : public KParts::MainWindow bool b_fullscreen; bool b_editorShown; - QString helpKeyword; + TQString helpKeyword; Translate *translate; KURL CurrentFile; // configuration related - QWidget *general; - QWidget *language; - QGroupBox *WidthHeightBox; - QLabel *WidthLabel; - QLabel *HeightLabel; + TQWidget *general; + TQWidget *language; + TQGroupBox *WidthHeightBox; + TQLabel *WidthLabel; + TQLabel *HeightLabel; KIntNumInput *kcfg_CanvasWidth; KIntNumInput *kcfg_CanvasHeight; KComboBox *kcfg_LanguageComboBox; - QLabel *LanguageLabel; + TQLabel *LanguageLabel; }; diff --git a/kturtle/src/lexer.cpp b/kturtle/src/lexer.cpp index 1a480641..ae6f3d61 100644 --- a/kturtle/src/lexer.cpp +++ b/kturtle/src/lexer.cpp @@ -16,8 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qdom.h> -#include <qfile.h> +#include <tqdom.h> +#include <tqfile.h> #include <kdebug.h> #include <klocale.h> @@ -27,7 +27,7 @@ #include "lexer.h" -Lexer::Lexer(QTextIStream& iStream) +Lexer::Lexer(TQTextIStream& iStream) { inputStream = &iStream; row = 1; @@ -48,7 +48,7 @@ Token Lexer::lex() currentToken.start.row = row; currentToken.start.col = col; - QChar currentChar = getChar(); + TQChar currentChar = getChar(); if ( inputStream->atEnd() ) { @@ -65,7 +65,7 @@ Token Lexer::lex() currentChar = getChar(); } - // if (currentChar.category() == QChar::Separator_Line) somehow doesnt work + // if (currentChar.category() == TQChar::Separator_Line) somehow doesnt work if (currentChar == '\x0a' || currentChar == '\n') { currentToken.type = tokEOL; @@ -198,14 +198,14 @@ Token Lexer::lex() // PRIVATEs -QChar Lexer::getChar() +TQChar Lexer::getChar() { - QChar c; + TQChar c; if ( !putBackChar.isNull() ) { c = putBackChar; // use the char that is stored to be put back // kdDebug(0)<<"Lexer::getChar(), restored: '"<<c<<"' @ ("<<row<<", "<<col<<")"<<endl; - putBackChar = QChar(); // and set putBackChar back to NULL + putBackChar = TQChar(); // and set putBackChar back to NULL if (c == '\x0a' || c == '\n') { row++; @@ -219,7 +219,7 @@ QChar Lexer::getChar() } else { - *inputStream >> c; // take a QChar of the inputStream + *inputStream >> c; // take a TQChar of the inputStream // kdDebug(0)<<"Lexer::getChar(): '"<<c<<"' @ ("<<row<<", "<<col<<")"<<endl; if (c == '\x0a' || c == '\n') { @@ -235,7 +235,7 @@ QChar Lexer::getChar() return c; } -void Lexer::ungetChar(QChar c) +void Lexer::ungetChar(TQChar c) { if (c == '\x0a' || c == '\n') { @@ -250,10 +250,10 @@ void Lexer::ungetChar(QChar c) // kdDebug(0)<<"Lexer::ungetChar(), saved char: '"<<c<<"' and steped back to ("<<row<<", "<<col<<")"<<endl; } -int Lexer::getWord(QString& word) +int Lexer::getWord(TQString& word) { // kdDebug(0)<<"Lexer::getWord()"<<endl; - QChar currentChar = getChar(); + TQChar currentChar = getChar(); if ( currentChar.isLetter() || currentChar == '[' || currentChar == ']' ) { while ( ( currentChar.isLetterOrNumber() || currentChar == '_' || currentChar == '[' || currentChar == ']' ) && !inputStream->atEnd() ) { @@ -272,7 +272,7 @@ void Lexer::setTokenType(Token& currentToken) if (currentToken.type == tokUnknown) { // make lowercase copy of the word as it was found in the inputStream - QString k = currentToken.look.lower(); + TQString k = currentToken.look.lower(); // if the key is an alias translate that alias to a key if ( !translate->alias2key(k).isEmpty() ) k = translate->alias2key(k); @@ -343,8 +343,8 @@ void Lexer::setTokenType(Token& currentToken) void Lexer::skipSpaces() { // kdDebug(0)<<"Lexer::skipSpaces(), skipping SPACES."<<endl; - QChar currentChar = getChar(); - // when the Separator_* groups can be identified in the QChar thing would be easier + TQChar currentChar = getChar(); + // when the Separator_* groups can be identified in the TQChar thing would be easier while ( !inputStream->atEnd() && ( currentChar.isSpace() && !(currentChar == '\x0a' || currentChar == '\n') ) ) { currentChar = getChar(); @@ -353,12 +353,12 @@ void Lexer::skipSpaces() } -int Lexer::getNumber(Value& num, QString& look) +int Lexer::getNumber(Value& num, TQString& look) { // by reference the value (Value) and look part are set // kdDebug(0)<<"Lexer::getNumber()"<<endl; bool hasPoint = false; - QChar currentChar = getChar(); + TQChar currentChar = getChar(); if ( currentChar.isNumber() ) { while ( ( currentChar.isNumber() || (currentChar == '.' && !hasPoint) ) && !inputStream->atEnd() ) @@ -380,8 +380,8 @@ int Lexer::getNumber(Value& num, QString& look) void Lexer::getString(Token& currentToken) { - QString str = "\""; // start with a " cauz it just got lost - QChar currentChar = QChar(); // start empty + TQString str = "\""; // start with a " cauz it just got lost + TQChar currentChar = TQChar(); // start empty while ( currentChar != '"' && !(currentChar == '\x0a' || currentChar == '\n') && !inputStream->atEnd() ) { currentChar = getChar(); diff --git a/kturtle/src/lexer.h b/kturtle/src/lexer.h index 49317f8e..37dccf08 100644 --- a/kturtle/src/lexer.h +++ b/kturtle/src/lexer.h @@ -20,9 +20,9 @@ #ifndef _LEXER_H_ #define _LEXER_H_ -#include <qmap.h> -#include <qstring.h> -#include <qtextstream.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqtextstream.h> #include "token.h" #include "translate.h" @@ -32,25 +32,25 @@ class Lexer { public: - Lexer(QTextIStream&); + Lexer(TQTextIStream&); ~Lexer() {} Token lex(); // returns the next Token, skipping spaces private: - QChar getChar(); - void ungetChar(QChar); - int getWord(QString&); + TQChar getChar(); + void ungetChar(TQChar); + int getWord(TQString&); void skipSpaces(); void setTokenType(Token&); - int getNumber(Value&, QString&); + int getNumber(Value&, TQString&); void getString(Token&); - QTextIStream *inputStream; + TQTextIStream *inputStream; Translate *translate; uint row, col, prevCol; - QChar putBackChar; + TQChar putBackChar; }; diff --git a/kturtle/src/parser.cpp b/kturtle/src/parser.cpp index ca1fafd7..07a33aea 100644 --- a/kturtle/src/parser.cpp +++ b/kturtle/src/parser.cpp @@ -20,7 +20,7 @@ // allmost every aspect of it is heavily changed by Cies Breijs. -#include <qstringlist.h> +#include <tqstringlist.h> #include <kdebug.h> #include <klocale.h> @@ -28,7 +28,7 @@ #include "parser.h" -Parser::Parser(QTextIStream& in) +Parser::Parser(TQTextIStream& in) { lexer = new Lexer(in); tree = new TreeNode(); @@ -198,8 +198,8 @@ TreeNode* Parser::Factor() case tokString: node = new TreeNode(currentToken, constantNode); - { // extra scope to localize the QString 'str' - QString str = currentToken.look; + { // extra scope to localize the TQString 'str' + TQString str = currentToken.look; if ( currentToken.look.endsWith("\"") ) { // cut off the quotes and store the value @@ -238,7 +238,7 @@ TreeNode* Parser::Factor() break; default: - QString s = currentToken.look; + TQString s = currentToken.look; if ( s.isEmpty() || currentToken.type == tokEOF ) { Error(currentToken, i18n("INTERNAL ERROR NR %1: please sent this Logo script to KTurtle developers").arg(1), 1020); @@ -1075,7 +1075,7 @@ TreeNode* Parser::Other() } -void Parser::Error(Token& t, const QString& s, uint code) +void Parser::Error(Token& t, const TQString& s, uint code) { emit ErrorMsg(t, s, code); } diff --git a/kturtle/src/parser.h b/kturtle/src/parser.h index 28be566f..68836221 100644 --- a/kturtle/src/parser.h +++ b/kturtle/src/parser.h @@ -20,7 +20,7 @@ #ifndef _PARSER_H_ #define _PARSER_H_ -#include <qobject.h> +#include <tqobject.h> #include "lexer.h" #include "treenode.h" @@ -31,7 +31,7 @@ class Parser : public QObject Q_OBJECT public: - Parser(QTextIStream& in); + Parser(TQTextIStream& in); virtual ~Parser(); void parse(); @@ -39,7 +39,7 @@ class Parser : public QObject signals: - void ErrorMsg(Token&, const QString&, uint code); + void ErrorMsg(Token&, const TQString&, uint code); private: @@ -49,7 +49,7 @@ class Parser : public QObject void getToken(); void matchToken(int tokenType); void appendParameters(TreeNode* node); - void Error(Token&, const QString& s, uint code); + void Error(Token&, const TQString& s, uint code); TreeNode* Program(); TreeNode* ParamList(); @@ -120,7 +120,7 @@ class Parser : public QObject Token preservedToken; // to preserve the currentToken so it wont get lost uint row; uint col; - QStringList learnedFunctionList; + TQStringList learnedFunctionList; }; #endif // _PARSER_H_ diff --git a/kturtle/src/token.h b/kturtle/src/token.h index 2c0e7622..24eb400b 100644 --- a/kturtle/src/token.h +++ b/kturtle/src/token.h @@ -20,7 +20,7 @@ #ifndef _TOKEN_H_ #define _TOKEN_H_ -#include <qstring.h> +#include <tqstring.h> #include "value.h" @@ -34,7 +34,7 @@ struct Pos // convenience, it codes a bit nicer with this, i.e.: "int row = tok. struct Token { int type; // filled with enumed tokenTypes - QString look; // the way the token looks in the text editor + TQString look; // the way the token looks in the text editor Value value; // if the token is a number it can be stored here Pos start; // row'n'col of the starting/ending point of the token Pos end; @@ -127,7 +127,7 @@ enum tokenTypes tokDo // a dummy command }; -// const QString tokenTypeNames[] = +// const TQString tokenTypeNames[] = // { // /* tokNotSet = 0 */ "", // /* tokError = 1 */ "", @@ -213,7 +213,7 @@ enum tokenTypes // /* tokDo */ "", // }; // -// // QString Token::tokenType2name(int tokenType) +// // TQString Token::tokenType2name(int tokenType) // // { // // if (tokenType >= 0) return tokenTypeNames[tokenType]; // // else return ""; diff --git a/kturtle/src/translate.cpp b/kturtle/src/translate.cpp index d2c43f16..10ad2b07 100644 --- a/kturtle/src/translate.cpp +++ b/kturtle/src/translate.cpp @@ -16,8 +16,8 @@ */ -#include <qdom.h> -#include <qfile.h> +#include <tqdom.h> +#include <tqfile.h> #include <kdebug.h> #include <klocale.h> @@ -34,32 +34,32 @@ Translate::Translate() } -QString Translate::name2fuzzy(const QString &name) +TQString Translate::name2fuzzy(const TQString &name) { if ( !aliasMap[name].isEmpty() ) // translate the alias if any { - return QString( i18n("'%1' (%2)").arg(keyMap[name]).arg(reverseAliasMap[name]) ); + return TQString( i18n("'%1' (%2)").arg(keyMap[name]).arg(reverseAliasMap[name]) ); } - return QString( "'" + keyMap[name] + "'"); + return TQString( "'" + keyMap[name] + "'"); } -QString Translate::name2key(const QString &name) +TQString Translate::name2key(const TQString &name) { return keyMap[name]; } -QString Translate::alias2key(const QString &name) +TQString Translate::alias2key(const TQString &name) { return aliasMap[name]; } void Translate::loadTranslations() { - QDomDocument KeywordsXML; + TQDomDocument KeywordsXML; kdDebug(0) << "Loading translation dictionary: "<< locate("data", "kturtle/data/logokeywords." + Settings::logoLanguage() + ".xml") <<endl; // Read the specified translation file - QFile xmlfile( locate("data", "kturtle/data/logokeywords." + Settings::logoLanguage() + ".xml") ); + TQFile xmlfile( locate("data", "kturtle/data/logokeywords." + Settings::logoLanguage() + ".xml") ); if ( !xmlfile.open(IO_ReadOnly) ) return; @@ -71,14 +71,14 @@ void Translate::loadTranslations() { xmlfile.close(); // get into the first child of the root element (in our case a <command> tag) - QDomElement rootElement = KeywordsXML.documentElement(); - QDomNode n = rootElement.firstChild(); + TQDomElement rootElement = KeywordsXML.documentElement(); + TQDomNode n = rootElement.firstChild(); while ( !n.isNull() ) { - QString name, key, alias; + TQString name, key, alias; name = n.toElement().attribute("name"); // get the name attribute of <command> - QDomNode m = n.firstChild(); // get into the first child of a <command> + TQDomNode m = n.firstChild(); // get into the first child of a <command> while (true) { if( !m.toElement().text().isEmpty() ) diff --git a/kturtle/src/translate.h b/kturtle/src/translate.h index b40cf133..788e11f3 100644 --- a/kturtle/src/translate.h +++ b/kturtle/src/translate.h @@ -19,8 +19,8 @@ #ifndef _TRANSLATE_H_ #define _TRANSLATE_H_ -#include <qmap.h> -#include <qstring.h> +#include <tqmap.h> +#include <tqstring.h> class Translate @@ -29,15 +29,15 @@ class Translate Translate(); ~Translate() {} - QString name2fuzzy(const QString&); - QString name2key(const QString&); - QString alias2key(const QString&); + TQString name2fuzzy(const TQString&); + TQString name2key(const TQString&); + TQString alias2key(const TQString&); private: void loadTranslations(); - typedef QMap<QString, QString> StringMap; + typedef TQMap<TQString, TQString> StringMap; StringMap keyMap; StringMap aliasMap; StringMap reverseAliasMap; diff --git a/kturtle/src/treenode.cpp b/kturtle/src/treenode.cpp index d27204ad..0b5619a5 100644 --- a/kturtle/src/treenode.cpp +++ b/kturtle/src/treenode.cpp @@ -31,7 +31,7 @@ TreeNode::TreeNode() fType = Unknown; } -TreeNode::TreeNode(Token t, NodeType nodeType, QString name) +TreeNode::TreeNode(Token t, NodeType nodeType, TQString name) { init(); fType = nodeType; @@ -59,7 +59,7 @@ void TreeNode::init() { clear(); parent = NULL; - // fTok.look (QString) and fTok.value (Value) are properly init'ed when constructed + // fTok.look (TQString) and fTok.value (Value) are properly init'ed when constructed fTok.start.row = 0; fTok.start.col = 0; fTok.end.row = 0; @@ -231,7 +231,7 @@ void TreeNode::showTree(TreeNode* node, int indent) const void TreeNode::show(int indent) { - QString s = ""; + TQString s = ""; for (int i = 0; i < indent; i++) { s += "> "; diff --git a/kturtle/src/treenode.h b/kturtle/src/treenode.h index 44d64d0a..f43260bf 100644 --- a/kturtle/src/treenode.h +++ b/kturtle/src/treenode.h @@ -25,7 +25,7 @@ #include <list> -#include <qstring.h> +#include <tqstring.h> #include "lexer.h" #include "token.h" @@ -214,7 +214,7 @@ class TreeNode : public list<TreeNode*> /*, public Value <-- maybe oneday */ public: TreeNode(); // used for creation of the first node called 'tree', in the contructor of the parser TreeNode( TreeNode* ); // give parent - TreeNode( Token, NodeType = Unknown, QString = QString() ); + TreeNode( Token, NodeType = Unknown, TQString = TQString() ); virtual ~TreeNode(); void init(); @@ -241,12 +241,12 @@ class TreeNode : public list<TreeNode*> /*, public Value <-- maybe oneday */ void setType(NodeType t) { fType = t; } NodeType getType() const { return fType; } - void setLook(const QString& s) { fTok.look = s; } - QString getLook() const { return fTok.look; } + void setLook(const TQString& s) { fTok.look = s; } + TQString getLook() const { return fTok.look; } void setValue(const Value& n) { fTok.value = n; } void setValue(double d) { fTok.value = d; } - void setValue(const QString& s) { fTok.value = s; } + void setValue(const TQString& s) { fTok.value = s; } void setValue(bool b) { fTok.value.setBool(b); } Value getValue() const { return fTok.value; } diff --git a/kturtle/src/value.cpp b/kturtle/src/value.cpp index b529452d..be0e0531 100644 --- a/kturtle/src/value.cpp +++ b/kturtle/src/value.cpp @@ -104,7 +104,7 @@ void Value::setNumber(double d) m_string.setNum(d); } -bool Value::setNumber(const QString &s) +bool Value::setNumber(const TQString &s) { type = numberValue; bool ok = true; @@ -119,16 +119,16 @@ bool Value::setNumber(const QString &s) } -QString Value::String() const +TQString Value::String() const { if (type == boolValue) { - if (m_bool) return QString( i18n("true") ); - else return QString( i18n("false") ); + if (m_bool) return TQString( i18n("true") ); + else return TQString( i18n("false") ); } else if (type == numberValue) { - QString s; + TQString s; s.setNum(m_double); return s; } @@ -142,7 +142,7 @@ void Value::setString(double d) m_string.setNum(d); } -void Value::setString(const QString &s) +void Value::setString(const TQString &s) { type = stringValue; m_string = s; @@ -182,7 +182,7 @@ Value& Value::operator=(const Value& n) } -Value& Value::operator=(const QString& s) +Value& Value::operator=(const TQString& s) { setString(s); return *this; diff --git a/kturtle/src/value.h b/kturtle/src/value.h index 8c61966e..0027d8e9 100644 --- a/kturtle/src/value.h +++ b/kturtle/src/value.h @@ -20,8 +20,8 @@ #ifndef _VALUE_H_ #define _VALUE_H_ -#include <qstring.h> -#include <qtextstream.h> +#include <tqstring.h> +#include <tqtextstream.h> enum valueType @@ -50,14 +50,14 @@ class Value double Number() const; void setNumber(double); - bool setNumber(const QString&); + bool setNumber(const TQString&); - QString String() const; + TQString String() const; void setString(double); - void setString(const QString&); + void setString(const TQString&); Value& operator=(const Value&); - Value& operator=(const QString&); + Value& operator=(const TQString&); Value& operator=(double); Value& operator+(const Value&); @@ -79,7 +79,7 @@ class Value int type; bool m_bool; double m_double; - QString m_string; + TQString m_string; }; #endif // _VALUE_H_ |