From 7d67cf42c44ee5c70a9f6d3436bf678089e23850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 5 Jul 2006 12:56:04 +0000 Subject: [PATCH] Data like transf. matrix that the effects can affect. svn path=/branches/work/kwin_composite/; revision=558454 --- effects.cpp | 36 ++++++++++++++++++++++++++++++------ effects.h | 24 ++++++++++++++++++++---- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/effects.cpp b/effects.cpp index 09cf356c77..c12b9ba93a 100644 --- a/effects.cpp +++ b/effects.cpp @@ -13,6 +13,30 @@ License. See the file "COPYING" for the exact licensing terms. namespace KWinInternal { +//**************************************** +// Matrix +//**************************************** + +Matrix::Matrix() + { + m[ 0 ][ 0 ] = 1; + m[ 0 ][ 1 ] = 0; + m[ 0 ][ 2 ] = 0; + m[ 0 ][ 3 ] = 0; + m[ 1 ][ 0 ] = 0; + m[ 1 ][ 1 ] = 1; + m[ 1 ][ 2 ] = 0; + m[ 1 ][ 3 ] = 0; + m[ 2 ][ 0 ] = 0; + m[ 2 ][ 1 ] = 0; + m[ 2 ][ 2 ] = 1; + m[ 2 ][ 3 ] = 0; + m[ 3 ][ 0 ] = 0; + m[ 3 ][ 1 ] = 0; + m[ 3 ][ 2 ] = 0; + m[ 3 ][ 3 ] = 1; + } + //**************************************** // Effect //**************************************** @@ -29,11 +53,11 @@ void Effect::windowUserResized( Toplevel* ) { } -void Effect::paintWindow( Toplevel* ) +void Effect::paintWindow( Toplevel*, EffectData& ) { } -void Effect::paintWorkspace( Workspace* ) +void Effect::paintWorkspace( Workspace*, EffectData& ) { } @@ -41,19 +65,19 @@ void Effect::paintWorkspace( Workspace* ) // EffectsHandler //**************************************** -void EffectsHandler::windowUserMoved( Toplevel* c ) +void EffectsHandler::windowUserMoved( Toplevel* ) { } -void EffectsHandler::windowUserResized( Toplevel* c ) +void EffectsHandler::windowUserResized( Toplevel* ) { } -void EffectsHandler::paintWindow( Toplevel* c ) +void EffectsHandler::paintWindow( Toplevel*, EffectData& ) { } -void EffectsHandler::paintWorkspace( Workspace* ) +void EffectsHandler::paintWorkspace( Workspace*, EffectData& ) { } diff --git a/effects.h b/effects.h index 7a0118c1c1..7d3123ad34 100644 --- a/effects.h +++ b/effects.h @@ -8,6 +8,8 @@ You can Freely distribute this program under the GNU General Public License. See the file "COPYING" for the exact licensing terms. ******************************************************************/ +// TODO MIT or some other licence, perhaps move to some lib + #ifndef KWIN_EFFECTS_H #define KWIN_EFFECTS_H @@ -17,14 +19,28 @@ namespace KWinInternal class Toplevel; class Workspace; +class Matrix + { + public: + Matrix(); + float m[ 4 ][ 4 ]; + }; + +class EffectData + { + public: + Matrix matrix; + float opacity; + }; + class Effect { public: virtual ~Effect(); virtual void windowUserMoved( Toplevel* c ); virtual void windowUserResized( Toplevel* c ); - virtual void paintWindow( Toplevel* c ); - virtual void paintWorkspace( Workspace* ); + virtual void paintWindow( Toplevel* c, EffectData& data ); + virtual void paintWorkspace( Workspace*, EffectData& data ); }; class EffectsHandler @@ -32,8 +48,8 @@ class EffectsHandler public: void windowUserMoved( Toplevel* c ); void windowUserResized( Toplevel* c ); - void paintWindow( Toplevel* c ); - void paintWorkspace( Workspace* ); + void paintWindow( Toplevel* c, EffectData& data ); + void paintWorkspace( Workspace*, EffectData& data ); }; extern EffectsHandler* effects;