From d515abb82c3125e15fbdada0fbdc498d84fe9f97 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Thu, 19 Jun 2008 14:16:21 +0000 Subject: [PATCH] Added screenNumber() and addRepaint(QRegion) to effects API svn path=/trunk/KDE/kdebase/workspace/; revision=822215 --- composite.cpp | 7 +++++++ effects.cpp | 10 ++++++++++ effects.h | 2 ++ lib/kwineffects.h | 2 ++ workspace.h | 1 + 5 files changed, 22 insertions(+) diff --git a/composite.cpp b/composite.cpp index 5dbc3160ff..efa5dd0a49 100644 --- a/composite.cpp +++ b/composite.cpp @@ -284,6 +284,13 @@ void Workspace::addRepaint( const QRect& r ) repaints_region += r; } +void Workspace::addRepaint( const QRegion& r ) + { + if( !compositing()) + return; + repaints_region += r; + } + void Workspace::addRepaintFull() { if( !compositing()) diff --git a/effects.cpp b/effects.cpp index a5a210cc7a..4db4c6f4cf 100644 --- a/effects.cpp +++ b/effects.cpp @@ -537,6 +537,11 @@ void EffectsHandlerImpl::addRepaint( const QRect& r ) Workspace::self()->addRepaint( r ); } +void EffectsHandlerImpl::addRepaint( const QRegion& r ) + { + Workspace::self()->addRepaint( r ); + } + void EffectsHandlerImpl::addRepaint( int x, int y, int w, int h ) { Workspace::self()->addRepaint( x, y, w, h ); @@ -552,6 +557,11 @@ int EffectsHandlerImpl::numScreens() const return Workspace::self()->numScreens(); } +int EffectsHandlerImpl::screenNumber( const QPoint& pos ) const + { + return Workspace::self()->screenNumber( pos ); + } + QRect EffectsHandlerImpl::clientArea( clientAreaOption opt, int screen, int desktop ) const { return Workspace::self()->clientArea( opt, screen, desktop ); diff --git a/effects.h b/effects.h index ea39c33ce0..d14ee3ee6c 100644 --- a/effects.h +++ b/effects.h @@ -85,9 +85,11 @@ class EffectsHandlerImpl : public EffectsHandler virtual void addRepaintFull(); virtual void addRepaint( const QRect& r ); + virtual void addRepaint( const QRegion& r ); virtual void addRepaint( int x, int y, int w, int h ); virtual int activeScreen() const; virtual int numScreens() const; + virtual int screenNumber( const QPoint& pos ) const; virtual QRect clientArea( clientAreaOption, int screen, int desktop ) const; virtual QRect clientArea( clientAreaOption, const EffectWindow* c ) const; virtual QRect clientArea( clientAreaOption, const QPoint& p, int desktop ) const; diff --git a/lib/kwineffects.h b/lib/kwineffects.h index 7dab8c75ca..32397b7c23 100644 --- a/lib/kwineffects.h +++ b/lib/kwineffects.h @@ -477,6 +477,7 @@ class KWIN_EXPORT EffectsHandler virtual QString desktopName( int desktop ) const = 0; virtual int activeScreen() const = 0; // Xinerama virtual int numScreens() const = 0; // Xinerama + virtual int screenNumber( const QPoint& pos ) const = 0; // Xinerama virtual QRect clientArea( clientAreaOption, int screen, int desktop ) const = 0; virtual QRect clientArea( clientAreaOption, const EffectWindow* c ) const = 0; virtual QRect clientArea( clientAreaOption, const QPoint& p, int desktop ) const = 0; @@ -515,6 +516,7 @@ class KWIN_EXPORT EffectsHandler **/ virtual void addRepaintFull() = 0; virtual void addRepaint( const QRect& r ) = 0; + virtual void addRepaint( const QRegion& r ) = 0; virtual void addRepaint( int x, int y, int w, int h ) = 0; CompositingType compositingType() const; diff --git a/workspace.h b/workspace.h index b0e2f4890d..f36b449492 100644 --- a/workspace.h +++ b/workspace.h @@ -317,6 +317,7 @@ class Workspace : public QObject, public KDecorationDefines // when adding repaints caused by a window, you probably want to use // either Toplevel::addRepaint() or Toplevel::addWorkspaceRepaint() void addRepaint( const QRect& r ); + void addRepaint( const QRegion& r ); void addRepaint( int x, int y, int w, int h ); // creates XComposite overlay window, call initOverlay() afterwards bool createOverlay();