diff options
Diffstat (limited to 'kdm/kfrontend/themer')
-rw-r--r-- | kdm/kfrontend/themer/kdmitem.cpp | 54 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmitem.h | 14 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmlabel.cpp | 20 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmlabel.h | 2 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmlayout.cpp | 28 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmlayout.h | 2 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmpixmap.cpp | 20 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmpixmap.h | 2 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmthemer.cpp | 24 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmthemer.h | 4 |
10 files changed, 85 insertions, 85 deletions
diff --git a/kdm/kfrontend/themer/kdmitem.cpp b/kdm/kfrontend/themer/kdmitem.cpp index a171bd1bb..3d81de58a 100644 --- a/kdm/kfrontend/themer/kdmitem.cpp +++ b/kdm/kfrontend/themer/kdmitem.cpp @@ -214,7 +214,7 @@ KdmItem::setWidget( TQWidget *widget ) myWidget->show(); // Remove borders so that it blends nicely with the theme background - TQFrame* frame = ::qt_cast<TQFrame *>( widget ); + TQFrame* frame = ::tqqt_cast<TQFrame *>( widget ); if (frame) frame->setFrameStyle( TQFrame::NoFrame ); @@ -278,7 +278,7 @@ KdmItem::setGeometry( const TQRect &newGeometry, bool force ) if (fixedManager && !fixedManager->isEmpty()) fixedManager->update( newGeometry, force ); - // TODO send *selective* repaint signal + // TODO send *selective* tqrepaint signal } void @@ -295,8 +295,8 @@ KdmItem::paint( TQPainter *p, const TQRect &rect ) // Maybe set a darker version of the background instead of an exact copy? if ( myWidget && myWidget->isA( "KListView" ) ) { TQPixmap copy( myWidget->size() ); - kdDebug() << myWidget->geometry() << " " << area << " " << myWidget->size() << endl; - bitBlt( ©, TQPoint( 0, 0), p->device(), myWidget->geometry(), Qt::CopyROP ); + kdDebug() << myWidget->tqgeometry() << " " << area << " " << myWidget->size() << endl; + bitBlt( ©, TQPoint( 0, 0), p->device(), myWidget->geometry(), TQt::CopyROP ); // Lighten it slightly TQImage lightVersion; lightVersion = copy.convertToImage(); @@ -368,7 +368,7 @@ KdmItem::mouseEvent( int x, int y, bool pressed, bool released ) } ItemState oldState = state; - if (area.contains( x, y )) { + if (area.tqcontains( x, y )) { if (released && oldState == Sactive) { if (buttonParent) emit activated( id ); @@ -414,22 +414,22 @@ KdmItem::statusChanged() // BEGIN protected inheritable -QSize -KdmItem::sizeHint() +TQSize +KdmItem::tqsizeHint() { if (myWidget) return myWidget->size(); if (myLayoutItem) - return myLayoutItem->sizeHint(); + return myLayoutItem->tqsizeHint(); int w = pos.wType == DTpixel ? kAbs( pos.width ) : -1, h = pos.hType == DTpixel ? kAbs( pos.height ) : -1; return TQSize( w, h ); } -QRect +TQRect KdmItem::placementHint( const TQRect &parentRect ) { - TQSize hintedSize = sizeHint(); + TQSize hintedSize = tqsizeHint(); TQSize boxHint; int x = parentRect.left(), @@ -446,7 +446,7 @@ KdmItem::placementHint( const TQRect &parentRect ) else { if (!boxManager) return parentRect; - boxHint = boxManager->sizeHint(); + boxHint = boxManager->tqsizeHint(); } kdDebug() << timestamp() << " boxHint " << boxHint << endl; } @@ -456,21 +456,21 @@ KdmItem::placementHint( const TQRect &parentRect ) else if (pos.xType == DTnpixel) x = parentRect.right() - pos.x; else if (pos.xType == DTpercent) - x += qRound( parentRect.width() / 100.0 * pos.x ); + x += tqRound( parentRect.width() / 100.0 * pos.x ); if (pos.yType == DTpixel) y += pos.y; else if (pos.yType == DTnpixel) y = parentRect.bottom() - pos.y; else if (pos.yType == DTpercent) - y += qRound( parentRect.height() / 100.0 * pos.y ); + y += tqRound( parentRect.height() / 100.0 * pos.y ); if (pos.wType == DTpixel) w = pos.width; else if (pos.wType == DTnpixel) w -= pos.width; else if (pos.wType == DTpercent) - w = qRound( parentRect.width() / 100.0 * pos.width ); + w = tqRound( parentRect.width() / 100.0 * pos.width ); else if (pos.wType == DTbox) w = boxHint.width(); else if (hintedSize.width() > 0) @@ -483,7 +483,7 @@ KdmItem::placementHint( const TQRect &parentRect ) else if (pos.hType == DTnpixel) h -= pos.height; else if (pos.hType == DTpercent) - h = qRound( parentRect.height() / 100.0 * pos.height ); + h = tqRound( parentRect.height() / 100.0 * pos.height ); else if (pos.hType == DTbox) h = boxHint.height(); else if (hintedSize.height() > 0) { @@ -496,7 +496,7 @@ KdmItem::placementHint( const TQRect &parentRect ) // we choose to take the hinted size, but it's better to listen to the aspect ratio if (pos.wType == DTnone && pos.hType != DTnone && h && w) { - w = qRound(float(hintedSize.width() * h) / hintedSize.height()); + w = tqRound(float(hintedSize.width() * h) / hintedSize.height()); } // defaults to center @@ -504,13 +504,13 @@ KdmItem::placementHint( const TQRect &parentRect ) // anchor the rect to an edge / corner if (pos.anchor.length() > 0 && pos.anchor.length() < 3) { - if (pos.anchor.find( 'n' ) >= 0) + if (pos.anchor.tqfind( 'n' ) >= 0) dy = 0; - if (pos.anchor.find( 's' ) >= 0) + if (pos.anchor.tqfind( 's' ) >= 0) dy = -h; - if (pos.anchor.find( 'w' ) >= 0) + if (pos.anchor.tqfind( 'w' ) >= 0) dx = 0; - if (pos.anchor.find( 'e' ) >= 0) + if (pos.anchor.tqfind( 'e' ) >= 0) dx = -w; } // KdmItem *p = static_cast<KdmItem*>( parent() ); @@ -555,11 +555,11 @@ KdmItem::parseAttribute( const TQString &s, int &val, enum DataType &dType ) if (s == "box") { // box value dType = DTbox; val = 0; - } else if ((p = s.find( '%' )) >= 0) { // percent value + } else if ((p = s.tqfind( '%' )) >= 0) { // percent value dType = DTpercent; TQString sCopy = s; sCopy.remove( p, 1 ); - sCopy.replace( ',', '.' ); + sCopy.tqreplace( ',', '.' ); val = (int)sCopy.toDouble(); } else { // int value dType = DTpixel; @@ -568,7 +568,7 @@ KdmItem::parseAttribute( const TQString &s, int &val, enum DataType &dType ) sCopy.remove( 0, 1 ); dType = DTnpixel; } - sCopy.replace( ',', '.' ); + sCopy.tqreplace( ',', '.' ); val = (int)sCopy.toDouble(); } } @@ -576,7 +576,7 @@ KdmItem::parseAttribute( const TQString &s, int &val, enum DataType &dType ) void KdmItem::parseFont( const TQString &s, TQFont &font ) { - int splitAt = s.findRev( ' ' ); + int splitAt = s.tqfindRev( ' ' ); if (splitAt < 1) return; font.setFamily( s.left( splitAt ) ); @@ -614,16 +614,16 @@ KdmItem::setFixedLayout( const TQDomNode &node ) } TQWidget * -KdmItem::parentWidget() const +KdmItem::tqparentWidget() const { if (myWidget) return myWidget; if (!this->parent()) return 0; - if (parent()->qt_cast("TQWidget")) + if (tqparent()->tqqt_cast("TQWidget")) return (TQWidget*)parent(); - return ((KdmItem*)parent())->parentWidget(); + return ((KdmItem*)parent())->tqparentWidget(); } #include "kdmitem.moc" diff --git a/kdm/kfrontend/themer/kdmitem.h b/kdm/kfrontend/themer/kdmitem.h index 230ed71c4..31d4fcfa2 100644 --- a/kdm/kfrontend/themer/kdmitem.h +++ b/kdm/kfrontend/themer/kdmitem.h @@ -96,7 +96,7 @@ public: /** * Fixup the geometry of an item and its children (even if fixed - * or boxed ones). Note that this will generate repaint signals + * or boxed ones). Note that this will generate tqrepaint signals * when needed. The default implementation should fit all needs. */ virtual void setGeometry( const TQRect &newGeometry, bool force ); @@ -109,7 +109,7 @@ public: void paint( TQPainter *painter, const TQRect &boundaries ); /** - * Update representation of contents and repaint. + * Update representation of contents and tqrepaint. */ virtual void update(); @@ -120,7 +120,7 @@ public: void mouseEvent( int x, int y, bool pressed = false, bool released = false ); /** - * Similar to sizeHint(..), this returns the area of the item + * Similar to tqsizeHint(..), this returns the area of the item * given the @p parentGeometry. The default implementation * takes into account geometric constraints and layoutings. * @param parentGeometry the geometry of the caller item or a @@ -147,7 +147,7 @@ public: TQString baseDir() const { if (basedir.isEmpty() && parent()) - return static_cast<KdmItem *>( parent()->qt_cast( "KdmItem" ) )->baseDir(); + return static_cast<KdmItem *>( tqparent()->tqqt_cast( "KdmItem" ) )->baseDir(); return basedir; } @@ -163,7 +163,7 @@ public: bool isExplicitlyHidden() const { return isShown == ExplicitlyHidden; } TQRect rect() const { return area; } - TQWidget *parentWidget() const; + TQWidget *tqparentWidget() const; TQString getId() const { return id; } signals: @@ -181,7 +181,7 @@ protected: * @return (-1,-1) if no size can be determined (so it should * default to parent's size). */ - virtual TQSize sizeHint(); + virtual TQSize tqsizeHint(); /** * Low level graphical function to paint the item. @@ -195,7 +195,7 @@ protected: /** * Called when item changes its 'state' variable. This must - * handle item's repaint. + * handle item's tqrepaint. */ virtual void statusChanged(); diff --git a/kdm/kfrontend/themer/kdmlabel.cpp b/kdm/kfrontend/themer/kdmlabel.cpp index e83ae9dc7..55a993988 100644 --- a/kdm/kfrontend/themer/kdmlabel.cpp +++ b/kdm/kfrontend/themer/kdmlabel.cpp @@ -96,7 +96,7 @@ KdmLabel::KdmLabel( KdmItem *parent, const TQDomNode &node, const char *name ) } // Check if this is a timer label) - label.isTimer = label.text.find( "%c" ) >= 0; + label.isTimer = label.text.tqfind( "%c" ) >= 0; if (label.isTimer) { timer = new TQTimer( this ); timer->start( 1000 ); @@ -110,13 +110,13 @@ KdmLabel::setTextInt( const TQString &txt) { // TODO: catch && cText = txt; - cAccel = txt.find('&'); + cAccel = txt.tqfind('&'); delete myAccel; myAccel = 0; if (cAccel != -1) { cText.remove('&'); - myAccel = new TQAccel(parentWidget()); - myAccel->insertItem(ALT + UNICODE_ACCEL + cText.at(cAccel).lower().unicode()); + myAccel = new TQAccel(tqparentWidget()); + myAccel->insertItem(ALT + UNICODE_ACCEL + cText.tqat(cAccel).lower().tqunicode()); connect(myAccel, TQT_SIGNAL(activated(int)), TQT_SLOT(slotAccel())); } } @@ -137,8 +137,8 @@ KdmLabel::setText( const TQString &txt ) setTextInt( lookupText( label.text ) ); } -QSize -KdmLabel::sizeHint() +TQSize +KdmLabel::tqsizeHint() { // choose the correct label class struct LabelStruct::LabelClass *l = &label.normal; @@ -231,7 +231,7 @@ static const struct { { "login", I18N_NOOP("Login") } }; -QString +TQString KdmLabel::lookupStock( const TQString &stock ) { //FIXME add key accels! @@ -245,12 +245,12 @@ KdmLabel::lookupStock( const TQString &stock ) return stock; } -QString +TQString KdmLabel::lookupText( const TQString &t ) { TQString text = t; - text.replace( '_', '&' ); + text.tqreplace( '_', '&' ); TQMap<TQChar,TQString> m; struct utsname uts; @@ -268,7 +268,7 @@ KdmLabel::lookupText( const TQString &t ) m['s'] = KThemedGreeter::timedUser; // xgettext:no-c-format KGlobal::locale()->setDateFormat( i18n("date format", "%a %d %B") ); - m['c'] = KGlobal::locale()->formatDateTime( TQDateTime::currentDateTime(), false, false ); + m['c'] = KGlobal::locale()->formatDateTime( TQDateTime::tqcurrentDateTime(), false, false ); return KMacroExpander::expandMacros( text, m ); } diff --git a/kdm/kfrontend/themer/kdmlabel.h b/kdm/kfrontend/themer/kdmlabel.h index 1ec2f88ec..33ce1cc00 100644 --- a/kdm/kfrontend/themer/kdmlabel.h +++ b/kdm/kfrontend/themer/kdmlabel.h @@ -42,7 +42,7 @@ public: protected: // reimplemented; returns the minimum size of rendered text - virtual TQSize sizeHint(); + virtual TQSize tqsizeHint(); // draw the label virtual void drawContents( TQPainter *p, const TQRect &r ); diff --git a/kdm/kfrontend/themer/kdmlayout.cpp b/kdm/kfrontend/themer/kdmlayout.cpp index b17d2e7b7..83a4ea377 100644 --- a/kdm/kfrontend/themer/kdmlayout.cpp +++ b/kdm/kfrontend/themer/kdmlayout.cpp @@ -74,7 +74,7 @@ KdmLayoutBox::update( const TQRect &parentGeometry, bool force ) // Check if box size was computed. If not compute it // TODO check if this prevents updating changing items // if (!hintedSize.isValid()) -// sizeHint(); +// tqsizeHint(); // kdDebug() << this << " hintedSize " << hintedSize << endl; @@ -114,30 +114,30 @@ KdmLayoutBox::update( const TQRect &parentGeometry, bool force ) if ((*it)->isExplicitlyHidden()) continue; - TQRect temp = childrenRect, itemRect; + TQRect temp = childrenRect, tqitemRect; if (box.isVertical) { temp.setHeight( 0 ); - itemRect = (*it)->placementHint( temp ); - temp.setHeight( itemRect.height() ); - childrenRect.setTop( childrenRect.top() + itemRect.size().height() + box.spacing ); + tqitemRect = (*it)->placementHint( temp ); + temp.setHeight( tqitemRect.height() ); + childrenRect.setTop( childrenRect.top() + tqitemRect.size().height() + box.spacing ); } else { temp.setWidth( 0 ); - itemRect = (*it)->placementHint( temp ); - kdDebug() << this << " placementHint " << *it << " " << temp << " " << itemRect << endl; - temp.setWidth( itemRect.width() ); - childrenRect.setLeft( childrenRect.left() + itemRect.size().width() + box.spacing ); + tqitemRect = (*it)->placementHint( temp ); + kdDebug() << this << " placementHint " << *it << " " << temp << " " << tqitemRect << endl; + temp.setWidth( tqitemRect.width() ); + childrenRect.setLeft( childrenRect.left() + tqitemRect.size().width() + box.spacing ); kdDebug() << timestamp() << " childrenRect after " << *it << " " << childrenRect << endl; } - itemRect = (*it)->placementHint( temp ); - kdDebug() << this << " placementHint2 " << *it << " " << temp << " " << itemRect << endl; - (*it)->setGeometry( itemRect, force ); + tqitemRect = (*it)->placementHint( temp ); + kdDebug() << this << " placementHint2 " << *it << " " << temp << " " << tqitemRect << endl; + (*it)->setGeometry( tqitemRect, force ); } } } //FIXME truly experimental (is so close to greeter_geometry.c) -QSize -KdmLayoutBox::sizeHint() +TQSize +KdmLayoutBox::tqsizeHint() { // Sum up area taken by children int w = 0, h = 0; diff --git a/kdm/kfrontend/themer/kdmlayout.h b/kdm/kfrontend/themer/kdmlayout.h index 4c73e9a1b..69b515d67 100644 --- a/kdm/kfrontend/themer/kdmlayout.h +++ b/kdm/kfrontend/themer/kdmlayout.h @@ -80,7 +80,7 @@ public: // Computes the size hint of the box, telling which is the // smallest size inside which boxed items will fit - TQSize sizeHint(); + TQSize tqsizeHint(); private: struct { diff --git a/kdm/kfrontend/themer/kdmpixmap.cpp b/kdm/kfrontend/themer/kdmpixmap.cpp index 0fcbc065c..2322312e8 100644 --- a/kdm/kfrontend/themer/kdmpixmap.cpp +++ b/kdm/kfrontend/themer/kdmpixmap.cpp @@ -96,8 +96,8 @@ KdmPixmap::KdmPixmap( KdmItem *parent, const TQDomNode &node, const char *name ) loadPixmap( &pixmap.normal ); } -QSize -KdmPixmap::sizeHint() +TQSize +KdmPixmap::tqsizeHint() { // choose the correct pixmap class PixmapStruct::PixmapClass * pClass = &pixmap.normal; @@ -108,7 +108,7 @@ KdmPixmap::sizeHint() // use the pixmap size as the size hint if (!pClass->pixmap.isNull()) return pClass->pixmap.size(); - return KdmItem::sizeHint(); + return KdmItem::tqsizeHint(); } void @@ -163,11 +163,11 @@ KdmPixmap::loadPixmap( PixmapStruct::PixmapClass *pClass ) TQString fullpath = pClass->fullpath; kdDebug() << timestamp() << " load " << fullpath << endl; - int index = fullpath.findRev('.'); + int index = fullpath.tqfindRev('.'); TQString ext = fullpath.right(fullpath.length() - index); fullpath = fullpath.left(index); kdDebug() << timestamp() << " ext " << ext << " " << fullpath << endl; - TQString testpath = TQString("-%1x%2").arg(area.width()).arg(area.height()) + ext; + TQString testpath = TQString("-%1x%2").tqarg(area.width()).arg(area.height()) + ext; kdDebug() << timestamp() << " testing for " << fullpath + testpath << endl; if (KStandardDirs::exists(fullpath + testpath)) pClass->pixmap.load(fullpath + testpath); @@ -268,11 +268,11 @@ KdmPixmap::drawContents( TQPainter *p, const TQRect &r ) QRgb *ls = (QRgb *)scaledImage.scanLine( y ); for (int x = 0; x < w; ++x) { QRgb l = ls[x]; - int r = int( qRed( l ) * tint_red ); - int g = int( qGreen( l ) * tint_green ); - int b = int( qBlue( l ) * tint_blue ); - int a = int( qAlpha( l ) * tint_alpha ); - ls[x] = qRgba( r, g, b, a ); + int r = int( tqRed( l ) * tint_red ); + int g = int( tqGreen( l ) * tint_green ); + int b = int( tqBlue( l ) * tint_blue ); + int a = int( tqAlpha( l ) * tint_alpha ); + ls[x] = tqRgba( r, g, b, a ); } } diff --git a/kdm/kfrontend/themer/kdmpixmap.h b/kdm/kfrontend/themer/kdmpixmap.h index a12c9fea4..d49394bc9 100644 --- a/kdm/kfrontend/themer/kdmpixmap.h +++ b/kdm/kfrontend/themer/kdmpixmap.h @@ -42,7 +42,7 @@ public: protected: // reimplemented; returns the size of loaded pixmap - virtual TQSize sizeHint(); + virtual TQSize tqsizeHint(); // draw the pixmap virtual void drawContents( TQPainter *p, const TQRect &r ); diff --git a/kdm/kfrontend/themer/kdmthemer.cpp b/kdm/kfrontend/themer/kdmthemer.cpp index 9e6db33db..f95343787 100644 --- a/kdm/kfrontend/themer/kdmthemer.cpp +++ b/kdm/kfrontend/themer/kdmthemer.cpp @@ -131,19 +131,19 @@ KdmThemer::widgetEvent( TQEvent *e ) switch (e->type()) { case TQEvent::MouseMove: { - TQMouseEvent *me = static_cast<TQMouseEvent *>(e); + TQMouseEvent *me = TQT_TQMOUSEEVENT(e); rootItem->mouseEvent( me->x(), me->y() ); } break; case TQEvent::MouseButtonPress: { - TQMouseEvent *me = static_cast<TQMouseEvent *>(e); + TQMouseEvent *me = TQT_TQMOUSEEVENT(e); rootItem->mouseEvent( me->x(), me->y(), true ); } break; case TQEvent::MouseButtonRelease: { - TQMouseEvent *me = static_cast<TQMouseEvent *>(e); + TQMouseEvent *me = TQT_TQMOUSEEVENT(e); rootItem->mouseEvent( me->x(), me->y(), false, true ); } break; @@ -156,7 +156,7 @@ KdmThemer::widgetEvent( TQEvent *e ) break; case TQEvent::Paint: { - TQRect paintRect = static_cast<TQPaintEvent *>(e)->rect(); + TQRect paintRect = TQT_TQPAINTEVENT(e)->rect(); kdDebug() << timestamp() << " paint on: " << paintRect << endl; if (!backBuffer) @@ -223,7 +223,7 @@ KdmThemer::generateItems( KdmItem *parent, const TQDomNode &node ) TQString id = el.attribute("id"); if (id.startsWith("plugin-specific-")) { id = id.mid(strlen("plugin-specific-")); - if (!_pluginsLogin.contains(id)) + if (!_pluginsLogin.tqcontains(id)) continue; } @@ -281,7 +281,7 @@ bool KdmThemer::willDisplay( const TQDomNode &node ) TQStringList modeList = TQStringList::split( ",", modes ); // If current mode isn't in this list, do not display item - if (modeList.find( m_currentMode ) == modeList.end()) + if (modeList.tqfind( m_currentMode ) == modeList.end()) return false; } @@ -314,13 +314,13 @@ void KdmThemer::showStructure( TQObject *obj ) { - const TQObjectList *wlist = obj->children(); + const TQObjectList wlist = obj->childrenListObject(); static int counter = 0; if (counter == 0) kdDebug() << timestamp() << " \n\n<======= Widget tree =================" << endl; - if (wlist) { + if (!wlist.isEmpty()) { counter++; - TQObjectListIterator it( *wlist ); + TQObjectListIterator it( wlist ); TQObject *object; while ((object = it.current()) != 0) { @@ -358,7 +358,7 @@ KdmThemer::slotActivated( const TQString &id ) return; item->widget()->setFocus(); - TQLineEdit *le = (TQLineEdit*)item->widget()->qt_cast("TQLineEdit"); + TQLineEdit *le = (TQLineEdit*)item->widget()->tqqt_cast("TQLineEdit"); if (le) le->selectAll(); } @@ -377,8 +377,8 @@ KdmThemer::slotPaintRoot() back_item->paint( &painter, back_item->rect()); painter.end(); - TQApplication::desktop()->screen()->setErasePixmap(pm); - TQApplication::desktop()->screen()->erase(); + TQT_TQWIDGET(TQApplication::desktop()->screen())->setErasePixmap(pm); + TQT_TQWIDGET(TQApplication::desktop()->screen())->erase(); } #include "kdmthemer.moc" diff --git a/kdm/kfrontend/themer/kdmthemer.h b/kdm/kfrontend/themer/kdmthemer.h index 6dc2318dd..0c4cd3753 100644 --- a/kdm/kfrontend/themer/kdmthemer.h +++ b/kdm/kfrontend/themer/kdmthemer.h @@ -60,9 +60,9 @@ public: bool isOK() { return rootItem != 0; } /* - * Gives a sizeHint to the widget (parent size) + * Gives a tqsizeHint to the widget (parent size) */ - //TQSize sizeHint() const{ return parentWidget()->size(); } + //TQSize tqsizeHint() const{ return tqparentWidget()->size(); } /* * Takes a shot of the current widget |