Convert to plugins (and make it a test, since it's more or less useless).
svn path=/branches/work/kwin_composite/; revision=652928
This commit is contained in:
parent
d45212d489
commit
6bf23a5c48
4 changed files with 16 additions and 10 deletions
|
@ -18,6 +18,7 @@ SET(kwin4_effect_builtins_sources
|
|||
|
||||
SET(kwin4_effect_tests_sources
|
||||
test_input.cpp
|
||||
test_shiftworkspaceup.cpp
|
||||
test_thumbnail.cpp
|
||||
)
|
||||
|
||||
|
@ -59,6 +60,7 @@ install( FILES
|
|||
diminactive.desktop
|
||||
zoom.desktop
|
||||
test_input.desktop
|
||||
test_shiftworkspaceup.desktop
|
||||
test_thumbnail.desktop
|
||||
DESTINATION ${DATA_INSTALL_DIR}/kwin/effects )
|
||||
|
||||
|
|
|
@ -8,13 +8,13 @@ You can Freely distribute this program under the GNU General Public
|
|||
License. See the file "COPYING" for the exact licensing terms.
|
||||
******************************************************************/
|
||||
|
||||
#include "shiftworkspaceup.h"
|
||||
|
||||
#include <workspace.h>
|
||||
#include "test_shiftworkspaceup.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT( ShiftWorkspaceUp, ShiftWorkspaceUpEffect )
|
||||
|
||||
ShiftWorkspaceUpEffect::ShiftWorkspaceUpEffect()
|
||||
: up( false )
|
||||
, diff( 0 )
|
||||
|
@ -30,7 +30,7 @@ void ShiftWorkspaceUpEffect::prePaintScreen( int* mask, QRegion* region, int tim
|
|||
if( !up && diff > 0 )
|
||||
diff = qBound( 0, diff - time, 1000 );
|
||||
if( diff != 0 )
|
||||
*mask |= Scene::PAINT_SCREEN_TRANSFORMED;
|
||||
*mask |= PAINT_SCREEN_TRANSFORMED;
|
||||
effects->prePaintScreen( mask, region, time );
|
||||
}
|
||||
|
||||
|
@ -44,16 +44,16 @@ void ShiftWorkspaceUpEffect::paintScreen( int mask, QRegion region, ScreenPaintD
|
|||
void ShiftWorkspaceUpEffect::postPaintScreen()
|
||||
{
|
||||
if( up ? diff < 1000 : diff > 0 )
|
||||
workspace()->addRepaintFull(); // trigger next animation repaint
|
||||
effects->addRepaintFull(); // trigger next animation repaint
|
||||
effects->postPaintScreen();
|
||||
}
|
||||
|
||||
void ShiftWorkspaceUpEffect::tick()
|
||||
{
|
||||
up = !up;
|
||||
workspace()->addRepaintFull();
|
||||
effects->addRepaintFull();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#include "shiftworkspaceup.moc"
|
||||
#include "test_shiftworkspaceup.moc"
|
4
effects/test_shiftworkspaceup.desktop
Normal file
4
effects/test_shiftworkspaceup.desktop
Normal file
|
@ -0,0 +1,4 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=TestShiftWorkspaceUp
|
||||
X-KDE-Library=kwin4_effect_tests
|
|
@ -8,12 +8,12 @@ You can Freely distribute this program under the GNU General Public
|
|||
License. See the file "COPYING" for the exact licensing terms.
|
||||
******************************************************************/
|
||||
|
||||
#ifndef KWIN_SHIFTWORKSPACEUP_H
|
||||
#define KWIN_SHIFTWORKSPACEUP_H
|
||||
#ifndef KWIN_TEST_SHIFTWORKSPACEUP_H
|
||||
#define KWIN_TEST_SHIFTWORKSPACEUP_H
|
||||
|
||||
#include <qtimer.h>
|
||||
|
||||
#include <effects.h>
|
||||
#include <kwineffects.h>
|
||||
|
||||
namespace KWin
|
||||
{
|
Loading…
Reference in a new issue