TRUE->true, FALSE->false

svn path=/trunk/KDE/kdebase/workspace/; revision=511180
This commit is contained in:
Allen Winter 2006-02-19 01:33:48 +00:00
parent 441523a689
commit ae65a40c7a
22 changed files with 175 additions and 175 deletions

View file

@ -646,7 +646,7 @@ Time Client::readUserCreationTime() const
unsigned char *data = 0;
KXErrorHandler handler; // ignore errors?
status = XGetWindowProperty( QX11Info::display(), window(),
atoms->kde_net_wm_user_creation_time, 0, 10000, FALSE, XA_CARDINAL,
atoms->kde_net_wm_user_creation_time, 0, 10000, false, XA_CARDINAL,
&type, &format, &nitems, &extra, &data );
if (status == Success )
{

View file

@ -108,7 +108,7 @@ Atoms::Atoms()
assert( n <= max );
XInternAtoms( QX11Info::display(), names, n, FALSE, atoms_return );
XInternAtoms( QX11Info::display(), names, n, false, atoms_return );
for (int i = 0; i < n; i++ )
*atoms[i] = atoms_return[i];
}

View file

@ -100,23 +100,23 @@ Client::Client( Workspace *ws )
desk = 0; // no desktop yet
mode = PositionCenter;
buttonDown = FALSE;
moveResizeMode = FALSE;
buttonDown = false;
moveResizeMode = false;
info = NULL;
shade_mode = ShadeNone;
active = FALSE;
active = false;
deleting = false;
keep_above = FALSE;
keep_below = FALSE;
is_shape = FALSE;
keep_above = false;
keep_below = false;
is_shape = false;
motif_noborder = false;
motif_may_move = TRUE;
motif_may_resize = TRUE;
motif_may_close = TRUE;
motif_may_move = true;
motif_may_resize = true;
motif_may_close = true;
fullscreen_mode = FullScreenNone;
skip_taskbar = FALSE;
skip_taskbar = false;
original_skip_taskbar = false;
minimized = false;
hidden = false;
@ -134,8 +134,8 @@ Client::Client( Workspace *ws )
Ptakeactivity = 0;
Pcontexthelp = 0;
Pping = 0;
input = FALSE;
skip_pager = FALSE;
input = false;
skip_pager = false;
max_mode = MaximizeRestore;
maxmode_restore = MaximizeRestore;
@ -181,7 +181,7 @@ void Client::releaseWindow( bool on_shutdown )
deleting = true;
workspace()->discardUsedWindowRules( this, true ); // remove ForceTemporarily rules
StackingUpdatesBlocker blocker( workspace());
if (!custom_opacity) setOpacity(FALSE);
if (!custom_opacity) setOpacity(false);
if (moveResizeMode)
leaveMoveResize();
finishWindowRules();
@ -390,7 +390,7 @@ void Client::detectShapable()
case NET::Menu :
case NET::Dialog :
case NET::Utility :
setShapable(FALSE);
setShapable(false);
break;
default:
assert( false );
@ -454,7 +454,7 @@ void Client::setUserNoBorder( bool set )
void Client::updateShape()
{
setShapable(TRUE);
setShapable(true);
if ( shape() )
{
XShapeCombineShape(QX11Info::display(), frameId(), ShapeBounding,
@ -586,7 +586,7 @@ void Client::unminimize( bool avoid_animation )
if( isOnCurrentDesktop() && isShown( true ))
{
if( mainClients().isEmpty() && !avoid_animation )
animateMinimizeOrUnminimize( FALSE );
animateMinimizeOrUnminimize( false );
}
updateVisibility();
updateAllowedActions();
@ -655,7 +655,7 @@ void Client::animateMinimizeOrUnminimize( bool minimize )
float diff;
QPainter p ( workspace()->desktopWidget() );
bool need_to_clear = FALSE;
bool need_to_clear = false;
QPixmap pm3;
do
{
@ -667,12 +667,12 @@ void Client::animateMinimizeOrUnminimize( bool minimize )
if ( need_to_clear )
{
p.drawPixmap( area2.x(), area2.y(), pm3 );
need_to_clear = FALSE;
need_to_clear = false;
}
area2 = area;
}
XFlush(QX11Info::display());
XSync( QX11Info::display(), FALSE );
XSync( QX11Info::display(), false );
diff = t.elapsed();
if (diff > step)
diff = step;
@ -687,7 +687,7 @@ void Client::animateMinimizeOrUnminimize( bool minimize )
else
{ // no overlap, we can clear later to avoid flicker
pm3 = pm2;
need_to_clear = TRUE;
need_to_clear = true;
}
}
} while ( t.elapsed() < step);
@ -772,7 +772,7 @@ void Client::setShade( ShadeMode mode )
XSelectInput( QX11Info::display(), wrapper, ClientWinMask | SubstructureNotifyMask );
//as we hid the unmap event, xcompmgr didn't recognize the client wid has vanished, so we'll extra inform it
//done xcompmgr workaround
// FRAME repaint( FALSE );
// FRAME repaint( false );
// bool wasStaticContents = testWFlags( WStaticContents );
// setWFlags( WStaticContents );
int step = qMax( 4, QABS( h - s.height() ) / as )+1;
@ -813,7 +813,7 @@ void Client::setShade( ShadeMode mode )
resizeDecoration( QSize( s.width(), h ));
// assume a border
// we do not have time to wait for X to send us paint events
// FRAME repaint( 0, h - step-5, width(), step+5, TRUE);
// FRAME repaint( 0, h - step-5, width(), step+5, true);
QApplication::syncX();
} while ( h < s.height() - step );
// if ( !wasStaticContents )
@ -821,7 +821,7 @@ void Client::setShade( ShadeMode mode )
shade_geometry_change = false;
plainResize( s );
if( shade_mode == ShadeHover || shade_mode == ShadeActivated )
setActive( TRUE );
setActive( true );
XMapWindow( QX11Info::display(), wrapperId());
XMapWindow( QX11Info::display(), window());
XDeleteProperty (QX11Info::display(), client, atoms->net_wm_window_shade);
@ -1419,10 +1419,10 @@ void Client::readIcons( Window win, QPixmap* icon, QPixmap* miniicon )
{
// get the icons, allow scaling
if( icon != NULL )
*icon = KWin::icon( win, 32, 32, TRUE, KWin::NETWM | KWin::WMHints );
*icon = KWin::icon( win, 32, 32, true, KWin::NETWM | KWin::WMHints );
if( miniicon != NULL )
if( icon == NULL || !icon->isNull())
*miniicon = KWin::icon( win, 16, 16, TRUE, KWin::NETWM | KWin::WMHints );
*miniicon = KWin::icon( win, 16, 16, true, KWin::NETWM | KWin::WMHints );
else
*miniicon = QPixmap();
}
@ -1449,8 +1449,8 @@ void Client::getIcons()
}
if( icon_pix.isNull())
{ // and if nothing else, load icon from classhint or xapp icon
icon_pix = KWin::icon( window(), 32, 32, TRUE, KWin::ClassHint | KWin::XApp );
miniicon_pix = KWin::icon( window(), 16, 16, TRUE, KWin::ClassHint | KWin::XApp );
icon_pix = KWin::icon( window(), 32, 32, true, KWin::ClassHint | KWin::XApp );
miniicon_pix = KWin::icon( window(), 16, 16, true, KWin::ClassHint | KWin::XApp );
}
if( isManaged() && decoration != NULL )
decoration->iconChange();
@ -1527,7 +1527,7 @@ Window Client::staticWmClientLeader(WId w)
Window result = w;
XErrorHandler oldHandler = XSetErrorHandler(nullErrorHandler);
status = XGetWindowProperty( QX11Info::display(), w, atoms->wm_client_leader, 0, 10000,
FALSE, XA_WINDOW, &type, &format,
false, XA_WINDOW, &type, &format,
&nitems, &extra, &data );
XSetErrorHandler(oldHandler);
if (status == Success )
@ -2012,9 +2012,9 @@ bool Client::getWindowOpacity() //query translucency settings from X, returns tr
custom_opacity = true;
// setOpacity(opacity_ < 0xFFFFFFFF, opacity_);
XFree ((char*)data);
return TRUE;
return true;
}
return FALSE;
return false;
}
void Client::setCustomOpacityFlag(bool custom)
@ -2036,14 +2036,14 @@ bool Client::touches(const Client* c)
// checks if this client borders c, needed to test beep media player window state
{
if (y() == c->y() + c->height()) // this bottom to c
return TRUE;
return true;
if (y() + height() == c->y()) // this top to c
return TRUE;
return true;
if (x() == c->x() + c->width()) // this right to c
return TRUE;
return true;
if (x() + width() == c->x()) // this left to c
return TRUE;
return FALSE;
return true;
return false;
}
void Client::setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth)

View file

@ -684,7 +684,7 @@ inline bool Client::isOnAllDesktops() const
}
/*!
Returns whether the client is on the virtual desktop \a d.
This is always TRUE for onAllDesktops clients.
This is always true for onAllDesktops clients.
*/
inline bool Client::isOnDesktop( int d ) const
{

View file

@ -86,14 +86,14 @@ void loadFakeSessionInfo( KConfig* config )
info->maximized = config->readEntry( QString("maximize")+n, 0 );
info->fullscreen = config->readEntry( QString("fullscreen")+n, 0 );
info->desktop = config->readEntry( QString("desktop")+n, 0 );
info->minimized = config->readEntry( QString("iconified")+n, FALSE );
info->onAllDesktops = config->readEntry( QString("sticky")+n, FALSE );
info->shaded = config->readEntry( QString("shaded")+n, FALSE );
info->keepAbove = config->readEntry( QString("staysOnTop")+n, FALSE );
info->keepBelow = config->readEntry( QString("keepBelow")+n, FALSE );
info->skipTaskbar = config->readEntry( QString("skipTaskbar")+n, FALSE );
info->skipPager = config->readEntry( QString("skipPager")+n, FALSE );
info->userNoBorder = config->readEntry( QString("userNoBorder")+n, FALSE );
info->minimized = config->readEntry( QString("iconified")+n, false );
info->onAllDesktops = config->readEntry( QString("sticky")+n, false );
info->shaded = config->readEntry( QString("shaded")+n, false );
info->keepAbove = config->readEntry( QString("staysOnTop")+n, false );
info->keepBelow = config->readEntry( QString("keepBelow")+n, false );
info->skipTaskbar = config->readEntry( QString("skipTaskbar")+n, false );
info->skipPager = config->readEntry( QString("skipPager")+n, false );
info->userNoBorder = config->readEntry( QString("userNoBorder")+n, false );
info->windowType = txtToWindowType( config->readEntry( QString("windowType")+n, QString() ).latin1());
info->active = false;
info->fake = true;

View file

@ -194,14 +194,14 @@ bool Workspace::workspaceEvent( XEvent * e )
{
if ( mouse_emulation && (e->type == ButtonPress || e->type == ButtonRelease ) )
{
mouse_emulation = FALSE;
mouse_emulation = false;
XUngrabKeyboard( QX11Info::display(), QX11Info::appTime() );
}
if ( e->type == PropertyNotify || e->type == ClientMessage )
{
if ( netCheck( e ) )
return TRUE;
return true;
}
// events that should be handled before Clients can get them
@ -215,7 +215,7 @@ bool Workspace::workspaceEvent( XEvent * e )
if ( tab_grab || control_grab )
{
tab_box->handleMouseEvent( e );
return TRUE;
return true;
}
break;
case KeyPress:
@ -316,7 +316,7 @@ bool Workspace::workspaceEvent( XEvent * e )
addSystemTrayWin( w );
}
}
return TRUE;
return true;
}
return ( e->xunmap.event != e->xunmap.window ); // hide wm typical event from Qt
@ -337,12 +337,12 @@ bool Workspace::workspaceEvent( XEvent * e )
{
//do not confuse Qt with these events. After all, _we_ are the
//window manager who does the reparenting.
return TRUE;
return true;
}
case DestroyNotify:
{
if ( removeSystemTrayWin( e->xdestroywindow.window, false ) )
return TRUE;
return true;
return false;
}
case MapRequest:
@ -363,7 +363,7 @@ bool Workspace::workspaceEvent( XEvent * e )
// this code doesn't check the parent to be root.
// if ( e->xmaprequest.parent == root ) { //###TODO store previously destroyed client ids
if ( addSystemTrayWin( e->xmaprequest.window ) )
return TRUE;
return true;
c = createClient( e->xmaprequest.window, false );
if ( c != NULL && root != QX11Info::appRootWindow() )
{ // TODO what is this?
@ -430,7 +430,7 @@ bool Workspace::workspaceEvent( XEvent * e )
break;
case KeyRelease:
if ( mouse_emulation )
return FALSE;
return false;
break;
case FocusIn:
if( e->xfocus.window == rootWin()
@ -466,7 +466,7 @@ bool Workspace::workspaceEvent( XEvent * e )
default:
break;
}
return FALSE;
return false;
}
// Some events don't have the actual window which caused the event
@ -752,7 +752,7 @@ void Client::destroyNotifyEvent( XDestroyWindowEvent* e )
}
bool blockAnimation = FALSE;
bool blockAnimation = false;
/*!
Handles client messages for the client window
@ -901,7 +901,7 @@ void Client::enterNotifyEvent( XCrossingEvent* e )
delete shadeHoverTimer;
shadeHoverTimer = new QTimer( this );
connect( shadeHoverTimer, SIGNAL( timeout() ), this, SLOT( shadeHover() ));
shadeHoverTimer->start( options->shadeHoverInterval, TRUE );
shadeHoverTimer->start( options->shadeHoverInterval, true );
}
if ( options->focusPolicy == Options::ClickToFocus )
@ -914,7 +914,7 @@ void Client::enterNotifyEvent( XCrossingEvent* e )
delete autoRaiseTimer;
autoRaiseTimer = new QTimer( this );
connect( autoRaiseTimer, SIGNAL( timeout() ), this, SLOT( autoRaise() ) );
autoRaiseTimer->start( options->autoRaiseInterval, TRUE );
autoRaiseTimer->start( options->autoRaiseInterval, true );
}
if ( options->focusPolicy != Options::FocusStrictlyUnderMouse && ( isDesktop() || isDock() || isTopMenu() ) )
@ -987,7 +987,7 @@ void Client::grabButton( int modifier )
++i )
XGrabButton( QX11Info::display(), AnyButton,
modifier | mods[ i ],
wrapperId(), FALSE, ButtonPressMask,
wrapperId(), false, ButtonPressMask,
GrabModeSync, GrabModeAsync, None, None );
}
@ -1041,7 +1041,7 @@ void Client::updateMouseGrab()
{
XUngrabButton( QX11Info::display(), AnyButton, AnyModifier, wrapperId());
// simply grab all modifier combinations
XGrabButton(QX11Info::display(), AnyButton, AnyModifier, wrapperId(), FALSE,
XGrabButton(QX11Info::display(), AnyButton, AnyModifier, wrapperId(), false,
ButtonPressMask,
GrabModeSync, GrabModeAsync,
None, None );
@ -1212,7 +1212,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in
bool replay = performMouseCommand( com, QPoint( x_root, y_root), perform_handled );
if ( isSpecialWindow())
replay = TRUE;
replay = true;
if( w == wrapperId()) // these can come only from a grab
XAllowEvents(QX11Info::display(), replay? ReplayPointer : SyncPointer, CurrentTime ); //QX11Info::appTime());
@ -1240,7 +1240,7 @@ void Client::processDecorationButtonPress( int button, int /*state*/, int x, int
Options::MouseCommand com = Options::MouseNothing;
bool active = isActive();
if ( !wantsInput() ) // we cannot be active, use it anyway
active = TRUE;
active = true;
if ( button == Button1 )
com = active ? options->commandActiveTitlebar1() : options->commandInactiveTitlebar1();
@ -1253,7 +1253,7 @@ void Client::processDecorationButtonPress( int button, int /*state*/, int x, int
&& com != Options::MouseMinimize ) // mouse release event
{
mode = mousePosition( QPoint( x, y ));
buttonDown = TRUE;
buttonDown = true;
moveOffset = QPoint( x, y );
invertedMoveOffset = rect().bottomRight() - moveOffset;
unrestrictedMoveResize = false;
@ -1304,7 +1304,7 @@ bool Client::buttonReleaseEvent( Window w, int /*button*/, int state, int x, int
y = this->y();
if ( (state & ( Button1Mask & Button2Mask & Button3Mask )) == 0 )
{
buttonDown = FALSE;
buttonDown = false;
if ( moveResizeMode )
{
finishMoveResize( false );
@ -1391,7 +1391,7 @@ void Client::focusInEvent( XFocusInEvent* e )
bool activate = workspace()->allowClientActivation( this, -1U, true );
workspace()->gotFocusIn( this ); // remove from should_get_focus list
if( activate )
setActive( TRUE );
setActive( true );
else
{
workspace()->restoreFocus();
@ -1460,7 +1460,7 @@ void Client::focusOutEvent( XFocusOutEvent* e )
if ( QApplication::activePopupWidget() )
return;
if( !check_follows_focusin( this ))
setActive( FALSE );
setActive( false );
}
void Client::visibilityNotifyEvent( XVisibilityEvent * e)
@ -1482,7 +1482,7 @@ void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction )
else if( moveResizeMode && direction == NET::MoveResizeCancel)
{
finishMoveResize( true );
buttonDown = FALSE;
buttonDown = false;
setCursor( mode );
}
else if( direction >= NET::TopLeft && direction <= NET::Left )
@ -1502,7 +1502,7 @@ void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction )
return;
if( moveResizeMode )
finishMoveResize( false );
buttonDown = TRUE;
buttonDown = true;
moveOffset = QPoint( x_root - x(), y_root - y()); // map from global
invertedMoveOffset = rect().bottomRight() - moveOffset;
unrestrictedMoveResize = false;
@ -1554,12 +1554,12 @@ void Client::keyPressEvent( uint key_code )
case Qt::Key_Return:
case Qt::Key_Enter:
finishMoveResize( false );
buttonDown = FALSE;
buttonDown = false;
setCursor( mode );
break;
case Qt::Key_Escape:
finishMoveResize( true );
buttonDown = FALSE;
buttonDown = false;
setCursor( mode );
break;
default:

View file

@ -1292,7 +1292,7 @@ void Client::sendSyntheticConfigureNotify()
c.border_width = 0;
c.above = None;
c.override_redirect = 0;
XSendEvent( QX11Info::display(), c.event, TRUE, StructureNotifyMask, (XEvent*)&c );
XSendEvent( QX11Info::display(), c.event, true, StructureNotifyMask, (XEvent*)&c );
}
const QPoint Client::calculateGravitation( bool invert, int gravity ) const
@ -1593,7 +1593,7 @@ bool Client::isMaximizable() const
return false;
}
if ( maximizeMode() != MaximizeRestore )
return TRUE;
return true;
QSize max = maxSize();
#if 0
if( max.width() < 32767 || max.height() < 32767 ) // sizes are 16bit with X

View file

@ -94,9 +94,9 @@ bool ButtonDrag::decode( QDropEvent* e, Button& btn )
int supported;
stream >> supported;
btn.supported = supported;
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -278,7 +278,7 @@ ButtonDropSite::ButtonDropSite( QWidget* parent, const char* name )
m_selected(0)
{
setObjectName( name );
setAcceptDrops( TRUE );
setAcceptDrops( true );
setFrameShape( WinPanel );
setFrameShadow( Raised );
setMinimumHeight( 26 );

View file

@ -1202,7 +1202,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
: KCModule(inst, parent), config(_config), standAlone(_standAlone)
{
kompmgr = 0L;
resetKompmgr_ = FALSE;
resetKompmgr_ = false;
QVBoxLayout *lay = new QVBoxLayout (this);
kompmgrAvailable_ = kompmgrAvailable();
if (!kompmgrAvailable_){
@ -1274,7 +1274,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
tabW->addTab(tGroup, i18n("Opacity"));
QWidget *sGroup = new QWidget(tabW);
// sGroup->setCheckable(TRUE);
// sGroup->setCheckable(true);
QVBoxLayout *vLay2 = new QVBoxLayout (sGroup,11,6);
vLay2->addSpacing(11); // to get the proper gb top offset
useShadows = new QCheckBox(i18n("Use shadows"),sGroup);
@ -1421,7 +1421,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
void KTranslucencyConfig::resetKompmgr()
{
resetKompmgr_ = TRUE;
resetKompmgr_ = true;
}
void KTranslucencyConfig::load( void )
{
@ -1459,7 +1459,7 @@ void KTranslucencyConfig::load( void )
KConfig conf_(QDir::homePath() + "/.xcompmgrrc");
conf_.setGroup("xcompmgr");
disableARGB->setChecked(conf_.readEntry("DisableARGB", QVariant(FALSE)).toBool());
disableARGB->setChecked(conf_.readEntry("DisableARGB", QVariant(false)).toBool());
useShadows->setChecked(conf_.readEntry("Compmode","CompClientShadows").compare("CompClientShadows") == 0);
shadowTopOffset->setValue(-1*(conf_.readEntry("ShadowOffsetY",-80)));
@ -1479,8 +1479,8 @@ void KTranslucencyConfig::load( void )
else
shadowColor->setColor(QColor(r,g,b));
fadeInWindows->setChecked(conf_.readEntry("FadeWindows", QVariant(TRUE)).toBool());
fadeOnOpacityChange->setChecked(conf_.readEntry("FadeTrans", QVariant(FALSE)).toBool());
fadeInWindows->setChecked(conf_.readEntry("FadeWindows", QVariant(true)).toBool());
fadeOnOpacityChange->setChecked(conf_.readEntry("FadeTrans", QVariant(false)).toBool());
fadeInSpeed->setValue((int)(conf_.readEntry("FadeInStep",0.020)*1000.0));
fadeOutSpeed->setValue((int)(conf_.readEntry("FadeOutStep",0.070)*1000.0));
@ -1579,12 +1579,12 @@ void KTranslucencyConfig::defaults()
inactiveWindowOpacity->setEnabled(true);
movingWindowOpacity->setEnabled(false);
dockWindowOpacity->setEnabled(true);
useShadows->setChecked(TRUE);
removeShadowsOnMove->setChecked(FALSE);
removeShadowsOnResize->setChecked(FALSE);
useShadows->setChecked(true);
removeShadowsOnMove->setChecked(false);
removeShadowsOnResize->setChecked(false);
shadowColor->setColor(Qt::black);
fadeInWindows->setChecked(TRUE);
fadeOnOpacityChange->setChecked(FALSE);
fadeInWindows->setChecked(true);
fadeOnOpacityChange->setChecked(false);
fadeInSpeed->setValue(70);
fadeOutSpeed->setValue(20);
emit KCModule::changed(true);

View file

@ -84,7 +84,7 @@ void KillWindow::start()
button_released = (ev.xbutton.button == Button1);
if ( ev.xbutton.button == Button3 )
{
escape_pressed = TRUE;
escape_pressed = true;
break;
}
workspace->killWindowId(ev.xbutton.subwindow);

View file

@ -44,13 +44,13 @@ Atoms* atoms;
int screen_number = -1;
static bool initting = FALSE;
static bool initting = false;
static
int x11ErrorHandler(Display *d, XErrorEvent *e)
{
char msg[80], req[80], number[80];
bool ignore_badwindow = TRUE; //maybe temporary
bool ignore_badwindow = true; //maybe temporary
if (initting &&
(
@ -104,7 +104,7 @@ Application::Application( )
// if there was already kwin running, it saved its configuration after loosing the selection -> reread
config->reparseConfiguration();
initting = TRUE; // startup....
initting = true; // startup....
// install X11 error handler
XSetErrorHandler( x11ErrorHandler );
@ -121,7 +121,7 @@ Application::Application( )
syncX(); // trigger possible errors, there's still a chance to abort
initting = FALSE; // startup done, we are up and running now.
initting = false; // startup done, we are up and running now.
dcopClient()->send( "ksplash", "", "upAndRunning(QString)", QString("wm started"));
XEvent e;
@ -153,7 +153,7 @@ void Application::lostSelection()
bool Application::x11EventFilter( XEvent *e )
{
if ( Workspace::self()->workspaceEvent( e ) )
return TRUE;
return true;
return KApplication::x11EventFilter( e );
}

View file

@ -191,7 +191,7 @@ bool Client::manage( Window w, bool isMapped )
// onAllDesktopsChange(); decoration doesn't exist here yet
QRect geom( attr.x, attr.y, attr.width, attr.height );
bool placementDone = FALSE;
bool placementDone = false;
if ( session )
geom = session->geometry;
@ -258,7 +258,7 @@ bool Client::manage( Window w, bool isMapped )
if ( ( (xSizeHint.flags & PPosition) && !ignorePPosition ) ||
(xSizeHint.flags & USPosition) )
{
placementDone = TRUE;
placementDone = true;
// disobey xinerama placement option for now (#70943)
area = workspace()->clientArea( PlacementArea, geom.center(), desktop());
}
@ -279,7 +279,7 @@ bool Client::manage( Window w, bool isMapped )
if( isMovable())
{
if( geom.x() > area.right() || geom.y() > area.bottom())
placementDone = FALSE; // weird, do not trust.
placementDone = false; // weird, do not trust.
}
if ( placementDone )
@ -301,7 +301,7 @@ bool Client::manage( Window w, bool isMapped )
if( !placementDone )
{ // placement needs to be after setting size
workspace()->place( this, area );
placementDone = TRUE;
placementDone = true;
}
if(( !isSpecialWindow() || isToolbar()) && isMovable())
@ -313,7 +313,7 @@ bool Client::manage( Window w, bool isMapped )
updateShape();
}
// else
// setShapable(FALSE);
// setShapable(false);
//CT extra check for stupid jdk 1.3.1. But should make sense in general
// if client has initial state set to Iconic and is transient with a parent
@ -335,7 +335,7 @@ bool Client::manage( Window w, bool isMapped )
// probably should be replaced by something better
bool doNotShow = false;
if ( workspace()->isNotManaged( caption() ) )
doNotShow = TRUE;
doNotShow = true;
// other settings from the previous session
if ( session )

View file

@ -92,7 +92,7 @@ QString Notify::eventToName( Event e )
return event;
}
static bool forgetIt = FALSE;
static bool forgetIt = false;
QList< Notify::EventData > Notify::pending_events;
bool Notify::raise( Event e, const QString& message, Client* c )

View file

@ -72,7 +72,7 @@ unsigned long Options::updateSettings()
if ( val == "CDE" )
altTabStyle = CDE;
rollOverDesktops = config->readEntry("RollOverDesktops", QVariant(TRUE)).toBool();
rollOverDesktops = config->readEntry("RollOverDesktops", QVariant(true)).toBool();
// focusStealingPreventionLevel = config->readEntry( "FocusStealingPreventionLevel", 2 );
// TODO use low level for now
@ -101,9 +101,9 @@ unsigned long Options::updateSettings()
placement = Placement::policyFromString( config->readEntry("Placement"), true );
animateShade = config->readEntry("AnimateShade", QVariant(TRUE )).toBool();
animateShade = config->readEntry("AnimateShade", QVariant(true)).toBool();
animateMinimize = config->readEntry("AnimateMinimize", QVariant(TRUE )).toBool();
animateMinimize = config->readEntry("AnimateMinimize", QVariant(true)).toBool();
animateMinimizeSpeed = config->readEntry("AnimateMinimizeSpeed", 5 );
if( focusPolicy == ClickToFocus )
@ -115,21 +115,21 @@ unsigned long Options::updateSettings()
}
else
{
autoRaise = config->readEntry("AutoRaise", QVariant(FALSE )).toBool();
autoRaise = config->readEntry("AutoRaise", QVariant(false)).toBool();
autoRaiseInterval = config->readEntry("AutoRaiseInterval", 0 );
delayFocus = config->readEntry("DelayFocus", QVariant(FALSE )).toBool();
delayFocus = config->readEntry("DelayFocus", QVariant(false)).toBool();
delayFocusInterval = config->readEntry("DelayFocusInterval", 0 );
}
shadeHover = config->readEntry("ShadeHover", QVariant(FALSE )).toBool();
shadeHover = config->readEntry("ShadeHover", QVariant(false)).toBool();
shadeHoverInterval = config->readEntry("ShadeHoverInterval", 250 );
// important: autoRaise implies ClickRaise
clickRaise = autoRaise || config->readEntry("ClickRaise", QVariant(TRUE )).toBool();
clickRaise = autoRaise || config->readEntry("ClickRaise", QVariant(true)).toBool();
borderSnapZone = config->readEntry("BorderSnapZone", 10);
windowSnapZone = config->readEntry("WindowSnapZone", 10);
snapOnlyWhenOverlapping=config->readEntry("SnapOnlyWhenOverlapping", QVariant(FALSE)).toBool();
snapOnlyWhenOverlapping=config->readEntry("SnapOnlyWhenOverlapping", QVariant(false)).toBool();
electric_borders = config->readEntry("ElectricBorders", 0);
electric_border_delay = config->readEntry("ElectricBorderDelay", 150);
@ -152,7 +152,7 @@ unsigned long Options::updateSettings()
(*it) = (*it).lower();
killPingTimeout = config->readEntry( "KillPingTimeout", 5000 );
hideUtilityWindowsForInactive = config->readEntry( "HideUtilityWindowsForInactive", QVariant( true )).toBool();
hideUtilityWindowsForInactive = config->readEntry( "HideUtilityWindowsForInactive", QVariant( true)).toBool();
// Mouse bindings
config->setGroup( "MouseBindings");
@ -194,7 +194,7 @@ unsigned long Options::updateSettings()
removeShadowsOnResize = config->readEntry("RemoveShadowsOnResize", QVariant(true)).toBool();
onlyDecoTranslucent = config->readEntry("OnlyDecoTranslucent", QVariant(false)).toBool();
if (resetKompmgr = config->readEntry("ResetKompmgr", QVariant(false)).toBool())
config->writeEntry("ResetKompmgr",FALSE);
config->writeEntry("ResetKompmgr",false);
@ -204,11 +204,11 @@ unsigned long Options::updateSettings()
// "EffectNoTooltip" setting from kdeglobals.
KConfig globalConfig("kdeglobals");
globalConfig.setGroup("KDE");
topmenus = globalConfig.readEntry( "macStyle", QVariant(false )).toBool();
topmenus = globalConfig.readEntry( "macStyle", QVariant(false)).toBool();
KConfig kdesktopcfg( "kdesktoprc", true );
kdesktopcfg.setGroup( "Menubar" );
desktop_topmenu = kdesktopcfg.readEntry( "ShowMenubar", QVariant(false )).toBool();
desktop_topmenu = kdesktopcfg.readEntry( "ShowMenubar", QVariant(false)).toBool();
if( desktop_topmenu )
topmenus = true;

View file

@ -45,7 +45,7 @@ PopupInfo::PopupInfo( const char *name )
connect(&m_delayedHideTimer, SIGNAL(timeout()), this, SLOT(hide()));
QFont f = font();
f.setBold( TRUE );
f.setBold( true );
f.setPointSize( 14 );
setFont( f );

18
sm.cpp
View file

@ -94,7 +94,7 @@ void Workspace::storeSession( KConfig* config, SMSavePhase phase )
config->writeEntry( QString("wmClientMachine")+n, c->wmClientMachine( true ).constData() );
config->writeEntry( QString("resourceName")+n, c->resourceName().constData() );
config->writeEntry( QString("resourceClass")+n, c->resourceClass().constData() );
config->writeEntry( QString("geometry")+n, QRect( c->calculateGravitation(TRUE), c->clientSize() ) ); // FRAME
config->writeEntry( QString("geometry")+n, QRect( c->calculateGravitation(true), c->clientSize() ) ); // FRAME
config->writeEntry( QString("restore")+n, c->geometryRestore() );
config->writeEntry( QString("fsrestore")+n, c->geometryFSRestore() );
config->writeEntry( QString("maximize")+n, (int) c->maximizeMode() );
@ -169,14 +169,14 @@ void Workspace::loadSessionInfo()
info->maximized = config->readEntry( QString("maximize")+n, 0 );
info->fullscreen = config->readEntry( QString("fullscreen")+n, 0 );
info->desktop = config->readEntry( QString("desktop")+n, 0 );
info->minimized = config->readEntry( QString("iconified")+n, FALSE );
info->onAllDesktops = config->readEntry( QString("sticky")+n, FALSE );
info->shaded = config->readEntry( QString("shaded")+n, FALSE );
info->keepAbove = config->readEntry( QString("staysOnTop")+n, FALSE );
info->keepBelow = config->readEntry( QString("keepBelow")+n, FALSE );
info->skipTaskbar = config->readEntry( QString("skipTaskbar")+n, FALSE );
info->skipPager = config->readEntry( QString("skipPager")+n, FALSE );
info->userNoBorder = config->readEntry( QString("userNoBorder")+n, FALSE );
info->minimized = config->readEntry( QString("iconified")+n, false );
info->onAllDesktops = config->readEntry( QString("sticky")+n, false );
info->shaded = config->readEntry( QString("shaded")+n, false );
info->keepAbove = config->readEntry( QString("staysOnTop")+n, false );
info->keepBelow = config->readEntry( QString("keepBelow")+n, false );
info->skipTaskbar = config->readEntry( QString("skipTaskbar")+n, false );
info->skipPager = config->readEntry( QString("skipPager")+n, false );
info->userNoBorder = config->readEntry( QString("userNoBorder")+n, false );
info->windowType = txtToWindowType( config->readEntry( QString("windowType")+n, QString() ).latin1());
info->shortcut = config->readEntry( QString("shortcut")+n, QString() );
info->active = ( active_client == i );

View file

@ -164,7 +164,7 @@ void TabBox::reset()
if ( clients.count() == 0 ) // height for the "not tasks" text
{
QFont f = font();
f.setBold( TRUE );
f.setBold( true );
f.setPointSize( 14 );
h = QFontMetrics(f).height()*4;
@ -342,7 +342,7 @@ void TabBox::drawContents( QPainter * )
if ( !currentClient() )
{
QFont f = font();
f.setBold( TRUE );
f.setBold( true );
f.setPointSize( 14 );
p.setFont(f);
@ -877,26 +877,26 @@ bool Workspace::startKDEWalkThroughWindows()
{
if( !establishTabBoxGrab())
return false;
tab_grab = TRUE;
tab_grab = true;
keys->setEnabled( false );
disable_shortcuts_keys->setEnabled( false );
client_keys->setEnabled( false );
tab_box->setMode( TabBox::WindowsMode );
tab_box->reset();
return TRUE;
return true;
}
bool Workspace::startWalkThroughDesktops( int mode )
{
if( !establishTabBoxGrab())
return false;
control_grab = TRUE;
control_grab = true;
keys->setEnabled( false );
disable_shortcuts_keys->setEnabled( false );
client_keys->setEnabled( false );
tab_box->setMode( (TabBox::Mode) mode );
tab_box->reset();
return TRUE;
return true;
}
bool Workspace::startWalkThroughDesktops()
@ -1048,8 +1048,8 @@ void Workspace::closeTabBox()
keys->setEnabled( true );
disable_shortcuts_keys->setEnabled( true );
client_keys->setEnabled( true );
tab_grab = FALSE;
control_grab = FALSE;
tab_grab = false;
control_grab = false;
}
/*!
@ -1212,7 +1212,7 @@ Client* Workspace::previousStaticClient( Client* c ) const
bool Workspace::establishTabBoxGrab()
{
if( XGrabKeyboard( QX11Info::display(), root, FALSE,
if( XGrabKeyboard( QX11Info::display(), root, false,
GrabModeAsync, GrabModeAsync, QX11Info::appTime()) != GrabSuccess )
return false;
// Don't try to establish a global mouse grab using XGrabPointer, as that would prevent

View file

@ -42,7 +42,7 @@ class TabBox : public Q3Frame
Mode mode() const;
void reset();
void nextPrev( bool next = TRUE);
void nextPrev( bool next = true);
void delayedShow();
void hide();

View file

@ -208,7 +208,7 @@ void Workspace::desktopPopupAboutToShow()
desk_popup->clear();
desk_popup->insertItem( i18n("&All Desktops"), 0 );
if ( active_popup_client && active_popup_client->isOnAllDesktops() )
desk_popup->setItemChecked( 0, TRUE );
desk_popup->setItemChecked( 0, true );
desk_popup->insertSeparator( -1 );
int id;
const int BASE = 10;
@ -226,7 +226,7 @@ void Workspace::desktopPopupAboutToShow()
i );
if ( active_popup_client &&
!active_popup_client->isOnAllDesktops() && active_popup_client->desktop() == i )
desk_popup->setItemChecked( id, TRUE );
desk_popup->setItemChecked( id, true );
}
}
@ -447,7 +447,7 @@ void Workspace::performWindowOperation( Client* c, Options::WindowOperation op )
*/
bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPos, bool handled )
{
bool replay = FALSE;
bool replay = false;
switch (command)
{
case Options::MouseRaise:
@ -490,11 +490,11 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
break;
case Options::MouseActivateRaiseAndPassClick:
workspace()->takeActivity( this, ActivityFocus | ActivityRaise, handled );
replay = TRUE;
replay = true;
break;
case Options::MouseActivateAndPassClick:
workspace()->takeActivity( this, ActivityFocus, handled );
replay = TRUE;
replay = true;
break;
case Options::MouseActivateRaiseAndMove:
case Options::MouseActivateRaiseAndUnrestrictedMove:
@ -511,7 +511,7 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
if( moveResizeMode )
finishMoveResize( false );
mode = PositionCenter;
buttonDown = TRUE;
buttonDown = true;
moveOffset = QPoint( globalPos.x() - x(), globalPos.y() - y()); // map from global
invertedMoveOffset = rect().bottomRight() - moveOffset;
unrestrictedMoveResize = ( command == Options::MouseActivateRaiseAndUnrestrictedMove
@ -531,7 +531,7 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
break;
if( moveResizeMode )
finishMoveResize( false );
buttonDown = TRUE;
buttonDown = true;
moveOffset = QPoint( globalPos.x() - x(), globalPos.y() - y()); // map from global
int x = moveOffset.x(), y = moveOffset.y();
bool left = x < width() / 3;
@ -592,12 +592,12 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
{
if (opacity_ < 0xF3333333)
{
setOpacity(TRUE, opacity_ + 0xCCCCCCC);
setOpacity(true, opacity_ + 0xCCCCCCC);
custom_opacity = true;
}
else
{
setOpacity(FALSE, 0xFFFFFFFF);
setOpacity(false, 0xFFFFFFFF);
custom_opacity = false;
}
}
@ -605,12 +605,12 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
case Options::MouseOpacityLess:
if (opacity_ > 0)
{
setOpacity(TRUE, (opacity_ > 0xCCCCCCC) ? opacity_ - 0xCCCCCCC : 0);
setOpacity(true, (opacity_ > 0xCCCCCCC) ? opacity_ - 0xCCCCCCC : 0);
custom_opacity = true;
}
break;
case Options::MouseNothing:
replay = TRUE;
replay = true;
break;
}
return replay;

View file

@ -54,7 +54,7 @@ bool Shape::hasShape( WId w)
unsigned int wws, hws, wbs, hbs;
int boundingShaped = 0, clipShaped = 0;
if (!kwin_has_shape)
return FALSE;
return false;
XShapeQueryExtents(QX11Info::display(), w,
&boundingShaped, &xws, &yws, &wws, &hws,
&clipShaped, &xbs, &ybs, &wbs, &hbs);
@ -82,7 +82,7 @@ void Motif::readFlags( WId w, bool& noborder, bool& resize, bool& move,
unsigned char* data;
MwmHints* hints = 0;
if ( XGetWindowProperty( QX11Info::display(), w, atoms->motif_wm_hints, 0, 5,
FALSE, atoms->motif_wm_hints, &type, &format,
false, atoms->motif_wm_hints, &type, &format,
&length, &after, &data ) == Success )
{
if ( data )
@ -188,7 +188,7 @@ QByteArray getStringProperty(WId w, Atom prop, char separator)
QByteArray result = "";
KXErrorHandler handler; // ignore errors
status = XGetWindowProperty( QX11Info::display(), w, prop, 0, 10000,
FALSE, XA_STRING, &type, &format,
false, XA_STRING, &type, &format,
&nitems, &extra, &data );
if ( status == Success)
{

View file

@ -59,7 +59,7 @@ Workspace *Workspace::_self = 0;
KProcess* kompmgr = 0;
bool allowKompmgrRestart = TRUE;
bool allowKompmgrRestart = true;
// Rikkus: This class is too complex. It needs splitting further.
// It's a nightmare to understand, especially with so few comments :(
@ -994,10 +994,10 @@ bool Workspace::isNotManaged( const QString& title )
if (r.search(title) != -1)
{
doNotManageList.remove( it );
return TRUE;
return true;
}
}
return FALSE;
return false;
}
/*!
@ -1479,19 +1479,19 @@ void Workspace::calcDesktopLayout(int &x, int &y) const
bool Workspace::addSystemTrayWin( WId w )
{
if ( systemTrayWins.contains( w ) )
return TRUE;
return true;
NETWinInfo ni( QX11Info::display(), w, root, NET::WMKDESystemTrayWinFor );
WId trayWinFor = ni.kdeSystemTrayWinFor();
if ( !trayWinFor )
return FALSE;
return false;
systemTrayWins.append( SystemTrayWindow( w, trayWinFor ) );
XSelectInput( QX11Info::display(), w,
StructureNotifyMask
);
XAddToSaveSet( QX11Info::display(), w );
propagateSystemTrayWins();
return TRUE;
return true;
}
/*!
@ -1501,7 +1501,7 @@ bool Workspace::addSystemTrayWin( WId w )
bool Workspace::removeSystemTrayWin( WId w, bool check )
{
if ( !systemTrayWins.contains( w ) )
return FALSE;
return false;
if( check )
{
// When getting UnmapNotify, it's not clear if it's the systray
@ -1528,7 +1528,7 @@ bool Workspace::removeSystemTrayWin( WId w, bool check )
}
systemTrayWins.remove( w );
propagateSystemTrayWins();
return TRUE;
return true;
}
@ -1664,16 +1664,16 @@ void Workspace::slotMouseEmulation()
if ( mouse_emulation )
{
XUngrabKeyboard(QX11Info::display(), QX11Info::appTime());
mouse_emulation = FALSE;
mouse_emulation = false;
return;
}
if ( XGrabKeyboard(QX11Info::display(),
root, FALSE,
root, false,
GrabModeAsync, GrabModeAsync,
QX11Info::appTime()) == GrabSuccess )
{
mouse_emulation = TRUE;
mouse_emulation = true;
mouse_emulation_state = 0;
mouse_emulation_window = 0;
}
@ -1734,7 +1734,7 @@ unsigned int Workspace::sendFakedMouseEvent( QPoint pos, WId w, MouseEmulation t
e.y_root = pos.y();
e.state = state;
e.is_hint = NotifyNormal;
XSendEvent( QX11Info::display(), w, TRUE, ButtonMotionMask, (XEvent*)&e );
XSendEvent( QX11Info::display(), w, true, ButtonMotionMask, (XEvent*)&e );
}
else
{
@ -1750,7 +1750,7 @@ unsigned int Workspace::sendFakedMouseEvent( QPoint pos, WId w, MouseEmulation t
e.y_root = pos.y();
e.state = state;
e.button = button;
XSendEvent( QX11Info::display(), w, TRUE, ButtonPressMask, (XEvent*)&e );
XSendEvent( QX11Info::display(), w, true, ButtonPressMask, (XEvent*)&e );
if ( type == EmuPress )
{
@ -1793,7 +1793,7 @@ unsigned int Workspace::sendFakedMouseEvent( QPoint pos, WId w, MouseEmulation t
bool Workspace::keyPressMouseEmulation( XKeyEvent& ev )
{
if ( root != QX11Info::appRootWindow() )
return FALSE;
return false;
int kc = XKeycodeToKeysym(QX11Info::display(), ev.keycode, 0);
int km = ev.state & (ControlMask | Mod1Mask | ShiftMask);
@ -1870,16 +1870,16 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent& ev )
// fall through
case XK_Escape:
XUngrabKeyboard(QX11Info::display(), QX11Info::appTime());
mouse_emulation = FALSE;
return TRUE;
mouse_emulation = false;
return true;
default:
return FALSE;
return false;
}
QCursor::setPos( pos );
if ( mouse_emulation_state )
mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuMove, 0, mouse_emulation_state );
return TRUE;
return true;
}
@ -1906,7 +1906,7 @@ void Workspace::requestDelayFocus( Client* c )
delete delayFocusTimer;
delayFocusTimer = new QTimer( this );
connect( delayFocusTimer, SIGNAL( timeout() ), this, SLOT( delayFocus() ) );
delayFocusTimer->start( options->delayFocusInterval, TRUE );
delayFocusTimer->start( options->delayFocusInterval, true );
}
void Workspace::cancelDelayFocus()
@ -2359,7 +2359,7 @@ void Workspace::startKompmgr()
return;
if (!kompmgr->start(KProcess::OwnGroup, KProcess::Stderr))
{
options->useTranslucency = FALSE;
options->useTranslucency = false;
KProcess proc;
proc << "kdialog" << "--error"
<< i18n("The Composite Manager could not be started.\\nMake sure you have \"kompmgr\" in a $PATH directory.")
@ -2369,8 +2369,8 @@ void Workspace::startKompmgr()
else
{
connect(kompmgr, SIGNAL(processExited(KProcess*)), SLOT(restartKompmgr()));
options->useTranslucency = TRUE;
allowKompmgrRestart = FALSE;
options->useTranslucency = true;
allowKompmgrRestart = false;
QTimer::singleShot( 60000, this, SLOT(unblockKompmgrRestart()) );
QByteArray ba;
QDataStream arg(&ba, QIODevice::WriteOnly);
@ -2385,7 +2385,7 @@ void Workspace::stopKompmgr()
if (!kompmgr || !kompmgr->isRunning())
return;
kompmgr->disconnect(this, SLOT(restartKompmgr()));
options->useTranslucency = FALSE;
options->useTranslucency = false;
if (popup){ delete popup; popup = 0L; } // to add/remove opacity slider
kompmgr->kill();
QByteArray ba;
@ -2401,7 +2401,7 @@ bool Workspace::kompmgrIsRunning()
void Workspace::unblockKompmgrRestart()
{
allowKompmgrRestart = TRUE;
allowKompmgrRestart = true;
}
void Workspace::restartKompmgr()
@ -2409,7 +2409,7 @@ void Workspace::restartKompmgr()
{
if (!allowKompmgrRestart) // uh-ohh
{
options->useTranslucency = FALSE;
options->useTranslucency = false;
KProcess proc;
proc << "kdialog" << "--error"
<< i18n( "The Composite Manager crashed twice within a minute and is therefore disabled for this session.")
@ -2429,7 +2429,7 @@ void Workspace::restartKompmgr()
// -------------------
if (!kompmgr->start(KProcess::NotifyOnExit, KProcess::Stderr))
{
options->useTranslucency = FALSE;
options->useTranslucency = false;
KProcess proc;
proc << "kdialog" << "--error"
<< i18n("The Composite Manager could not be started.\\nMake sure you have \"kompmgr\" in a $PATH directory.")
@ -2438,7 +2438,7 @@ void Workspace::restartKompmgr()
}
else
{
allowKompmgrRestart = FALSE;
allowKompmgrRestart = false;
QTimer::singleShot( 60000, this, SLOT(unblockKompmgrRestart()) );
}
}

View file

@ -73,7 +73,7 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine
{
Q_OBJECT
public:
Workspace( bool restore = FALSE );
Workspace( bool restore = false );
virtual ~Workspace();
static Workspace * self() { return _self; }
@ -112,8 +112,8 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine
// stealing prevention code.
Client* mostRecentlyActivatedClient() const;
void activateClient( Client*, bool force = FALSE );
void requestFocus( Client* c, bool force = FALSE );
void activateClient( Client*, bool force = false );
void requestFocus( Client* c, bool force = false );
void takeActivity( Client* c, int flags, bool handled ); // flags are ActivityFlags
void handleTakeActivity( Client* c, Time timestamp, int flags ); // flags are ActivityFlags
bool allowClientActivation( const Client* c, Time time = -1U, bool focus_in = false );