From 35237aadcb478c5288f20dced31d6eef9f43f76c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 30 Aug 2012 08:20:26 +0200 Subject: [PATCH] Splitting up of KWin's global D-Bus interface Two new interfaces are introduced: * org.kde.kwin.Compositing * org.kde.kwin.Effects The Compositing interface is generated from scriptable elements on the KWin::Compositor class and the Compositor is exported as /Compositor. It provides the general Compositing related D-Bus methods like whether the compositor is active and toggling and so on. The Effects interface is generated from scriptable elements on the KWin::EffectsHandlerImpl class and the instance is exported as /Effects. It provides all the effects related D-Bus methods like loading an effect or the list of all effects. This removes the need to have all these methods provided on the global org.kde.KWin interface. For backwards compatibility they are kept, but no longer provided by the Workspace class. Instead a new DBusInterface is generated which wrapps the calls and delegates it to one of our three related Singleton objects: * Workspace * Compositor * EffectsHandlerImpl --- CMakeLists.txt | 5 +- composite.cpp | 42 +++++---- composite.h | 49 ++++++++-- dbusinterface.cpp | 177 +++++++++++++++++++++++++++++++++++ dbusinterface.h | 151 ++++++++++++++++++++++++++++++ effects.cpp | 5 + effects.h | 18 ++-- org.kde.kwin.Compositing.xml | 15 +++ org.kde.kwin.Effects.xml | 34 +++++++ useractions.cpp | 47 ---------- workspace.cpp | 43 ++------- workspace.h | 24 ----- 12 files changed, 469 insertions(+), 141 deletions(-) create mode 100644 dbusinterface.cpp create mode 100644 dbusinterface.h create mode 100644 org.kde.kwin.Compositing.xml create mode 100644 org.kde.kwin.Effects.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index ce69e8492a..b65d5ee30f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,7 @@ add_subdirectory( tabbox ) set(kwin_KDEINIT_SRCS workspace.cpp + dbusinterface.cpp client.cpp tabgroup.cpp placement.cpp @@ -148,7 +149,9 @@ if(KWIN_BUILD_SCREENEDGES) ) endif(KWIN_BUILD_SCREENEDGES) -qt4_add_dbus_adaptor( kwin_KDEINIT_SRCS org.kde.KWin.xml workspace.h KWin::Workspace ) +qt4_add_dbus_adaptor( kwin_KDEINIT_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface ) +qt4_add_dbus_adaptor( kwin_KDEINIT_SRCS org.kde.kwin.Compositing.xml composite.h KWin::Compositor ) +qt4_add_dbus_adaptor( kwin_KDEINIT_SRCS org.kde.kwin.Effects.xml effects.h KWin::EffectsHandlerImpl ) qt4_add_dbus_interface( kwin_KDEINIT_SRCS ${KDEBASE_WORKSPACE_SOURCE_DIR}/ksmserver/org.kde.KSMServerInterface.xml ksmserver_interface) diff --git a/composite.cpp b/composite.cpp index 6d3ad3f2d9..f3d04b097c 100644 --- a/composite.cpp +++ b/composite.cpp @@ -37,6 +37,8 @@ along with this program. If not, see . http://ktown.kde.org/~fredrik/composite_howto.html */ +#include "composite.h" +#include "compositingadaptor.h" #include @@ -54,7 +56,6 @@ along with this program. If not, see . #include "shadow.h" #include "useractions.h" #include "compositingprefs.h" -#include "composite.h" #include "notifications.h" #include @@ -64,6 +65,7 @@ along with this program. If not, see . #include #include #include +#include #include #include #include @@ -105,6 +107,10 @@ Compositor::Compositor(QObject* workspace) , m_nextFrameDelay(0) , m_scene(NULL) { + new CompositingAdaptor(this); + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/Compositor", this); + dbus.registerService("org.kde.kwin.Compositing"); connect(&unredirectTimer, SIGNAL(timeout()), SLOT(delayedCheckUnredirect())); connect(&compositeResetTimer, SIGNAL(timeout()), SLOT(restart())); connect(workspace, SIGNAL(configChanged()), SLOT(slotConfigChanged())); @@ -375,13 +381,6 @@ void Compositor::toggleCompositing() } } -QStringList Workspace::activeEffects() const -{ - if (effects) - return static_cast< EffectsHandlerImpl* >(effects)->activeEffects(); - return QStringList(); -} - void Compositor::updateCompositeBlocking() { updateCompositeBlocking(NULL); @@ -698,33 +697,30 @@ void Compositor::restartKWin(const QString &reason) system(cmd); } -/***************************************************** - * Compositing related D-Bus interface from Workspace - ****************************************************/ -bool Workspace::compositingPossible() const +bool Compositor::isCompositingPossible() const { return CompositingPrefs::compositingPossible(); } -QString Workspace::compositingNotPossibleReason() const +QString Compositor::compositingNotPossibleReason() const { return CompositingPrefs::compositingNotPossibleReason(); } -bool Workspace::openGLIsBroken() const +bool Compositor::isOpenGLBroken() const { return CompositingPrefs::openGlIsBroken(); } -QString Workspace::compositingType() +QString Compositor::compositingType() const { - // the returned strings are considered as identifiers and may not be translated - if (!effects) { + if (!hasScene()) { return "none"; } - if (effects->compositingType() == XRenderCompositing) { + switch (m_scene->compositingType()) { + case XRenderCompositing: return "xrender"; - } else if (effects->compositingType() == OpenGLCompositing) { + case OpenGLCompositing: #ifdef KWIN_HAVE_OPENGLES return "gles"; #else @@ -734,10 +730,16 @@ QString Workspace::compositingType() return "gl1"; } #endif + case NoCompositing: + default: + return "none"; } - return "none"; } +/***************************************************** + * Workspace + ****************************************************/ + bool Workspace::compositing() const { return m_compositor && m_compositor->hasScene(); diff --git a/composite.h b/composite.h index 2d96780cd1..2d9eee3005 100644 --- a/composite.h +++ b/composite.h @@ -25,7 +25,6 @@ along with this program. If not, see . #include #include #include -#include #include #include @@ -38,6 +37,34 @@ class Scene; class Compositor : public QObject { Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.Compositing") + /** + * @brief Whether the Compositor is active. That is a Scene is present and the Compositor is + * not shutting down itself. + **/ + Q_PROPERTY(bool active READ isActive) + /** + * @brief Whether compositing is possible. Mostly means whether the required X extensions + * are available. + **/ + Q_PROPERTY(bool compositingPossible READ isCompositingPossible) + /** + * @brief The reason why compositing is not possible. Empty String if compositing is possible. + **/ + Q_PROPERTY(QString compositingNotPossibleReason READ compositingNotPossibleReason) + /** + * @brief Whether OpenGL has failed badly in the past (crash) and is considered as broken. + **/ + Q_PROPERTY(bool openGLIsBroken READ isOpenGLBroken) + /** + * The type of the currently used Scene: + * @li @c none No Compositing + * @li @c xrender XRender + * @li @c gl1 OpenGL 1 + * @li @c gl2 OpenGL 2 + * @li @c gles OpenGL ES 2 + **/ + Q_PROPERTY(QString compositingType READ compositingType) public: ~Compositor(); // when adding repaints caused by a window, you probably want to use @@ -45,11 +72,6 @@ public: void addRepaint(const QRect& r); void addRepaint(const QRegion& r); void addRepaint(int x, int y, int w, int h); - /** - * Called from the D-Bus interface. Does the same as slotToggleCompositing with the - * addition to show a notification on how to revert the compositing state. - **/ - void toggleCompositing(); // Mouse polling void startMousePolling(); void stopMousePolling(); @@ -139,8 +161,19 @@ public: return s_compositor != NULL && s_compositor->isActive(); } + // D-Bus: getters for Properties, see documentation on the property + bool isCompositingPossible() const; + QString compositingNotPossibleReason() const; + bool isOpenGLBroken() const; + QString compositingType() const; + public Q_SLOTS: void addRepaintFull(); + /** + * Called from the D-Bus interface. Does the same as slotToggleCompositing with the + * addition to show a notification on how to revert the compositing state. + **/ + Q_SCRIPTABLE void toggleCompositing(); /** * Actual slot to perform the toggling compositing. * That is if the Compositor is suspended it will be resumed and if the Compositor is active @@ -163,8 +196,10 @@ public Q_SLOTS: void updateCompositeBlocking(); void updateCompositeBlocking(KWin::Client* c); + // For the D-Bus interface + Q_SIGNALS: - void compositingToggled(bool active); + Q_SCRIPTABLE void compositingToggled(bool active); protected: void timerEvent(QTimerEvent *te); diff --git a/dbusinterface.cpp b/dbusinterface.cpp new file mode 100644 index 0000000000..180f6cf670 --- /dev/null +++ b/dbusinterface.cpp @@ -0,0 +1,177 @@ +/******************************************************************** + KWin - the KDE window manager + This file is part of the KDE project. + +Copyright (C) 2012 Martin Gräßlin + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*********************************************************************/ + +// own +#include "dbusinterface.h" +// kwin +#include "composite.h" +#include "effects.h" +#include "kwinadaptor.h" +#include "workspace.h" + +namespace KWin +{ + +DBusInterface::DBusInterface(QObject *parent) + : QObject(parent) +{ + (void) new KWinAdaptor(this); + + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/KWin", this); + dbus.registerService("org.kde.KWin"); + connect(Compositor::self(), SIGNAL(compositingToggled(bool)), SIGNAL(compositingToggled(bool))); + dbus.connect(QString(), "/KWin", "org.kde.KWin", "reloadConfig", + Workspace::self(), SLOT(slotReloadConfig())); + dbus.connect(QString(), "/KWin", "org.kde.KWin", "reinitCompositing", + Compositor::self(), SLOT(slotReinitialize())); +} + +DBusInterface::~DBusInterface() +{ +} + +// wrap void methods with no arguments to Workspace +#define WRAP(name) \ +void DBusInterface::name() \ +{\ + Workspace::self()->name();\ +} + +WRAP(cascadeDesktop) +WRAP(circulateDesktopApplications) +WRAP(killWindow) +WRAP(nextDesktop) +WRAP(previousDesktop) +WRAP(reconfigure) +WRAP(unclutterDesktop) + +#undef WRAP + +// wrap returning methods with no arguments to Workspace +#define WRAP( rettype, name ) \ +rettype DBusInterface::name( ) \ +{\ + return Workspace::self()->name(); \ +} + +WRAP(int, currentDesktop) +WRAP(QList, decorationSupportedColors) +WRAP(QString, supportInformation) +WRAP(bool, waitForCompositingSetup) + +#undef WRAP + +// wrap returning methods with one argument to Workspace +#define WRAP( rettype, name, argtype ) \ +rettype DBusInterface::name( argtype arg ) \ +{\ + return Workspace::self()->name(arg); \ +} + +WRAP(bool, setCurrentDesktop, int) +WRAP(bool, startActivity, const QString &) +WRAP(bool, stopActivity, const QString &) + +#undef WRAP + +void DBusInterface::doNotManage(const QString &name) +{ + Workspace::self()->doNotManage(name); +} + +void DBusInterface::showWindowMenuAt(qlonglong winId, int x, int y) +{ + Workspace::self()->showWindowMenuAt(winId, x, y); +} + +// wrap returning methods with no arguments to COMPOSITOR +#define WRAP( rettype, name ) \ +rettype DBusInterface::name( ) \ +{\ + return Compositor::self()->name(); \ +} + +WRAP(QString, compositingNotPossibleReason) +WRAP(QString, compositingType) + +#undef WRAP + +bool DBusInterface::compositingPossible() +{ + return Compositor::self()->isCompositingPossible(); +} + +bool DBusInterface::openGLIsBroken() +{ + return Compositor::self()->isOpenGLBroken(); +} + +bool DBusInterface::compositingActive() +{ + return Compositor::self()->isActive(); +} + +void DBusInterface::toggleCompositing() +{ + Compositor::self()->toggleCompositing(); +} + +// wrap returning QStringList methods with no argument to EffectsHandlerImpl +#define WRAP( name ) \ +QStringList DBusInterface::name( ) \ +{\ + if (effects) { \ + return static_cast< EffectsHandlerImpl* >(effects)->name(); \ + } \ + return QStringList(); \ +} + +WRAP(activeEffects) +WRAP(listOfEffects) +WRAP(loadedEffects) + +#undef WRAP + +// wrap void methods with one argument to EffectsHandlerImpl +#define WRAP( name, argtype ) \ +void DBusInterface::name( argtype arg ) \ +{\ + if (effects) { \ + static_cast< EffectsHandlerImpl* >(effects)->name(arg); \ + } \ +} + +WRAP(loadEffect, const QString &) +WRAP(reconfigureEffect, const QString &) +WRAP(toggleEffect, const QString &) +WRAP(unloadEffect, const QString &) + +#undef WRAP + +QString DBusInterface::supportInformationForEffect(const QString &name) +{ + if (effects) { + static_cast< EffectsHandlerImpl* >(effects)->supportInformation(name); + } + return QString(); +} + +} // namespace diff --git a/dbusinterface.h b/dbusinterface.h new file mode 100644 index 0000000000..e49d4e0ab2 --- /dev/null +++ b/dbusinterface.h @@ -0,0 +1,151 @@ +/******************************************************************** + KWin - the KDE window manager + This file is part of the KDE project. + +Copyright (C) 2012 Martin Gräßlin + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*********************************************************************/ + +#ifndef KWIN_DBUS_INTERFACE_H +#define KWIN_DBUS_INTERFACE_H + +#include +#include +class QByteArray; +template class QList; +template class QMap; +class QString; +class QStringList; +class QVariant; + +namespace KWin +{ + +/** + * @brief This class is a wrapper for the org.kde.KWin D-Bus interface. + * + * The main purpose of this class is to be exported on the D-Bus as object /KWin. + * It is a pure wrapper to provide the deprecated D-Bus methods which have been + * removed from Workspace which used to implement the complete D-Bus interface. + * + * Nowadays the D-Bus interfaces are distributed, parts of it are exported on + * /Compositor, parts on /Effects and parts on /KWin. The implementation in this + * class just delegates the method calls to the actual implementation in one of the + * three singletons. + * + * @author Martin Gräßlin + * @todo KDE5: remove the methods provided on /Effects and /Compositor + **/ +class DBusInterface: public QObject +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.kde.KWin") +public: + DBusInterface(QObject *parent); + virtual ~DBusInterface(); + +public: // PROPERTIES +public Q_SLOTS: // METHODS + Q_NOREPLY void cascadeDesktop(); + void circulateDesktopApplications(); + int currentDesktop(); + QList decorationSupportedColors(); + void doNotManage(const QString &name); + Q_NOREPLY void killWindow(); + void nextDesktop(); + void previousDesktop(); + Q_NOREPLY void reconfigure(); + bool setCurrentDesktop(int desktop); + /** + * @deprecated + **/ + void showWindowMenuAt(qlonglong winId, int x, int y); + bool startActivity(const QString &in0); + bool stopActivity(const QString &in0); + QString supportInformation(); + Q_NOREPLY void unclutterDesktop(); + // from compositor + /** + * @deprecated + **/ + bool compositingActive(); + /** + * @deprecated + **/ + QString compositingNotPossibleReason(); + /** + * @deprecated + **/ + bool compositingPossible(); + /** + * @deprecated + **/ + QString compositingType(); + /** + * @deprecated + **/ + bool openGLIsBroken(); + /** + * @deprecated + **/ + Q_NOREPLY void toggleCompositing(); + /** + * @deprecated + **/ + bool waitForCompositingSetup(); + // from effectshandler + /** + * @deprecated + **/ + QStringList activeEffects(); + /** + * @deprecated + **/ + QStringList listOfEffects(); + /** + * @deprecated + **/ + void loadEffect(const QString &name); + /** + * @deprecated + **/ + QStringList loadedEffects(); + /** + * @deprecated + **/ + void reconfigureEffect(const QString &name); + /** + * @deprecated + **/ + QString supportInformationForEffect(const QString &name); + /** + * @deprecated + **/ + void toggleEffect(const QString &name); + /** + * @deprecated + **/ + void unloadEffect(const QString &name); + +Q_SIGNALS: // SIGNALS + /** + * @deprecated + **/ + void compositingToggled(bool active); +}; + +} // namespace + +#endif // KWIN_DBUS_INTERFACE_H diff --git a/effects.cpp b/effects.cpp index ecb0a8a7ce..0f3084474a 100644 --- a/effects.cpp +++ b/effects.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . #include "effects.h" +#include "effectsadaptor.h" #include "deleted.h" #include "client.h" #include "group.h" @@ -105,6 +106,10 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene) , m_compositor(compositor) , m_scene(scene) { + new EffectsAdaptor(this); + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/Effects", this); + dbus.registerService("org.kde.kwin.Effects"); // init is important, otherwise causes crashes when quads are build before the first painting pass start m_currentBuildQuadsIterator = m_activeEffects.end(); diff --git a/effects.h b/effects.h index 8f6b6c174d..6e922ffffb 100644 --- a/effects.h +++ b/effects.h @@ -47,6 +47,10 @@ class Unmanaged; class EffectsHandlerImpl : public EffectsHandler { Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.Effects") + Q_PROPERTY(QStringList activeEffects READ activeEffects) + Q_PROPERTY(QStringList loadedEffects READ loadedEffects) + Q_PROPERTY(QStringList listOfEffects READ listOfEffects) public: EffectsHandlerImpl(Compositor *compositor, Scene *scene); virtual ~EffectsHandlerImpl(); @@ -164,12 +168,6 @@ public: void desktopResized(const QSize &size); virtual void reloadEffect(Effect *effect); - bool loadEffect(const QString& name, bool checkDefault = false); - void toggleEffect(const QString& name); - void unloadEffect(const QString& name); - void reconfigureEffect(const QString& name); - bool isEffectLoaded(const QString& name) const; - QString supportInformation(const QString& name) const; QStringList loadedEffects() const; QStringList listOfEffects() const; @@ -183,6 +181,14 @@ public Q_SLOTS: void slotShowOutline(const QRect &geometry); void slotHideOutline(); + // slots for D-Bus interface + Q_SCRIPTABLE void reconfigureEffect(const QString& name); + Q_SCRIPTABLE bool loadEffect(const QString& name, bool checkDefault = false); + Q_SCRIPTABLE void toggleEffect(const QString& name); + Q_SCRIPTABLE void unloadEffect(const QString& name); + Q_SCRIPTABLE bool isEffectLoaded(const QString& name) const; + Q_SCRIPTABLE QString supportInformation(const QString& name) const; + protected Q_SLOTS: void slotDesktopChanged(int old, KWin::Client *withClient); void slotClientAdded(KWin::Client *c); diff --git a/org.kde.kwin.Compositing.xml b/org.kde.kwin.Compositing.xml new file mode 100644 index 0000000000..ad20701089 --- /dev/null +++ b/org.kde.kwin.Compositing.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/org.kde.kwin.Effects.xml b/org.kde.kwin.Effects.xml new file mode 100644 index 0000000000..d060e8e023 --- /dev/null +++ b/org.kde.kwin.Effects.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/useractions.cpp b/useractions.cpp index ea0071741e..a65214feed 100755 --- a/useractions.cpp +++ b/useractions.cpp @@ -1200,53 +1200,6 @@ void Workspace::showWindowMenuAt(unsigned long, int, int) slotWindowOperations(); } -void Workspace::loadEffect(const QString& name) -{ - if (effects) - static_cast(effects)->loadEffect(name); -} - -void Workspace::toggleEffect(const QString& name) -{ - if (effects) - static_cast(effects)->toggleEffect(name); -} - -void Workspace::unloadEffect(const QString& name) -{ - if (effects) - static_cast(effects)->unloadEffect(name); -} - -void Workspace::reconfigureEffect(const QString& name) -{ - if (effects) - static_cast(effects)->reconfigureEffect(name); -} - -QStringList Workspace::loadedEffects() const -{ - QStringList listModulesLoaded; - if (effects) - listModulesLoaded = static_cast(effects)->loadedEffects(); - return listModulesLoaded; -} - -QStringList Workspace::listOfEffects() const -{ - QStringList listModules; - if (effects) - listModules = static_cast(effects)->listOfEffects(); - return listModules; -} - -QString Workspace::supportInformationForEffect(const QString& name) const -{ - if (effects) - return static_cast(effects)->supportInformation(name); - return QString(); -} - void Workspace::slotActivateAttentionWindow() { if (attention_chain.count() > 0) diff --git a/workspace.cpp b/workspace.cpp index 06add6c8bf..258a237534 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -55,7 +55,7 @@ along with this program. If not, see . #include "outline.h" #include "group.h" #include "rules.h" -#include "kwinadaptor.h" +#include "dbusinterface.h" #include "unmanaged.h" #include "deleted.h" #include "effects.h" @@ -148,13 +148,6 @@ Workspace::Workspace(bool restore) // If KWin was already running it saved its configuration after loosing the selection -> Reread QFuture reparseConfigFuture = QtConcurrent::run(options, &Options::reparseConfiguration); - (void) new KWinAdaptor(this); - - QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/KWin", this); - dbus.connect(QString(), "/KWin", "org.kde.KWin", "reloadConfig", - this, SLOT(slotReloadConfig())); - // Initialize desktop grid array desktopGrid_[0] = 0; desktopGrid_[1] = 0; @@ -207,10 +200,9 @@ Workspace::Workspace(bool restore) m_compositor = Compositor::createCompositor(this); connect(this, SIGNAL(currentDesktopChanged(int,KWin::Client*)), m_compositor, SLOT(addRepaintFull())); - connect(m_compositor, SIGNAL(compositingToggled(bool)), SIGNAL(compositingToggled(bool))); connect(m_compositor, SIGNAL(compositingToggled(bool)), SLOT(slotCompositingToggled())); - dbus.connect(QString(), "/KWin", "org.kde.KWin", "reinitCompositing", - m_compositor, SLOT(slotReinitialize())); + + new DBusInterface(this); // Compatibility long data = 1; @@ -2210,18 +2202,18 @@ QString Workspace::supportInformation() const } support.append("\nLoaded Effects:\n"); support.append( "---------------\n"); - foreach (const QString &effect, loadedEffects()) { + foreach (const QString &effect, static_cast(effects)->loadedEffects()) { support.append(effect % '\n'); } support.append("\nCurrently Active Effects:\n"); support.append( "-------------------------\n"); - foreach (const QString &effect, activeEffects()) { + foreach (const QString &effect, static_cast(effects)->activeEffects()) { support.append(effect % '\n'); } support.append("\nEffect Settings:\n"); support.append( "----------------\n"); - foreach (const QString &effect, loadedEffects()) { - support.append(supportInformationForEffect(effect)); + foreach (const QString &effect, static_cast(effects)->loadedEffects()) { + support.append(static_cast(effects)->supportInformation(effect)); support.append('\n'); } } else { @@ -2239,27 +2231,6 @@ void Workspace::slotCompositingToggled() } } -/* - * Called from D-BUS - */ -bool Workspace::compositingActive() -{ - if (m_compositor) { - return m_compositor->isActive(); - } - return false; -} - -/* - * Called from D-BUS - */ -void Workspace::toggleCompositing() -{ - if (m_compositor) { - m_compositor->toggleCompositing(); - } -} - void Workspace::slotToggleCompositing() { if (m_compositor) { diff --git a/workspace.h b/workspace.h index 474591901e..ae26f6ba81 100644 --- a/workspace.h +++ b/workspace.h @@ -397,15 +397,6 @@ public: // KDE4 remove me - And it's also in the DCOP interface :( void showWindowMenuAt(unsigned long id, int x, int y); - void toggleCompositing(); - void loadEffect(const QString& name); - void toggleEffect(const QString& name); - void reconfigureEffect(const QString& name); - void unloadEffect(const QString& name); - QString supportInformationForEffect(const QString& name) const; - - QStringList loadedEffects() const; - QStringList listOfEffects() const; /** @@ -455,24 +446,10 @@ public: void nextDesktop(); void previousDesktop(); void circulateDesktopApplications(); - bool compositingActive(); bool waitForCompositingSetup(); bool stopActivity(const QString &id); bool startActivity(const QString &id); - QStringList activeEffects() const; QString supportInformation() const; - bool compositingPossible() const; - QString compositingNotPossibleReason() const; - bool openGLIsBroken() const; - /** - * Returns the currently used Compositor (Scene): - * @li @c none No Compositing - * @li @c xrender XRender - * @li @c gl1 OpenGL 1 - * @li @c gl2 OpenGL 2 - * @li @c gles OpenGL ES 2 - **/ - QString compositingType(); void setCurrentScreen(int new_screen); @@ -645,7 +622,6 @@ private slots: void handleActivityReply(); Q_SIGNALS: - Q_SCRIPTABLE void compositingToggled(bool active); /** * Emitted after the Workspace has setup the complete initialization process. * This can be used to connect to for performing post-workspace initialization.