diff options
Diffstat (limited to 'kdm/kfrontend/themer')
-rw-r--r-- | kdm/kfrontend/themer/kdmitem.cpp | 104 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmitem.h | 66 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmlabel.cpp | 60 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmlabel.h | 28 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmlayout.cpp | 38 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmlayout.h | 20 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmpixmap.cpp | 38 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmpixmap.h | 24 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmrect.cpp | 56 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmrect.h | 20 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmthemer.cpp | 112 | ||||
-rw-r--r-- | kdm/kfrontend/themer/kdmthemer.h | 32 |
12 files changed, 299 insertions, 299 deletions
diff --git a/kdm/kfrontend/themer/kdmitem.cpp b/kdm/kfrontend/themer/kdmitem.cpp index 48c0d1faf..38af9d0aa 100644 --- a/kdm/kfrontend/themer/kdmitem.cpp +++ b/kdm/kfrontend/themer/kdmitem.cpp @@ -31,16 +31,16 @@ #include <kglobal.h> #include <kdebug.h> -#include <qframe.h> -#include <qwidget.h> -#include <qlayout.h> -#include <qimage.h> +#include <tqframe.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqimage.h> #ifdef DRAW_OUTLINE -# include <qpainter.h> +# include <tqpainter.h> #endif -KdmItem::KdmItem( KdmItem *parent, const QDomNode &node, const char *name ) - : QObject( parent, name ) +KdmItem::KdmItem( KdmItem *parent, const TQDomNode &node, const char *name ) + : TQObject( parent, name ) , boxManager( 0 ) , fixedManager( 0 ) , image( 0 ) @@ -68,23 +68,23 @@ KdmItem::KdmItem( KdmItem *parent, const QDomNode &node, const char *name ) } // Read the mandatory Pos tag. Other tags such as normal, prelighted, // etc.. are read under specific implementations. - QDomNodeList childList = node.childNodes(); + TQDomNodeList childList = node.childNodes(); for (uint nod = 0; nod < childList.count(); nod++) { - QDomNode child = childList.item( nod ); - QDomElement el = child.toElement(); - QString tagName = el.tagName(), attr; + TQDomNode child = childList.item( nod ); + TQDomElement el = child.toElement(); + TQString tagName = el.tagName(), attr; if (tagName == "pos") { - parseAttribute( el.attribute( "x", QString::null ), pos.x, pos.xType ); - parseAttribute( el.attribute( "y", QString::null ), pos.y, pos.yType ); - parseAttribute( el.attribute( "width", QString::null ), pos.width, pos.wType ); - parseAttribute( el.attribute( "height", QString::null ), pos.height, pos.hType ); + parseAttribute( el.attribute( "x", TQString::null ), pos.x, pos.xType ); + parseAttribute( el.attribute( "y", TQString::null ), pos.y, pos.yType ); + parseAttribute( el.attribute( "width", TQString::null ), pos.width, pos.wType ); + parseAttribute( el.attribute( "height", TQString::null ), pos.height, pos.hType ); pos.anchor = el.attribute( "anchor", "nw" ); } } - QDomNode tnode = node; - id = tnode.toElement().attribute( "id", QString::number( (ulong)this, 16 ) ); + TQDomNode tnode = node; + id = tnode.toElement().attribute( "id", TQString::number( (ulong)this, 16 ) ); // Tell 'parent' to add 'me' to its children KdmItem *parentItem = static_cast<KdmItem *>( parent ); @@ -115,7 +115,7 @@ KdmItem::show( bool force ) if (isShown != InitialHidden && !force) return; - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) (*it)->show(); @@ -139,7 +139,7 @@ KdmItem::hide( bool force ) return; // no need for further action } - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) (*it)->hide(); @@ -158,18 +158,18 @@ KdmItem::inheritFromButton( KdmItem *button ) if (button) buttonParent = button; - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) (*it)->inheritFromButton( button ); } KdmItem * -KdmItem::findNode( const QString &_id ) const +KdmItem::findNode( const TQString &_id ) const { if (id == _id) return const_cast<KdmItem *>( this ); - QValueList<KdmItem *>::ConstIterator it; + TQValueList<KdmItem *>::ConstIterator it; for (it = m_children.begin(); it != m_children.end(); ++it) { KdmItem *t = (*it)->findNode( _id ); if (t) @@ -180,7 +180,7 @@ KdmItem::findNode( const QString &_id ) const } void -KdmItem::setWidget( QWidget *widget ) +KdmItem::setWidget( TQWidget *widget ) { // delete myWidget; -- themer->widget() owns the widgets @@ -191,13 +191,13 @@ KdmItem::setWidget( QWidget *widget ) myWidget->show(); // Remove borders so that it blends nicely with the theme background - QFrame* frame = ::qt_cast<QFrame *>( widget ); + TQFrame* frame = ::qt_cast<TQFrame *>( widget ); if (frame) - frame->setFrameStyle( QFrame::NoFrame ); + frame->setFrameStyle( TQFrame::NoFrame ); myWidget->setGeometry(area); - connect( myWidget, SIGNAL(destroyed()), SLOT(widgetGone()) ); + connect( myWidget, TQT_SIGNAL(destroyed()), TQT_SLOT(widgetGone()) ); } void @@ -207,16 +207,16 @@ KdmItem::widgetGone() } void -KdmItem::setLayoutItem( QLayoutItem *item ) +KdmItem::setLayoutItem( TQLayoutItem *item ) { myLayoutItem = item; // XXX hiding not supported - it think it's pointless here if (myLayoutItem->widget()) - connect( myLayoutItem->widget(), SIGNAL(destroyed()), - SLOT(layoutItemGone()) ); + connect( myLayoutItem->widget(), TQT_SIGNAL(destroyed()), + TQT_SLOT(layoutItemGone()) ); else if (myLayoutItem->layout()) - connect( myLayoutItem->layout(), SIGNAL(destroyed()), - SLOT(layoutItemGone()) ); + connect( myLayoutItem->layout(), TQT_SIGNAL(destroyed()), + TQT_SLOT(layoutItemGone()) ); } void @@ -227,7 +227,7 @@ KdmItem::layoutItemGone() /* This is called as a result of KdmLayout::update, and directly on the root */ void -KdmItem::setGeometry( const QRect &newGeometry, bool force ) +KdmItem::setGeometry( const TQRect &newGeometry, bool force ) { kdDebug() << " KdmItem::setGeometry " << id << newGeometry << endl; // check if already 'in place' @@ -253,7 +253,7 @@ KdmItem::setGeometry( const QRect &newGeometry, bool force ) } void -KdmItem::paint( QPainter *p, const QRect &rect ) +KdmItem::paint( TQPainter *p, const TQRect &rect ) { if (isHidden()) return; @@ -262,7 +262,7 @@ KdmItem::paint( QPainter *p, const QRect &rect ) return; if (area.intersects( rect )) { - QRect contentsRect = area.intersect( rect ); + TQRect contentsRect = area.intersect( rect ); contentsRect.moveBy( QMIN( 0, -area.x() ), QMIN( 0, -area.y() ) ); drawContents( p, contentsRect ); } @@ -277,7 +277,7 @@ KdmItem::paint( QPainter *p, const QRect &rect ) return; // Dispatch paint events to children - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) (*it)->paint( p, rect ); } @@ -316,7 +316,7 @@ KdmItem::mouseEvent( int x, int y, bool pressed, bool released ) } if (!buttonParent) { - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) (*it)->mouseEvent( x, y, pressed, released ); } @@ -329,7 +329,7 @@ void KdmItem::statusChanged() { if (buttonParent == this) { - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) { (*it)->state = state; (*it)->statusChanged(); @@ -348,14 +348,14 @@ KdmItem::sizeHint() return myLayoutItem->sizeHint(); int w = pos.wType == DTpixel ? kAbs( pos.width ) : -1, h = pos.hType == DTpixel ? kAbs( pos.height ) : -1; - return QSize( w, h ); + return TQSize( w, h ); } QRect -KdmItem::placementHint( const QRect &parentRect ) +KdmItem::placementHint( const TQRect &parentRect ) { - QSize hintedSize = sizeHint(); - QSize boxHint; + TQSize hintedSize = sizeHint(); + TQSize boxHint; int x = parentRect.left(), y = parentRect.top(), @@ -435,7 +435,7 @@ KdmItem::placementHint( const QRect &parentRect ) x += dx; // Note: no clipping to parent because this broke many themes! - return QRect( x, y, w, h ); + return TQRect( x, y, w, h ); } // END protected inheritable @@ -457,12 +457,12 @@ KdmItem::addChildItem( KdmItem *item ) } // signal bounce from child to parent - connect( item, SIGNAL(needUpdate( int, int, int, int )), SIGNAL(needUpdate( int, int, int, int )) ); - connect( item, SIGNAL(activated( const QString & )), SIGNAL(activated( const QString & )) ); + connect( item, TQT_SIGNAL(needUpdate( int, int, int, int )), TQT_SIGNAL(needUpdate( int, int, int, int )) ); + connect( item, TQT_SIGNAL(activated( const TQString & )), TQT_SIGNAL(activated( const TQString & )) ); } void -KdmItem::parseAttribute( const QString &s, int &val, enum DataType &dType ) +KdmItem::parseAttribute( const TQString &s, int &val, enum DataType &dType ) { if (s.isEmpty()) return; @@ -473,13 +473,13 @@ KdmItem::parseAttribute( const QString &s, int &val, enum DataType &dType ) val = 0; } else if ((p = s.find( '%' )) >= 0) { // percent value dType = DTpercent; - QString sCopy = s; + TQString sCopy = s; sCopy.remove( p, 1 ); sCopy.replace( ',', '.' ); val = (int)sCopy.toDouble(); } else { // int value dType = DTpixel; - QString sCopy = s; + TQString sCopy = s; if (sCopy.at( 0 ) == '-') { sCopy.remove( 0, 1 ); dType = DTnpixel; @@ -490,7 +490,7 @@ KdmItem::parseAttribute( const QString &s, int &val, enum DataType &dType ) } void -KdmItem::parseFont( const QString &s, QFont &font ) +KdmItem::parseFont( const TQString &s, TQFont &font ) { int splitAt = s.findRev( ' ' ); if (splitAt < 1) @@ -502,19 +502,19 @@ KdmItem::parseFont( const QString &s, QFont &font ) } void -KdmItem::parseColor( const QString &s, QColor &color ) +KdmItem::parseColor( const TQString &s, TQColor &color ) { if (s.at( 0 ) != '#') return; bool ok; - QString sCopy = s; + TQString sCopy = s; int hexColor = sCopy.remove( 0, 1 ).toInt( &ok, 16 ); if (ok) color.setRgb( hexColor ); } void -KdmItem::setBoxLayout( const QDomNode &node ) +KdmItem::setBoxLayout( const TQDomNode &node ) { if (!boxManager) boxManager = new KdmLayoutBox( node ); @@ -522,7 +522,7 @@ KdmItem::setBoxLayout( const QDomNode &node ) } void -KdmItem::setFixedLayout( const QDomNode &node ) +KdmItem::setFixedLayout( const TQDomNode &node ) { if (!fixedManager) fixedManager = new KdmLayoutFixed( node ); diff --git a/kdm/kfrontend/themer/kdmitem.h b/kdm/kfrontend/themer/kdmitem.h index 66feedd02..9105f8b93 100644 --- a/kdm/kfrontend/themer/kdmitem.h +++ b/kdm/kfrontend/themer/kdmitem.h @@ -22,10 +22,10 @@ #ifndef KDMITEM_H #define KDMITEM_H -#include <qobject.h> -#include <qvaluelist.h> -#include <qrect.h> -#include <qdom.h> +#include <tqobject.h> +#include <tqvaluelist.h> +#include <tqrect.h> +#include <tqdom.h> class KdmItem; class KdmLayoutBox; @@ -80,7 +80,7 @@ class QLayoutItem; * - TODO: send a selective redraw signal also merging children's areas */ -class KdmItem : public QObject { +class KdmItem : public TQObject { Q_OBJECT friend class KdmThemer; @@ -89,7 +89,7 @@ public: /** * Item constructor and destructor */ - KdmItem( KdmItem *parent, const QDomNode &node = QDomNode(), const char *name = 0 ); + KdmItem( KdmItem *parent, const TQDomNode &node = TQDomNode(), const char *name = 0 ); virtual ~KdmItem(); /** @@ -97,14 +97,14 @@ public: * or boxed ones). Note that this will generate repaint signals * when needed. The default implementation should fit all needs. */ - virtual void setGeometry( const QRect &newGeometry, bool force ); + virtual void setGeometry( const TQRect &newGeometry, bool force ); /** * Paint the item and its children using the given painter. * This is the compositing core function. It buffers paint operations * to speed up rendering of dynamic objects. */ - void paint( QPainter *painter, const QRect &boundaries ); + void paint( TQPainter *painter, const TQRect &boundaries ); /** * Update representation of contents and repaint. @@ -124,45 +124,45 @@ public: * @param parentGeometry the geometry of the caller item or a * null rect if the geometry of the parent is not yet defined. */ - virtual QRect placementHint( const QRect &parentGeometry ); + virtual TQRect placementHint( const TQRect &parentGeometry ); /** * Create the box layout manager; next children will be * managed by the box layouter */ - void setBoxLayout( const QDomNode &node = QDomNode() ); + void setBoxLayout( const TQDomNode &node = TQDomNode() ); /** * Create the fixed layout manager; next children will be * in fixed position relative to this item */ - void setFixedLayout( const QDomNode &node = QDomNode() ); + void setFixedLayout( const TQDomNode &node = TQDomNode() ); - QString type() const { return itemType; } - void setType( const QString &t ) { itemType = t; } - void setBaseDir( const QString &bd ) { basedir = bd; } + TQString type() const { return itemType; } + void setType( const TQString &t ) { itemType = t; } + void setBaseDir( const TQString &bd ) { basedir = bd; } - QString baseDir() const + TQString baseDir() const { if (basedir.isEmpty() && parent()) return static_cast<KdmItem *>( parent()->qt_cast( "KdmItem" ) )->baseDir(); return basedir; } - KdmItem *findNode( const QString &id ) const; - virtual void setWidget( QWidget *widget ); - virtual void setLayoutItem( QLayoutItem *item ); + KdmItem *findNode( const TQString &id ) const; + virtual void setWidget( TQWidget *widget ); + virtual void setLayoutItem( TQLayoutItem *item ); virtual void hide( bool force = false ); virtual void show( bool force = false ); bool isHidden() const { return isShown != Shown; } bool isExplicitlyHidden() const { return isShown == ExplicitlyHidden; } - QRect rect() const { return area; } + TQRect rect() const { return area; } signals: void needUpdate( int x, int y, int w, int h ); - void activated( const QString &id ); + void activated( const TQString &id ); protected slots: void widgetGone(); @@ -175,7 +175,7 @@ protected: * @return (-1,-1) if no size can be determined (so it should * default to parent's size). */ - virtual QSize sizeHint(); + virtual TQSize sizeHint(); /** * Low level graphical function to paint the item. @@ -185,7 +185,7 @@ protected: * @param painter the painter to draw the item with * @param region the part of the the image to render */ - virtual void drawContents( QPainter *painter, const QRect ®ion ) = 0; + virtual void drawContents( TQPainter *painter, const TQRect ®ion ) = 0; /** * Called when item changes its 'state' variable. This must @@ -209,7 +209,7 @@ protected: } properties; // This is the placement of the item - QRect area; + TQRect area; // This struct is filled in by KdmItem base class enum DataType { DTnone, DTpixel, DTnpixel, DTpercent, DTbox }; @@ -219,7 +219,7 @@ protected: int y; int width; int height; - QString anchor; + TQString anchor; } pos; /* For internal use ONLY @@ -232,14 +232,14 @@ protected: * Parse type and value of an attribute (pos tag), a font or a * color. */ - void parseAttribute( const QString &, int &, enum DataType & ); - void parseFont( const QString &, QFont & ); - void parseColor( const QString &, QColor & ); + void parseAttribute( const TQString &, int &, enum DataType & ); + void parseFont( const TQString &, TQFont & ); + void parseColor( const TQString &, TQColor & ); void inheritFromButton( KdmItem *button ); - QString itemType, id; - QValueList<KdmItem *> m_children; + TQString itemType, id; + TQValueList<KdmItem *> m_children; // Layouting related variables enum { MNone = 0, MFixed = 1, MBox = 2 } currentManager; @@ -247,13 +247,13 @@ protected: KdmLayoutFixed *fixedManager; // Compositing related variables - QImage *image; + TQImage *image; // defines the directory the theme is in (may be present in the parent) - QString basedir; + TQString basedir; - QWidget *myWidget; - QLayoutItem *myLayoutItem; + TQWidget *myWidget; + TQLayoutItem *myLayoutItem; enum { InitialHidden, ExplicitlyHidden, Shown } isShown; diff --git a/kdm/kfrontend/themer/kdmlabel.cpp b/kdm/kfrontend/themer/kdmlabel.cpp index 41d7e4254..297b7cc48 100644 --- a/kdm/kfrontend/themer/kdmlabel.cpp +++ b/kdm/kfrontend/themer/kdmlabel.cpp @@ -27,10 +27,10 @@ #include <kmacroexpander.h> #include <kdebug.h> -#include <qdatetime.h> -#include <qpainter.h> -#include <qfontmetrics.h> -#include <qtimer.h> +#include <tqdatetime.h> +#include <tqpainter.h> +#include <tqfontmetrics.h> +#include <tqtimer.h> #include <unistd.h> #include <sys/utsname.h> @@ -38,7 +38,7 @@ # include <sys/systeminfo.h> #endif -KdmLabel::KdmLabel( KdmItem *parent, const QDomNode &node, const char *name ) +KdmLabel::KdmLabel( KdmItem *parent, const TQDomNode &node, const char *name ) : KdmItem( parent, node, name ) { itemType = "label"; @@ -49,23 +49,23 @@ KdmLabel::KdmLabel( KdmItem *parent, const QDomNode &node, const char *name ) label.prelight.present = false; label.maximumWidth = -1; - const QString locale = KGlobal::locale()->language(); + const TQString locale = KGlobal::locale()->language(); // Read LABEL ID - QDomNode n = node; - QDomElement elLab = n.toElement(); + TQDomNode n = node; + TQDomElement elLab = n.toElement(); // ID types: clock, pam-error, pam-message, pam-prompt, // pam-warning, timed-label label.id = elLab.attribute( "id", "" ); label.hasId = !(label.id).isEmpty(); // Read LABEL TAGS - QDomNodeList childList = node.childNodes(); + TQDomNodeList childList = node.childNodes(); bool stockUsed = false; for (uint nod = 0; nod < childList.count(); nod++) { - QDomNode child = childList.item( nod ); - QDomElement el = child.toElement(); - QString tagName = el.tagName(); + TQDomNode child = childList.item( nod ); + TQDomElement el = child.toElement(); + TQString tagName = el.tagName(); if (tagName == "pos") label.maximumWidth = el.attribute( "max-width", "-1" ).toInt(); @@ -83,7 +83,7 @@ KdmLabel::KdmLabel( KdmItem *parent, const QDomNode &node, const char *name ) } else if (tagName == "text" && el.attributes().count() == 0 && !stockUsed) { label.text = el.text(); } else if (tagName == "text" && !stockUsed) { - QString lang = el.attribute( "xml:lang", "" ); + TQString lang = el.attribute( "xml:lang", "" ); if (lang == locale) label.text = el.text(); } else if (tagName == "stock") { @@ -95,15 +95,15 @@ KdmLabel::KdmLabel( KdmItem *parent, const QDomNode &node, const char *name ) // Check if this is a timer label label.isTimer = label.text.find( "%c" ) >= 0; if (label.isTimer) { - timer = new QTimer( this ); + timer = new TQTimer( this ); timer->start( 1000 ); - connect( timer, SIGNAL(timeout()), SLOT(update()) ); + connect( timer, TQT_SIGNAL(timeout()), TQT_SLOT(update()) ); } cText = lookupText( label.text ); } void -KdmLabel::setText( const QString &txt ) +KdmLabel::setText( const TQString &txt ) { label.text = txt; update(); @@ -119,7 +119,7 @@ KdmLabel::sizeHint() else if (state == Sprelight && label.prelight.present) l = &label.prelight; // get the hint from font metrics - QSize hint = QFontMetrics( l->font ).size( AlignLeft | SingleLine, cText ); + TQSize hint = TQFontMetrics( l->font ).size( AlignLeft | SingleLine, cText ); // clip the result using the max-width label(pos) parameter if (label.maximumWidth > 0 && hint.width() > label.maximumWidth) hint.setWidth( label.maximumWidth ); @@ -127,7 +127,7 @@ KdmLabel::sizeHint() } void -KdmLabel::drawContents( QPainter *p, const QRect &/*r*/ ) +KdmLabel::drawContents( TQPainter *p, const TQRect &/*r*/ ) { // choose the correct label class struct LabelStruct::LabelClass *l = &label.normal; @@ -157,7 +157,7 @@ KdmLabel::statusChanged() void KdmLabel::update() { - QString text = lookupText( label.text ); + TQString text = lookupText( label.text ); if (text != cText) { cText = text; needUpdate(); @@ -186,10 +186,10 @@ static const struct { }; QString -KdmLabel::lookupStock( const QString &stock ) +KdmLabel::lookupStock( const TQString &stock ) { //FIXME add key accels! - QString type( stock.lower() ); + TQString type( stock.lower() ); for (uint i = 0; i < sizeof(stocks)/sizeof(stocks[0]); i++) if (type == stocks[i].type) @@ -200,30 +200,30 @@ KdmLabel::lookupStock( const QString &stock ) } QString -KdmLabel::lookupText( const QString &t ) +KdmLabel::lookupText( const TQString &t ) { - QString text = t; + TQString text = t; text.replace( '_', '&' ); // text.remove( '_' ); // FIXME add key accels, remove underscores for now - QMap<QChar,QString> m; + TQMap<TQChar,TQString> m; struct utsname uts; uname( &uts ); - m['n'] = QString::fromLocal8Bit( uts.nodename ); + m['n'] = TQString::fromLocal8Bit( uts.nodename ); char buf[256]; buf[sizeof(buf) - 1] = '\0'; - m['h'] = gethostname( buf, sizeof(buf) - 1 ) ? "localhost" : QString::fromLocal8Bit( buf ); + m['h'] = gethostname( buf, sizeof(buf) - 1 ) ? "localhost" : TQString::fromLocal8Bit( buf ); #ifdef HAVE_GETDOMAINNAME - m['o'] = getdomainname( buf, sizeof(buf) - 1 ) ? "localdomain" : QString::fromLocal8Bit( buf ); + m['o'] = getdomainname( buf, sizeof(buf) - 1 ) ? "localdomain" : TQString::fromLocal8Bit( buf ); #elif defined(HAVE_SYSINFO) - m['o'] = (unsigned)sysinfo( SI_SRPC_DOMAIN, buf, sizeof(buf) ) > sizeof(buf) ? "localdomain" : QString::fromLocal8Bit( buf ); + m['o'] = (unsigned)sysinfo( SI_SRPC_DOMAIN, buf, sizeof(buf) ) > sizeof(buf) ? "localdomain" : TQString::fromLocal8Bit( buf ); #endif - m['d'] = QString::number( KThemedGreeter::timedDelay ); + m['d'] = TQString::number( KThemedGreeter::timedDelay ); m['s'] = KThemedGreeter::timedUser; // xgettext:no-c-format KGlobal::locale()->setDateFormat( i18n("date format", "%a %d %B") ); - m['c'] = KGlobal::locale()->formatDateTime( QDateTime::currentDateTime(), false, false ); + m['c'] = KGlobal::locale()->formatDateTime( TQDateTime::currentDateTime(), false, false ); return KMacroExpander::expandMacros( text, m ); } diff --git a/kdm/kfrontend/themer/kdmlabel.h b/kdm/kfrontend/themer/kdmlabel.h index b80d0189a..93801d594 100644 --- a/kdm/kfrontend/themer/kdmlabel.h +++ b/kdm/kfrontend/themer/kdmlabel.h @@ -24,8 +24,8 @@ #include "kdmitem.h" -#include <qcolor.h> -#include <qfont.h> +#include <tqcolor.h> +#include <tqfont.h> class QTimer; @@ -37,45 +37,45 @@ class KdmLabel : public KdmItem { Q_OBJECT public: - KdmLabel( KdmItem *parent, const QDomNode &node, const char *name = 0 ); - void setText( const QString &txt ); + KdmLabel( KdmItem *parent, const TQDomNode &node, const char *name = 0 ); + void setText( const TQString &txt ); protected: // reimplemented; returns the minimum size of rendered text - virtual QSize sizeHint(); + virtual TQSize sizeHint(); // draw the label - virtual void drawContents( QPainter *p, const QRect &r ); + virtual void drawContents( TQPainter *p, const TQRect &r ); // handle switching between normal / active / prelight configurations virtual void statusChanged(); struct LabelStruct { - QString text; + TQString text; bool isTimer; bool hasId; - QString id; + TQString id; struct LabelClass { - QColor color; - QFont font; + TQColor color; + TQFont font; bool present; } normal, active, prelight; int maximumWidth; } label; - QTimer *timer; + TQTimer *timer; public slots: void update(); private: /* Method to lookup the caption associated with an item */ - QString lookupStock( const QString &stock ); + TQString lookupStock( const TQString &stock ); /* Lookup variables in the text */ - QString lookupText( const QString &t ); + TQString lookupText( const TQString &t ); - QString cText; + TQString cText; }; #endif diff --git a/kdm/kfrontend/themer/kdmlayout.cpp b/kdm/kfrontend/themer/kdmlayout.cpp index ed93be264..00ca693ae 100644 --- a/kdm/kfrontend/themer/kdmlayout.cpp +++ b/kdm/kfrontend/themer/kdmlayout.cpp @@ -24,16 +24,16 @@ #include <kdebug.h> -#include <qdom.h> -#include <qrect.h> +#include <tqdom.h> +#include <tqrect.h> -KdmLayoutFixed::KdmLayoutFixed( const QDomNode &/*node*/ ) +KdmLayoutFixed::KdmLayoutFixed( const TQDomNode &/*node*/ ) { //Parsing FIXED parameters on 'node' [NONE!] } void -KdmLayoutFixed::update( const QRect &parentGeometry, bool force ) +KdmLayoutFixed::update( const TQRect &parentGeometry, bool force ) { kdDebug() << "KdmLayoutFixed::update " << parentGeometry << endl; @@ -43,15 +43,15 @@ KdmLayoutFixed::update( const QRect &parentGeometry, bool force ) return; } // For each child in list I ask their hinted size and set it! - for (QValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) + for (TQValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) (*it)->setGeometry( (*it)->placementHint( parentGeometry ), force ); } -KdmLayoutBox::KdmLayoutBox( const QDomNode &node ) +KdmLayoutBox::KdmLayoutBox( const TQDomNode &node ) { //Parsing BOX parameters - QDomNode n = node; - QDomElement el = n.toElement(); + TQDomNode n = node; + TQDomElement el = n.toElement(); box.isVertical = el.attribute( "orientation", "vertical" ) != "horizontal"; box.xpadding = el.attribute( "xpadding", "0" ).toInt(); box.ypadding = el.attribute( "ypadding", "0" ).toInt(); @@ -62,7 +62,7 @@ KdmLayoutBox::KdmLayoutBox( const QDomNode &node ) } void -KdmLayoutBox::update( const QRect &parentGeometry, bool force ) +KdmLayoutBox::update( const TQRect &parentGeometry, bool force ) { kdDebug() << this << " update " << parentGeometry << endl; @@ -78,7 +78,7 @@ KdmLayoutBox::update( const QRect &parentGeometry, bool force ) // kdDebug() << this << " hintedSize " << hintedSize << endl; //XXX why was this asymmetric? it broke things big time. - QRect childrenRect = /*box.isVertical ? QRect( parentGeometry.topLeft(), hintedSize ) :*/ parentGeometry; + TQRect childrenRect = /*box.isVertical ? TQRect( parentGeometry.topLeft(), hintedSize ) :*/ parentGeometry; // Begin cutting the parent rectangle to attach children on the right place childrenRect.addCoords( box.xpadding, box.ypadding, -box.xpadding, -box.ypadding ); @@ -87,21 +87,21 @@ KdmLayoutBox::update( const QRect &parentGeometry, bool force ) // For each child in list ... if (box.homogeneous) { int ccnt = 0; - for (QValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) + for (TQValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) if (!(*it)->isExplicitlyHidden()) ccnt++; int height = (childrenRect.height() - (ccnt - 1) * box.spacing) / ccnt; int width = (childrenRect.width() - (ccnt - 1) * box.spacing) / ccnt; - for (QValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { + for (TQValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { if ((*it)->isExplicitlyHidden()) continue; if (box.isVertical) { - QRect temp( childrenRect.left(), childrenRect.top(), childrenRect.width(), height ); + TQRect temp( childrenRect.left(), childrenRect.top(), childrenRect.width(), height ); (*it)->setGeometry( temp, force ); childrenRect.setTop( childrenRect.top() + height + box.spacing ); } else { - QRect temp( childrenRect.left(), childrenRect.top(), width, childrenRect.height() ); + TQRect temp( childrenRect.left(), childrenRect.top(), width, childrenRect.height() ); kdDebug() << "placement " << *it << " " << temp << " " << (*it)->placementHint( temp ) << endl; temp = (*it)->placementHint( temp ); (*it)->setGeometry( temp, force ); @@ -109,11 +109,11 @@ KdmLayoutBox::update( const QRect &parentGeometry, bool force ) } } } else { - for (QValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { + for (TQValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { if ((*it)->isExplicitlyHidden()) continue; - QRect temp = childrenRect, itemRect; + TQRect temp = childrenRect, itemRect; if (box.isVertical) { temp.setHeight( 0 ); itemRect = (*it)->placementHint( temp ); @@ -140,8 +140,8 @@ KdmLayoutBox::sizeHint() { // Sum up area taken by children int w = 0, h = 0; - for (QValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { - QSize s = (*it)->placementHint( QRect() ).size(); + for (TQValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { + TQSize s = (*it)->placementHint( TQRect() ).size(); if (box.isVertical) { if (s.width() > w) w = s.width(); @@ -162,6 +162,6 @@ KdmLayoutBox::sizeHint() w += box.spacing * (m_children.count() - 1); // Make hint at least equal to minimum size (if set) - return QSize( w < box.minwidth ? box.minwidth : w, + return TQSize( w < box.minwidth ? box.minwidth : w, h < box.minheight ? box.minheight : h ); } diff --git a/kdm/kfrontend/themer/kdmlayout.h b/kdm/kfrontend/themer/kdmlayout.h index 2e00675fb..491b20393 100644 --- a/kdm/kfrontend/themer/kdmlayout.h +++ b/kdm/kfrontend/themer/kdmlayout.h @@ -27,8 +27,8 @@ * but can be treated like a usual widget */ -#include <qvaluelist.h> -#include <qsize.h> +#include <tqvaluelist.h> +#include <tqsize.h> class KdmItem; @@ -48,20 +48,20 @@ public: // Updates the layout of all items knowing that the parent // has the @p parentGeometry geometry -// virtual void update( const QRect &parentGeometry ) = 0; +// virtual void update( const TQRect &parentGeometry ) = 0; protected: - QValueList<KdmItem *> m_children; + TQValueList<KdmItem *> m_children; }; class KdmLayoutFixed : public KdmLayout { public: - KdmLayoutFixed( const QDomNode &node ); + KdmLayoutFixed( const TQDomNode &node ); // Updates the layout of all boxed items knowing that the parent // has the @p parentGeometry geometry - void update( const QRect &parentGeometry, bool force ); + void update( const TQRect &parentGeometry, bool force ); }; /** @@ -72,15 +72,15 @@ public: class KdmLayoutBox : public KdmLayout { public: - KdmLayoutBox( const QDomNode &node ); + KdmLayoutBox( const TQDomNode &node ); // Updates the layout of all boxed items knowing that they // should fit into @p parentGeometry container - void update( const QRect &parentGeometry, bool force ); + void update( const TQRect &parentGeometry, bool force ); // Computes the size hint of the box, telling which is the // smallest size inside which boxed items will fit - QSize sizeHint(); + TQSize sizeHint(); private: struct { @@ -92,7 +92,7 @@ private: int minheight; bool homogeneous; } box; -// QSize hintedSize; +// TQSize hintedSize; }; #endif diff --git a/kdm/kfrontend/themer/kdmpixmap.cpp b/kdm/kfrontend/themer/kdmpixmap.cpp index 337c19ced..07077e4a1 100644 --- a/kdm/kfrontend/themer/kdmpixmap.cpp +++ b/kdm/kfrontend/themer/kdmpixmap.cpp @@ -30,11 +30,11 @@ #include <kdebug.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqimage.h> -KdmPixmap::KdmPixmap( KdmItem *parent, const QDomNode &node, const char *name ) +KdmPixmap::KdmPixmap( KdmItem *parent, const TQDomNode &node, const char *name ) : KdmItem( parent, node, name ) { itemType = "pixmap"; @@ -47,15 +47,15 @@ KdmPixmap::KdmPixmap( KdmItem *parent, const QDomNode &node, const char *name ) // Read PIXMAP ID // it rarely happens that a pixmap can be a button too! - QDomNode n = node; - QDomElement elPix = n.toElement(); + TQDomNode n = node; + TQDomElement elPix = n.toElement(); // Read PIXMAP TAGS - QDomNodeList childList = node.childNodes(); + TQDomNodeList childList = node.childNodes(); for (uint nod = 0; nod < childList.count(); nod++) { - QDomNode child = childList.item( nod ); - QDomElement el = child.toElement(); - QString tagName = el.tagName(); + TQDomNode child = childList.item( nod ); + TQDomElement el = child.toElement(); + TQString tagName = el.tagName(); if (tagName == "normal") { loadPixmap( el.attribute( "file", "" ), pixmap.normal.pixmap, pixmap.normal.fullpath ); @@ -91,7 +91,7 @@ KdmPixmap::sizeHint() } void -KdmPixmap::setGeometry( const QRect &newGeometry, bool force ) +KdmPixmap::setGeometry( const TQRect &newGeometry, bool force ) { KdmItem::setGeometry( newGeometry, force ); pixmap.active.readyPixmap.resize( 0, 0 ); @@ -101,7 +101,7 @@ KdmPixmap::setGeometry( const QRect &newGeometry, bool force ) void -KdmPixmap::loadPixmap( const QString &fileName, QPixmap &map, QString &fullName ) +KdmPixmap::loadPixmap( const TQString &fileName, TQPixmap &map, TQString &fullName ) { if (fileName.isEmpty()) return; @@ -112,24 +112,24 @@ KdmPixmap::loadPixmap( const QString &fileName, QPixmap &map, QString &fullName if (!fullName.endsWith( ".svg" )) // we delay it for svgs if (!map.load( fullName )) - fullName = QString::null; + fullName = TQString::null; } void -KdmPixmap::renderSvg( PixmapStruct::PixmapClass *pClass, const QRect &area ) +KdmPixmap::renderSvg( PixmapStruct::PixmapClass *pClass, const TQRect &area ) { #ifdef HAVE_LIBART // Special stuff for SVG icons KSVGIconEngine *svgEngine = new KSVGIconEngine(); if (svgEngine->load( area.width(), area.height(), pClass->fullpath )) { - QImage *t = svgEngine->image(); + TQImage *t = svgEngine->image(); pClass->pixmap = *t; pClass->readyPixmap.resize( 0, 0 ); delete t; } else { kdWarning() << "failed to load " << pClass->fullpath << endl; - pClass->fullpath = QString::null; + pClass->fullpath = TQString::null; } delete svgEngine; @@ -140,7 +140,7 @@ KdmPixmap::renderSvg( PixmapStruct::PixmapClass *pClass, const QRect &area ) } void -KdmPixmap::drawContents( QPainter *p, const QRect &r ) +KdmPixmap::drawContents( TQPainter *p, const TQRect &r ) { // choose the correct pixmap class PixmapStruct::PixmapClass *pClass = &pixmap.normal; @@ -176,7 +176,7 @@ KdmPixmap::drawContents( QPainter *p, const QRect &r ) if (pClass->readyPixmap.isNull()) { - QImage scaledImage; + TQImage scaledImage; // use the loaded pixmap or a scaled version if needed @@ -187,7 +187,7 @@ KdmPixmap::drawContents( QPainter *p, const QRect &r ) scaledImage = pClass->pixmap.convertToImage(); } else { kdDebug() << "convertFromImage\n"; - QImage tempImage = pClass->pixmap.convertToImage(); + TQImage tempImage = pClass->pixmap.convertToImage(); scaledImage = tempImage.smoothScale( area.width(), area.height() ); } } else diff --git a/kdm/kfrontend/themer/kdmpixmap.h b/kdm/kfrontend/themer/kdmpixmap.h index eb621a0a5..479ef0f8d 100644 --- a/kdm/kfrontend/themer/kdmpixmap.h +++ b/kdm/kfrontend/themer/kdmpixmap.h @@ -24,8 +24,8 @@ #include "kdmitem.h" -//#include <qrect.h> -#include <qpixmap.h> +//#include <tqrect.h> +#include <tqpixmap.h> /* * KdmPixmap. A pixmap element @@ -35,26 +35,26 @@ class KdmPixmap : public KdmItem { Q_OBJECT public: - KdmPixmap( KdmItem *parent, const QDomNode &node, const char *name = 0 ); + KdmPixmap( KdmItem *parent, const TQDomNode &node, const char *name = 0 ); protected: // reimplemented; returns the size of loaded pixmap - virtual QSize sizeHint(); + virtual TQSize sizeHint(); // draw the pixmap - virtual void drawContents( QPainter *p, const QRect &r ); + virtual void drawContents( TQPainter *p, const TQRect &r ); // handle switching between normal / active / prelight configurations virtual void statusChanged(); - virtual void setGeometry( const QRect &newGeometry, bool force ); + virtual void setGeometry( const TQRect &newGeometry, bool force ); struct PixmapStruct { struct PixmapClass { - QString fullpath; - QPixmap pixmap; - QPixmap readyPixmap; - QColor tint; + TQString fullpath; + TQPixmap pixmap; + TQPixmap readyPixmap; + TQColor tint; float alpha; //TODO added: not in greeter.dtd bool present; } normal, active, prelight; @@ -62,8 +62,8 @@ protected: private: // Method to load the pixmap given by the theme - void loadPixmap( const QString &fileName, QPixmap &p, QString &path ); - void renderSvg( PixmapStruct::PixmapClass *pClass, const QRect &area ); + void loadPixmap( const TQString &fileName, TQPixmap &p, TQString &path ); + void renderSvg( PixmapStruct::PixmapClass *pClass, const TQRect &area ); }; #endif diff --git a/kdm/kfrontend/themer/kdmrect.cpp b/kdm/kfrontend/themer/kdmrect.cpp index 478c5c8b3..961809a37 100644 --- a/kdm/kfrontend/themer/kdmrect.cpp +++ b/kdm/kfrontend/themer/kdmrect.cpp @@ -25,12 +25,12 @@ #include <kimageeffect.h> #include <kdebug.h> -#include <qimage.h> -#include <qpainter.h> -#include <qwidget.h> -#include <qlayout.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqwidget.h> +#include <tqlayout.h> -KdmRect::KdmRect( KdmItem *parent, const QDomNode &node, const char *name ) +KdmRect::KdmRect( KdmItem *parent, const TQDomNode &node, const char *name ) : KdmItem( parent, node, name ) { itemType = "rect"; @@ -46,28 +46,28 @@ KdmRect::KdmRect( KdmItem *parent, const QDomNode &node, const char *name ) return; // Read RECT ID - QDomNode n = node; - QDomElement elRect = n.toElement(); + TQDomNode n = node; + TQDomElement elRect = n.toElement(); // Read RECT TAGS - QDomNodeList childList = node.childNodes(); + TQDomNodeList childList = node.childNodes(); for (uint nod = 0; nod < childList.count(); nod++) { - QDomNode child = childList.item( nod ); - QDomElement el = child.toElement(); - QString tagName = el.tagName(); + TQDomNode child = childList.item( nod ); + TQDomElement el = child.toElement(); + TQString tagName = el.tagName(); if (tagName == "normal") { - parseColor( el.attribute( "color", QString::null ), rect.normal.color ); + parseColor( el.attribute( "color", TQString::null ), rect.normal.color ); rect.normal.alpha = el.attribute( "alpha", "1.0" ).toFloat(); parseFont( el.attribute( "font", "Sans 14" ), rect.normal.font ); } else if (tagName == "active") { rect.active.present = true; - parseColor( el.attribute( "color", QString::null ), rect.active.color ); + parseColor( el.attribute( "color", TQString::null ), rect.active.color ); rect.active.alpha = el.attribute( "alpha", "1.0" ).toFloat(); parseFont( el.attribute( "font", "Sans 14" ), rect.active.font ); } else if (tagName == "prelight") { rect.prelight.present = true; - parseColor( el.attribute( "color", QString::null ), rect.prelight.color ); + parseColor( el.attribute( "color", TQString::null ), rect.prelight.color ); rect.prelight.alpha = el.attribute( "alpha", "1.0" ).toFloat(); parseFont( el.attribute( "font", "Sans 14" ), rect.prelight.font ); } else if (tagName == "border") @@ -76,7 +76,7 @@ KdmRect::KdmRect( KdmItem *parent, const QDomNode &node, const char *name ) } void -KdmRect::drawContents( QPainter *p, const QRect &r ) +KdmRect::drawContents( TQPainter *p, const TQRect &r ) { // choose the correct rect class RectStruct::RectClass *rClass = &rect.normal; @@ -89,13 +89,13 @@ KdmRect::drawContents( QPainter *p, const QRect &r ) return; if (rClass->alpha == 1) - p->fillRect( area, QBrush( rClass->color ) ); + p->fillRect( area, TQBrush( rClass->color ) ); else { - QRect backRect = r; + TQRect backRect = r; backRect.moveBy( area.x(), area.y() ); - QPixmap backPixmap( backRect.size() ); - bitBlt( &backPixmap, QPoint( 0, 0 ), p->device(), backRect ); - QImage backImage = backPixmap.convertToImage(); + TQPixmap backPixmap( backRect.size() ); + bitBlt( &backPixmap, TQPoint( 0, 0 ), p->device(), backRect ); + TQImage backImage = backPixmap.convertToImage(); KImageEffect::blend( rClass->color, backImage, rClass->alpha ); p->drawImage( backRect.x(), backRect.y(), backImage ); // area.moveBy(1,1); @@ -116,35 +116,35 @@ KdmRect::statusChanged() /* void -KdmRect::setAttribs( QWidget *widget ) +KdmRect::setAttribs( TQWidget *widget ) { widget->setFont( rect.normal.font ); } void -KdmRect::recursiveSetAttribs( QLayoutItem *li ) +KdmRect::recursiveSetAttribs( TQLayoutItem *li ) { - QWidget *w; - QLayout *l; + TQWidget *w; + TQLayout *l; if ((w = li->widget())) setAttribs( w ); else if ((l = li->layout())) { - QLayoutIterator it = l->iterator(); - for (QLayoutItem *itm = it.current(); itm; itm = ++it) + TQLayoutIterator it = l->iterator(); + for (TQLayoutItem *itm = it.current(); itm; itm = ++it) recursiveSetAttribs( itm ); } } void -KdmRect::setWidget( QWidget *widget ) +KdmRect::setWidget( TQWidget *widget ) { KdmItem::setWidget( widget ); setAttribs( widget ); } void -KdmRect::setLayoutItem( QLayoutItem *item ) +KdmRect::setLayoutItem( TQLayoutItem *item ) { KdmItem::setLayoutItem( item ); recursiveSetAttribs( item ); diff --git a/kdm/kfrontend/themer/kdmrect.h b/kdm/kfrontend/themer/kdmrect.h index 2e89a6a52..7e4776233 100644 --- a/kdm/kfrontend/themer/kdmrect.h +++ b/kdm/kfrontend/themer/kdmrect.h @@ -24,8 +24,8 @@ #include "kdmitem.h" -#include <qcolor.h> -#include <qfont.h> +#include <tqcolor.h> +#include <tqfont.h> /* * KdmRect: A themed rectangular element @@ -35,11 +35,11 @@ class KdmRect : public KdmItem { Q_OBJECT public: - KdmRect( KdmItem *parent, const QDomNode &node, const char *name = 0 ); + KdmRect( KdmItem *parent, const TQDomNode &node, const char *name = 0 ); protected: // draw the rect - virtual void drawContents( QPainter *p, const QRect &r ); + virtual void drawContents( TQPainter *p, const TQRect &r ); // handle switching between normal / active / prelight configurations virtual void statusChanged(); @@ -47,19 +47,19 @@ protected: struct RectStruct { struct RectClass { float alpha; - QColor color; + TQColor color; bool present; - QFont font; + TQFont font; } normal, active, prelight; bool hasBorder; } rect; -// virtual void setWidget( QWidget *widget ); -// virtual void setLayoutItem( QLayoutItem *item ); +// virtual void setWidget( TQWidget *widget ); +// virtual void setLayoutItem( TQLayoutItem *item ); private: - void setAttribs( QWidget *widget ); - void recursiveSetAttribs( QLayoutItem *item ); + void setAttribs( TQWidget *widget ); + void recursiveSetAttribs( TQLayoutItem *item ); }; #endif diff --git a/kdm/kfrontend/themer/kdmthemer.cpp b/kdm/kfrontend/themer/kdmthemer.cpp index 65eebabf4..aca43e45d 100644 --- a/kdm/kfrontend/themer/kdmthemer.cpp +++ b/kdm/kfrontend/themer/kdmthemer.cpp @@ -34,21 +34,21 @@ #include <ksimpleconfig.h> #include <kdebug.h> -#include <qfile.h> -#include <qfileinfo.h> -//#include <qtimer.h> // animation timer - TODO -#include <qobjectlist.h> -#include <qpainter.h> -#include <qwidget.h> -#include <qregion.h> +#include <tqfile.h> +#include <tqfileinfo.h> +//#include <tqtimer.h> // animation timer - TODO +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqwidget.h> +#include <tqregion.h> #include <unistd.h> /* * KdmThemer. The main theming interface */ -KdmThemer::KdmThemer( const QString &_filename, const QString &mode, QWidget *parent ) - : QObject( parent ) +KdmThemer::KdmThemer( const TQString &_filename, const TQString &mode, TQWidget *parent ) + : TQObject( parent ) , rootItem( 0 ) , backBuffer( 0 ) { @@ -56,13 +56,13 @@ KdmThemer::KdmThemer( const QString &_filename, const QString &mode, QWidget *pa m_currentMode = mode; // read the XML file and create DOM tree - QString filename = _filename; - if (!::access( QFile::encodeName( filename + "/GdmGreeterTheme.desktop" ), R_OK )) { + TQString filename = _filename; + if (!::access( TQFile::encodeName( filename + "/GdmGreeterTheme.desktop" ), R_OK )) { KSimpleConfig cfg( filename + "/GdmGreeterTheme.desktop" ); cfg.setGroup( "GdmGreeterTheme" ); filename += '/' + cfg.readEntry( "Greeter" ); } - QFile opmlFile( filename ); + TQFile opmlFile( filename ); if (!opmlFile.open( IO_ReadOnly )) { FDialog::box( widget(), errorbox, i18n( "Cannot open theme file %1" ).arg(filename) ); return; @@ -72,22 +72,22 @@ KdmThemer::KdmThemer( const QString &_filename, const QString &mode, QWidget *pa return; } // Set the root (screen) item - rootItem = new KdmRect( 0, QDomNode(), "kdm root" ); - connect( rootItem, SIGNAL(needUpdate( int, int, int, int )), - widget(), SLOT(update( int, int, int, int )) ); + rootItem = new KdmRect( 0, TQDomNode(), "kdm root" ); + connect( rootItem, TQT_SIGNAL(needUpdate( int, int, int, int )), + widget(), TQT_SLOT(update( int, int, int, int )) ); - rootItem->setBaseDir( QFileInfo( filename ).dirPath( true ) ); + rootItem->setBaseDir( TQFileInfo( filename ).dirPath( true ) ); // generate all the items defined in the theme generateItems( rootItem ); - connect( rootItem, SIGNAL(activated( const QString & )), SIGNAL(activated( const QString & )) ); + connect( rootItem, TQT_SIGNAL(activated( const TQString & )), TQT_SIGNAL(activated( const TQString & )) ); /* *TODO* // Animation timer - QTimer *time = new QTimer( this ); + TQTimer *time = new TQTimer( this ); time->start( 500 ); - connect( time, SIGNAL(timeout()), SLOT(update()) ) + connect( time, TQT_SIGNAL(timeout()), TQT_SLOT(update()) ) */ } @@ -97,14 +97,14 @@ KdmThemer::~KdmThemer() delete backBuffer; } -inline QWidget * +inline TQWidget * KdmThemer::widget() { - return static_cast<QWidget *>(parent()); + return static_cast<TQWidget *>(parent()); } KdmItem * -KdmThemer::findNode( const QString &item ) const +KdmThemer::findNode( const TQString &item ) const { return rootItem->findNode( item ); } @@ -112,53 +112,53 @@ KdmThemer::findNode( const QString &item ) const void KdmThemer::updateGeometry( bool force ) { - rootItem->setGeometry( QRect( QPoint(), widget()->size() ), force ); + rootItem->setGeometry( TQRect( TQPoint(), widget()->size() ), force ); } // BEGIN other functions void -KdmThemer::widgetEvent( QEvent *e ) +KdmThemer::widgetEvent( TQEvent *e ) { if (!rootItem) return; switch (e->type()) { - case QEvent::MouseMove: + case TQEvent::MouseMove: { - QMouseEvent *me = static_cast<QMouseEvent *>(e); + TQMouseEvent *me = static_cast<TQMouseEvent *>(e); rootItem->mouseEvent( me->x(), me->y() ); } break; - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: { - QMouseEvent *me = static_cast<QMouseEvent *>(e); + TQMouseEvent *me = static_cast<TQMouseEvent *>(e); rootItem->mouseEvent( me->x(), me->y(), true ); } break; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: { - QMouseEvent *me = static_cast<QMouseEvent *>(e); + TQMouseEvent *me = static_cast<TQMouseEvent *>(e); rootItem->mouseEvent( me->x(), me->y(), false, true ); } break; - case QEvent::Show: + case TQEvent::Show: rootItem->show(); break; - case QEvent::Resize: + case TQEvent::Resize: updateGeometry( false ); showStructure( rootItem ); break; - case QEvent::Paint: + case TQEvent::Paint: { - QRect paintRect = static_cast<QPaintEvent *>(e)->rect(); + TQRect paintRect = static_cast<TQPaintEvent *>(e)->rect(); kdDebug() << "paint on: " << paintRect << endl; if (!backBuffer) - backBuffer = new QPixmap( widget()->size() ); + backBuffer = new TQPixmap( widget()->size() ); if (backBuffer->size() != widget()->size()) backBuffer->resize( widget()->size() ); - QPainter p; + TQPainter p; p.begin( backBuffer ); rootItem->paint( &p, paintRect ); p.end(); @@ -173,25 +173,25 @@ KdmThemer::widgetEvent( QEvent *e ) /* void -KdmThemer::pixmap( const QRect &r, QPixmap *px ) +KdmThemer::pixmap( const TQRect &r, TQPixmap *px ) { - bitBlt( px, QPoint( 0, 0 ), widget(), r ); + bitBlt( px, TQPoint( 0, 0 ), widget(), r ); } */ void -KdmThemer::generateItems( KdmItem *parent, const QDomNode &node ) +KdmThemer::generateItems( KdmItem *parent, const TQDomNode &node ) { if (!parent) return; - QDomNodeList subnodeList; //List of subnodes of this node + TQDomNodeList subnodeList; //List of subnodes of this node /* * Get the child nodes */ if (node.isNull()) { // It's the first node, get its child nodes - QDomElement theme = domTree.documentElement(); + TQDomElement theme = domTree.documentElement(); // Get its tag, and check it's correct ("greeter") if (theme.tagName() != "greeter") { @@ -207,15 +207,15 @@ KdmThemer::generateItems( KdmItem *parent, const QDomNode &node ) * Go through each of the child nodes */ for (uint nod = 0; nod < subnodeList.count(); nod++) { - QDomNode subnode = subnodeList.item( nod ); - QDomElement el = subnode.toElement(); - QString tagName = el.tagName(); + TQDomNode subnode = subnodeList.item( nod ); + TQDomElement el = subnode.toElement(); + TQString tagName = el.tagName(); if (tagName == "item") { if (!willDisplay( subnode )) continue; // It's a new item. Draw it - QString type = el.attribute( "type" ); + TQString type = el.attribute( "type" ); KdmItem *newItem = 0; @@ -255,26 +255,26 @@ KdmThemer::generateItems( KdmItem *parent, const QDomNode &node ) } } -bool KdmThemer::willDisplay( const QDomNode &node ) +bool KdmThemer::willDisplay( const TQDomNode &node ) { - QDomNode showNode = node.namedItem( "show" ); + TQDomNode showNode = node.namedItem( "show" ); // No "show" node means this item can be displayed at all times if (showNode.isNull()) return true; - QDomElement el = showNode.toElement(); + TQDomElement el = showNode.toElement(); - QString modes = el.attribute( "modes" ); + TQString modes = el.attribute( "modes" ); if (!modes.isNull()) { - QStringList modeList = QStringList::split( ",", modes ); + TQStringList modeList = TQStringList::split( ",", modes ); // If current mode isn't in this list, do not display item if (modeList.find( m_currentMode ) == modeList.end()) return false; } - QString type = el.attribute( "type" ); + TQString type = el.attribute( "type" ); if (type == "config" || type == "suspend") return false; // not implemented (yet) if (type == "timed") @@ -295,21 +295,21 @@ bool KdmThemer::willDisplay( const QDomNode &node ) } void -KdmThemer::showStructure( QObject *obj ) +KdmThemer::showStructure( TQObject *obj ) { - const QObjectList *wlist = obj->children(); + const TQObjectList *wlist = obj->children(); static int counter = 0; if (counter == 0) kdDebug() << "\n\n<======= Widget tree =================" << endl; if (wlist) { counter++; - QObjectListIterator it( *wlist ); - QObject *object; + TQObjectListIterator it( *wlist ); + TQObject *object; while ((object = it.current()) != 0) { ++it; - QString node; + TQString node; for (int i = 1; i < counter; i++) node += "-"; diff --git a/kdm/kfrontend/themer/kdmthemer.h b/kdm/kfrontend/themer/kdmthemer.h index 34baffbb7..cd93c3c8c 100644 --- a/kdm/kfrontend/themer/kdmthemer.h +++ b/kdm/kfrontend/themer/kdmthemer.h @@ -22,8 +22,8 @@ #ifndef KDMTHEMER_H #define KDMTHEMER_H -#include <qobject.h> -#include <qdom.h> +#include <tqobject.h> +#include <tqdom.h> class KdmThemer; class KdmItem; @@ -47,7 +47,7 @@ class QEvent; */ -class KdmThemer : public QObject { +class KdmThemer : public TQObject { Q_OBJECT public: @@ -55,41 +55,41 @@ public: * Construct and destruct the interface */ - KdmThemer( const QString &path, const QString &mode, QWidget *parent ); + KdmThemer( const TQString &path, const TQString &mode, TQWidget *parent ); ~KdmThemer(); bool isOK() { return rootItem != 0; } /* * Gives a sizeHint to the widget (parent size) */ - //QSize sizeHint() const{ return parentWidget()->size(); } + //TQSize sizeHint() const{ return parentWidget()->size(); } /* * Takes a shot of the current widget */ -// void pixmap( const QRect &r, QPixmap *px ); +// void pixmap( const TQRect &r, TQPixmap *px ); virtual // just to put the reference in the vmt - KdmItem *findNode( const QString & ) const; + KdmItem *findNode( const TQString & ) const; void updateGeometry( bool force ); // force = true for external calls // must be called by parent widget - void widgetEvent( QEvent *e ); + void widgetEvent( TQEvent *e ); signals: - void activated( const QString &id ); + void activated( const TQString &id ); private: /* * Our display mode (e.g. console, remote, ...) */ - QString m_currentMode; + TQString m_currentMode; /* * The config file being used */ - QDomDocument domTree; + TQDomDocument domTree; /* * Stores the root of the theme @@ -99,24 +99,24 @@ private: /* * The backbuffer */ - QPixmap *backBuffer; + TQPixmap *backBuffer; // methods /* * Test whether item needs to be displayed */ - bool willDisplay( const QDomNode &node ); + bool willDisplay( const TQDomNode &node ); /* * Parses the XML file looking for the * item list and adds those to the themer */ - void generateItems( KdmItem *parent = 0, const QDomNode &node = QDomNode() ); + void generateItems( KdmItem *parent = 0, const TQDomNode &node = TQDomNode() ); - void showStructure( QObject *obj ); + void showStructure( TQObject *obj ); - QWidget *widget(); + TQWidget *widget(); }; |