diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-19 01:42:14 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-19 01:42:14 +0000 |
commit | 8155225c9be993acc0512956416d195edfef4eb9 (patch) | |
tree | de4f3cd17614fc67e47eefabcdbe2fbe170c9be7 /kwin/lib | |
parent | 364641b8e0279758d236af39abd138d379328a19 (diff) | |
download | tdebase-8155225c9be993acc0512956416d195edfef4eb9.tar.gz tdebase-8155225c9be993acc0512956416d195edfef4eb9.zip |
Enable compilation with TQt for Qt4 3.4.0 TP2
This should not break compatibility with TQt for Qt3; if it does please fix it ASAP!
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1215552 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwin/lib')
-rw-r--r-- | kwin/lib/kcommondecoration.cpp | 38 | ||||
-rw-r--r-- | kwin/lib/kcommondecoration.h | 13 | ||||
-rw-r--r-- | kwin/lib/kdecoration.cpp | 6 | ||||
-rw-r--r-- | kwin/lib/kdecoration.h | 16 | ||||
-rw-r--r-- | kwin/lib/kdecoration_plugins_p.cpp | 2 | ||||
-rw-r--r-- | kwin/lib/kdecorationfactory.cpp | 2 | ||||
-rw-r--r-- | kwin/lib/kdecorationfactory.h | 2 |
7 files changed, 41 insertions, 38 deletions
diff --git a/kwin/lib/kcommondecoration.cpp b/kwin/lib/kcommondecoration.cpp index 87541ad60..eabcc16b5 100644 --- a/kwin/lib/kcommondecoration.cpp +++ b/kwin/lib/kcommondecoration.cpp @@ -199,7 +199,7 @@ void KCommonDecoration::updateLayout() const if (*it) { if (!(*it)->isHidden() ) { moveWidget(x,y, *it); - x += layoutMetric(LM_ButtonWidth, true, ::qt_cast<KCommonDecorationButton*>(*it) ); + x += layoutMetric(LM_ButtonWidth, true, ::tqqt_cast<KCommonDecorationButton*>(*it) ); elementLayouted = true; } } else { @@ -221,7 +221,7 @@ void KCommonDecoration::updateLayout() const if (*it) { if (!(*it)->isHidden() ) { moveWidget(x,y, *it); - x += layoutMetric(LM_ButtonWidth, true, ::qt_cast<KCommonDecorationButton*>(*it) );; + x += layoutMetric(LM_ButtonWidth, true, ::tqqt_cast<KCommonDecorationButton*>(*it) );; elementLayouted = true; } } else { @@ -327,7 +327,7 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString btn = createButton(MenuButton); if (!btn) break; btn->setTipText(i18n("Menu") ); - btn->setRealizeButtons(LeftButton|RightButton); + btn->setRealizeButtons(Qt::LeftButton|Qt::RightButton); connect(btn, TQT_SIGNAL(pressed()), TQT_SLOT(menuButtonPressed())); connect(btn, TQT_SIGNAL(released()), this, TQT_SLOT(menuButtonReleased())); @@ -371,7 +371,7 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString if ((!m_button[MaxButton]) && isMaximizable()){ btn = createButton(MaxButton); if (!btn) break; - btn->setRealizeButtons(LeftButton|MidButton|RightButton); + btn->setRealizeButtons(Qt::LeftButton|Qt::MidButton|Qt::RightButton); const bool max = maximizeMode()==MaximizeFull; btn->setTipText(max?i18n("Restore"):i18n("Maximize") ); btn->setToggleButton(true); @@ -497,7 +497,7 @@ void KCommonDecoration::resize( const TQSize& s ) widget()->resize( s ); } -TQSize KCommonDecoration::minimumSize() const +TQSize KCommonDecoration::tqminimumSize() const { const int minWidth = QMAX(layoutMetric(LM_TitleEdgeLeft), layoutMetric(LM_BorderLeft)) +QMAX(layoutMetric(LM_TitleEdgeRight), layoutMetric(LM_BorderRight)) @@ -659,7 +659,7 @@ void KCommonDecoration::resizeEvent(TQResizeEvent */*e*/) updateWindowShape(); // FIXME: don't update() here! this would result in two paintEvent()s - // because there is already "something" else triggering the repaint... + // because there is already "something" else triggering the tqrepaint... // widget()->update(); } @@ -685,7 +685,7 @@ void KCommonDecoration::resizeWidget(int w, int h, TQWidget *widget) const void KCommonDecoration::mouseDoubleClickEvent(TQMouseEvent *e) { - if( e->button() != LeftButton ) + if( e->button() != Qt::LeftButton ) return; int tb = layoutMetric(LM_TitleEdgeTop)+layoutMetric(LM_TitleHeight)+layoutMetric(LM_TitleEdgeBottom); @@ -819,24 +819,24 @@ void KCommonDecoration::updateWindowShape() bool KCommonDecoration::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::Wheel: - wheelEvent( static_cast< TQWheelEvent* >( e )); + wheelEvent(TQT_TQWHEELEVENT( e )); return true; default: return false; @@ -856,7 +856,7 @@ bool KCommonDecoration::isToolWindow() const TQRect KCommonDecoration::titleRect() const { int r_x, r_y, r_x2, r_y2; - widget()->rect().coords(&r_x, &r_y, &r_x2, &r_y2); + TQT_TQRECT_OBJECT(widget()->rect()).coords(&r_x, &r_y, &r_x2, &r_y2); const int titleEdgeLeft = layoutMetric(LM_TitleEdgeLeft); const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop); const int titleEdgeRight = layoutMetric(LM_TitleEdgeRight); @@ -875,8 +875,8 @@ KCommonDecorationButton::KCommonDecorationButton(ButtonType type, KCommonDecorat : TQButton(parent->widget(), name), m_decoration(parent), m_type(type), - m_realizeButtons(LeftButton), - m_lastMouse(NoButton), + m_realizeButtons(Qt::LeftButton), + m_lastMouse(Qt::NoButton), m_isLeft(true) { setCursor(ArrowCursor); @@ -921,7 +921,7 @@ void KCommonDecorationButton::setSize(const TQSize &s) } } -TQSize KCommonDecorationButton::sizeHint() const +TQSize KCommonDecorationButton::tqsizeHint() const { return m_size; } @@ -950,7 +950,7 @@ void KCommonDecorationButton::mousePressEvent(TQMouseEvent* e) m_lastMouse = e->button(); // pass on event after changing button to LeftButton 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); } @@ -960,7 +960,7 @@ void KCommonDecorationButton::mouseReleaseEvent(TQMouseEvent* e) m_lastMouse = e->button(); // pass on event after changing button to LeftButton 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); } diff --git a/kwin/lib/kcommondecoration.h b/kwin/lib/kcommondecoration.h index f515a7da7..4dcaf51fb 100644 --- a/kwin/lib/kcommondecoration.h +++ b/kwin/lib/kcommondecoration.h @@ -177,7 +177,7 @@ class KWIN_EXPORT KCommonDecoration : public KDecoration /** * This updates the window mask using the information provided by * cornerShape(). Edges which are aligned to screen corners are not - * shaped for better usability (remember to paint these areas in paintEvent(), too). + * tqshaped for better usability (remember to paint these areas in paintEvent(), too). * You normally don't want/need to reimplement updateWindowShape(). * @see cornerShape() */ @@ -202,7 +202,7 @@ class KWIN_EXPORT KCommonDecoration : public KDecoration */ void updateLayout() const; /** - * Makes sure all buttons are repainted. + * Makes sure all buttons are tqrepainted. */ void updateButtons() const; /** @@ -233,7 +233,7 @@ class KWIN_EXPORT KCommonDecoration : public KDecoration virtual void borders( int& left, int& right, int& top, int& bottom ) const; virtual void show(); virtual void resize(const TQSize& s); - virtual TQSize minimumSize() const; + virtual TQSize tqminimumSize() const; virtual void maximizeChange(); virtual void desktopChange(); virtual void shadeChange(); @@ -287,10 +287,13 @@ class KWIN_EXPORT KCommonDecoration : public KDecoration /** * Title bar buttons of KCommonDecoration need to inherit this class. */ -class KWIN_EXPORT KCommonDecorationButton : public QButton +class KWIN_EXPORT KCommonDecorationButton : public TQButton { friend class KCommonDecoration; + Q_OBJECT + TQ_OBJECT + public: KCommonDecorationButton(ButtonType type, KCommonDecoration *parent, const char *name); virtual ~KCommonDecorationButton(); @@ -343,7 +346,7 @@ class KWIN_EXPORT KCommonDecorationButton : public QButton */ ButtonState lastMousePress() const { return m_lastMouse; } - TQSize sizeHint() const; + TQSize tqsizeHint() const; protected: void setToggleButton(bool toggle); diff --git a/kwin/lib/kdecoration.cpp b/kwin/lib/kdecoration.cpp index 97c8965e9..a8b78bee5 100644 --- a/kwin/lib/kdecoration.cpp +++ b/kwin/lib/kdecoration.cpp @@ -388,14 +388,14 @@ const TQFont& KDecorationOptions::font(bool active, bool small) const return(active ? d->activeFont : d->inactiveFont); } -const TQColorGroup& KDecorationOptions::colorGroup(ColorType type, bool active) const +const TQColorGroup& KDecorationOptions::tqcolorGroup(ColorType type, bool active) const { int idx = type + (active ? 0 : NUM_COLORS); if(d->cg[idx]) return(*d->cg[idx]); d->cg[idx] = new TQColorGroup(Qt::black, d->colors[idx], d->colors[idx].light(150), d->colors[idx].dark(), d->colors[idx].dark(120), - Qt::black, TQApplication::palette().active(). + Qt::black, TQApplication::tqpalette().active(). base()); return(*d->cg[idx]); } @@ -434,7 +434,7 @@ bool KDecorationOptions::moveResizeMaximizedWindows() const return d->move_resize_maximized_windows; } -KDecorationDefines::WindowOperation KDecorationOptions::operationMaxButtonClick( Qt::ButtonState button ) const +KDecorationDefines::WindowOperation KDecorationOptions::operationMaxButtonClick( TQt::ButtonState button ) const { return button == Qt::RightButton? d->OpMaxButtonRightClick : button == Qt::MidButton? d->OpMaxButtonMiddleClick : diff --git a/kwin/lib/kdecoration.h b/kwin/lib/kdecoration.h index f41f19041..7ce588142 100644 --- a/kwin/lib/kdecoration.h +++ b/kwin/lib/kdecoration.h @@ -205,7 +205,7 @@ public: * @param type The requested color type. * @param active Whether to return the color for active or inactive windows. */ - const TQColorGroup& colorGroup(ColorType type, bool active=true) const; + const TQColorGroup& tqcolorGroup(ColorType type, bool active=true) const; /** * Returns the active or inactive decoration font. * The changed flags for this setting is SettingFont. @@ -286,7 +286,7 @@ public: /** * @internal */ - WindowOperation operationMaxButtonClick( Qt::ButtonState button ) const; + WindowOperation operationMaxButtonClick( TQt::ButtonState button ) const; /** * @internal @@ -481,15 +481,15 @@ class KWIN_EXPORT KDecoration void performWindowOperation( WindowOperation op ); /** * If the decoration is non-rectangular, this function needs to be called - * to set the shape of the decoration. + * to set the tqshape of the decoration. * - * @param reg The shape of the decoration. + * @param reg The tqshape of the decoration. * @param mode The X11 values Unsorted, YSorted, YXSorted and YXBanded that specify * the sorting of the rectangles, default value is Unsorted. */ void setMask( const TQRegion& reg, int mode = 0 ); /** - * This convenience function resets the shape mask. + * This convenience function resets the tqshape mask. */ void clearMask(); // convenience /** @@ -573,13 +573,13 @@ class KWIN_EXPORT KDecoration * whether it's shaded. Decorations often turn off their bottom border when the * window is shaded, and turn off their left/right/bottom borders when * the window is maximized and moving and resizing of maximized windows is disabled. - * This function mustn't do any repaints or resizes. Also, if the sizes returned + * This function mustn't do any tqrepaints or resizes. Also, if the sizes returned * by this function don't match the real values, this may result in drawing errors * or other problems. * * @see KDecorationOptions::moveResizeMaximizedWindows() */ - // mustn't do any repaints, resizes or anything like that + // mustn't do any tqrepaints, resizes or anything like that virtual void borders( int& left, int& right, int& top, int& bottom ) const = 0; /** * This method is called by kwin when the style should resize the decoration window. @@ -594,7 +594,7 @@ class KWIN_EXPORT KDecoration * Note that the returned size shouldn't be too large, because it will be * used to keep the decorated window at least as large. */ - virtual TQSize minimumSize() const = 0; + virtual TQSize tqminimumSize() const = 0; /** * This function is called whenever the window either becomes or stops being active. * Use isActive() to find out the current state. diff --git a/kwin/lib/kdecoration_plugins_p.cpp b/kwin/lib/kdecoration_plugins_p.cpp index 0490e4755..2e870eaf4 100644 --- a/kwin/lib/kdecoration_plugins_p.cpp +++ b/kwin/lib/kdecoration_plugins_p.cpp @@ -167,7 +167,7 @@ bool KDecorationPlugins::loadPlugin( TQString nameStr ) // For clients in kdeartwork TQString catalogue = nameStr; - catalogue.replace( "kwin3_", "kwin_" ); + catalogue.tqreplace( "kwin3_", "kwin_" ); KGlobal::locale()->insertCatalogue( catalogue ); // For KCommonDecoration based clients KGlobal::locale()->insertCatalogue( "kwin_lib" ); diff --git a/kwin/lib/kdecorationfactory.cpp b/kwin/lib/kdecorationfactory.cpp index 7ad1aefbe..65fde37bc 100644 --- a/kwin/lib/kdecorationfactory.cpp +++ b/kwin/lib/kdecorationfactory.cpp @@ -58,7 +58,7 @@ TQValueList< KDecorationDefines::BorderSize > KDecorationFactory::borderSizes() bool KDecorationFactory::exists( const KDecoration* deco ) const { - return _decorations.contains( const_cast< KDecoration* >( deco )); + return _decorations.tqcontains( const_cast< KDecoration* >( deco )); } void KDecorationFactory::addDecoration( KDecoration* deco ) diff --git a/kwin/lib/kdecorationfactory.h b/kwin/lib/kdecorationfactory.h index 7396ad987..fb560c492 100644 --- a/kwin/lib/kdecorationfactory.h +++ b/kwin/lib/kdecorationfactory.h @@ -56,7 +56,7 @@ class KWIN_EXPORT KDecorationFactory * The argument specifies what has changed, using the SettingXXX masks. * It should be determined whether the decorations need to be completely * remade, in which case true should be returned, or whether only e.g. - * a repaint will be sufficient, in which case false should be returned, + * a tqrepaint will be sufficient, in which case false should be returned, * and resetDecorations() can be called to reset all decoration objects. * Note that true should be returned only when really necessary. */ |