diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
commit | c663b6440964f6ac48027143ac9e63298991f9d0 (patch) | |
tree | 6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /kwin/kcmkwin/kwindecoration | |
parent | a061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff) | |
download | tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwin/kcmkwin/kwindecoration')
-rw-r--r-- | kwin/kcmkwin/kwindecoration/buttons.cpp | 208 | ||||
-rw-r--r-- | kwin/kcmkwin/kwindecoration/buttons.h | 90 | ||||
-rw-r--r-- | kwin/kcmkwin/kwindecoration/kwindecoration.cpp | 174 | ||||
-rw-r--r-- | kwin/kcmkwin/kwindecoration/kwindecoration.h | 48 | ||||
-rw-r--r-- | kwin/kcmkwin/kwindecoration/preview.cpp | 84 | ||||
-rw-r--r-- | kwin/kcmkwin/kwindecoration/preview.h | 46 |
6 files changed, 325 insertions, 325 deletions
diff --git a/kwin/kcmkwin/kwindecoration/buttons.cpp b/kwin/kcmkwin/kwindecoration/buttons.cpp index 888e092e7..5d1d96d85 100644 --- a/kwin/kcmkwin/kwindecoration/buttons.cpp +++ b/kwin/kcmkwin/kwindecoration/buttons.cpp @@ -28,11 +28,11 @@ */ -#include <qheader.h> -#include <qpainter.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qstyle.h> +#include <tqheader.h> +#include <tqpainter.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqstyle.h> #include <kdebug.h> @@ -47,11 +47,11 @@ #define BUTTONDRAGMIMETYPE "application/x-kde_kwindecoration_buttons" -ButtonDrag::ButtonDrag( Button btn, QWidget* parent, const char* name) - : QStoredDrag( BUTTONDRAGMIMETYPE, parent, name) +ButtonDrag::ButtonDrag( Button btn, TQWidget* parent, const char* name) + : TQStoredDrag( BUTTONDRAGMIMETYPE, parent, name) { - QByteArray data; - QDataStream stream(data, IO_WriteOnly); + TQByteArray data; + TQDataStream stream(data, IO_WriteOnly); stream << btn.name; stream << btn.icon; stream << btn.type.unicode(); @@ -61,23 +61,23 @@ ButtonDrag::ButtonDrag( Button btn, QWidget* parent, const char* name) } -bool ButtonDrag::canDecode( QDropEvent* e ) +bool ButtonDrag::canDecode( TQDropEvent* e ) { return e->provides( BUTTONDRAGMIMETYPE ); } -bool ButtonDrag::decode( QDropEvent* e, Button& btn ) +bool ButtonDrag::decode( TQDropEvent* e, Button& btn ) { - QByteArray data = e->data( BUTTONDRAGMIMETYPE ); + TQByteArray data = e->data( BUTTONDRAGMIMETYPE ); if ( data.size() ) { e->accept(); - QDataStream stream(data, IO_ReadOnly); + TQDataStream stream(data, IO_ReadOnly); stream >> btn.name; stream >> btn.icon; ushort type; stream >> type; - btn.type = QChar(type); + btn.type = TQChar(type); int duplicate; stream >> duplicate; btn.duplicate = duplicate; @@ -94,7 +94,7 @@ Button::Button() { } -Button::Button(const QString& n, const QBitmap& i, QChar t, bool d, bool s) +Button::Button(const TQString& n, const TQBitmap& i, TQChar t, bool d, bool s) : name(n), icon(i), type(t), @@ -108,11 +108,11 @@ Button::~Button() } // helper function to deal with the Button's bitmaps more easily... -QPixmap bitmapPixmap(const QBitmap& bm, const QColor& color) +TQPixmap bitmapPixmap(const TQBitmap& bm, const TQColor& color) { - QPixmap pm(bm.size() ); + TQPixmap pm(bm.size() ); pm.setMask(bm); - QPainter p(&pm); + TQPainter p(&pm); p.setPen(color); p.drawPixmap(0,0,bm); p.end(); @@ -120,12 +120,12 @@ QPixmap bitmapPixmap(const QBitmap& bm, const QColor& color) } -ButtonSource::ButtonSource(QWidget *parent, const char* name) +ButtonSource::ButtonSource(TQWidget *parent, const char* name) : KListView(parent, name) { - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); - setResizeMode(QListView::AllColumns); + setResizeMode(TQListView::AllColumns); setDragEnabled(true); setAcceptDrops(true); setDropVisualizer(false); @@ -140,20 +140,20 @@ ButtonSource::~ButtonSource() { } -QSize ButtonSource::sizeHint() const +TQSize ButtonSource::sizeHint() const { - // make the sizeHint height a bit smaller than the one of QListView... + // make the sizeHint height a bit smaller than the one of TQListView... if ( cachedSizeHint().isValid() ) return cachedSizeHint(); constPolish(); - QSize s( header()->sizeHint() ); + TQSize s( header()->sizeHint() ); if ( verticalScrollBar()->isVisible() ) - s.setWidth( s.width() + style().pixelMetric(QStyle::PM_ScrollBarExtent) ); - s += QSize(frameWidth()*2,frameWidth()*2); + s.setWidth( s.width() + style().pixelMetric(TQStyle::PM_ScrollBarExtent) ); + s += TQSize(frameWidth()*2,frameWidth()*2); // size hint: 4 lines of text... s.setHeight( s.height() + fontMetrics().lineSpacing()*3 ); @@ -165,7 +165,7 @@ QSize ButtonSource::sizeHint() const void ButtonSource::hideAllButtons() { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); while (it.current() ) { it.current()->setVisible(false); ++it; @@ -174,16 +174,16 @@ void ButtonSource::hideAllButtons() void ButtonSource::showAllButtons() { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); while (it.current() ) { it.current()->setVisible(true); ++it; } } -void ButtonSource::showButton( QChar btn ) +void ButtonSource::showButton( TQChar btn ) { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); while (it.current() ) { ButtonSourceItem *item = dynamic_cast<ButtonSourceItem*>(it.current() ); if (item && item->button().type == btn) { @@ -194,9 +194,9 @@ void ButtonSource::showButton( QChar btn ) } } -void ButtonSource::hideButton( QChar btn ) +void ButtonSource::hideButton( TQChar btn ) { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); while (it.current() ) { ButtonSourceItem *item = dynamic_cast<ButtonSourceItem*>(it.current() ); if (item && item->button().type == btn && !item->button().duplicate) { @@ -207,12 +207,12 @@ void ButtonSource::hideButton( QChar btn ) } } -bool ButtonSource::acceptDrag(QDropEvent* e) const +bool ButtonSource::acceptDrag(TQDropEvent* e) const { return acceptDrops() && ButtonDrag::canDecode(e); } -QDragObject *ButtonSource::dragObject() +TQDragObject *ButtonSource::dragObject() { ButtonSourceItem *i = dynamic_cast<ButtonSourceItem*>(selectedItem() ); @@ -251,20 +251,20 @@ int ButtonDropSiteItem::height() return 20; } -void ButtonDropSiteItem::draw(QPainter *p, const QColorGroup& cg, QRect r) +void ButtonDropSiteItem::draw(TQPainter *p, const TQColorGroup& cg, TQRect r) { // p->fillRect(r, cg.base() ); if (m_button.supported) p->setPen(cg.foreground() ); else p->setPen(cg.mid() ); - QBitmap &i = m_button.icon; + TQBitmap &i = m_button.icon; p->drawPixmap(r.left()+(r.width()-i.width())/2, r.top()+(r.height()-i.height())/2, i); } -ButtonDropSite::ButtonDropSite( QWidget* parent, const char* name ) - : QFrame( parent, name ), +ButtonDropSite::ButtonDropSite( TQWidget* parent, const char* name ) + : TQFrame( parent, name ), m_selected(0) { setAcceptDrops( TRUE ); @@ -303,14 +303,14 @@ void ButtonDropSite::clearRight() } } -void ButtonDropSite::dragMoveEvent( QDragMoveEvent* e ) +void ButtonDropSite::dragMoveEvent( TQDragMoveEvent* e ) { - QPoint p = e->pos(); + TQPoint p = e->pos(); if (leftDropArea().contains(p) || rightDropArea().contains(p) || buttonAt(p) ) { e->accept(); // 2 pixel wide drop visualizer... - QRect r = contentsRect(); + TQRect r = contentsRect(); int x = -1; if (leftDropArea().contains(p) ) { x = leftDropArea().left(); @@ -327,7 +327,7 @@ void ButtonDropSite::dragMoveEvent( QDragMoveEvent* e ) } } if (x != -1) { - QRect tmpRect(x, r.y(), 2, r.height() ); + TQRect tmpRect(x, r.y(), 2, r.height() ); if (tmpRect != m_oldDropVisualizer) { cleanDropVisualizer(); m_oldDropVisualizer = tmpRect; @@ -346,28 +346,28 @@ void ButtonDropSite::cleanDropVisualizer() { if (m_oldDropVisualizer.isValid()) { - QRect rect = m_oldDropVisualizer; - m_oldDropVisualizer = QRect(); // rect is invalid + TQRect rect = m_oldDropVisualizer; + m_oldDropVisualizer = TQRect(); // rect is invalid update(rect); } } -void ButtonDropSite::dragEnterEvent( QDragEnterEvent* e ) +void ButtonDropSite::dragEnterEvent( TQDragEnterEvent* e ) { if ( ButtonDrag::canDecode( e ) ) e->accept(); } -void ButtonDropSite::dragLeaveEvent( QDragLeaveEvent* /* e */ ) +void ButtonDropSite::dragLeaveEvent( TQDragLeaveEvent* /* e */ ) { cleanDropVisualizer(); } -void ButtonDropSite::dropEvent( QDropEvent* e ) +void ButtonDropSite::dropEvent( TQDropEvent* e ) { cleanDropVisualizer(); - QPoint p = e->pos(); + TQPoint p = e->pos(); // collect information where to insert the dropped button ButtonList *buttonList = 0; @@ -393,7 +393,7 @@ void ButtonDropSite::dropEvent( QDropEvent* e ) // got the list and the aboveItem position. now determine if the item should be inserted // before aboveItem or after aboveItem. - QRect aboveItemRect = aboveItem->rect; + TQRect aboveItemRect = aboveItem->rect; if (!aboveItemRect.isValid() ) return; @@ -463,25 +463,25 @@ bool ButtonDropSite::getItemIterator(ButtonDropSiteItem *item, ButtonList* &list return true; } -QRect ButtonDropSite::leftDropArea() +TQRect ButtonDropSite::leftDropArea() { // return a 10 pixel drop area... - QRect r = contentsRect(); + TQRect r = contentsRect(); int leftButtonsWidth = calcButtonListWidth(buttonsLeft); - return QRect(r.left()+leftButtonsWidth, r.top(), 10, r.height() ); + return TQRect(r.left()+leftButtonsWidth, r.top(), 10, r.height() ); } -QRect ButtonDropSite::rightDropArea() +TQRect ButtonDropSite::rightDropArea() { // return a 10 pixel drop area... - QRect r = contentsRect(); + TQRect r = contentsRect(); int rightButtonsWidth = calcButtonListWidth(buttonsRight); - return QRect(r.right()-rightButtonsWidth-10, r.top(), 10, r.height() ); + return TQRect(r.right()-rightButtonsWidth-10, r.top(), 10, r.height() ); } -void ButtonDropSite::mousePressEvent( QMouseEvent* e ) +void ButtonDropSite::mousePressEvent( TQMouseEvent* e ) { // TODO: only start the real drag after some drag distance m_selected = buttonAt(e->pos() ); @@ -492,20 +492,20 @@ void ButtonDropSite::mousePressEvent( QMouseEvent* e ) } } -void ButtonDropSite::resizeEvent(QResizeEvent*) +void ButtonDropSite::resizeEvent(TQResizeEvent*) { recalcItemGeometry(); } void ButtonDropSite::recalcItemGeometry() { - QRect r = contentsRect(); + TQRect r = contentsRect(); // update the geometry of the items in the left button list int offset = r.left(); for (ButtonList::const_iterator it = buttonsLeft.begin(); it != buttonsLeft.end(); ++it) { int w = (*it)->width(); - (*it)->rect = QRect(offset, r.top(), w, (*it)->height() ); + (*it)->rect = TQRect(offset, r.top(), w, (*it)->height() ); offset += w; } @@ -513,12 +513,12 @@ void ButtonDropSite::recalcItemGeometry() offset = r.right() - calcButtonListWidth(buttonsRight); for (ButtonList::const_iterator it = buttonsRight.begin(); it != buttonsRight.end(); ++it) { int w = (*it)->width(); - (*it)->rect = QRect(offset, r.top(), w, (*it)->height() ); + (*it)->rect = TQRect(offset, r.top(), w, (*it)->height() ); offset += w; } } -ButtonDropSiteItem *ButtonDropSite::buttonAt(QPoint p) { +ButtonDropSiteItem *ButtonDropSite::buttonAt(TQPoint p) { // try to find the item in the left button list for (ButtonList::const_iterator it = buttonsLeft.begin(); it != buttonsLeft.end(); ++it) { if ( (*it)->rect.contains(p) ) { @@ -578,10 +578,10 @@ bool ButtonDropSite::removeSelectedButton() return succ; } -void ButtonDropSite::drawButtonList(QPainter *p, const ButtonList& btns, int offset) +void ButtonDropSite::drawButtonList(TQPainter *p, const ButtonList& btns, int offset) { for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { - QRect itemRect = (*it)->rect; + TQRect itemRect = (*it)->rect; if (itemRect.isValid() ) { (*it)->draw(p, colorGroup(), itemRect); } @@ -589,13 +589,13 @@ void ButtonDropSite::drawButtonList(QPainter *p, const ButtonList& btns, int off } } -void ButtonDropSite::drawContents( QPainter* p ) +void ButtonDropSite::drawContents( TQPainter* p ) { int leftoffset = calcButtonListWidth( buttonsLeft ); int rightoffset = calcButtonListWidth( buttonsRight ); int offset = 3; - QRect r = contentsRect(); + TQRect r = contentsRect(); // Shrink by 1 r.moveBy(1 + leftoffset, 1); @@ -604,10 +604,10 @@ void ButtonDropSite::drawContents( QPainter* p ) drawButtonList( p, buttonsLeft, offset ); - QColor c1( 0x0A, 0x5F, 0x89 ); // KDE 2 titlebar default colour + TQColor c1( 0x0A, 0x5F, 0x89 ); // KDE 2 titlebar default colour p->fillRect( r, c1 ); p->setPen( Qt::white ); - p->setFont( QFont( KGlobalSettings::generalFont().family(), 12, QFont::Bold) ); + p->setFont( TQFont( KGlobalSettings::generalFont().family(), 12, TQFont::Bold) ); p->drawText( r, AlignLeft | AlignVCenter, i18n("KDE") ); offset = geometry().width() - 3 - rightoffset; @@ -619,8 +619,8 @@ void ButtonDropSite::drawContents( QPainter* p ) } } -ButtonSourceItem::ButtonSourceItem(QListView * parent, const Button& btn) - : QListViewItem(parent), +ButtonSourceItem::ButtonSourceItem(TQListView * parent, const Button& btn) + : TQListViewItem(parent), m_button(btn), m_dirty(true) { @@ -631,7 +631,7 @@ ButtonSourceItem::~ButtonSourceItem() { } -void ButtonSourceItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) +void ButtonSourceItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { // we need the color group cg, so to the work here, not in setButton... if (m_dirty) { @@ -644,12 +644,12 @@ void ButtonSourceItem::paintCell(QPainter *p, const QColorGroup &cg, int column, } if (m_button.supported) { - QListViewItem::paintCell(p,cg,column,width,align); + TQListViewItem::paintCell(p,cg,column,width,align); } else { // grey out unsupported buttons - QColorGroup cg2 = cg; - cg2.setColor(QColorGroup::Text, cg.mid() ); - QListViewItem::paintCell(p,cg2,column,width,align); + TQColorGroup cg2 = cg; + cg2.setColor(TQColorGroup::Text, cg.mid() ); + TQListViewItem::paintCell(p,cg2,column,width,align); } } @@ -670,16 +670,16 @@ Button ButtonSourceItem::button() const } -ButtonPositionWidget::ButtonPositionWidget(QWidget *parent, const char* name) - : QWidget(parent,name), +ButtonPositionWidget::ButtonPositionWidget(TQWidget *parent, const char* name) + : TQWidget(parent,name), m_factory(0) { - QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); + TQVBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint() ); + setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Maximum); - QLabel* label = new QLabel( this ); + TQLabel* label = new TQLabel( this ); m_dropSite = new ButtonDropSite( this ); - label->setAlignment( int( QLabel::WordBreak ) ); + label->setAlignment( int( TQLabel::WordBreak ) ); label->setText( i18n( "To add or remove titlebar buttons, simply <i>drag</i> items " "between the available item list and the titlebar preview. Similarly, " "drag items within the titlebar preview to re-position them.") ); @@ -689,11 +689,11 @@ ButtonPositionWidget::ButtonPositionWidget(QWidget *parent, const char* name) layout->addWidget(m_dropSite); layout->addWidget(m_buttonSource); - connect( m_dropSite, SIGNAL(buttonAdded(QChar)), m_buttonSource, SLOT(hideButton(QChar)) ); - connect( m_dropSite, SIGNAL(buttonRemoved(QChar)), m_buttonSource, SLOT(showButton(QChar)) ); - connect( m_buttonSource, SIGNAL(dropped(QDropEvent*, QListViewItem*)), m_dropSite, SLOT(removeSelectedButton()) ); + connect( m_dropSite, TQT_SIGNAL(buttonAdded(TQChar)), m_buttonSource, TQT_SLOT(hideButton(TQChar)) ); + connect( m_dropSite, TQT_SIGNAL(buttonRemoved(TQChar)), m_buttonSource, TQT_SLOT(showButton(TQChar)) ); + connect( m_buttonSource, TQT_SIGNAL(dropped(TQDropEvent*, TQListViewItem*)), m_dropSite, TQT_SLOT(removeSelectedButton()) ); - connect( m_dropSite, SIGNAL(changed()), SIGNAL(changed()) ); + connect( m_dropSite, TQT_SIGNAL(changed()), TQT_SIGNAL(changed()) ); // insert all possible buttons into the source (backwards to keep the preferred order...) bool dummy; @@ -723,7 +723,7 @@ void ButtonPositionWidget::setDecorationFactory(KDecorationFactory *factory) // get the list of supported buttons if (m_factory->supports(KDecorationDefines::AbilityAnnounceButtons) ) { - QString supportedButtons; + TQString supportedButtons; if (m_factory->supports(KDecorationDefines::AbilityButtonMenu) ) supportedButtons.append('M'); @@ -756,7 +756,7 @@ void ButtonPositionWidget::setDecorationFactory(KDecorationFactory *factory) // update the button lists... // 1. set status on the source items... - QListViewItemIterator it(m_buttonSource); + TQListViewItemIterator it(m_buttonSource); while (it.current() ) { ButtonSourceItem *i = dynamic_cast<ButtonSourceItem*>(it.current() ); if (i) { @@ -771,51 +771,51 @@ void ButtonPositionWidget::setDecorationFactory(KDecorationFactory *factory) setButtonsRight(buttonsRight() ); } -Button ButtonPositionWidget::getButton(QChar type, bool& success) { +Button ButtonPositionWidget::getButton(TQChar type, bool& success) { success = true; if (type == 'R') { - QBitmap bmp(resize_width, resize_height, resize_bits, true); + TQBitmap bmp(resize_width, resize_height, resize_bits, true); bmp.setMask(bmp); return Button(i18n("Resize"), bmp, 'R', false, m_supportedButtons.contains('R') ); } else if (type == 'L') { - QBitmap bmp(shade_width, shade_height, shade_bits, true); + TQBitmap bmp(shade_width, shade_height, shade_bits, true); bmp.setMask(bmp); return Button(i18n("Shade"), bmp, 'L', false, m_supportedButtons.contains('L') ); } else if (type == 'B') { - QBitmap bmp(keepbelowothers_width, keepbelowothers_height, keepbelowothers_bits, true); + TQBitmap bmp(keepbelowothers_width, keepbelowothers_height, keepbelowothers_bits, true); bmp.setMask(bmp); return Button(i18n("Keep Below Others"), bmp, 'B', false, m_supportedButtons.contains('B') ); } else if (type == 'F') { - QBitmap bmp(keepaboveothers_width, keepaboveothers_height, keepaboveothers_bits, true); + TQBitmap bmp(keepaboveothers_width, keepaboveothers_height, keepaboveothers_bits, true); bmp.setMask(bmp); return Button(i18n("Keep Above Others"), bmp, 'F', false, m_supportedButtons.contains('F') ); } else if (type == 'X') { - QBitmap bmp(close_width, close_height, close_bits, true); + TQBitmap bmp(close_width, close_height, close_bits, true); bmp.setMask(bmp); return Button(i18n("Close"), bmp, 'X', false, m_supportedButtons.contains('X') ); } else if (type == 'A') { - QBitmap bmp(maximize_width, maximize_height, maximize_bits, true); + TQBitmap bmp(maximize_width, maximize_height, maximize_bits, true); bmp.setMask(bmp); return Button(i18n("Maximize"), bmp, 'A', false, m_supportedButtons.contains('A') ); } else if (type == 'I') { - QBitmap bmp(minimize_width, minimize_height, minimize_bits, true); + TQBitmap bmp(minimize_width, minimize_height, minimize_bits, true); bmp.setMask(bmp); return Button(i18n("Minimize"), bmp, 'I', false, m_supportedButtons.contains('I') ); } else if (type == 'H') { - QBitmap bmp(help_width, help_height, help_bits, true); + TQBitmap bmp(help_width, help_height, help_bits, true); bmp.setMask(bmp); return Button(i18n("Help"), bmp, 'H', false, m_supportedButtons.contains('H') ); } else if (type == 'S') { - QBitmap bmp(onalldesktops_width, onalldesktops_height, onalldesktops_bits, true); + TQBitmap bmp(onalldesktops_width, onalldesktops_height, onalldesktops_bits, true); bmp.setMask(bmp); return Button(i18n("On All Desktops"), bmp, 'S', false, m_supportedButtons.contains('S') ); } else if (type == 'M') { - QBitmap bmp(menu_width, menu_height, menu_bits, true); + TQBitmap bmp(menu_width, menu_height, menu_bits, true); bmp.setMask(bmp); return Button(i18n("Menu"), bmp, 'M', false, m_supportedButtons.contains('M') ); } else if (type == '_') { - QBitmap bmp(spacer_width, spacer_height, spacer_bits, true); + TQBitmap bmp(spacer_width, spacer_height, spacer_bits, true); bmp.setMask(bmp); return Button(i18n("--- spacer ---"), bmp, '_', true, m_supportedButtons.contains('_') ); } else { @@ -824,27 +824,27 @@ Button ButtonPositionWidget::getButton(QChar type, bool& success) { } } -QString ButtonPositionWidget::buttonsLeft() const +TQString ButtonPositionWidget::buttonsLeft() const { ButtonList btns = m_dropSite->buttonsLeft; - QString btnString = ""; + TQString btnString = ""; for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { btnString.append( (*it)->button().type ); } return btnString; } -QString ButtonPositionWidget::buttonsRight() const +TQString ButtonPositionWidget::buttonsRight() const { ButtonList btns = m_dropSite->buttonsRight; - QString btnString = ""; + TQString btnString = ""; for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { btnString.append( (*it)->button().type ); } return btnString; } -void ButtonPositionWidget::setButtonsLeft(const QString &buttons) +void ButtonPositionWidget::setButtonsLeft(const TQString &buttons) { // to keep the button lists consistent, first remove all left buttons, then add buttons again... m_dropSite->clearLeft(); @@ -861,7 +861,7 @@ void ButtonPositionWidget::setButtonsLeft(const QString &buttons) m_dropSite->update(); } -void ButtonPositionWidget::setButtonsRight(const QString &buttons) +void ButtonPositionWidget::setButtonsRight(const TQString &buttons) { // to keep the button lists consistent, first remove all left buttons, then add buttons again... m_dropSite->clearRight(); diff --git a/kwin/kcmkwin/kwindecoration/buttons.h b/kwin/kcmkwin/kwindecoration/buttons.h index a3db6266e..0fcbff085 100644 --- a/kwin/kcmkwin/kwindecoration/buttons.h +++ b/kwin/kcmkwin/kwindecoration/buttons.h @@ -31,10 +31,10 @@ #ifndef __BUTTONS_H_ #define __BUTTONS_H_ -#include <qbitmap.h> -#include <qevent.h> -#include <qdragobject.h> -#include <qlistbox.h> +#include <tqbitmap.h> +#include <tqevent.h> +#include <tqdragobject.h> +#include <tqlistbox.h> #include <klistview.h> @@ -47,12 +47,12 @@ class Button { public: Button(); - Button(const QString& name, const QBitmap& icon, QChar type, bool duplicate, bool supported); + Button(const TQString& name, const TQBitmap& icon, TQChar type, bool duplicate, bool supported); virtual ~Button(); - QString name; - QBitmap icon; - QChar type; + TQString name; + TQBitmap icon; + TQChar type; bool duplicate; bool supported; }; @@ -60,11 +60,11 @@ class Button class ButtonDrag : public QStoredDrag { public: - ButtonDrag( Button btn, QWidget* parent, const char* name=0 ); + ButtonDrag( Button btn, TQWidget* parent, const char* name=0 ); ~ButtonDrag() {}; - static bool canDecode( QDropEvent* e ); - static bool decode( QDropEvent* e, Button& btn ); + static bool canDecode( TQDropEvent* e ); + static bool decode( TQDropEvent* e, Button& btn ); }; /** @@ -78,11 +78,11 @@ class ButtonDropSiteItem Button button(); - QRect rect; + TQRect rect; int width(); int height(); - void draw(QPainter *p, const QColorGroup& cg, QRect rect); + void draw(TQPainter *p, const TQColorGroup& cg, TQRect rect); private: Button m_button; @@ -94,10 +94,10 @@ class ButtonDropSiteItem class ButtonSourceItem : public QListViewItem { public: - ButtonSourceItem(QListView * parent, const Button& btn); + ButtonSourceItem(TQListView * parent, const Button& btn); virtual ~ButtonSourceItem(); - void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align); + void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align); void setButton(const Button& btn); Button button() const; @@ -114,24 +114,24 @@ class ButtonSource : public KListView Q_OBJECT public: - ButtonSource(QWidget *parent = 0, const char* name = 0); + ButtonSource(TQWidget *parent = 0, const char* name = 0); virtual ~ButtonSource(); - QSize sizeHint() const; + TQSize sizeHint() const; void hideAllButtons(); void showAllButtons(); public slots: - void hideButton(QChar btn); - void showButton(QChar btn); + void hideButton(TQChar btn); + void showButton(TQChar btn); protected: - bool acceptDrag(QDropEvent* e) const; - virtual QDragObject *dragObject(); + bool acceptDrag(TQDropEvent* e) const; + virtual TQDragObject *dragObject(); }; -typedef QValueList<ButtonDropSiteItem*> ButtonList; +typedef TQValueList<ButtonDropSiteItem*> ButtonList; /** * This class renders and handles the demo titlebar dropsite @@ -141,7 +141,7 @@ class ButtonDropSite: public QFrame Q_OBJECT public: - ButtonDropSite( QWidget* parent=0, const char* name=0 ); + ButtonDropSite( TQWidget* parent=0, const char* name=0 ); ~ButtonDropSite(); // Allow external classes access our buttons - ensure buttons are @@ -152,8 +152,8 @@ class ButtonDropSite: public QFrame void clearRight(); signals: - void buttonAdded(QChar btn); - void buttonRemoved(QChar btn); + void buttonAdded(TQChar btn); + void buttonRemoved(TQChar btn); void changed(); public slots: @@ -161,21 +161,21 @@ class ButtonDropSite: public QFrame void recalcItemGeometry(); ///< Call this whenever the item list changes... updates the items' rect property protected: - void resizeEvent(QResizeEvent*); - void dragEnterEvent( QDragEnterEvent* e ); - void dragMoveEvent( QDragMoveEvent* e ); - void dragLeaveEvent( QDragLeaveEvent* e ); - void dropEvent( QDropEvent* e ); - void mousePressEvent( QMouseEvent* e ); ///< Starts dragging a button... - - void drawContents( QPainter* p ); - ButtonDropSiteItem *buttonAt(QPoint p); + void resizeEvent(TQResizeEvent*); + void dragEnterEvent( TQDragEnterEvent* e ); + void dragMoveEvent( TQDragMoveEvent* e ); + void dragLeaveEvent( TQDragLeaveEvent* e ); + void dropEvent( TQDropEvent* e ); + void mousePressEvent( TQMouseEvent* e ); ///< Starts dragging a button... + + void drawContents( TQPainter* p ); + ButtonDropSiteItem *buttonAt(TQPoint p); bool removeButton(ButtonDropSiteItem *item); int calcButtonListWidth(const ButtonList& buttons); ///< Computes the total space the buttons will take in the titlebar - void drawButtonList(QPainter *p, const ButtonList& buttons, int offset); + void drawButtonList(TQPainter *p, const ButtonList& buttons, int offset); - QRect leftDropArea(); - QRect rightDropArea(); + TQRect leftDropArea(); + TQRect rightDropArea(); private: /** @@ -184,7 +184,7 @@ class ButtonDropSite: public QFrame bool getItemIterator(ButtonDropSiteItem *item, ButtonList* &list, ButtonList::iterator &iterator); void cleanDropVisualizer(); - QRect m_oldDropVisualizer; + TQRect m_oldDropVisualizer; ButtonDropSiteItem *m_selected; }; @@ -194,7 +194,7 @@ class ButtonPositionWidget : public QWidget Q_OBJECT public: - ButtonPositionWidget(QWidget *parent = 0, const char* name = 0); + ButtonPositionWidget(TQWidget *parent = 0, const char* name = 0); ~ButtonPositionWidget(); /** @@ -202,23 +202,23 @@ class ButtonPositionWidget : public QWidget */ void setDecorationFactory(KDecorationFactory *factory); - QString buttonsLeft() const; - QString buttonsRight() const; - void setButtonsLeft(const QString &buttons); - void setButtonsRight(const QString &buttons); + TQString buttonsLeft() const; + TQString buttonsRight() const; + void setButtonsLeft(const TQString &buttons); + void setButtonsRight(const TQString &buttons); signals: void changed(); private: void clearButtonList(const ButtonList& btns); - Button getButton(QChar type, bool& success); + Button getButton(TQChar type, bool& success); ButtonDropSite* m_dropSite; ButtonSource *m_buttonSource; KDecorationFactory *m_factory; - QString m_supportedButtons; + TQString m_supportedButtons; }; diff --git a/kwin/kcmkwin/kwindecoration/kwindecoration.cpp b/kwin/kcmkwin/kwindecoration/kwindecoration.cpp index 7435781bc..68aec85ff 100644 --- a/kwin/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kwin/kcmkwin/kwindecoration/kwindecoration.cpp @@ -28,17 +28,17 @@ */ #include <assert.h> -#include <qdir.h> -#include <qfileinfo.h> -#include <qlayout.h> -#include <qwhatsthis.h> -#include <qgroupbox.h> -#include <qcheckbox.h> -#include <qtabwidget.h> -#include <qvbox.h> -#include <qlabel.h> -#include <qfile.h> -#include <qslider.h> +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> +#include <tqgroupbox.h> +#include <tqcheckbox.h> +#include <tqtabwidget.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqfile.h> +#include <tqslider.h> #include <kapplication.h> #include <kcombobox.h> @@ -59,10 +59,10 @@ // KCModule plugin interface // ========================= -typedef KGenericFactory<KWinDecorationModule, QWidget> KWinDecoFactory; +typedef KGenericFactory<KWinDecorationModule, TQWidget> KWinDecoFactory; K_EXPORT_COMPONENT_FACTORY( kcm_kwindecoration, KWinDecoFactory("kcmkwindecoration") ) -KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, const QStringList &) +KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, const TQStringList &) : DCOPObject("KWinClientDecoration"), KCModule(KWinDecoFactory::instance(), parent, name), kwinConfig("kwinrc"), @@ -71,28 +71,28 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co kwinConfig.setGroup("Style"); plugins = new KDecorationPreviewPlugins( &kwinConfig ); - QVBoxLayout* layout = new QVBoxLayout(this, 0, KDialog::spacingHint()); + TQVBoxLayout* layout = new TQVBoxLayout(this, 0, KDialog::spacingHint()); // Save this for later... -// cbUseMiniWindows = new QCheckBox( i18n( "Render mini &titlebars for all windows"), checkGroup ); -// QWhatsThis::add( cbUseMiniWindows, i18n( "Note that this option is not available on all styles yet!" ) ); +// cbUseMiniWindows = new TQCheckBox( i18n( "Render mini &titlebars for all windows"), checkGroup ); +// TQWhatsThis::add( cbUseMiniWindows, i18n( "Note that this option is not available on all styles yet!" ) ); - tabWidget = new QTabWidget( this ); + tabWidget = new TQTabWidget( this ); layout->addWidget( tabWidget ); // Page 1 (General Options) - QWidget *pluginPage = new QWidget( tabWidget ); + TQWidget *pluginPage = new TQWidget( tabWidget ); - QVBoxLayout* pluginLayout = new QVBoxLayout(pluginPage, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout* pluginLayout = new TQVBoxLayout(pluginPage, KDialog::marginHint(), KDialog::spacingHint()); // decoration chooser decorationList = new KComboBox( pluginPage ); - QString whatsThis = i18n("Select the window decoration. This is the look and feel of both " + TQString whatsThis = i18n("Select the window decoration. This is the look and feel of both " "the window borders and the window handle."); - QWhatsThis::add(decorationList, whatsThis); + TQWhatsThis::add(decorationList, whatsThis); pluginLayout->addWidget(decorationList); - QGroupBox *pluginSettingsGrp = new QGroupBox( i18n("Decoration Options"), pluginPage ); + TQGroupBox *pluginSettingsGrp = new TQGroupBox( i18n("Decoration Options"), pluginPage ); pluginSettingsGrp->setColumnLayout( 0, Vertical ); pluginSettingsGrp->setFlat( true ); pluginSettingsGrp->layout()->setMargin( 0 ); @@ -102,33 +102,33 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co pluginLayout->addStretch(); // Border size chooser - lBorder = new QLabel (i18n("B&order size:"), pluginSettingsGrp); - cBorder = new QComboBox(pluginSettingsGrp); + lBorder = new TQLabel (i18n("B&order size:"), pluginSettingsGrp); + cBorder = new TQComboBox(pluginSettingsGrp); lBorder->setBuddy(cBorder); - QWhatsThis::add( cBorder, i18n( "Use this combobox to change the border size of the decoration." )); + TQWhatsThis::add( cBorder, i18n( "Use this combobox to change the border size of the decoration." )); lBorder->hide(); cBorder->hide(); - QHBoxLayout *borderSizeLayout = new QHBoxLayout(pluginSettingsGrp->layout() ); + TQHBoxLayout *borderSizeLayout = new TQHBoxLayout(pluginSettingsGrp->layout() ); borderSizeLayout->addWidget(lBorder); borderSizeLayout->addWidget(cBorder); borderSizeLayout->addStretch(); - pluginConfigWidget = new QVBox(pluginSettingsGrp); + pluginConfigWidget = new TQVBox(pluginSettingsGrp); pluginSettingsGrp->layout()->add( pluginConfigWidget ); // Page 2 (Button Selector) - QWidget* buttonPage = new QWidget( tabWidget ); - QVBoxLayout* buttonLayout = new QVBoxLayout(buttonPage, KDialog::marginHint(), KDialog::spacingHint()); + TQWidget* buttonPage = new TQWidget( tabWidget ); + TQVBoxLayout* buttonLayout = new TQVBoxLayout(buttonPage, KDialog::marginHint(), KDialog::spacingHint()); - cbShowToolTips = new QCheckBox( + cbShowToolTips = new TQCheckBox( i18n("&Show window button tooltips"), buttonPage ); - QWhatsThis::add( cbShowToolTips, + TQWhatsThis::add( cbShowToolTips, i18n( "Enabling this checkbox will show window button tooltips. " "If this checkbox is off, no window button tooltips will be shown.")); - cbUseCustomButtonPositions = new QCheckBox( + cbUseCustomButtonPositions = new TQCheckBox( i18n("Use custom titlebar button &positions"), buttonPage ); - QWhatsThis::add( cbUseCustomButtonPositions, + TQWhatsThis::add( cbUseCustomButtonPositions, i18n( "The appropriate settings can be found in the \"Buttons\" Tab; " "please note that this option is not available on all styles yet." ) ); @@ -138,20 +138,20 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co // Add nifty dnd button modification widgets buttonPositionWidget = new ButtonPositionWidget(buttonPage, "button_position_widget"); buttonPositionWidget->setDecorationFactory(plugins->factory() ); - QHBoxLayout* buttonControlLayout = new QHBoxLayout(buttonLayout); + TQHBoxLayout* buttonControlLayout = new TQHBoxLayout(buttonLayout); buttonControlLayout->addSpacing(20); buttonControlLayout->addWidget(buttonPositionWidget); // buttonLayout->addStretch(); // preview - QVBoxLayout* previewLayout = new QVBoxLayout(layout, KDialog::spacingHint() ); + TQVBoxLayout* previewLayout = new TQVBoxLayout(layout, KDialog::spacingHint() ); previewLayout->setMargin( KDialog::marginHint() ); preview = new KDecorationPreview( this ); previewLayout->addWidget(preview); - preview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - tabWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); + preview->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); + tabWidget->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Maximum); // Load all installed decorations into memory // Set up the decoration lists and other UI settings @@ -163,17 +163,17 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co tabWidget->insertTab( pluginPage, i18n("&Window Decoration") ); tabWidget->insertTab( buttonPage, i18n("&Buttons") ); - connect( buttonPositionWidget, SIGNAL(changed()), this, SLOT(slotButtonsChanged()) ); // update preview etc. - connect( buttonPositionWidget, SIGNAL(changed()), this, SLOT(slotSelectionChanged()) ); // emit changed()... - connect( decorationList, SIGNAL(activated(const QString&)), SLOT(slotSelectionChanged()) ); - connect( decorationList, SIGNAL(activated(const QString&)), - SLOT(slotChangeDecoration(const QString&)) ); - connect( cbUseCustomButtonPositions, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); - connect(cbUseCustomButtonPositions, SIGNAL(toggled(bool)), buttonPositionWidget, SLOT(setEnabled(bool))); - connect(cbUseCustomButtonPositions, SIGNAL(toggled(bool)), this, SLOT(slotButtonsChanged()) ); - connect( cbShowToolTips, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); - connect( cBorder, SIGNAL( activated( int )), SLOT( slotBorderChanged( int ))); -// connect( cbUseMiniWindows, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); + connect( buttonPositionWidget, TQT_SIGNAL(changed()), this, TQT_SLOT(slotButtonsChanged()) ); // update preview etc. + connect( buttonPositionWidget, TQT_SIGNAL(changed()), this, TQT_SLOT(slotSelectionChanged()) ); // emit changed()... + connect( decorationList, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(slotSelectionChanged()) ); + connect( decorationList, TQT_SIGNAL(activated(const TQString&)), + TQT_SLOT(slotChangeDecoration(const TQString&)) ); + connect( cbUseCustomButtonPositions, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectionChanged()) ); + connect(cbUseCustomButtonPositions, TQT_SIGNAL(toggled(bool)), buttonPositionWidget, TQT_SLOT(setEnabled(bool))); + connect(cbUseCustomButtonPositions, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotButtonsChanged()) ); + connect( cbShowToolTips, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectionChanged()) ); + connect( cBorder, TQT_SIGNAL( activated( int )), TQT_SLOT( slotBorderChanged( int ))); +// connect( cbUseMiniWindows, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectionChanged()) ); // Allow kwin dcop signal to update our selection list connectDCOPSignal("kwin", 0, "dcopResetAllClients()", "dcopUpdateClientList()", false); @@ -199,20 +199,20 @@ KWinDecorationModule::~KWinDecorationModule() // And insert these into a DecorationInfo structure void KWinDecorationModule::findDecorations() { - QStringList dirList = KGlobal::dirs()->findDirs("data", "kwin"); - QStringList::ConstIterator it; + TQStringList dirList = KGlobal::dirs()->findDirs("data", "kwin"); + TQStringList::ConstIterator it; for (it = dirList.begin(); it != dirList.end(); it++) { - QDir d(*it); + TQDir d(*it); if (d.exists()) for (QFileInfoListIterator it(*d.entryInfoList()); it.current(); ++it) { - QString filename(it.current()->absFilePath()); + TQString filename(it.current()->absFilePath()); if (KDesktopFile::isDesktopFile(filename)) { KDesktopFile desktopFile(filename); - QString libName = desktopFile.readEntry("X-KDE-Library"); + TQString libName = desktopFile.readEntry("X-KDE-Library"); if (!libName.isEmpty() && libName.startsWith( "kwin3_" )) { @@ -230,10 +230,10 @@ void KWinDecorationModule::findDecorations() // Fills the decorationList with a list of available kwin decorations void KWinDecorationModule::createDecorationList() { - QValueList<DecorationInfo>::ConstIterator it; + TQValueList<DecorationInfo>::ConstIterator it; // Sync with kwin hardcoded KDE2 style which has no desktop item - QStringList decorationNames; + TQStringList decorationNames; decorationNames.append( i18n("KDE 2") ); for (it = decorations.begin(); it != decorations.end(); ++it) { @@ -245,7 +245,7 @@ void KWinDecorationModule::createDecorationList() // Reset the decoration plugin to what the user just selected -void KWinDecorationModule::slotChangeDecoration( const QString & text) +void KWinDecorationModule::slotChangeDecoration( const TQString & text) { KConfig kwinConfig("kwinrc"); kwinConfig.setGroup("Style"); @@ -272,10 +272,10 @@ static const char* const border_names[ KDecorationDefines::BordersCount ] = I18N_NOOP( "Oversized" ) }; -int KWinDecorationModule::borderSizeToIndex( BorderSize size, QValueList< BorderSize > sizes ) +int KWinDecorationModule::borderSizeToIndex( BorderSize size, TQValueList< BorderSize > sizes ) { int pos = 0; - for( QValueList< BorderSize >::ConstIterator it = sizes.begin(); + for( TQValueList< BorderSize >::ConstIterator it = sizes.begin(); it != sizes.end(); ++it, ++pos ) if( size <= *it ) @@ -284,9 +284,9 @@ int KWinDecorationModule::borderSizeToIndex( BorderSize size, QValueList< Border } KDecorationDefines::BorderSize KWinDecorationModule::indexToBorderSize( int index, - QValueList< BorderSize > sizes ) + TQValueList< BorderSize > sizes ) { - QValueList< BorderSize >::ConstIterator it = sizes.begin(); + TQValueList< BorderSize >::ConstIterator it = sizes.begin(); for(; it != sizes.end(); ++it, --index ) @@ -300,7 +300,7 @@ void KWinDecorationModule::slotBorderChanged( int size ) if( lBorder->isHidden()) return; emit KCModule::changed( true ); - QValueList< BorderSize > sizes; + TQValueList< BorderSize > sizes; if( plugins->factory() != NULL ) sizes = plugins->factory()->borderSizes(); assert( sizes.count() >= 2 ); @@ -316,11 +316,11 @@ void KWinDecorationModule::slotButtonsChanged() preview->setTempButtons(plugins, cbUseCustomButtonPositions->isChecked(), buttonPositionWidget->buttonsLeft(), buttonPositionWidget->buttonsRight() ); } -QString KWinDecorationModule::decorationName( QString& libName ) +TQString KWinDecorationModule::decorationName( TQString& libName ) { - QString decoName; + TQString decoName; - QValueList<DecorationInfo>::Iterator it; + TQValueList<DecorationInfo>::Iterator it; for( it = decorations.begin(); it != decorations.end(); ++it ) if ( (*it).libraryName == libName ) { @@ -332,13 +332,13 @@ QString KWinDecorationModule::decorationName( QString& libName ) } -QString KWinDecorationModule::decorationLibName( const QString& name ) +TQString KWinDecorationModule::decorationLibName( const TQString& name ) { - QString libName; + TQString libName; // Find the corresponding library name to that of // the current plugin name - QValueList<DecorationInfo>::Iterator it; + TQValueList<DecorationInfo>::Iterator it; for( it = decorations.begin(); it != decorations.end(); ++it ) if ( (*it).name == name ) { @@ -355,14 +355,14 @@ QString KWinDecorationModule::decorationLibName( const QString& name ) // Loads/unloads and inserts the decoration config plugin into the // pluginConfigWidget, allowing for dynamic configuration of decorations -void KWinDecorationModule::resetPlugin( KConfig* conf, const QString& currentDecoName ) +void KWinDecorationModule::resetPlugin( KConfig* conf, const TQString& currentDecoName ) { // Config names are "kwin_icewm_config" // for "kwin3_icewm" kwin client - QString oldName = styleToConfigLib( oldLibraryName ); + TQString oldName = styleToConfigLib( oldLibraryName ); - QString currentName; + TQString currentName; if (!currentDecoName.isEmpty()) currentName = decorationLibName( currentDecoName ); // Use what the user selected else @@ -391,23 +391,23 @@ void KWinDecorationModule::resetPlugin( KConfig* conf, const QString& currentDec // Free the old library if possible if (!oldLibraryName.isNull()) - loader->unloadLibrary( QFile::encodeName(oldName) ); + loader->unloadLibrary( TQFile::encodeName(oldName) ); - KLibrary* library = loader->library( QFile::encodeName(currentName) ); + KLibrary* library = loader->library( TQFile::encodeName(currentName) ); if (library != NULL) { void* alloc_ptr = library->symbol("allocate_config"); if (alloc_ptr != NULL) { - allocatePlugin = (QObject* (*)(KConfig* conf, QWidget* parent))alloc_ptr; - pluginObject = (QObject*)(allocatePlugin( conf, pluginConfigWidget )); + allocatePlugin = (TQObject* (*)(KConfig* conf, TQWidget* parent))alloc_ptr; + pluginObject = (TQObject*)(allocatePlugin( conf, pluginConfigWidget )); // connect required signals and slots together... - connect( pluginObject, SIGNAL(changed()), this, SLOT(slotSelectionChanged()) ); - connect( this, SIGNAL(pluginLoad(KConfig*)), pluginObject, SLOT(load(KConfig*)) ); - connect( this, SIGNAL(pluginSave(KConfig*)), pluginObject, SLOT(save(KConfig*)) ); - connect( this, SIGNAL(pluginDefaults()), pluginObject, SLOT(defaults()) ); + connect( pluginObject, TQT_SIGNAL(changed()), this, TQT_SLOT(slotSelectionChanged()) ); + connect( this, TQT_SIGNAL(pluginLoad(KConfig*)), pluginObject, TQT_SLOT(load(KConfig*)) ); + connect( this, TQT_SIGNAL(pluginSave(KConfig*)), pluginObject, TQT_SLOT(save(KConfig*)) ); + connect( this, TQT_SIGNAL(pluginDefaults()), pluginObject, TQT_SLOT(defaults()) ); pluginConfigWidget->show(); return; } @@ -431,8 +431,8 @@ void KWinDecorationModule::readConfig( KConfig* conf ) oldLibraryName = currentLibraryName; currentLibraryName = conf->readEntry("PluginLib", - ((QPixmap::defaultDepth() > 8) ? "kwin_plastik" : "kwin_quartz")); - QString decoName = decorationName( currentLibraryName ); + ((TQPixmap::defaultDepth() > 8) ? "kwin_plastik" : "kwin_quartz")); + TQString decoName = decorationName( currentLibraryName ); // If we are using the "default" kde client, use the "default" entry. if (decoName.isEmpty()) @@ -472,8 +472,8 @@ void KWinDecorationModule::readConfig( KConfig* conf ) // Writes the selected user configuration to the kwin config file void KWinDecorationModule::writeConfig( KConfig* conf ) { - QString name = decorationList->currentText(); - QString libName = decorationLibName( name ); + TQString name = decorationList->currentText(); + TQString libName = decorationLibName( name ); KConfig kwinConfig("kwinrc"); kwinConfig.setGroup("Style"); @@ -558,7 +558,7 @@ void KWinDecorationModule::defaults() void KWinDecorationModule::checkSupportedBorderSizes() { - QValueList< BorderSize > sizes; + TQValueList< BorderSize > sizes; if( plugins->factory() != NULL ) sizes = plugins->factory()->borderSizes(); if( sizes.count() < 2 ) { @@ -566,7 +566,7 @@ void KWinDecorationModule::checkSupportedBorderSizes() cBorder->hide(); } else { cBorder->clear(); - for (QValueList<BorderSize>::const_iterator it = sizes.begin(); it != sizes.end(); ++it) { + for (TQValueList<BorderSize>::const_iterator it = sizes.begin(); it != sizes.end(); ++it) { BorderSize size = *it; cBorder->insertItem(i18n(border_names[size]), borderSizeToIndex(size,sizes) ); } @@ -578,7 +578,7 @@ void KWinDecorationModule::checkSupportedBorderSizes() } } -QString KWinDecorationModule::styleToConfigLib( QString& styleLib ) +TQString KWinDecorationModule::styleToConfigLib( TQString& styleLib ) { if( styleLib.startsWith( "kwin3_" )) return "kwin_" + styleLib.mid( 6 ) + "_config"; @@ -586,7 +586,7 @@ QString KWinDecorationModule::styleToConfigLib( QString& styleLib ) return styleLib + "_config"; } -QString KWinDecorationModule::quickHelp() const +TQString KWinDecorationModule::quickHelp() const { return i18n( "<h1>Window Manager Decoration</h1>" "<p>This module allows you to choose the window border decorations, " @@ -602,7 +602,7 @@ QString KWinDecorationModule::quickHelp() const void KWinDecorationModule::resetKWin() { bool ok = kapp->dcopClient()->send("kwin*", "KWinInterface", - "reconfigure()", QByteArray()); + "reconfigure()", TQByteArray()); if (!ok) kdDebug() << "kcmkwindecoration: Could not reconfigure kwin" << endl; } diff --git a/kwin/kcmkwin/kwindecoration/kwindecoration.h b/kwin/kcmkwin/kwindecoration/kwindecoration.h index eea091ebc..126f20fa9 100644 --- a/kwin/kcmkwin/kwindecoration/kwindecoration.h +++ b/kwin/kcmkwin/kwindecoration/kwindecoration.h @@ -53,8 +53,8 @@ class KDecorationPreview; // Stores themeName and its corresponding library Name struct DecorationInfo { - QString name; - QString libraryName; + TQString name; + TQString libraryName; }; @@ -63,14 +63,14 @@ class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface Q_OBJECT public: - KWinDecorationModule(QWidget* parent, const char* name, const QStringList &); + KWinDecorationModule(TQWidget* parent, const char* name, const TQStringList &); ~KWinDecorationModule(); virtual void load(); virtual void save(); virtual void defaults(); - QString quickHelp() const; + TQString quickHelp() const; virtual void dcopUpdateClientList(); @@ -82,7 +82,7 @@ class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface protected slots: // Allows us to turn "save" on void slotSelectionChanged(); - void slotChangeDecoration( const QString & ); + void slotChangeDecoration( const TQString & ); void slotBorderChanged( int ); void slotButtonsChanged(); @@ -92,41 +92,41 @@ class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface void findDecorations(); void createDecorationList(); void updateSelection(); - QString decorationLibName( const QString& name ); - QString decorationName ( QString& libName ); - static QString styleToConfigLib( QString& styleLib ); - void resetPlugin( KConfig* conf, const QString& currentDecoName = QString::null ); + TQString decorationLibName( const TQString& name ); + TQString decorationName ( TQString& libName ); + static TQString styleToConfigLib( TQString& styleLib ); + void resetPlugin( KConfig* conf, const TQString& currentDecoName = TQString::null ); void resetKWin(); void checkSupportedBorderSizes(); - static int borderSizeToIndex( BorderSize size, QValueList< BorderSize > sizes ); - static BorderSize indexToBorderSize( int index, QValueList< BorderSize > sizes ); + static int borderSizeToIndex( BorderSize size, TQValueList< BorderSize > sizes ); + static BorderSize indexToBorderSize( int index, TQValueList< BorderSize > sizes ); - QTabWidget* tabWidget; + TQTabWidget* tabWidget; // Page 1 KComboBox* decorationList; - QValueList<DecorationInfo> decorations; + TQValueList<DecorationInfo> decorations; KDecorationPreview* preview; KDecorationPlugins* plugins; KConfig kwinConfig; - QCheckBox* cbUseCustomButtonPositions; - // QCheckBox* cbUseMiniWindows; - QCheckBox* cbShowToolTips; - QLabel* lBorder; - QComboBox* cBorder; + TQCheckBox* cbUseCustomButtonPositions; + // TQCheckBox* cbUseMiniWindows; + TQCheckBox* cbShowToolTips; + TQLabel* lBorder; + TQComboBox* cBorder; BorderSize border_size; - QObject* pluginObject; - QWidget* pluginConfigWidget; - QString currentLibraryName; - QString oldLibraryName; - QObject* (*allocatePlugin)( KConfig* conf, QWidget* parent ); + TQObject* pluginObject; + TQWidget* pluginConfigWidget; + TQString currentLibraryName; + TQString oldLibraryName; + TQObject* (*allocatePlugin)( KConfig* conf, TQWidget* parent ); // Page 2 ButtonPositionWidget *buttonPositionWidget; - QVBox* buttonPage; + TQVBox* buttonPage; }; diff --git a/kwin/kcmkwin/kwindecoration/preview.cpp b/kwin/kcmkwin/kwindecoration/preview.cpp index 8c88a3604..c9a0174f4 100644 --- a/kwin/kcmkwin/kwindecoration/preview.cpp +++ b/kwin/kcmkwin/kwindecoration/preview.cpp @@ -23,8 +23,8 @@ #include <klocale.h> #include <kconfig.h> #include <kglobal.h> -#include <qlabel.h> -#include <qstyle.h> +#include <tqlabel.h> +#include <tqstyle.h> #include <kiconloader.h> #include <X11/Xlib.h> @@ -35,8 +35,8 @@ // FRAME the preview doesn't update to reflect the changes done in the kcm -KDecorationPreview::KDecorationPreview( QWidget* parent, const char* name ) - : QWidget( parent, name ) +KDecorationPreview::KDecorationPreview( TQWidget* parent, const char* name ) + : TQWidget( parent, name ) { options = new KDecorationPreviewOptions; @@ -45,7 +45,7 @@ KDecorationPreview::KDecorationPreview( QWidget* parent, const char* name ) deco[Active] = deco[Inactive] = NULL; - no_preview = new QLabel( i18n( "No preview available.\n" + no_preview = new TQLabel( i18n( "No preview available.\n" "Most probably there\n" "was a problem loading the plugin." ), this ); @@ -99,9 +99,9 @@ void KDecorationPreview::disablePreview() no_preview->show(); } -void KDecorationPreview::resizeEvent( QResizeEvent* e ) +void KDecorationPreview::resizeEvent( TQResizeEvent* e ) { - QWidget::resizeEvent( e ); + TQWidget::resizeEvent( e ); positionPreviews(); } @@ -109,8 +109,8 @@ void KDecorationPreview::positionPreviews() { int titleBarHeight, leftBorder, rightBorder, xoffset, dummy1, dummy2, dummy3; - QRect geometry; - QSize size; + TQRect geometry; + TQSize size; no_preview->resize( this->size() ); @@ -122,25 +122,25 @@ void KDecorationPreview::positionPreviews() deco[Inactive]->borders( leftBorder, rightBorder, dummy1, dummy2 ); titleBarHeight = kMin( int( titleBarHeight * .9 ), 30 ); - xoffset = kMin( kMax( 10, QApplication::reverseLayout() + xoffset = kMin( kMax( 10, TQApplication::reverseLayout() ? leftBorder : rightBorder ), 30 ); // Resize the active window - size = QSize( width() - xoffset, height() - titleBarHeight ) + size = TQSize( width() - xoffset, height() - titleBarHeight ) .expandedTo( deco[Active]->minimumSize() ); - geometry = QRect( QPoint( 0, titleBarHeight ), size ); - deco[Active]->widget()->setGeometry( QStyle::visualRect( geometry, this ) ); + geometry = TQRect( TQPoint( 0, titleBarHeight ), size ); + deco[Active]->widget()->setGeometry( TQStyle::visualRect( geometry, this ) ); // Resize the inactive window - size = QSize( width() - xoffset, height() - titleBarHeight ) + size = TQSize( width() - xoffset, height() - titleBarHeight ) .expandedTo( deco[Inactive]->minimumSize() ); - geometry = QRect( QPoint( xoffset, 0 ), size ); - deco[Inactive]->widget()->setGeometry( QStyle::visualRect( geometry, this ) ); + geometry = TQRect( TQPoint( xoffset, 0 ), size ); + deco[Inactive]->widget()->setGeometry( TQStyle::visualRect( geometry, this ) ); } -void KDecorationPreview::setPreviewMask( const QRegion& reg, int mode, bool active ) +void KDecorationPreview::setPreviewMask( const TQRegion& reg, int mode, bool active ) { - QWidget *widget = active ? deco[Active]->widget() : deco[Inactive]->widget(); + TQWidget *widget = active ? deco[Active]->widget() : deco[Inactive]->widget(); // FRAME duped from client.cpp if( mode == Unsorted ) @@ -150,7 +150,7 @@ void KDecorationPreview::setPreviewMask( const QRegion& reg, int mode, bool acti } else { - QMemArray< QRect > rects = reg.rects(); + TQMemArray< TQRect > rects = reg.rects(); XRectangle* xrects = new XRectangle[ rects.count() ]; for( unsigned int i = 0; i < rects.count(); @@ -169,9 +169,9 @@ void KDecorationPreview::setPreviewMask( const QRegion& reg, int mode, bool acti mask = reg; // keep shape of the active window for unobscuredRegion() } -QRect KDecorationPreview::windowGeometry( bool active ) const +TQRect KDecorationPreview::windowGeometry( bool active ) const { - QWidget *widget = active ? deco[Active]->widget() : deco[Inactive]->widget(); + TQWidget *widget = active ? deco[Active]->widget() : deco[Inactive]->widget(); return widget->geometry(); } @@ -190,7 +190,7 @@ void KDecorationPreview::setTempBorderSize(KDecorationPlugins* plugin, KDecorati } } -void KDecorationPreview::setTempButtons(KDecorationPlugins* plugin, bool customEnabled, const QString &left, const QString &right) +void KDecorationPreview::setTempButtons(KDecorationPlugins* plugin, bool customEnabled, const TQString &left, const TQString &right) { options->setCustomTitleButtonsEnabled(customEnabled); options->setCustomTitleButtons(left, right); @@ -206,17 +206,17 @@ void KDecorationPreview::setTempButtons(KDecorationPlugins* plugin, bool customE } } -QRegion KDecorationPreview::unobscuredRegion( bool active, const QRegion& r ) const +TQRegion KDecorationPreview::unobscuredRegion( bool active, const TQRegion& r ) const { if( active ) // this one is not obscured return r; else { // copied from KWin core's code - QRegion ret = r; - QRegion r2 = mask; + TQRegion ret = r; + TQRegion r2 = mask; if( r2.isEmpty()) - r2 = QRegion( windowGeometry( true )); + r2 = TQRegion( windowGeometry( true )); r2.translate( windowGeometry( true ).x() - windowGeometry( false ).x(), windowGeometry( true ).y() - windowGeometry( false ).y()); ret -= r2; @@ -229,7 +229,7 @@ KDecorationPreviewBridge::KDecorationPreviewBridge( KDecorationPreview* p, bool { } -QWidget* KDecorationPreviewBridge::initialParentWidget() const +TQWidget* KDecorationPreviewBridge::initialParentWidget() const { return preview; } @@ -319,26 +319,26 @@ NET::WindowType KDecorationPreviewBridge::windowType( unsigned long ) const return NET::Normal; } -QIconSet KDecorationPreviewBridge::icon() const +TQIconSet KDecorationPreviewBridge::icon() const { - return QIconSet( KGlobal::iconLoader()->loadIcon( "xapp", KIcon::NoGroup, 16 ), + return TQIconSet( KGlobal::iconLoader()->loadIcon( "xapp", KIcon::NoGroup, 16 ), KGlobal::iconLoader()->loadIcon( "xapp", KIcon::NoGroup, 32 )); } -QString KDecorationPreviewBridge::caption() const +TQString KDecorationPreviewBridge::caption() const { return active ? i18n( "Active Window" ) : i18n( "Inactive Window" ); } -void KDecorationPreviewBridge::processMousePressEvent( QMouseEvent* ) +void KDecorationPreviewBridge::processMousePressEvent( TQMouseEvent* ) { } -void KDecorationPreviewBridge::showWindowMenu( const QRect &) +void KDecorationPreviewBridge::showWindowMenu( const TQRect &) { } -void KDecorationPreviewBridge::showWindowMenu( QPoint ) +void KDecorationPreviewBridge::showWindowMenu( TQPoint ) { } @@ -346,7 +346,7 @@ void KDecorationPreviewBridge::performWindowOperation( WindowOperation ) { } -void KDecorationPreviewBridge::setMask( const QRegion& reg, int mode ) +void KDecorationPreviewBridge::setMask( const TQRegion& reg, int mode ) { preview->setPreviewMask( reg, mode, active ); } @@ -356,22 +356,22 @@ bool KDecorationPreviewBridge::isPreview() const return true; } -QRect KDecorationPreviewBridge::geometry() const +TQRect KDecorationPreviewBridge::geometry() const { return preview->windowGeometry( active ); } -QRect KDecorationPreviewBridge::iconGeometry() const +TQRect KDecorationPreviewBridge::iconGeometry() const { - return QRect(); + return TQRect(); } -QRegion KDecorationPreviewBridge::unobscuredRegion( const QRegion& r ) const +TQRegion KDecorationPreviewBridge::unobscuredRegion( const TQRegion& r ) const { return preview->unobscuredRegion( active, r ); } -QWidget* KDecorationPreviewBridge::workspaceWidget() const +TQWidget* KDecorationPreviewBridge::workspaceWidget() const { return preview; } @@ -439,8 +439,8 @@ KDecorationPreviewOptions::KDecorationPreviewOptions() customBorderSize = BordersCount; // invalid customButtonsChanged = false; // invalid customButtons = true; - customTitleButtonsLeft = QString::null; // invalid - customTitleButtonsRight = QString::null; // invalid + customTitleButtonsLeft = TQString::null; // invalid + customTitleButtonsRight = TQString::null; // invalid d = new KDecorationOptionsPrivate; d->defaultKWinSettings(); @@ -491,7 +491,7 @@ void KDecorationPreviewOptions::setCustomTitleButtonsEnabled(bool enabled) updateSettings(); } -void KDecorationPreviewOptions::setCustomTitleButtons(const QString &left, const QString &right) +void KDecorationPreviewOptions::setCustomTitleButtons(const TQString &left, const TQString &right) { customTitleButtonsLeft = left; customTitleButtonsRight = right; diff --git a/kwin/kcmkwin/kwindecoration/preview.h b/kwin/kcmkwin/kwindecoration/preview.h index 1c1943486..a7f50d682 100644 --- a/kwin/kcmkwin/kwindecoration/preview.h +++ b/kwin/kcmkwin/kwindecoration/preview.h @@ -20,7 +20,7 @@ #ifndef KWINDECORATION_PREVIEW_H #define KWINDECORATION_PREVIEW_H -#include <qwidget.h> +#include <tqwidget.h> #include <kdecoration_p.h> #include <kdecoration_plugins_p.h> @@ -39,25 +39,25 @@ class KDecorationPreview // and an inactive window. enum Windows { Inactive = 0, Active, NumWindows }; - KDecorationPreview( QWidget* parent = NULL, const char* name = NULL ); + KDecorationPreview( TQWidget* parent = NULL, const char* name = NULL ); virtual ~KDecorationPreview(); bool recreateDecoration( KDecorationPlugins* plugin ); void enablePreview(); void disablePreview(); - void setPreviewMask( const QRegion&, int, bool ); - QRegion unobscuredRegion( bool, const QRegion& ) const; - QRect windowGeometry( bool ) const; + void setPreviewMask( const TQRegion&, int, bool ); + TQRegion unobscuredRegion( bool, const TQRegion& ) const; + TQRect windowGeometry( bool ) const; void setTempBorderSize(KDecorationPlugins* plugin, KDecorationDefines::BorderSize size); - void setTempButtons(KDecorationPlugins* plugin, bool customEnabled, const QString &left, const QString &right); + void setTempButtons(KDecorationPlugins* plugin, bool customEnabled, const TQString &left, const TQString &right); protected: - virtual void resizeEvent( QResizeEvent* ); + virtual void resizeEvent( TQResizeEvent* ); private: void positionPreviews(); KDecorationPreviewOptions* options; KDecorationPreviewBridge* bridge[NumWindows]; KDecoration* deco[NumWindows]; - QLabel* no_preview; - QRegion mask; + TQLabel* no_preview; + TQRegion mask; }; class KDecorationPreviewBridge @@ -81,18 +81,18 @@ class KDecorationPreviewBridge virtual bool isMovable() const; virtual bool isResizable() const; virtual NET::WindowType windowType( unsigned long supported_types ) const; - virtual QIconSet icon() const; - virtual QString caption() const; - virtual void processMousePressEvent( QMouseEvent* ); - virtual void showWindowMenu( const QRect &); - virtual void showWindowMenu( QPoint ); + virtual TQIconSet icon() const; + virtual TQString caption() const; + virtual void processMousePressEvent( TQMouseEvent* ); + virtual void showWindowMenu( const TQRect &); + virtual void showWindowMenu( TQPoint ); virtual void performWindowOperation( WindowOperation ); - virtual void setMask( const QRegion&, int ); + virtual void setMask( const TQRegion&, int ); virtual bool isPreview() const; - virtual QRect geometry() const; - virtual QRect iconGeometry() const; - virtual QRegion unobscuredRegion( const QRegion& r ) const; - virtual QWidget* workspaceWidget() const; + virtual TQRect geometry() const; + virtual TQRect iconGeometry() const; + virtual TQRegion unobscuredRegion( const TQRegion& r ) const; + virtual TQWidget* workspaceWidget() const; virtual WId windowId() const; virtual void closeWindow(); virtual void maximize( MaximizeMode mode ); @@ -105,7 +105,7 @@ class KDecorationPreviewBridge virtual void setKeepAbove( bool ); virtual void setKeepBelow( bool ); virtual int currentDesktop() const; - virtual QWidget* initialParentWidget() const; + virtual TQWidget* initialParentWidget() const; virtual Qt::WFlags initialWFlags() const; virtual void helperShowHide( bool show ); virtual void grabXServer( bool grab ); @@ -124,14 +124,14 @@ class KDecorationPreviewOptions void setCustomBorderSize(BorderSize size); void setCustomTitleButtonsEnabled(bool enabled); - void setCustomTitleButtons(const QString &left, const QString &right); + void setCustomTitleButtons(const TQString &left, const TQString &right); private: BorderSize customBorderSize; bool customButtonsChanged; bool customButtons; - QString customTitleButtonsLeft; - QString customTitleButtonsRight; + TQString customTitleButtonsLeft; + TQString customTitleButtonsRight; }; class KDecorationPreviewPlugins |