diff --git a/CMakeLists.txt b/CMakeLists.txt index 3129d86520..35b503a92d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,8 +63,6 @@ set(kwin_KDEINIT_SRCS deleted.cpp effects.cpp effects/fade.cpp - effects/fadein.cpp - effects/fadeout.cpp effects/maketransparent.cpp effects/scalein.cpp effects/shakymove.cpp diff --git a/effects.cpp b/effects.cpp index e3c4156221..27da168b68 100644 --- a/effects.cpp +++ b/effects.cpp @@ -18,8 +18,6 @@ License. See the file "COPYING" for the exact licensing terms. #include "effects/desktopchangeslide.h" #include "effects/dialogparent.h" #include "effects/fade.h" -#include "effects/fadein.h" -#include "effects/fadeout.h" #include "effects/howto.h" #include "effects/maketransparent.h" #include "effects/minimizeanimation.h" @@ -146,8 +144,6 @@ EffectsHandler::EffectsHandler() registerEffect("ShakyMove", new GenericEffectFactory); registerEffect("ShiftWorkspaceUp", new GenericEffectFactory); registerEffect("Fade", new GenericEffectFactory); - registerEffect("FadeIn", new GenericEffectFactory); - registerEffect("FadeOut", new GenericEffectFactory); registerEffect("ScaleIn", new GenericEffectFactory); registerEffect("DialogParent", new GenericEffectFactory); registerEffect("DesktopChangeSlide", new GenericEffectFactory); diff --git a/effects/fadein.cpp b/effects/fadein.cpp deleted file mode 100644 index ad5a52560b..0000000000 --- a/effects/fadein.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/***************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2006 Lubos Lunak - -You can Freely distribute this program under the GNU General Public -License. See the file "COPYING" for the exact licensing terms. -******************************************************************/ - -#include "fadein.h" - -#include - -namespace KWinInternal -{ - -void FadeInEffect::prePaintWindow( EffectWindow* w, int* mask, QRegion* region, int time ) - { - if( windows.contains( w )) - { - windows[ w ] += time / 1000.; // complete change in 1000ms - if( windows[ w ] < 1 ) - { - *mask |= Scene::PAINT_WINDOW_TRANSLUCENT; - *mask &= ~Scene::PAINT_WINDOW_OPAQUE; - } - else - windows.remove( w ); - } - effects->prePaintWindow( w, mask, region, time ); - } - -void FadeInEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ) - { - if( windows.contains( w )) - { - data.opacity *= windows[ w ]; - } - effects->paintWindow( w, mask, region, data ); - } - -void FadeInEffect::postPaintWindow( EffectWindow* w ) - { - if( windows.contains( w )) - w->window()->addRepaintFull(); // trigger next animation repaint - effects->postPaintWindow( w ); - } - -void FadeInEffect::windowAdded( EffectWindow* c ) - { - Client* cc = dynamic_cast< Client* >( c->window()); - if( cc == NULL || cc->isOnCurrentDesktop()) - { - windows[ c ] = 0; - c->window()->addRepaintFull(); - } - } - -void FadeInEffect::windowClosed( EffectWindow* c ) - { - windows.remove( c ); - } - -} // namespace diff --git a/effects/fadein.h b/effects/fadein.h deleted file mode 100644 index 1b386bc8bc..0000000000 --- a/effects/fadein.h +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2006 Lubos Lunak - -You can Freely distribute this program under the GNU General Public -License. See the file "COPYING" for the exact licensing terms. -******************************************************************/ - -#ifndef KWIN_FADEIN_H -#define KWIN_FADEIN_H - -#include - -namespace KWinInternal -{ - -class FadeInEffect - : public Effect - { - public: - virtual void prePaintWindow( EffectWindow* w, int* mask, QRegion* region, int time ); - virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ); - virtual void postPaintWindow( EffectWindow* w ); - // TODO react also on virtual desktop changes - virtual void windowAdded( EffectWindow* c ); - virtual void windowClosed( EffectWindow* c ); - private: - QMap< const EffectWindow*, double > windows; - }; - -} // namespace - -#endif diff --git a/effects/fadeout.cpp b/effects/fadeout.cpp deleted file mode 100644 index cf6ca339d8..0000000000 --- a/effects/fadeout.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2006 Lubos Lunak - -You can Freely distribute this program under the GNU General Public -License. See the file "COPYING" for the exact licensing terms. -******************************************************************/ - -#include "fadeout.h" - -#include -#include - -namespace KWinInternal -{ - -void FadeOutEffect::prePaintWindow( EffectWindow* w, int* mask, QRegion* region, int time ) - { - if( windows.contains( w )) - { - windows[ w ] -= time / 1000.; // complete change in 1000ms - if( windows[ w ] > 0 ) - { - *mask |= Scene::PAINT_WINDOW_TRANSLUCENT; - *mask &= ~Scene::PAINT_WINDOW_OPAQUE; - w->enablePainting( Scene::Window::PAINT_DISABLED_BY_DELETE ); - } - else - { - windows.remove( w ); - static_cast< Deleted* >( w->window())->unrefWindow(); - } - } - effects->prePaintWindow( w, mask, region, time ); - } - -void FadeOutEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ) - { - if( windows.contains( w )) - { - data.opacity *= windows[ w ]; - } - effects->paintWindow( w, mask, region, data ); - } - -void FadeOutEffect::postPaintWindow( EffectWindow* w ) - { - if( windows.contains( w )) - w->window()->addRepaintFull(); // trigger next animation repaint - effects->postPaintWindow( w ); - } - -void FadeOutEffect::windowClosed( EffectWindow* c ) - { - Client* cc = dynamic_cast< Client* >( c->window()); - if( cc == NULL || cc->isOnCurrentDesktop()) - { - windows[ c ] = 1; // count down to 0 - c->window()->addRepaintFull(); - static_cast< Deleted* >( c->window())->refWindow(); - } - } - -void FadeOutEffect::windowDeleted( EffectWindow* c ) - { - windows.remove( c ); - } - -} // namespace diff --git a/effects/fadeout.h b/effects/fadeout.h deleted file mode 100644 index 0813c72b83..0000000000 --- a/effects/fadeout.h +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2006 Lubos Lunak - -You can Freely distribute this program under the GNU General Public -License. See the file "COPYING" for the exact licensing terms. -******************************************************************/ - -#ifndef KWIN_FADEOUT_H -#define KWIN_FADEOUT_H - -#include - -namespace KWinInternal -{ - -class FadeOutEffect - : public Effect - { - public: - virtual void prePaintWindow( EffectWindow* w, int* mask, QRegion* region, int time ); - virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ); - virtual void postPaintWindow( EffectWindow* w ); - // TODO react also on virtual desktop changes - virtual void windowClosed( EffectWindow* c ); - virtual void windowDeleted( EffectWindow* c ); - private: - QMap< const EffectWindow*, double > windows; - }; - -} // namespace - -#endif