From 54ede72bf13a3c5d9620e1bbc1341c90e0881818 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Mon, 2 Jun 2008 19:52:02 +0000 Subject: [PATCH] Add a dbus function to show which effect is loaded svn path=/trunk/KDE/kdebase/workspace/; revision=815896 --- effects.cpp | 12 +++++++++++- effects.h | 1 + org.kde.KWin.xml | 3 +++ useractions.cpp | 30 +++++++++++++++++++----------- workspace.h | 7 +++++-- 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/effects.cpp b/effects.cpp index c8ff646f98..9d814248d5 100644 --- a/effects.cpp +++ b/effects.cpp @@ -711,6 +711,16 @@ void EffectsHandlerImpl::toggleEffect( const QString& name ) loadEffect( name ); } +QStringList EffectsHandlerImpl::loadedModules() const + { + QStringList listModules; + for(QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) + { + listModules <<(*it).first; + } + return listModules; + } + bool EffectsHandlerImpl::loadEffect( const QString& name ) { Workspace::self()->addRepaintFull(); @@ -1262,7 +1272,7 @@ EffectWindow* effectWindow( Scene::Window* w ) // EffectWindowGroupImpl //**************************************** - + EffectWindowList EffectWindowGroupImpl::members() const { EffectWindowList ret; diff --git a/effects.h b/effects.h index 8a31fc401e..8e19cb3c98 100644 --- a/effects.h +++ b/effects.h @@ -141,6 +141,7 @@ class EffectsHandlerImpl : public EffectsHandler void unloadEffect( const QString& name ); void reloadEffect( const QString& name ); bool isEffectLoaded( const QString& name ); + QStringList loadedModules() const; QList elevatedWindows() const; diff --git a/org.kde.KWin.xml b/org.kde.KWin.xml index 33172ef663..b3a8e7e3ab 100644 --- a/org.kde.KWin.xml +++ b/org.kde.KWin.xml @@ -47,6 +47,9 @@ + + + diff --git a/useractions.cpp b/useractions.cpp index c4805dd2bd..1c65c86f31 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -454,7 +454,7 @@ void Workspace::clientPopupActivated( QAction *action ) } -void Workspace::performWindowOperation( Client* c, Options::WindowOperation op ) +void Workspace::performWindowOperation( Client* c, Options::WindowOperation op ) { if ( !c ) return; @@ -463,7 +463,7 @@ void Workspace::performWindowOperation( Client* c, Options::WindowOperation op ) QCursor::setPos( c->geometry().center() ); if (op == Options::ResizeOp || op == Options::UnrestrictedResizeOp ) QCursor::setPos( c->geometry().bottomRight()); - switch ( op ) + switch ( op ) { case Options::MoveOp: c->performMouseCommand( Options::MouseMove, cursorPos() ); @@ -552,7 +552,7 @@ void Workspace::performWindowOperation( Client* c, Options::WindowOperation op ) bool Client::performMouseCommand( Options::MouseCommand command, const QPoint &globalPos, bool handled ) { bool replay = false; - switch (command) + switch (command) { case Options::MouseRaise: workspace()->raiseClient( this ); @@ -734,6 +734,14 @@ void Workspace::reloadEffect( const QString& name ) static_cast(effects)->reloadEffect( name ); } +QStringList Workspace::loadedModules() const + { + QStringList listModulesLoaded; + if ( effects ) + listModulesLoaded = static_cast(effects)->loadedModules(); + return listModulesLoaded; + } + void Workspace::slotActivateAttentionWindow() { if( attention_chain.count() > 0 ) @@ -743,13 +751,13 @@ void Workspace::slotActivateAttentionWindow() void Workspace::slotSwitchDesktopNext() { int d = currentDesktop() + 1; - if ( d > numberOfDesktops() ) + if ( d > numberOfDesktops() ) { - if ( options->rollOverDesktops ) + if ( options->rollOverDesktops ) { d = 1; } - else + else { return; } @@ -760,7 +768,7 @@ void Workspace::slotSwitchDesktopNext() void Workspace::slotSwitchDesktopPrevious() { int d = currentDesktop() - 1; - if ( d <= 0 ) + if ( d <= 0 ) { if ( options->rollOverDesktops ) d = numberOfDesktops(); @@ -979,7 +987,7 @@ void Workspace::slotWindowToNextDesktop() { windowToNextDesktop( active_popup_client ? active_popup_client : active_client ); } - + void Workspace::windowToNextDesktop( Client* c ) { int d = currentDesktop() + 1; @@ -1001,7 +1009,7 @@ void Workspace::slotWindowToPreviousDesktop() { windowToPreviousDesktop( active_popup_client ? active_popup_client : active_client ); } - + void Workspace::windowToPreviousDesktop( Client* c ) { int d = currentDesktop() - 1; @@ -1096,7 +1104,7 @@ void Workspace::slotSendToDesktop( QAction *action ) int desk = action->data().toInt(); if ( !active_popup_client ) return; - if ( desk == 0 ) + if ( desk == 0 ) { // the 'on_all_desktops' menu entry active_popup_client->setOnAllDesktops( !active_popup_client->isOnAllDesktops()); return; @@ -1255,7 +1263,7 @@ bool Workspace::shortcutAvailable( const KShortcut& cut, Client* ignore ) const ++it ) { if( (*it) != ignore && (*it)->shortcut() == cut ) - return false; + return false; } return true; } diff --git a/workspace.h b/workspace.h index 29effa5a26..0efa13fd8c 100644 --- a/workspace.h +++ b/workspace.h @@ -66,7 +66,7 @@ class Workspace : public QObject, public KDecorationDefines virtual ~Workspace(); static Workspace * self() { return _self; } - + bool workspaceEvent( XEvent * ); bool workspaceEvent( QEvent * ); @@ -213,6 +213,9 @@ class Workspace : public QObject, public KDecorationDefines void unloadEffect( const QString& name ); + QStringList loadedModules() const; + + /** * Shows the menu operations menu for the client and makes it active if * it's not already. @@ -560,7 +563,7 @@ class Workspace : public QObject, public KDecorationDefines void closeActivePopup(); void updateClientArea( bool force ); - + void finishCompositing(); bool windowRepaintsPending() const;