Convert to plugins (and make it a test, since it's more or less useless).
svn path=/branches/work/kwin_composite/; revision=652928icc-effect-5.14.5
parent
d45212d489
commit
6bf23a5c48
|
@ -18,6 +18,7 @@ SET(kwin4_effect_builtins_sources
|
||||||
|
|
||||||
SET(kwin4_effect_tests_sources
|
SET(kwin4_effect_tests_sources
|
||||||
test_input.cpp
|
test_input.cpp
|
||||||
|
test_shiftworkspaceup.cpp
|
||||||
test_thumbnail.cpp
|
test_thumbnail.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -59,6 +60,7 @@ install( FILES
|
||||||
diminactive.desktop
|
diminactive.desktop
|
||||||
zoom.desktop
|
zoom.desktop
|
||||||
test_input.desktop
|
test_input.desktop
|
||||||
|
test_shiftworkspaceup.desktop
|
||||||
test_thumbnail.desktop
|
test_thumbnail.desktop
|
||||||
DESTINATION ${DATA_INSTALL_DIR}/kwin/effects )
|
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.
|
License. See the file "COPYING" for the exact licensing terms.
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
#include "shiftworkspaceup.h"
|
#include "test_shiftworkspaceup.h"
|
||||||
|
|
||||||
#include <workspace.h>
|
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
|
KWIN_EFFECT( ShiftWorkspaceUp, ShiftWorkspaceUpEffect )
|
||||||
|
|
||||||
ShiftWorkspaceUpEffect::ShiftWorkspaceUpEffect()
|
ShiftWorkspaceUpEffect::ShiftWorkspaceUpEffect()
|
||||||
: up( false )
|
: up( false )
|
||||||
, diff( 0 )
|
, diff( 0 )
|
||||||
|
@ -30,7 +30,7 @@ void ShiftWorkspaceUpEffect::prePaintScreen( int* mask, QRegion* region, int tim
|
||||||
if( !up && diff > 0 )
|
if( !up && diff > 0 )
|
||||||
diff = qBound( 0, diff - time, 1000 );
|
diff = qBound( 0, diff - time, 1000 );
|
||||||
if( diff != 0 )
|
if( diff != 0 )
|
||||||
*mask |= Scene::PAINT_SCREEN_TRANSFORMED;
|
*mask |= PAINT_SCREEN_TRANSFORMED;
|
||||||
effects->prePaintScreen( mask, region, time );
|
effects->prePaintScreen( mask, region, time );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,16 +44,16 @@ void ShiftWorkspaceUpEffect::paintScreen( int mask, QRegion region, ScreenPaintD
|
||||||
void ShiftWorkspaceUpEffect::postPaintScreen()
|
void ShiftWorkspaceUpEffect::postPaintScreen()
|
||||||
{
|
{
|
||||||
if( up ? diff < 1000 : diff > 0 )
|
if( up ? diff < 1000 : diff > 0 )
|
||||||
workspace()->addRepaintFull(); // trigger next animation repaint
|
effects->addRepaintFull(); // trigger next animation repaint
|
||||||
effects->postPaintScreen();
|
effects->postPaintScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShiftWorkspaceUpEffect::tick()
|
void ShiftWorkspaceUpEffect::tick()
|
||||||
{
|
{
|
||||||
up = !up;
|
up = !up;
|
||||||
workspace()->addRepaintFull();
|
effects->addRepaintFull();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#include "shiftworkspaceup.moc"
|
#include "test_shiftworkspaceup.moc"
|
|
@ -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.
|
License. See the file "COPYING" for the exact licensing terms.
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
#ifndef KWIN_SHIFTWORKSPACEUP_H
|
#ifndef KWIN_TEST_SHIFTWORKSPACEUP_H
|
||||||
#define KWIN_SHIFTWORKSPACEUP_H
|
#define KWIN_TEST_SHIFTWORKSPACEUP_H
|
||||||
|
|
||||||
#include <qtimer.h>
|
#include <qtimer.h>
|
||||||
|
|
||||||
#include <effects.h>
|
#include <kwineffects.h>
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
Loading…
Reference in New Issue