From 1d077caf68127ab1a5518df84cc5592a1b47a965 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sun, 14 Aug 2011 05:14:51 +0000 Subject: TQt4 port kdeartwork This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeartwork@1246991 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kwin-styles/glow/Makefile.am | 2 +- kwin-styles/glow/config/Makefile.am | 2 +- kwin-styles/glow/config/glowconfigdialog.cpp | 16 ++++---- kwin-styles/glow/config/glowconfigdialog.h | 3 +- kwin-styles/glow/glowbutton.cpp | 52 ++++++++++++------------ kwin-styles/glow/glowbutton.h | 9 +++-- kwin-styles/glow/glowclient.cpp | 60 ++++++++++++++-------------- kwin-styles/glow/glowclient.h | 3 +- kwin-styles/glow/resources.h | 10 ++--- 9 files changed, 80 insertions(+), 77 deletions(-) (limited to 'kwin-styles/glow') diff --git a/kwin-styles/glow/Makefile.am b/kwin-styles/glow/Makefile.am index 92d5a63a..e63c4ef8 100644 --- a/kwin-styles/glow/Makefile.am +++ b/kwin-styles/glow/Makefile.am @@ -6,7 +6,7 @@ SUBDIRS = . config themes kde_module_LTLIBRARIES = kwin3_glow.la kwin3_glow_la_SOURCES = glowclient.cpp glowbutton.cpp -kwin3_glow_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +kwin3_glow_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) -lkdefx kwin3_glow_la_LIBADD = $(LIB_KDECORE) -lkdecorations METASOURCES = AUTO diff --git a/kwin-styles/glow/config/Makefile.am b/kwin-styles/glow/config/Makefile.am index e677ff91..c1721d1e 100644 --- a/kwin-styles/glow/config/Makefile.am +++ b/kwin-styles/glow/config/Makefile.am @@ -3,7 +3,7 @@ INCLUDES = $(all_includes) kde_module_LTLIBRARIES = kwin_glow_config.la kwin_glow_config_la_SOURCES = glowconfigdialog.cpp -kwin_glow_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +kwin_glow_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) -lkdefx kwin_glow_config_la_LIBADD = $(LIB_KDEUI) METASOURCES = AUTO diff --git a/kwin-styles/glow/config/glowconfigdialog.cpp b/kwin-styles/glow/config/glowconfigdialog.cpp index ab0cd40d..5d3b4487 100644 --- a/kwin-styles/glow/config/glowconfigdialog.cpp +++ b/kwin-styles/glow/config/glowconfigdialog.cpp @@ -59,7 +59,7 @@ GlowConfigDialog::GlowConfigDialog( KConfig * conf, TQWidget * parent ) _main_group_box = new TQWidget(parent); TQVBoxLayout *main_group_boxLayout = new TQVBoxLayout(_main_group_box); - main_group_boxLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); + main_group_boxLayout->tqsetAlignment(TQt::AlignTop | TQt::AlignLeft); main_group_boxLayout->setSpacing(6); //------------------------------------------------------------------------- @@ -79,12 +79,12 @@ GlowConfigDialog::GlowConfigDialog( KConfig * conf, TQWidget * parent ) _button_glow_color_group_box = new TQGroupBox( 0, Qt::Horizontal, i18n("Button Glow Colors"), _main_group_box); TQHBoxLayout *colorHBoxLayout = - new TQHBoxLayout(_button_glow_color_group_box->layout()); + new TQHBoxLayout(_button_glow_color_group_box->tqlayout()); // create buttons TQSize buttonSize(BITMAP_SIZE, BITMAP_SIZE); TQPixmap pm(buttonSize); - pm.fill(Qt::black); + pm.fill(TQt::black); _stickyButton = new TQPushButton(_button_glow_color_group_box); pm.setMask(TQBitmap(buttonSize, stickyoff_bits, true)); @@ -119,7 +119,7 @@ GlowConfigDialog::GlowConfigDialog( KConfig * conf, TQWidget * parent ) // create signal mapper _titleButtonMapper = new TQSignalMapper(this); for( uint i=0; i<_titleButtonList.size(); i++ ) { - _titleButtonMapper->setMapping(_titleButtonList[i], i); + _titleButtonMapper->setMapping(TQT_TQOBJECT(_titleButtonList[i]), i); connect(_titleButtonList[i], TQT_SIGNAL(clicked()),_titleButtonMapper, TQT_SLOT(map())); } connect(_titleButtonMapper, TQT_SIGNAL(mapped(int)),this, TQT_SLOT(slotTitleButtonClicked(int))); @@ -139,7 +139,7 @@ GlowConfigDialog::GlowConfigDialog( KConfig * conf, TQWidget * parent ) _titlebarGradientTypeComboBox = new TQComboBox(_main_group_box); KConfig *c = KGlobal::config(); - KConfigGroupSaver cgs( c, TQString::fromLatin1("WM") ); + KConfigGroupSaver cgs( c, TQString::tqfromLatin1("WM") ); TQColor activeBackground = c->readColorEntry("activeBackground"); TQColor activeBlend = c->readColorEntry("activeBlend"); @@ -159,7 +159,7 @@ GlowConfigDialog::GlowConfigDialog( KConfig * conf, TQWidget * parent ) this, TQT_SLOT(slotTitlebarGradientTypeChanged(int))); titlebarGradientTypeLayout->addWidget( new TQLabel(i18n("Titlebar gradient:"), _main_group_box)); - titlebarGradientTypeLayout->addWidget(_titlebarGradientTypeComboBox, 0, Qt::AlignLeft); + titlebarGradientTypeLayout->addWidget(_titlebarGradientTypeComboBox, 0, TQt::AlignLeft); titlebarGradientTypeLayout->addStretch(10); main_group_boxLayout->addLayout(titlebarGradientTypeLayout); @@ -194,7 +194,7 @@ void GlowConfigDialog::load( KConfig* /* conf */ ) _glowConfig->setGroup("General"); - _buttonConfigMap = new QColor[NUMBER_OF_BUTTONS]; + _buttonConfigMap = new TQColor[NUMBER_OF_BUTTONS]; color = _glowConfig->readColorEntry("stickyButtonGlowColor", &defaultStickyButtonColor); _buttonConfigMap[stickyButton] = color; @@ -286,7 +286,7 @@ void GlowConfigDialog::slotLoadThemeList () TQDir::Dirs | TQDir::Readable); if (dir.exists()) { - QFileInfoListIterator it2(*dir.entryInfoList()); + TQFileInfoListIterator it2(*dir.entryInfoList()); TQFileInfo * finfo; while ((finfo=it2.current())) diff --git a/kwin-styles/glow/config/glowconfigdialog.h b/kwin-styles/glow/config/glowconfigdialog.h index e8a1be31..81747a4c 100644 --- a/kwin-styles/glow/config/glowconfigdialog.h +++ b/kwin-styles/glow/config/glowconfigdialog.h @@ -29,9 +29,10 @@ class TQComboBox; class KConfig; class KColorButton; -class GlowConfigDialog : public QObject +class GlowConfigDialog : public TQObject { Q_OBJECT + TQ_OBJECT public: GlowConfigDialog( KConfig* conf, TQWidget* parent ); diff --git a/kwin-styles/glow/glowbutton.cpp b/kwin-styles/glow/glowbutton.cpp index 25bae19c..87079c2e 100644 --- a/kwin-styles/glow/glowbutton.cpp +++ b/kwin-styles/glow/glowbutton.cpp @@ -87,12 +87,12 @@ GlowButton::GlowButton(TQWidget *parent, const char *name, _steps = 0; m_updateTime = 50; - m_pixmapName = TQString::null; + m_pixmapName = TQString(); m_timer = new TQTimer(this); connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimeout())); m_pos = 0; - m_timerStatus = Stop; + m_timertqStatus = Stop; setTipText (tip); setCursor(arrowCursor); @@ -116,7 +116,7 @@ TQString GlowButton::getPixmapName() const return m_pixmapName; } -Qt::ButtonState GlowButton::lastButton() const +TQt::ButtonState GlowButton::lastButton() const { return _last_button; } @@ -132,7 +132,7 @@ void GlowButton::setPixmapName(const TQString& pixmapName) // set steps _steps = pixmap->height()/pixmap->width() - 1; - repaint(false); + tqrepaint(false); } void GlowButton::paintEvent( TQPaintEvent *e ) @@ -160,7 +160,7 @@ void GlowButton::enterEvent( TQEvent *e ) { if( m_pos<0 ) m_pos=-m_pos; - m_timerStatus = Run; + m_timertqStatus = Run; if( ! m_timer->isActive() ) m_timer->start(m_updateTime); TQButton::enterEvent(e); @@ -168,7 +168,7 @@ void GlowButton::enterEvent( TQEvent *e ) void GlowButton::leaveEvent( TQEvent *e ) { - m_timerStatus = Stop; + m_timertqStatus = Stop; if( ! m_timer->isActive() ) m_timer->start(m_updateTime); TQButton::leaveEvent(e); @@ -180,11 +180,11 @@ void GlowButton::mousePressEvent( TQMouseEvent *e ) if( m_timer->isActive() ) m_timer->stop(); m_pos = _steps; - repaint(false); + tqrepaint(false); // without pretending LeftButton, clicking on the button with MidButton // or RightButton would cause unwanted titlebar action TQMouseEvent me (e->type(), e->pos(), e->globalPos(), - (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state()); + (e->button()&m_realizeButtons)?Qt::LeftButton:Qt::NoButton, e->state()); TQButton::mousePressEvent(&me); } @@ -195,22 +195,22 @@ void GlowButton::mouseReleaseEvent( TQMouseEvent *e ) if( ! m_timer->isActive() ) { m_timer->start(m_updateTime); } - if( ! geometry().contains(p) ) { - m_timerStatus = Stop; + if( ! tqgeometry().contains(p) ) { + m_timertqStatus = Stop; } TQMouseEvent me (e->type(), e->pos(), e->globalPos(), - (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state()); + (e->button()&m_realizeButtons)?Qt::LeftButton:Qt::NoButton, e->state()); TQButton::mouseReleaseEvent(&me); } void GlowButton::slotTimeout() { - repaint(false); + tqrepaint(false); if( m_pos>=_steps-1 ) { m_pos = -m_pos; } - if( m_timerStatus==Stop ) { + if( m_timertqStatus==Stop ) { if( m_pos==0 ) { m_timer->stop(); return; @@ -268,29 +268,29 @@ TQPixmap * GlowButtonFactory::createGlowButtonPixmap( uint * src2_line = (uint*) fg_image.scanLine (y); uint * dst_line = (uint*) image.scanLine (i*h+y); for (int x=0; xrepaint(false); + widget()->tqrepaint(false); } void GlowClient::paintEvent( TQPaintEvent * ) { GlowClientConfig *conf = GlowClientGlobals::instance()->config(); TQRect r_this = widget()->rect(); - TQRect r_title = _title_spacer->geometry(); - TQColorGroup titleCg = options()->colorGroup(ColorTitleBar, isActive()); - TQColorGroup titleBlendCg=options()->colorGroup(ColorTitleBlend, isActive()); - TQColorGroup cg = widget()->colorGroup(); + TQRect r_title = _title_spacer->tqgeometry(); + TQColorGroup titleCg = options()->tqcolorGroup(ColorTitleBar, isActive()); + TQColorGroup titleBlendCg=options()->tqcolorGroup(ColorTitleBlend, isActive()); + TQColorGroup cg = widget()->tqcolorGroup(); TQColor titleColor = options()->color(ColorTitleBar, isActive()); TQColor titleBlendColor = options()->color(ColorTitleBlend, isActive()); - TQColor bgColor = widget()->colorGroup().background(); + TQColor bgColor = widget()->tqcolorGroup().background(); TQPainter p; TQPointArray pArray, pArray2, pArray3, pArray4; @@ -443,7 +443,7 @@ void GlowClient::paintEvent( TQPaintEvent * ) p.setPen(options()->color(ColorFont, isActive())); p.drawText(r_title.x(), 0, r_title.width(), r_title.height(), - Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, caption()); + TQt::AlignLeft | TQt::AlignVCenter | TQt::SingleLine, caption()); // draw split color beneath buttons top right pArray4 = TQPointArray(4); @@ -452,7 +452,7 @@ void GlowClient::paintEvent( TQPaintEvent * ) tBSize.height()/2-1); pArray4.setPoint(2, r_title.x()+r_title.width()-1, tBSize.height()); pArray4.setPoint(3, tBSize.width()-1, tBSize.height()); - p.setPen(Qt::NoPen); + p.setPen(TQt::NoPen); p.setBrush(bgColor); p.drawPolygon(pArray4); @@ -479,7 +479,7 @@ void GlowClient::paintEvent( TQPaintEvent * ) pArray3.setPoint(1, 0, 0); pArray3.setPoint(2, tBSize.width()-1, 0); pArray3.setPoint(3, tBSize.width()-1, tBSize.height()-1); - p.setPen(Qt::black); + p.setPen(TQt::black); p.drawPolyline(pArray3); p.end(); @@ -489,10 +489,10 @@ void GlowClient::paintEvent( TQPaintEvent * ) bitBlt(widget(), 0, 0, title_buffer); for (unsigned int i=0; irepaint(false); + m_buttonList[i]->tqrepaint(false); p.begin(widget()); - p.setPen(Qt::black); + p.setPen(TQt::black); //----- // draw borders p.drawLine(0,tBSize.height(),0,r_this.height()-1); @@ -503,7 +503,7 @@ void GlowClient::paintEvent( TQPaintEvent * ) // fill content widget p.fillRect(1, tBSize.height(), r_this.width()-2, r_this.height()-tBSize.height()-1, - options()->colorGroup(ColorFrame, isActive()).background()); + options()->tqcolorGroup(ColorFrame, isActive()).background()); p.end(); // paint resize handle if necessary @@ -511,7 +511,7 @@ void GlowClient::paintEvent( TQPaintEvent * ) && width()>=2 && height() >= RESIZE_HANDLE_HEIGHT) { p.begin(widget()); - p.setPen (Qt::black); + p.setPen (TQt::black); p.drawLine (1, height() - RESIZE_HANDLE_HEIGHT, width()-2, height() - RESIZE_HANDLE_HEIGHT); p.end(); @@ -521,12 +521,12 @@ void GlowClient::paintEvent( TQPaintEvent * ) void GlowClient::showEvent( TQShowEvent * ) { doShape(); - widget()->repaint(false); + widget()->tqrepaint(false); } void GlowClient::mouseDoubleClickEvent( TQMouseEvent *e ) { - if(e->button() == LeftButton && _title_spacer->geometry().contains(e->pos())) + if(e->button() == Qt::LeftButton && _title_spacer->tqgeometry().contains(e->pos())) titlebarDblClickOperation(); } @@ -539,7 +539,7 @@ void GlowClient::wheelEvent( TQWheelEvent *e ) void GlowClient::activeChange() { updateButtonPixmaps(); - widget()->repaint(false); + widget()->tqrepaint(false); } void GlowClient::iconChange() @@ -553,12 +553,12 @@ void GlowClient::shadeChange() void GlowClient::captionChange() { - widget()->update(_title_spacer->geometry()); + widget()->update(_title_spacer->tqgeometry()); } -TQSize GlowClient::minimumSize() const +TQSize GlowClient::tqminimumSize() const { - return widget()->minimumSize(); + return widget()->tqminimumSize(); } void GlowClient::resize( const TQSize& s ) @@ -649,7 +649,7 @@ void GlowClient::createButtons() TQSize size = globals->theme()->buttonSize; m_stickyButton = factory->createGlowButton(widget(), - "StickyButton", isOnAllDesktops()?i18n("Not on all desktops"):i18n("On all desktops"), LeftButton|RightButton); + "StickyButton", isOnAllDesktops()?i18n("Not on all desktops"):i18n("On all desktops"), Qt::LeftButton|Qt::RightButton); m_stickyButton->setFixedSize(size); connect(m_stickyButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(toggleOnAllDesktops())); m_buttonList.insert(m_buttonList.end(), m_stickyButton); @@ -667,7 +667,7 @@ void GlowClient::createButtons() m_buttonList.insert(m_buttonList.end(), m_minimizeButton); m_maximizeButton=factory->createGlowButton(widget(), - "MaximizeButton", i18n("Maximize"), LeftButton|MidButton|RightButton); + "MaximizeButton", i18n("Maximize"), Qt::LeftButton|Qt::MidButton|Qt::RightButton); m_maximizeButton->setFixedSize(size); connect(m_maximizeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMaximize())); m_buttonList.insert(m_buttonList.end(), m_maximizeButton); @@ -746,7 +746,7 @@ void GlowClient::updateButtonPositions() m_leftButtonList.clear(); m_rightButtonList.clear(); - // reset left and right button layout + // reset left and right button tqlayout if(m_leftButtonLayout) delete m_leftButtonLayout; m_leftButtonLayout = new TQBoxLayout(0, TQBoxLayout::LeftToRight, 0, 0, 0); @@ -857,27 +857,27 @@ void GlowClient::slotMaximize() bool GlowClient::eventFilter( TQObject* o, TQEvent* e ) { - if( o != widget()) + if( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(widget())) return false; switch( e->type()) { case TQEvent::Resize: - resizeEvent( static_cast< TQResizeEvent* >( e )); + resizeEvent( TQT_TQRESIZEEVENT( e )); return true; case TQEvent::Paint: - paintEvent( static_cast< TQPaintEvent* >( e )); + paintEvent( TQT_TQPAINTEVENT( e )); return true; case TQEvent::MouseButtonDblClick: - mouseDoubleClickEvent( static_cast< TQMouseEvent* >( e )); + mouseDoubleClickEvent( TQT_TQMOUSEEVENT( e )); return true; case TQEvent::MouseButtonPress: - processMousePressEvent( static_cast< TQMouseEvent* >( e )); + processMousePressEvent( TQT_TQMOUSEEVENT( e )); return true; case TQEvent::Show: - showEvent( static_cast< TQShowEvent* >( e )); + showEvent( TQT_TQSHOWEVENT( e )); return true; case TQEvent::Wheel: - wheelEvent( static_cast< TQWheelEvent* >( e )); + wheelEvent( TQT_TQWHEELEVENT( e )); return true; default: break; diff --git a/kwin-styles/glow/glowclient.h b/kwin-styles/glow/glowclient.h index 41305bc6..9129dce0 100644 --- a/kwin-styles/glow/glowclient.h +++ b/kwin-styles/glow/glowclient.h @@ -144,6 +144,7 @@ private: class GlowClient : public KDecoration { Q_OBJECT + TQ_OBJECT public: GlowClient( KDecorationBridge* b, KDecorationFactory* f ); ~GlowClient(); @@ -151,7 +152,7 @@ public: virtual void init(); virtual void borders( int&, int&, int&, int& ) const; virtual void resize( const TQSize& ); - virtual TQSize minimumSize() const; + virtual TQSize tqminimumSize() const; protected: virtual void resizeEvent( TQResizeEvent * ); diff --git a/kwin-styles/glow/resources.h b/kwin-styles/glow/resources.h index fa575aed..a304b822 100644 --- a/kwin-styles/glow/resources.h +++ b/kwin-styles/glow/resources.h @@ -1,11 +1,11 @@ #ifndef RESOURCES_H #define RESOURCES_H -#define DEFAULT_CLOSE_BUTTON_COLOR Qt::red -#define DEFAULT_MAXIMIZE_BUTTON_COLOR Qt::yellow -#define DEFAULT_ICONIFY_BUTTON_COLOR Qt::green -#define DEFAULT_HELP_BUTTON_COLOR Qt::white -#define DEFAULT_STICKY_BUTTON_COLOR Qt::white +#define DEFAULT_CLOSE_BUTTON_COLOR TQt::red +#define DEFAULT_MAXIMIZE_BUTTON_COLOR TQt::yellow +#define DEFAULT_ICONIFY_BUTTON_COLOR TQt::green +#define DEFAULT_HELP_BUTTON_COLOR TQt::white +#define DEFAULT_STICKY_BUTTON_COLOR TQt::white #endif -- cgit v1.2.1