Some first attempt at effects interface.
svn path=/branches/work/kwin_composite/; revision=558191
This commit is contained in:
parent
06e47c10db
commit
4f12c1e606
6 changed files with 126 additions and 2 deletions
|
@ -46,7 +46,8 @@ set(kwin_KDEINIT_SRCS
|
|||
rules.cpp
|
||||
composite.cpp
|
||||
toplevel.cpp
|
||||
unmanaged.cpp )
|
||||
unmanaged.cpp
|
||||
effects.cpp )
|
||||
|
||||
kde4_automoc(${kwin_KDEINIT_SRCS})
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
#include "workspace.h"
|
||||
#include "client.h"
|
||||
#include "unmanaged.h"
|
||||
#include "effects.h"
|
||||
|
||||
namespace KWinInternal
|
||||
{
|
||||
|
@ -63,21 +64,30 @@ void Workspace::compositeTimeout()
|
|||
it != stackingOrder().end();
|
||||
++it )
|
||||
{
|
||||
#if 1
|
||||
(*it)->windowPixmap(); // trigger creation
|
||||
effects->paintWindow( *it );
|
||||
#else
|
||||
QRect r = (*it)->geometry().intersect( QRect( 0, 0, displayWidth(), displayHeight()));
|
||||
if( !r.isEmpty())
|
||||
{
|
||||
XCopyArea( display(), (*it)->windowPixmap(), composite_pixmap, gc,
|
||||
qMax( 0, -(*it)->x()), qMax( 0, -(*it)->y()), r.width(), r.height(), r.x(), r.y());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
for( UnmanagedList::ConstIterator it = unmanaged.begin();
|
||||
it != unmanaged.end();
|
||||
++it )
|
||||
{
|
||||
#if 1
|
||||
effects->paintWorkspace( this );
|
||||
#else
|
||||
QRect r = (*it)->geometry().intersect( QRect( 0, 0, displayWidth(), displayHeight()));
|
||||
if( !r.isEmpty())
|
||||
XCopyArea( display(), (*it)->windowPixmap(), composite_pixmap, gc,
|
||||
qMax( 0, -(*it)->x()), qMax( 0, -(*it)->y()), r.width(), r.height(), r.x(), r.y());
|
||||
#endif
|
||||
}
|
||||
XCopyArea( display(), composite_pixmap, rootWindow(), gc, 0, 0, displayWidth(), displayHeight(), 0, 0 );
|
||||
XFreeGC( display(), gc );
|
||||
|
|
62
effects.cpp
Normal file
62
effects.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*****************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
|
||||
|
||||
You can Freely distribute this program under the GNU General Public
|
||||
License. See the file "COPYING" for the exact licensing terms.
|
||||
******************************************************************/
|
||||
|
||||
#include "effects.h"
|
||||
|
||||
namespace KWinInternal
|
||||
{
|
||||
|
||||
//****************************************
|
||||
// Effect
|
||||
//****************************************
|
||||
|
||||
Effect::~Effect()
|
||||
{
|
||||
}
|
||||
|
||||
void Effect::windowUserMoved( Toplevel* )
|
||||
{
|
||||
}
|
||||
|
||||
void Effect::windowUserResized( Toplevel* )
|
||||
{
|
||||
}
|
||||
|
||||
void Effect::paintWindow( Toplevel* )
|
||||
{
|
||||
}
|
||||
|
||||
void Effect::paintWorkspace( Workspace* )
|
||||
{
|
||||
}
|
||||
|
||||
//****************************************
|
||||
// EffectsHandler
|
||||
//****************************************
|
||||
|
||||
void EffectsHandler::windowUserMoved( Toplevel* c )
|
||||
{
|
||||
}
|
||||
|
||||
void EffectsHandler::windowUserResized( Toplevel* c )
|
||||
{
|
||||
}
|
||||
|
||||
void EffectsHandler::paintWindow( Toplevel* c )
|
||||
{
|
||||
}
|
||||
|
||||
void EffectsHandler::paintWorkspace( Workspace* )
|
||||
{
|
||||
}
|
||||
|
||||
EffectsHandler* effects;
|
||||
|
||||
} // namespace
|
43
effects.h
Normal file
43
effects.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*****************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
|
||||
|
||||
You can Freely distribute this program under the GNU General Public
|
||||
License. See the file "COPYING" for the exact licensing terms.
|
||||
******************************************************************/
|
||||
|
||||
#ifndef KWIN_EFFECTS_H
|
||||
#define KWIN_EFFECTS_H
|
||||
|
||||
namespace KWinInternal
|
||||
{
|
||||
|
||||
class Toplevel;
|
||||
class Workspace;
|
||||
|
||||
class Effect
|
||||
{
|
||||
public:
|
||||
virtual ~Effect();
|
||||
virtual void windowUserMoved( Toplevel* c );
|
||||
virtual void windowUserResized( Toplevel* c );
|
||||
virtual void paintWindow( Toplevel* c );
|
||||
virtual void paintWorkspace( Workspace* );
|
||||
};
|
||||
|
||||
class EffectsHandler
|
||||
{
|
||||
public:
|
||||
void windowUserMoved( Toplevel* c );
|
||||
void windowUserResized( Toplevel* c );
|
||||
void paintWindow( Toplevel* c );
|
||||
void paintWorkspace( Workspace* );
|
||||
};
|
||||
|
||||
extern EffectsHandler* effects;
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif
|
|
@ -28,6 +28,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
#include "notifications.h"
|
||||
#include "geometrytip.h"
|
||||
#include "rules.h"
|
||||
#include "effects.h"
|
||||
#include <QX11Info>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
|
@ -2549,7 +2550,10 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root )
|
|||
}
|
||||
if ( isMove() )
|
||||
workspace()->clientMoved(globalPos, xTime());
|
||||
if( isMove())
|
||||
effects->windowUserMoved( this );
|
||||
else
|
||||
effects->windowUserResized( this );
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
|
4
main.cpp
4
main.cpp
|
@ -30,6 +30,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
#include "options.h"
|
||||
#include "sm.h"
|
||||
#include "utils.h"
|
||||
#include "effects.h"
|
||||
|
||||
#define INT8 _X11INT8
|
||||
#define INT32 _X11INT32
|
||||
|
@ -117,6 +118,7 @@ Application::Application( )
|
|||
|
||||
options = new Options;
|
||||
atoms = new Atoms;
|
||||
effects = new EffectsHandler;
|
||||
|
||||
// create workspace.
|
||||
(void) new Workspace( isSessionRestored() );
|
||||
|
@ -143,6 +145,8 @@ Application::~Application()
|
|||
if( owner.ownerWindow() != None ) // if there was no --replace (no new WM)
|
||||
XSetInputFocus( display(), PointerRoot, RevertToPointerRoot, xTime() );
|
||||
delete options;
|
||||
delete effects;
|
||||
delete atoms;
|
||||
}
|
||||
|
||||
void Application::lostSelection()
|
||||
|
|
Loading…
Reference in a new issue