diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-03 20:16:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-03 20:16:47 +0000 |
commit | 495d08bc2db58ee7fc4ea55a7158f2f61b82fc56 (patch) | |
tree | daabcb652c07b9a17cad88ca50b63a2d91ead4a3 /kwin/lib/kcommondecoration.cpp | |
parent | 50001f1757f97510e80cb1990e2f2d5b00144c2a (diff) | |
download | tdebase-495d08bc2db58ee7fc4ea55a7158f2f61b82fc56.tar.gz tdebase-495d08bc2db58ee7fc4ea55a7158f2f61b82fc56.zip |
Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1211357 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwin/lib/kcommondecoration.cpp')
-rw-r--r-- | kwin/lib/kcommondecoration.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/kwin/lib/kcommondecoration.cpp b/kwin/lib/kcommondecoration.cpp index 87541ad60..a950a7ecb 100644 --- a/kwin/lib/kcommondecoration.cpp +++ b/kwin/lib/kcommondecoration.cpp @@ -73,7 +73,7 @@ bool KCommonDecoration::decorationBehaviour(DecorationBehaviour behaviour) const return false; } -int KCommonDecoration::layoutMetric(LayoutMetric lm, bool, const KCommonDecorationButton *) const +int KCommonDecoration::tqlayoutMetric(LayoutMetric lm, bool, const KCommonDecorationButton *) const { switch (lm) { case LM_BorderLeft: @@ -145,12 +145,12 @@ void KCommonDecoration::updateCaption() void KCommonDecoration::borders( int& left, int& right, int& top, int& bottom ) const { - left = layoutMetric(LM_BorderLeft); - right = layoutMetric(LM_BorderRight); - bottom = layoutMetric(LM_BorderBottom); - top = layoutMetric(LM_TitleHeight) + - layoutMetric(LM_TitleEdgeTop) + - layoutMetric(LM_TitleEdgeBottom); + left = tqlayoutMetric(LM_BorderLeft); + right = tqlayoutMetric(LM_BorderRight); + bottom = tqlayoutMetric(LM_BorderBottom); + top = tqlayoutMetric(LM_TitleHeight) + + tqlayoutMetric(LM_TitleEdgeTop) + + tqlayoutMetric(LM_TitleEdgeBottom); updateLayout(); // TODO!! don't call everytime we are in ::borders } @@ -161,14 +161,14 @@ void KCommonDecoration::updateLayout() const int r_x, r_y, r_x2, r_y2; r.coords(&r_x, &r_y, &r_x2, &r_y2); - // layout preview widget + // tqlayout preview widget if (m_previewWidget) { - const int borderLeft = layoutMetric(LM_BorderLeft); - const int borderRight = layoutMetric(LM_BorderRight); - const int borderBottom = layoutMetric(LM_BorderBottom); - const int titleHeight = layoutMetric(LM_TitleHeight); - const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop); - const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom); + const int borderLeft = tqlayoutMetric(LM_BorderLeft); + const int borderRight = tqlayoutMetric(LM_BorderRight); + const int borderBottom = tqlayoutMetric(LM_BorderBottom); + const int titleHeight = tqlayoutMetric(LM_TitleHeight); + const int titleEdgeTop = tqlayoutMetric(LM_TitleEdgeTop); + const int titleEdgeBottom = tqlayoutMetric(LM_TitleEdgeBottom); int left = r_x+borderLeft; int top = r_y+titleEdgeTop+titleHeight+titleEdgeBottom; @@ -182,28 +182,28 @@ void KCommonDecoration::updateLayout() const // resize buttons... for (int n=0; n<NumButtons; n++) { if (m_button[n]) { - TQSize newSize = TQSize(layoutMetric(LM_ButtonWidth, true, m_button[n]), - layoutMetric(LM_ButtonHeight, true, m_button[n]) ); + TQSize newSize = TQSize(tqlayoutMetric(LM_ButtonWidth, true, m_button[n]), + tqlayoutMetric(LM_ButtonHeight, true, m_button[n]) ); if (newSize != m_button[n]->size() ) m_button[n]->setSize(newSize); } } - // layout buttons - int y = r_y + layoutMetric(LM_TitleEdgeTop) + layoutMetric(LM_ButtonMarginTop); + // tqlayout buttons + int y = r_y + tqlayoutMetric(LM_TitleEdgeTop) + tqlayoutMetric(LM_ButtonMarginTop); if (m_buttonsLeft.count() > 0) { - const int buttonSpacing = layoutMetric(LM_ButtonSpacing); - int x = r_x + layoutMetric(LM_TitleEdgeLeft); + const int buttonSpacing = tqlayoutMetric(LM_ButtonSpacing); + int x = r_x + tqlayoutMetric(LM_TitleEdgeLeft); for (ButtonContainer::const_iterator it = m_buttonsLeft.begin(); it != m_buttonsLeft.end(); ++it) { bool elementLayouted = false; if (*it) { if (!(*it)->isHidden() ) { moveWidget(x,y, *it); - x += layoutMetric(LM_ButtonWidth, true, ::qt_cast<KCommonDecorationButton*>(*it) ); + x += tqlayoutMetric(LM_ButtonWidth, true, ::qt_cast<KCommonDecorationButton*>(*it) ); elementLayouted = true; } } else { - x+= layoutMetric(LM_ExplicitButtonSpacer); + x+= tqlayoutMetric(LM_ExplicitButtonSpacer); elementLayouted = true; } if (elementLayouted && it != m_buttonsLeft.end() ) @@ -212,20 +212,20 @@ void KCommonDecoration::updateLayout() const } if (m_buttonsRight.count() > 0) { - const int titleEdgeRightLeft = r_x2-layoutMetric(LM_TitleEdgeRight)+1; + const int titleEdgeRightLeft = r_x2-tqlayoutMetric(LM_TitleEdgeRight)+1; - const int buttonSpacing = layoutMetric(LM_ButtonSpacing); + const int buttonSpacing = tqlayoutMetric(LM_ButtonSpacing); int x = titleEdgeRightLeft - buttonContainerWidth(m_buttonsRight); for (ButtonContainer::const_iterator it = m_buttonsRight.begin(); it != m_buttonsRight.end(); ++it) { bool elementLayouted = false; if (*it) { if (!(*it)->isHidden() ) { moveWidget(x,y, *it); - x += layoutMetric(LM_ButtonWidth, true, ::qt_cast<KCommonDecorationButton*>(*it) );; + x += tqlayoutMetric(LM_ButtonWidth, true, ::qt_cast<KCommonDecorationButton*>(*it) );; elementLayouted = true; } } else { - x += layoutMetric(LM_ExplicitButtonSpacer); + x += tqlayoutMetric(LM_ExplicitButtonSpacer); elementLayouted = true; } if (elementLayouted && it != m_buttonsRight.end() ) @@ -277,8 +277,8 @@ void KCommonDecoration::resetLayout() const int minTitleBarWidth = 35; btnHideMinWidth = buttonContainerWidth(m_buttonsLeft,true) + buttonContainerWidth(m_buttonsRight,true) + - layoutMetric(LM_TitleEdgeLeft,false) + layoutMetric(LM_TitleEdgeRight,false) + - layoutMetric(LM_TitleBorderLeft,false) + layoutMetric(LM_TitleBorderRight,false) + + tqlayoutMetric(LM_TitleEdgeLeft,false) + tqlayoutMetric(LM_TitleEdgeRight,false) + + tqlayoutMetric(LM_TitleBorderLeft,false) + tqlayoutMetric(LM_TitleBorderRight,false) + minTitleBarWidth; btnHideLastWidth = 0; } @@ -295,7 +295,7 @@ int KCommonDecoration::buttonsRightWidth() const int KCommonDecoration::buttonContainerWidth(const ButtonContainer &btnContainer, bool countHidden) const { - int explicitSpacer = layoutMetric(LM_ExplicitButtonSpacer); + int explicitSpacer = tqlayoutMetric(LM_ExplicitButtonSpacer); int shownElementsCount = 0; @@ -311,7 +311,7 @@ int KCommonDecoration::buttonContainerWidth(const ButtonContainer &btnContainer, ++shownElementsCount; } } - w += layoutMetric(LM_ButtonSpacing)*(shownElementsCount-1); + w += tqlayoutMetric(LM_ButtonSpacing)*(shownElementsCount-1); return w; } @@ -437,7 +437,7 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString if (btn) { btn->setLeft(isLeft); - btn->setSize(TQSize(layoutMetric(LM_ButtonWidth, true, btn),layoutMetric(LM_ButtonHeight, true, btn)) ); + btn->setSize(TQSize(tqlayoutMetric(LM_ButtonWidth, true, btn),tqlayoutMetric(LM_ButtonHeight, true, btn)) ); btn->show(); btnContainer.append(btn); } @@ -497,15 +497,15 @@ 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)) - +layoutMetric(LM_TitleBorderLeft)+layoutMetric(LM_TitleBorderRight); + const int minWidth = QMAX(tqlayoutMetric(LM_TitleEdgeLeft), tqlayoutMetric(LM_BorderLeft)) + +QMAX(tqlayoutMetric(LM_TitleEdgeRight), tqlayoutMetric(LM_BorderRight)) + +tqlayoutMetric(LM_TitleBorderLeft)+tqlayoutMetric(LM_TitleBorderRight); return TQSize(minWidth, - layoutMetric(LM_TitleEdgeTop)+layoutMetric(LM_TitleHeight) - +layoutMetric(LM_TitleEdgeBottom) - +layoutMetric(LM_BorderBottom) ); + tqlayoutMetric(LM_TitleEdgeTop)+tqlayoutMetric(LM_TitleHeight) + +tqlayoutMetric(LM_TitleEdgeBottom) + +tqlayoutMetric(LM_BorderBottom) ); } void KCommonDecoration::maximizeChange() @@ -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(); } @@ -688,7 +688,7 @@ void KCommonDecoration::mouseDoubleClickEvent(TQMouseEvent *e) if( e->button() != LeftButton ) return; - int tb = layoutMetric(LM_TitleEdgeTop)+layoutMetric(LM_TitleHeight)+layoutMetric(LM_TitleEdgeBottom); + int tb = tqlayoutMetric(LM_TitleEdgeTop)+tqlayoutMetric(LM_TitleHeight)+tqlayoutMetric(LM_TitleEdgeBottom); // when shaded, react on double clicks everywhere to make it easier to unshade. otherwise // react only on double clicks in the title bar region... if (isSetShade() || e->pos().y() <= tb ) @@ -697,14 +697,14 @@ void KCommonDecoration::mouseDoubleClickEvent(TQMouseEvent *e) void KCommonDecoration::wheelEvent(TQWheelEvent *e) { - int tb = layoutMetric(LM_TitleEdgeTop)+layoutMetric(LM_TitleHeight)+layoutMetric(LM_TitleEdgeBottom); + int tb = tqlayoutMetric(LM_TitleEdgeTop)+tqlayoutMetric(LM_TitleHeight)+tqlayoutMetric(LM_TitleEdgeBottom); if (isSetShade() || e->pos().y() <= tb ) titlebarMouseWheelOperation( e->delta()); } KCommonDecoration::Position KCommonDecoration::mousePosition(const TQPoint &point) const { - const int corner = 18+3*layoutMetric(LM_BorderBottom, false)/2; + const int corner = 18+3*tqlayoutMetric(LM_BorderBottom, false)/2; Position pos = PositionCenter; TQRect r = widget()->rect(); @@ -712,14 +712,14 @@ KCommonDecoration::Position KCommonDecoration::mousePosition(const TQPoint &poin r.coords(&r_x, &r_y, &r_x2, &r_y2); int p_x = point.x(); int p_y = point.y(); - const int borderLeft = layoutMetric(LM_BorderLeft); -// const int borderRight = layoutMetric(LM_BorderRight); - const int borderBottom = layoutMetric(LM_BorderBottom); - const int titleHeight = layoutMetric(LM_TitleHeight); - const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop); - const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom); - const int titleEdgeLeft = layoutMetric(LM_TitleEdgeLeft); - const int titleEdgeRight = layoutMetric(LM_TitleEdgeRight); + const int borderLeft = tqlayoutMetric(LM_BorderLeft); +// const int borderRight = tqlayoutMetric(LM_BorderRight); + const int borderBottom = tqlayoutMetric(LM_BorderBottom); + const int titleHeight = tqlayoutMetric(LM_TitleHeight); + const int titleEdgeTop = tqlayoutMetric(LM_TitleEdgeTop); + const int titleEdgeBottom = tqlayoutMetric(LM_TitleEdgeBottom); + const int titleEdgeLeft = tqlayoutMetric(LM_TitleEdgeLeft); + const int titleEdgeRight = tqlayoutMetric(LM_TitleEdgeRight); const int borderBottomTop = r_y2-borderBottom+1; const int borderLeftRight = r_x+borderLeft-1; @@ -769,7 +769,7 @@ KCommonDecoration::Position KCommonDecoration::mousePosition(const TQPoint &poin void KCommonDecoration::updateWindowShape() { - // don't mask the widget... + // don't tqmask the widget... if (!decorationBehaviour(DB_WindowMask) ) return; @@ -783,7 +783,7 @@ void KCommonDecoration::updateWindowShape() for(int screen=0; screen < desktop->numScreens(); ++screen) { TQRect fullscreen(desktop->screenGeometry(screen)); - TQRect window = geometry(); + TQRect window = tqgeometry(); if(window.topLeft() == fullscreen.topLeft() ) tl = false; if(window.topRight() == fullscreen.topRight() ) tr = false; @@ -791,30 +791,30 @@ void KCommonDecoration::updateWindowShape() if(window.bottomRight()== fullscreen.bottomRight() ) br = false; } - TQRegion mask(0, 0, w, h); + TQRegion tqmask(0, 0, w, h); // Remove top-left corner. if(tl) { - mask -= cornerShape(WC_TopLeft); + tqmask -= cornerShape(WC_TopLeft); } // Remove top-right corner. if(tr) { - mask -= cornerShape(WC_TopRight); + tqmask -= cornerShape(WC_TopRight); } // Remove top-left corner. if(bl) { - mask -= cornerShape(WC_BottomLeft); + tqmask -= cornerShape(WC_BottomLeft); } // Remove top-right corner. if(br) { - mask -= cornerShape(WC_BottomRight); + tqmask -= cornerShape(WC_BottomRight); } - setMask( mask ); + setMask( tqmask ); } bool KCommonDecoration::eventFilter( TQObject* o, TQEvent* e ) @@ -857,13 +857,13 @@ TQRect KCommonDecoration::titleRect() const { int r_x, r_y, r_x2, r_y2; 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); - const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom); - const int titleBorderLeft = layoutMetric(LM_TitleBorderLeft); - const int titleBorderRight = layoutMetric(LM_TitleBorderRight); - const int ttlHeight = layoutMetric(LM_TitleHeight); + const int titleEdgeLeft = tqlayoutMetric(LM_TitleEdgeLeft); + const int titleEdgeTop = tqlayoutMetric(LM_TitleEdgeTop); + const int titleEdgeRight = tqlayoutMetric(LM_TitleEdgeRight); + const int titleEdgeBottom = tqlayoutMetric(LM_TitleEdgeBottom); + const int titleBorderLeft = tqlayoutMetric(LM_TitleBorderLeft); + const int titleBorderRight = tqlayoutMetric(LM_TitleBorderRight); + const int ttlHeight = tqlayoutMetric(LM_TitleHeight); const int titleEdgeBottomBottom = r_y+titleEdgeTop+ttlHeight+titleEdgeBottom-1; return TQRect(r_x+titleEdgeLeft+buttonsLeftWidth()+titleBorderLeft, r_y+titleEdgeTop, r_x2-titleEdgeRight-buttonsRightWidth()-titleBorderRight-(r_x+titleEdgeLeft+buttonsLeftWidth()+titleBorderLeft), @@ -921,7 +921,7 @@ void KCommonDecorationButton::setSize(const TQSize &s) } } -TQSize KCommonDecorationButton::sizeHint() const +TQSize KCommonDecorationButton::tqsizeHint() const { return m_size; } |