summaryrefslogtreecommitdiffstats
path: root/kwin/clients/keramik/keramik.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-07 04:10:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-07 04:10:07 +0000
commitfd3a982e26813f5bcc82c7e89ce6fa2ad44432bf (patch)
tree9eda848e56fcb862fdfdf479adeccd95b6fe387a /kwin/clients/keramik/keramik.cpp
parent02f67d0e1355b79b1806746efb0f2f640e57f13d (diff)
downloadtdebase-fd3a982e26813f5bcc82c7e89ce6fa2ad44432bf.tar.gz
tdebase-fd3a982e26813f5bcc82c7e89ce6fa2ad44432bf.zip
Revert automated changes
Sorry guys, they are just not ready for prime time Work will continue as always git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1212480 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwin/clients/keramik/keramik.cpp')
-rw-r--r--kwin/clients/keramik/keramik.cpp152
1 files changed, 76 insertions, 76 deletions
diff --git a/kwin/clients/keramik/keramik.cpp b/kwin/clients/keramik/keramik.cpp
index 64592a3cd..48a187098 100644
--- a/kwin/clients/keramik/keramik.cpp
+++ b/kwin/clients/keramik/keramik.cpp
@@ -62,7 +62,7 @@ namespace Keramik
const int buttonSpacing = 4; // Spacing between the titlebar buttons
const int iconSpacing = 5; // Spacing between the icon and the text label
- // Default button tqlayout
+ // Default button layout
const char default_left[] = "M";
const char default_right[] = "HIAX";
@@ -201,7 +201,7 @@ KeramikHandler::KeramikHandler()
buttonDecos[ ShadeOn ] = new TQBitmap( 17, 17, shade_on_bits, true );
buttonDecos[ ShadeOff ] = new TQBitmap( 17, 17, shade_off_bits, true );
- // Selftqmask the bitmaps
+ // Selfmask the bitmaps
for ( int i = 0; i < NumButtonDecos; i++ )
buttonDecos[i]->setMask( *buttonDecos[i] );
@@ -585,39 +585,39 @@ TQPixmap *KeramikHandler::composite( TQImage *over, TQImage *under )
int width = over->width(), height = over->height();
// Clear the destination image
- TQ_UINT32 *data = reinterpret_cast<TQ_UINT32*>( dest.bits() );
+ Q_UINT32 *data = reinterpret_cast<Q_UINT32*>( dest.bits() );
for (int i = 0; i < width * height; i++)
*(data++) = 0;
// Copy the under image (bottom aligned) to the destination image
for (int y1 = height - under->height(), y2 = 0; y1 < height; y1++, y2++ )
{
- register TQ_UINT32 *dst = reinterpret_cast<TQ_UINT32*>( dest.scanLine(y1) );
- register TQ_UINT32 *src = reinterpret_cast<TQ_UINT32*>( under->scanLine(y2) );
+ register Q_UINT32 *dst = reinterpret_cast<Q_UINT32*>( dest.scanLine(y1) );
+ register Q_UINT32 *src = reinterpret_cast<Q_UINT32*>( under->scanLine(y2) );
for ( int x = 0; x < width; x++ )
*(dst++) = *(src++);
}
// Blend the over image onto the destination
- register TQ_UINT32 *dst = reinterpret_cast<TQ_UINT32*>( dest.bits() );
- register TQ_UINT32 *src = reinterpret_cast<TQ_UINT32*>( over->bits() );
+ register Q_UINT32 *dst = reinterpret_cast<Q_UINT32*>( dest.bits() );
+ register Q_UINT32 *src = reinterpret_cast<Q_UINT32*>( over->bits() );
for ( int i = 0; i < width * height; i++ )
{
- int r1 = tqRed( *dst ), g1 = tqGreen( *dst ), b1 = tqBlue( *dst );
- int r2 = tqRed( *src ), g2 = tqGreen( *src ), b2 = tqBlue( *src );
- int a = tqAlpha( *src );
+ int r1 = qRed( *dst ), g1 = qGreen( *dst ), b1 = qBlue( *dst );
+ int r2 = qRed( *src ), g2 = qGreen( *src ), b2 = qBlue( *src );
+ int a = qAlpha( *src );
if ( a == 0xff )
*dst = *src;
else if ( a != 0x00 )
- *dst = tqRgba( TQ_UINT8( r1 + (((r2 - r1) * a) >> 8) ),
- TQ_UINT8( g1 + (((g2 - g1) * a) >> 8) ),
- TQ_UINT8( b1 + (((b2 - b1) * a) >> 8) ),
+ *dst = qRgba( Q_UINT8( r1 + (((r2 - r1) * a) >> 8) ),
+ Q_UINT8( g1 + (((g2 - g1) * a) >> 8) ),
+ Q_UINT8( b1 + (((b2 - b1) * a) >> 8) ),
0xff );
- else if ( tqAlpha(*dst) == 0x00 )
+ else if ( qAlpha(*dst) == 0x00 )
*dst = 0;
src++; dst++;
@@ -783,7 +783,7 @@ void KeramikButton::enterEvent( TQEvent *e )
TQButton::enterEvent( e );
hover = true;
- tqrepaint( false );
+ repaint( false );
}
@@ -792,7 +792,7 @@ void KeramikButton::leaveEvent( TQEvent *e )
TQButton::leaveEvent( e );
hover = false;
- tqrepaint( false );
+ repaint( false );
}
@@ -831,14 +831,14 @@ void KeramikButton::drawButton( TQPainter *p )
if ( isDown() ) {
// Pressed
- p->drawPixmap( TQPoint(), *pix, TQStyle::tqvisualRect( TQRect(2*size, 0, size, size), pix->rect() ) );
+ p->drawPixmap( TQPoint(), *pix, TQStyle::visualRect( TQRect(2*size, 0, size, size), pix->rect() ) );
p->translate( TQApplication::reverseLayout() ? -1 : 1, 1 );
} else if ( hover )
// Mouse over
- p->drawPixmap( TQPoint(), *pix, TQStyle::tqvisualRect( TQRect(size, 0, size, size), pix->rect() ) );
+ p->drawPixmap( TQPoint(), *pix, TQStyle::visualRect( TQRect(size, 0, size, size), pix->rect() ) );
else
// Normal
- p->drawPixmap( TQPoint(), *pix, TQStyle::tqvisualRect( TQRect(0, 0, size, size), pix->rect() ) );
+ p->drawPixmap( TQPoint(), *pix, TQStyle::visualRect( TQRect(0, 0, size, size), pix->rect() ) );
// Draw the button deco on the bevel
@@ -900,7 +900,7 @@ void KeramikButton::drawButton( TQPainter *p )
KeramikClient::KeramikClient( KDecorationBridge* bridge, KDecorationFactory* factory )
: KDecoration( bridge, factory ),
- activeIcon( NULL ), inactiveIcon( NULL ), captionBufferDirty( true ), tqmaskDirty( true )
+ activeIcon( NULL ), inactiveIcon( NULL ), captionBufferDirty( true ), maskDirty( true )
{
}
@@ -987,7 +987,7 @@ void KeramikClient::reset( unsigned long )
largeTitlebar = true;
largeCaption = isActive();
- widget()->tqlayout()->activate();
+ widget()->layout()->activate();
// Compensate for the titlebar size change
@@ -1002,7 +1002,7 @@ void KeramikClient::reset( unsigned long )
topSpacer->changeSize( 10, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
largeTitlebar = largeCaption = false;
- widget()->tqlayout()->activate();
+ widget()->layout()->activate();
// Compensate for the titlebar size change
// FRAME
@@ -1011,20 +1011,20 @@ void KeramikClient::reset( unsigned long )
calculateCaptionRect();
- captionBufferDirty = tqmaskDirty = true;
+ captionBufferDirty = maskDirty = true;
- // Only tqrepaint the window if it's visible
+ // Only repaint the window if it's visible
// (i.e. not minimized and on the current desktop)
if ( widget()->isVisible() ) {
- widget()->tqrepaint( false );
+ widget()->repaint( false );
for ( int i = 0; i < NumButtons; i++ )
- if ( button[i] ) button[i]->tqrepaint( false );
+ if ( button[i] ) button[i]->repaint( false );
}
}
-void KeramikClient::addButtons( TQBoxLayout *tqlayout, const TQString &s )
+void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s )
{
for ( uint i=0; i < s.length(); i++ )
{
@@ -1035,7 +1035,7 @@ void KeramikClient::addButtons( TQBoxLayout *tqlayout, const TQString &s )
if ( !button[MenuButton] ) {
button[MenuButton] = new KeramikButton( this, "menu", MenuButton, i18n("Menu"), LeftButton|RightButton );
connect( button[MenuButton], TQT_SIGNAL( pressed() ), TQT_SLOT( menuButtonPressed() ) );
- tqlayout->addWidget( button[MenuButton] );
+ layout->addWidget( button[MenuButton] );
}
break;
@@ -1047,7 +1047,7 @@ void KeramikClient::addButtons( TQBoxLayout *tqlayout, const TQString &s )
if(isOnAllDesktops())
button[OnAllDesktopsButton]->toggle();
connect( button[OnAllDesktopsButton], TQT_SIGNAL( clicked() ), TQT_SLOT( toggleOnAllDesktops() ) );
- tqlayout->addWidget( button[OnAllDesktopsButton] );
+ layout->addWidget( button[OnAllDesktopsButton] );
}
break;
@@ -1056,7 +1056,7 @@ void KeramikClient::addButtons( TQBoxLayout *tqlayout, const TQString &s )
if ( !button[HelpButton] && providesContextHelp() ) {
button[HelpButton] = new KeramikButton( this, "help", HelpButton, i18n("Help") );
connect( button[HelpButton], TQT_SIGNAL( clicked() ), TQT_SLOT( showContextHelp() ) );
- tqlayout->addWidget( button[HelpButton] );
+ layout->addWidget( button[HelpButton] );
}
break;
@@ -1065,7 +1065,7 @@ void KeramikClient::addButtons( TQBoxLayout *tqlayout, const TQString &s )
if ( !button[MinButton] && isMinimizable() ) {
button[MinButton] = new KeramikButton( this, "minimize", MinButton, i18n("Minimize") );
connect( button[MinButton], TQT_SIGNAL( clicked() ), TQT_SLOT( minimize() ) );
- tqlayout->addWidget( button[MinButton] );
+ layout->addWidget( button[MinButton] );
}
break;
@@ -1074,7 +1074,7 @@ void KeramikClient::addButtons( TQBoxLayout *tqlayout, const TQString &s )
if ( !button[MaxButton] && isMaximizable() ) {
button[MaxButton] = new KeramikButton( this, "maximize", MaxButton, i18n("Maximize"), LeftButton|MidButton|RightButton );
connect( button[MaxButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotMaximize() ) );
- tqlayout->addWidget( button[MaxButton] );
+ layout->addWidget( button[MaxButton] );
}
break;
@@ -1083,7 +1083,7 @@ void KeramikClient::addButtons( TQBoxLayout *tqlayout, const TQString &s )
if ( !button[CloseButton] && isCloseable() ) {
button[CloseButton] = new KeramikButton( this, "close", CloseButton, i18n("Close") );
connect( button[CloseButton], TQT_SIGNAL( clicked() ), TQT_SLOT( closeWindow() ) );
- tqlayout->addWidget( button[CloseButton] );
+ layout->addWidget( button[CloseButton] );
}
break;
@@ -1092,7 +1092,7 @@ void KeramikClient::addButtons( TQBoxLayout *tqlayout, const TQString &s )
if ( !button[AboveButton]) {
button[AboveButton] = new KeramikButton( this, "above", AboveButton, i18n("Keep Above Others") );
connect( button[AboveButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotAbove() ) );
- tqlayout->addWidget( button[AboveButton] );
+ layout->addWidget( button[AboveButton] );
}
break;
@@ -1101,7 +1101,7 @@ void KeramikClient::addButtons( TQBoxLayout *tqlayout, const TQString &s )
if ( !button[BelowButton]) {
button[BelowButton] = new KeramikButton( this, "below", BelowButton, i18n("Keep Below Others") );
connect( button[BelowButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotBelow() ) );
- tqlayout->addWidget( button[BelowButton] );
+ layout->addWidget( button[BelowButton] );
}
break;
@@ -1111,13 +1111,13 @@ void KeramikClient::addButtons( TQBoxLayout *tqlayout, const TQString &s )
button[ShadeButton] = new KeramikButton( this, "shade", ShadeButton,
isSetShade() ? i18n("Unshade") : i18n( "Shade" ));
connect( button[ShadeButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotShade() ) );
- tqlayout->addWidget( button[ShadeButton] );
+ layout->addWidget( button[ShadeButton] );
}
break;
// Additional spacing
case '_' :
- tqlayout->addSpacing( buttonSpacing );
+ layout->addSpacing( buttonSpacing );
break;
}
}
@@ -1130,8 +1130,8 @@ void KeramikClient::updateMask()
return;
// To maximize performance this code uses precalculated bounding rects
- // to set the window tqmask. This saves us from having to allocate a 1bpp
- // pixmap, paint the tqmask on it and then have the X server iterate
+ // to set the window mask. This saves us from having to allocate a 1bpp
+ // pixmap, paint the mask on it and then have the X server iterate
// over the pixels to compute the bounding rects from it.
TQRegion r;
@@ -1206,7 +1206,7 @@ void KeramikClient::updateMask()
setMask( r, YXBanded );
- tqmaskDirty = false;
+ maskDirty = false;
}
@@ -1260,7 +1260,7 @@ void KeramikClient::updateCaptionBuffer()
( clientHandler->showAppIcons() ? 16 + iconSpacing : 0 );
int xpos = QMAX( (captionRect.width() - tw) / 3, 8 );
- TQRect tr = TQStyle::tqvisualRect( TQRect(xpos, 1, captionRect.width() - xpos - 10,
+ TQRect tr = TQStyle::visualRect( TQRect(xpos, 1, captionRect.width() - xpos - 10,
captionRect.height() - 4), captionBuffer.rect() );
//p.setPen( Qt::red ); // debug
@@ -1269,7 +1269,7 @@ void KeramikClient::updateCaptionBuffer()
// Application icon
if ( clientHandler->showAppIcons() )
{
- TQRect iconRect = TQStyle::tqvisualRect( TQRect(tr.x(),
+ TQRect iconRect = TQStyle::visualRect( TQRect(tr.x(),
1 + (captionRect.height() - 4 - 16) / 2, 16, 16), tr );
TQRect r( icon->rect() );
r.moveCenter( iconRect.center() );
@@ -1304,7 +1304,7 @@ void KeramikClient::updateCaptionBuffer()
{
p.translate( TQApplication::reverseLayout() ? -1 : 1, 1 );
//p.setPen( options()->color(ColorTitleBar, active).dark() );
- if (tqGray(options()->color(ColorFont, active).rgb()) < 100)
+ if (qGray(options()->color(ColorFont, active).rgb()) < 100)
p.setPen( TQColor(200,200,200) );
else
p.setPen( black );
@@ -1328,10 +1328,10 @@ void KeramikClient::calculateCaptionRect()
if ( clientHandler->showAppIcons() )
cw += 16 + 4; // icon width + space
- cw = QMIN( cw, titlebar->tqgeometry().width() );
- captionRect = TQStyle::tqvisualRect( TQRect(titlebar->tqgeometry().x(), (largeCaption ? 0 : titleBaseY),
+ cw = QMIN( cw, titlebar->geometry().width() );
+ captionRect = TQStyle::visualRect( TQRect(titlebar->geometry().x(), (largeCaption ? 0 : titleBaseY),
cw, clientHandler->titleBarHeight(largeCaption) ),
- titlebar->tqgeometry() );
+ titlebar->geometry() );
}
@@ -1341,11 +1341,11 @@ void KeramikClient::captionChange()
calculateCaptionRect();
if ( r.size() != captionRect.size() )
- tqmaskDirty = true;
+ maskDirty = true;
captionBufferDirty = true;
- widget()->tqrepaint( r | captionRect, false );
+ widget()->repaint( r | captionRect, false );
}
@@ -1361,7 +1361,7 @@ void KeramikClient::iconChange()
activeIcon = inactiveIcon = NULL;
captionBufferDirty = true;
- widget()->tqrepaint( captionRect, false );
+ widget()->repaint( captionRect, false );
}
}
@@ -1375,15 +1375,15 @@ void KeramikClient::activeChange()
if ( largeTitlebar ) {
largeCaption = ( active && !maximizedVertical() );
calculateCaptionRect();
- tqmaskDirty = true;
+ maskDirty = true;
}
captionBufferDirty = true;
- widget()->tqrepaint( false );
+ widget()->repaint( false );
for ( int i=0; i < NumButtons; i++ )
- if ( button[i] ) button[i]->tqrepaint( false );
+ if ( button[i] ) button[i]->repaint( false );
}
@@ -1397,27 +1397,27 @@ void KeramikClient::maximizeChange()
largeCaption = largeTitlebar = false;
calculateCaptionRect();
- captionBufferDirty = tqmaskDirty = true;
+ captionBufferDirty = maskDirty = true;
- widget()->tqlayout()->activate();
- widget()->tqrepaint( false );
+ widget()->layout()->activate();
+ widget()->repaint( false );
} else if (( maximizeMode() & MaximizeVertical ) == 0 && !largeTitlebar ) {
// We've been restored - enlarge the titlebar by 3 pixels
topSpacer->changeSize( 10, 4, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
largeCaption = largeTitlebar = true;
calculateCaptionRect();
- captionBufferDirty = tqmaskDirty = true;
+ captionBufferDirty = maskDirty = true;
- widget()->tqlayout()->activate();
- widget()->tqrepaint( false );
+ widget()->layout()->activate();
+ widget()->repaint( false );
}
}
if ( button[ MaxButton ] ) {
TQToolTip::remove( button[ MaxButton ] );
TQToolTip::add( button[ MaxButton ], maximizeMode() == MaximizeFull ? i18n("Restore") : i18n("Maximize") );
- button[ MaxButton ]->tqrepaint();
+ button[ MaxButton ]->repaint();
}
}
@@ -1426,7 +1426,7 @@ void KeramikClient::desktopChange()
{
if ( button[ OnAllDesktopsButton ] )
{
- button[ OnAllDesktopsButton ]->tqrepaint( true );
+ button[ OnAllDesktopsButton ]->repaint( true );
TQToolTip::remove( button[ OnAllDesktopsButton ] );
TQToolTip::add( button[ OnAllDesktopsButton ], isOnAllDesktops() ? i18n("Not on all desktops") : i18n("On all desktops") );
}
@@ -1437,7 +1437,7 @@ void KeramikClient::shadeChange()
{
if ( button[ ShadeButton ] )
{
- button[ ShadeButton ]->tqrepaint( true );
+ button[ ShadeButton ]->repaint( true );
TQToolTip::remove( button[ ShadeButton ] );
TQToolTip::add( button[ ShadeButton ], isSetShade() ? i18n("Unshade") : i18n("Shade") );
}
@@ -1447,14 +1447,14 @@ void KeramikClient::shadeChange()
void KeramikClient::keepAboveChange( bool )
{
if ( button[ AboveButton ] )
- button[ AboveButton ]->tqrepaint( true );
+ button[ AboveButton ]->repaint( true );
}
void KeramikClient::keepBelowChange( bool )
{
if ( button[ BelowButton ] )
- button[ BelowButton ]->tqrepaint( true );
+ button[ BelowButton ]->repaint( true );
}
@@ -1482,21 +1482,21 @@ void KeramikClient::slotMaximize()
void KeramikClient::slotAbove()
{
setKeepAbove( !keepAbove());
- button[ AboveButton ]->tqrepaint( true );
+ button[ AboveButton ]->repaint( true );
}
void KeramikClient::slotBelow()
{
setKeepBelow( !keepBelow());
- button[ BelowButton ]->tqrepaint( true );
+ button[ BelowButton ]->repaint( true );
}
void KeramikClient::slotShade()
{
setShade( !isSetShade());
- button[ ShadeButton ]->tqrepaint( true );
+ button[ ShadeButton ]->repaint( true );
}
@@ -1515,7 +1515,7 @@ void KeramikClient::paintEvent( TQPaintEvent *e )
int leftBorderWidth = clientHandler->tile( BorderLeft, active )->width();
int rightBorderWidth = clientHandler->tile( BorderRight, active )->width();
- if ( tqmaskDirty )
+ if ( maskDirty )
updateMask();
// Titlebar
@@ -1624,7 +1624,7 @@ void KeramikClient::resizeEvent( TQResizeEvent *e )
if ( r.size() != captionRect.size() )
captionBufferDirty = true;
- tqmaskDirty = true;
+ maskDirty = true;
if ( widget()->isVisible() )
{
@@ -1644,11 +1644,11 @@ void KeramikClient::resizeEvent( TQResizeEvent *e )
if ( dx )
{
widget()->update( width() - dx + 1, 0, dx, height() );
- widget()->update( TQRect( TQPoint(4,4), titlebar->tqgeometry().bottomLeft() - TQPoint(1,0) ) );
- widget()->update( TQRect( titlebar->tqgeometry().topRight(), TQPoint( width() - 4,
- titlebar->tqgeometry().bottom() ) ) );
+ widget()->update( TQRect( TQPoint(4,4), titlebar->geometry().bottomLeft() - TQPoint(1,0) ) );
+ widget()->update( TQRect( titlebar->geometry().topRight(), TQPoint( width() - 4,
+ titlebar->geometry().bottom() ) ) );
// Titlebar needs no paint event
- TQApplication::postEvent( this, new TQPaintEvent( titlebar->tqgeometry(), FALSE ) );
+ TQApplication::postEvent( this, new TQPaintEvent( titlebar->geometry(), FALSE ) );
}
}
}
@@ -1657,14 +1657,14 @@ void KeramikClient::resizeEvent( TQResizeEvent *e )
void KeramikClient::mouseDoubleClickEvent( TQMouseEvent *e )
{
if ( e->button() == LeftButton
- && TQRect( 0, 0, width(), clientHandler->titleBarHeight( largeTitlebar ) ).tqcontains( e->pos() ) )
+ && TQRect( 0, 0, width(), clientHandler->titleBarHeight( largeTitlebar ) ).contains( e->pos() ) )
titlebarDblClickOperation();
}
void KeramikClient::wheelEvent( TQWheelEvent *e )
{
if (isSetShade()
- || TQRect( 0, 0, width(), clientHandler->titleBarHeight( largeTitlebar ) ).tqcontains( e->pos() ) )
+ || TQRect( 0, 0, width(), clientHandler->titleBarHeight( largeTitlebar ) ).contains( e->pos() ) )
titlebarMouseWheelOperation( e->delta());
}
@@ -1774,9 +1774,9 @@ void KeramikClient::borders( int& left, int& right, int& top, int& bottom ) cons
}
-TQSize KeramikClient::tqminimumSize() const
+TQSize KeramikClient::minimumSize() const
{
- return widget()->tqminimumSize();
+ return widget()->minimumSize();
}