From a1bd60b34891ccc77056c190d7871bc4b14fe654 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 22 Jun 2011 21:31:21 +0000 Subject: TQt4 port kdetoys This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1238103 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- amor/amor.cpp | 20 ++++++++++---------- amor/amor.h | 6 ++++-- amor/amoranim.cpp | 8 ++++---- amor/amoranim.h | 4 ++-- amor/amorbubble.cpp | 24 ++++++++++++------------ amor/amorbubble.h | 7 ++++--- amor/amordialog.cpp | 6 +++--- amor/amordialog.h | 3 ++- amor/amorpm.cpp | 2 +- amor/amorpm.h | 2 +- amor/amortips.cpp | 6 +++--- amor/amorwidget.cpp | 10 +++++----- amor/amorwidget.h | 5 +++-- 13 files changed, 54 insertions(+), 49 deletions(-) (limited to 'amor') diff --git a/amor/amor.cpp b/amor/amor.cpp index bd0171b..fafee0c 100644 --- a/amor/amor.cpp +++ b/amor/amor.cpp @@ -152,7 +152,7 @@ Amor::Amor() : DCOPObject( "AmorIface" ), TQObject() TQT_SLOT(slotMouseClicked(const TQPoint &))); connect(mAmor, TQT_SIGNAL(dragged(const TQPoint &, bool)), TQT_SLOT(slotWidgetDragged(const TQPoint &, bool))); - mAmor->resize(mTheme.maximumSize()); + mAmor->resize(mTheme.tqmaximumSize()); mTimer = new TQTimer(this); connect(mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout())); @@ -288,7 +288,7 @@ void Amor::reset() mPosition = mCurrAnim->hotspot().x(); mState = Normal; - mAmor->resize(mTheme.maximumSize()); + mAmor->resize(mTheme.tqmaximumSize()); mCurrAnim->reset(); mTimer->start(0, true); @@ -562,14 +562,14 @@ void Amor::restack() #endif Window sibling = mTargetWin; - Window dw, parent = None, *wins; + Window dw, tqparent = None, *wins; do { unsigned int nwins = 0; - // We must use the target window's parent as our sibling. - // Is there a faster way to get parent window than XQueryTree? - if (XQueryTree(qt_xdisplay(), sibling, &dw, &parent, &wins, &nwins)) + // We must use the target window's tqparent as our sibling. + // Is there a faster way to get tqparent window than XQueryTree? + if (XQueryTree(qt_xdisplay(), sibling, &dw, &tqparent, &wins, &nwins)) { if (nwins) { @@ -577,9 +577,9 @@ void Amor::restack() } } - if (parent != None && parent != dw ) - sibling = parent; - } while ( parent != None && parent != dw ); + if (tqparent != None && tqparent != dw ) + sibling = tqparent; + } while ( tqparent != None && tqparent != dw ); // Set animation's stacking order to be above the window manager's // decoration of target window. @@ -748,7 +748,7 @@ void Amor::slotOffsetChanged(int off) // void Amor::slotAbout() { - TQString about = i18n("Amor Version %1\n\n").arg(AMOR_VERSION) + + TQString about = i18n("Amor Version %1\n\n").tqarg(AMOR_VERSION) + i18n("Amusing Misuse Of Resources\n\n") + i18n("Copyright (c) 1999 Martin R. Jones \n\n") + i18n("Original Author: Martin R. Jones \n") + diff --git a/amor/amor.h b/amor/amor.h index b93099e..39e3c0e 100644 --- a/amor/amor.h +++ b/amor/amor.h @@ -55,7 +55,7 @@ public: QueueItem(itemType ty, TQString te, int ti = -1); itemType type() { return iType; } - QString text() { return iText; }; + TQString text() { return iText; }; int time() { return iTime; }; void setTime(int newTime) { if (iTime > 0) iTime = newTime; }; @@ -73,6 +73,7 @@ private: class Amor : public TQObject, virtual public AmorIface { Q_OBJECT + TQ_OBJECT public: Amor(); virtual ~Amor(); @@ -150,9 +151,10 @@ private: //--------------------------------------------------------------------------- -class AmorSessionWidget : public QWidget +class AmorSessionWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: AmorSessionWidget(); ~AmorSessionWidget() {}; diff --git a/amor/amoranim.cpp b/amor/amoranim.cpp index b4e595b..6be6262 100644 --- a/amor/amoranim.cpp +++ b/amor/amoranim.cpp @@ -170,7 +170,7 @@ bool AmorThemeManager::setTheme(const TQString & file) else { // relative to config file. - mPath.truncate(mPath.findRev('/')+1); + mPath.truncate(mPath.tqfindRev('/')+1); mPath += pixmapPath; } @@ -195,7 +195,7 @@ AmorAnim *AmorThemeManager::random(const TQString & group) if (mStatic) grp = "Base"; - AmorAnimationGroup *animGroup = mAnimations.find(grp); + AmorAnimationGroup *animGroup = mAnimations.tqfind(grp); if (animGroup) { int idx = kapp->random()%animGroup->count(); @@ -227,7 +227,7 @@ bool AmorThemeManager::readGroup(const TQString & seq) mConfig->setGroup(list.at(i)); AmorAnim *anim = new AmorAnim(*mConfig); animList->append(anim); - mMaximumSize = mMaximumSize.expandedTo(anim->maximumSize()); + mMaximumSize = mMaximumSize.expandedTo(anim->tqmaximumSize()); } // If no animations were available for this group, just add the base anim @@ -238,7 +238,7 @@ bool AmorThemeManager::readGroup(const TQString & seq) if (anim) { animList->append(anim); - mMaximumSize = mMaximumSize.expandedTo(anim->maximumSize()); + mMaximumSize = mMaximumSize.expandedTo(anim->tqmaximumSize()); entries++; } } diff --git a/amor/amoranim.h b/amor/amoranim.h index acc4fba..d315840 100644 --- a/amor/amoranim.h +++ b/amor/amoranim.h @@ -59,7 +59,7 @@ public: { return (mCurrent < mSequence.count()); } int totalMovement() const { return mTotalMovement; } - TQSize maximumSize() const + TQSize tqmaximumSize() const { return mMaximumSize; } int delay() const @@ -103,7 +103,7 @@ public: AmorAnim *random(const TQString & group); - TQSize maximumSize() const { return mMaximumSize; } + TQSize tqmaximumSize() const { return mMaximumSize; } protected: TQString mPath; diff --git a/amor/amorbubble.cpp b/amor/amorbubble.cpp index 8dcc4d3..314eba5 100644 --- a/amor/amorbubble.cpp +++ b/amor/amorbubble.cpp @@ -55,8 +55,8 @@ AmorBubble::AmorBubble() mBrowser->setWrapPolicy(TQTextEdit::AtWordOrDocumentBoundary); // too long to fit in one line? - TQColorGroup clgrp = mBrowser->colorGroup(); - clgrp.setColor(TQColorGroup::Text, Qt::black); + TQColorGroup clgrp = mBrowser->tqcolorGroup(); + clgrp.setColor(TQColorGroup::Text, TQt::black); //Laurent TQTextBrowser didn't have this function FIX me //mBrowser->setPaperColorGroup( clgrp ); mBrowser->setPaper( TQToolTip::palette().active().brush( TQColorGroup::Background ) ); @@ -83,12 +83,12 @@ AmorBubble::~AmorBubble() //--------------------------------------------------------------------------- // -// Set the message to display in the bubble. Causes the geometry of the +// Set the message to display in the bubble. Causes the tqgeometry of the // widget to be recalculated. // void AmorBubble::setMessage(const TQString& message) { - mMessage = TQString( "%1" ).arg( message ); + mMessage = TQString( "%1" ).tqarg( message ); // hacks because heightForWidth() doesn't work. setGeometry( -1000, 0, 300, 1000 ); show(); @@ -99,7 +99,7 @@ void AmorBubble::setMessage(const TQString& message) //--------------------------------------------------------------------------- // -// Calculates the size, position and mask of the bubble +// Calculates the size, position and tqmask of the bubble // void AmorBubble::calcGeometry() { @@ -108,7 +108,7 @@ void AmorBubble::calcGeometry() mBound.setHeight( mBrowser->contentsHeight() ); mBound.moveBy(ARROW_WIDTH+BORDER_SIZE, BORDER_SIZE); - // initialise the default geometry of the bubble + // initialise the default tqgeometry of the bubble int w = mBound.width() + BORDER_SIZE * 2 + ARROW_WIDTH; int h = mBound.height() + BORDER_SIZE * 2; int xpos = mOriginX + BUBBLE_OFFSET; @@ -141,13 +141,13 @@ void AmorBubble::calcGeometry() setGeometry(xpos, ypos, w, h); mBrowser->setGeometry( mBound ); - // create and apply the shape mask + // create and apply the tqshape tqmask mMask.resize(w, h); mMask.fill(color0); - TQPainter maskPainter(&mMask); - maskPainter.setPen(color1); - maskPainter.setBrush(color1); - drawBubble(maskPainter); + TQPainter tqmaskPainter(&mMask); + tqmaskPainter.setPen(color1); + tqmaskPainter.setBrush(color1); + drawBubble(tqmaskPainter); XShapeCombineMask( x11Display(), winId(), ShapeBounding, 0, 0, mMask.handle(), ShapeSet ); } @@ -195,7 +195,7 @@ void AmorBubble::drawBubble(TQPainter &p) p.drawPolygon(pointArray); p.setPen(pen); - p.drawPolyline(pointArray, 0, 3); + p.tqdrawPolyline(pointArray, 0, 3); } //--------------------------------------------------------------------------- diff --git a/amor/amorbubble.h b/amor/amorbubble.h index 89a8707..408c568 100644 --- a/amor/amorbubble.h +++ b/amor/amorbubble.h @@ -40,11 +40,12 @@ class TQTimer; //--------------------------------------------------------------------------- // -// AmorBubble displays a message in a shaped window +// AmorBubble displays a message in a tqshaped window // -class AmorBubble : public QWidget +class AmorBubble : public TQWidget { Q_OBJECT + TQ_OBJECT public: AmorBubble(); virtual ~AmorBubble(); @@ -69,7 +70,7 @@ protected: int mOriginX; // X origin of bubble arrow int mOriginY; // Y origin of bubble arrow TQRect mBound; // bounds of the text - TQBitmap mMask; // shape mask + TQBitmap mMask; // tqshape tqmask VertPos mArrowVert; // vertical position of the arrow HorzPos mArrowHorz; // horizontal position of the arrow TQTextBrowser *mBrowser; // displays the message diff --git a/amor/amordialog.cpp b/amor/amordialog.cpp index fb3ddba..981200b 100644 --- a/amor/amordialog.cpp +++ b/amor/amordialog.cpp @@ -74,7 +74,7 @@ AmorDialog::AmorDialog() label = new TQLabel(i18n("Offset:"), offsetBox); TQSlider *slider = new TQSlider(-40, 40, 5, mConfig.mOffset, - TQSlider::Vertical, offsetBox); + Qt::Vertical, offsetBox); connect(slider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotOffset(int))); // Always on top @@ -84,7 +84,7 @@ AmorDialog::AmorDialog() checkBox = new TQCheckBox(i18n("Show random tips"), mainwidget); connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotRandomTips(bool))); - checkBox->setChecked(mConfig.mTips); // always keep this one after the connect, or the QList would not be grayed when it should + checkBox->setChecked(mConfig.mTips); // always keep this one after the connect, or the TQList would not be grayed when it should checkBox = new TQCheckBox(i18n("Use a random character"), mainwidget); connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotRandomTheme(bool))); @@ -275,7 +275,7 @@ void AmorListBoxItem::paint( TQPainter *p ) int AmorListBoxItem::height(const TQListBox *lb ) const { - return QMAX( mPixmap.height(), lb->fontMetrics().lineSpacing() + 1 ); + return TQMAX( mPixmap.height(), lb->fontMetrics().lineSpacing() + 1 ); } int AmorListBoxItem::width(const TQListBox *lb ) const diff --git a/amor/amordialog.h b/amor/amordialog.h index 2f978fd..c299fc1 100644 --- a/amor/amordialog.h +++ b/amor/amordialog.h @@ -41,6 +41,7 @@ class AmorDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: AmorDialog(); @@ -86,7 +87,7 @@ protected: // // AmorListBoxItem implements a list box items for selection of themes // -class AmorListBoxItem : public QListBoxItem +class AmorListBoxItem : public TQListBoxItem { public: AmorListBoxItem(const TQString & s, const TQPixmap& p) diff --git a/amor/amorpm.cpp b/amor/amorpm.cpp index 75a87b3..9d58794 100644 --- a/amor/amorpm.cpp +++ b/amor/amorpm.cpp @@ -56,7 +56,7 @@ AmorPixmapManager::~AmorPixmapManager() // const TQPixmap *AmorPixmapManager::load(const TQString & img) { - TQPixmap *pixmap = mPixmaps.find(img); + TQPixmap *pixmap = mPixmaps.tqfind(img); if (!pixmap) { diff --git a/amor/amorpm.h b/amor/amorpm.h index ad2a355..633bf2e 100644 --- a/amor/amorpm.h +++ b/amor/amorpm.h @@ -50,7 +50,7 @@ public: { mPixmapDir = "."; mPixmaps.clear(); } const TQPixmap *load(const TQString & img); const TQPixmap *pixmap(const TQString & img) const - { return mPixmaps.find(img); } + { return mPixmaps.tqfind(img); } static AmorPixmapManager *manager(); diff --git a/amor/amortips.cpp b/amor/amortips.cpp index 798657e..c8da178 100644 --- a/amor/amortips.cpp +++ b/amor/amortips.cpp @@ -103,11 +103,11 @@ bool AmorTips::readKTips() const TQRegExp rx("\\n+"); int pos = -1; - while ((pos = content.find("", pos + 1, false)) != -1) + while ((pos = content.tqfind("", pos + 1, false)) != -1) { TQString tip = content - .mid(pos + 6, content.find("", pos, false) - pos - 6) - .replace(rx, "\n"); + .mid(pos + 6, content.tqfind("", pos, false) - pos - 6) + .tqreplace(rx, "\n"); if (!tip.endsWith("\n")) tip += "\n"; if (tip.startsWith("\n")) diff --git a/amor/amorwidget.cpp b/amor/amorwidget.cpp index c659af2..b64af77 100644 --- a/amor/amorwidget.cpp +++ b/amor/amorwidget.cpp @@ -60,11 +60,11 @@ void AmorWidget::setPixmap(const TQPixmap *pixmap) if (mPixmap) { - if (mPixmap->mask()) + if (mPixmap->tqmask()) { XShapeCombineMask( x11Display(), winId(), ShapeBounding, 0, 0, - mPixmap->mask()->handle(), ShapeSet ); - repaint(false); + mPixmap->tqmask()->handle(), ShapeSet ); + tqrepaint(false); } update(); @@ -98,7 +98,7 @@ void AmorWidget::mousePressEvent(TQMouseEvent *me) // void AmorWidget::mouseMoveEvent(TQMouseEvent *me) { - if ( me->state() == LeftButton ) { + if ( me->state() == Qt::LeftButton ) { if ( !dragging && (clickPos-me->globalPos()).manhattanLength() > 3 ) dragging = true; if ( dragging ) { @@ -116,7 +116,7 @@ void AmorWidget::mouseReleaseEvent(TQMouseEvent *me) { if ( dragging ) emit dragged( me->globalPos() - clickPos, true ); - else if ( me->state() == RightButton ) + else if ( me->state() == Qt::RightButton ) emit mouseClicked(clickPos); clickPos = TQPoint(); diff --git a/amor/amorwidget.h b/amor/amorwidget.h index 308ed73..15f9126 100644 --- a/amor/amorwidget.h +++ b/amor/amorwidget.h @@ -36,11 +36,12 @@ //--------------------------------------------------------------------------- // -// AmorWidget displays a shaped pixmap +// AmorWidget displays a tqshaped pixmap // -class AmorWidget : public QWidget +class AmorWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: AmorWidget(); virtual ~AmorWidget(); -- cgit v1.2.1