effects: Link builtin effects with executables
The main motivation behind this change is to prepare kwin for importing kwayland-server code in libkwin. As is, builtin effects are linked with libkwin. Some builtin effects have wayland specific code. If we move wayland stuff in libkwin, there's going to be a circular dependency between kwin4_effect_builtins and libkwin targets. This change intends to break that dependency by linking builtin effects to kwin executable. The main issue with that is that EffectLoader would need to discover the effects indirectly. QStaticPlugin is used for that purpose. Besides breaking the cyclic dependency, it makes builtin effects use the same plugin infrastructure in libkwineffects that external effects use. Metadata in src/effects/effect_builtins.cpp was converted in a list of python dictionaries, which was fed to a python script that generated main.cpp and metadata.json files.
This commit is contained in:
parent
2019dcd0fe
commit
141947d2e8
148 changed files with 1369 additions and 1651 deletions
|
@ -133,32 +133,6 @@ target_link_libraries(testXcbWindow
|
|||
add_test(NAME kwin-testXcbWindow COMMAND testXcbWindow)
|
||||
ecm_mark_as_test(testXcbWindow)
|
||||
|
||||
########################################################
|
||||
# Test BuiltInEffectLoader
|
||||
########################################################
|
||||
set(testBuiltInEffectLoader_SRCS
|
||||
../src/effectloader.cpp
|
||||
mock_effectshandler.cpp
|
||||
test_builtin_effectloader.cpp
|
||||
)
|
||||
add_executable(testBuiltInEffectLoader ${testBuiltInEffectLoader_SRCS})
|
||||
set_target_properties(testBuiltInEffectLoader PROPERTIES COMPILE_DEFINITIONS "NO_NONE_WINDOW")
|
||||
|
||||
target_link_libraries(testBuiltInEffectLoader
|
||||
Qt::Concurrent
|
||||
Qt::Qml
|
||||
Qt::Test
|
||||
Qt::X11Extras
|
||||
|
||||
KF5::Package
|
||||
|
||||
kwineffects
|
||||
kwin4_effect_builtins
|
||||
)
|
||||
|
||||
add_test(NAME kwin-testBuiltInEffectLoader COMMAND testBuiltInEffectLoader)
|
||||
ecm_mark_as_test(testBuiltInEffectLoader)
|
||||
|
||||
########################################################
|
||||
# Test ScriptedEffectLoader
|
||||
########################################################
|
||||
|
@ -193,7 +167,6 @@ target_link_libraries(testScriptedEffectLoader
|
|||
XCB::CURSOR
|
||||
|
||||
kwineffects
|
||||
kwin4_effect_builtins
|
||||
)
|
||||
|
||||
add_test(NAME kwin-testScriptedEffectLoader COMMAND testScriptedEffectLoader)
|
||||
|
@ -218,7 +191,6 @@ target_link_libraries(testPluginEffectLoader
|
|||
KF5::Package
|
||||
|
||||
kwineffects
|
||||
kwin4_effect_builtins
|
||||
)
|
||||
|
||||
add_test(NAME kwin-testPluginEffectLoader COMMAND testPluginEffectLoader)
|
||||
|
|
|
@ -44,6 +44,7 @@ add_library(KWinIntegrationTestFramework STATIC ${KWinIntegrationTestFramework_S
|
|||
target_link_libraries(KWinIntegrationTestFramework
|
||||
Qt::Test
|
||||
KF5::WaylandClient
|
||||
kwin4_effect_builtins
|
||||
kwin
|
||||
Wayland::Client
|
||||
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KWayland/Client/surface.h>
|
||||
|
||||
namespace KWin
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KWayland/Client/surface.h>
|
||||
|
||||
using namespace KWin;
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KWayland/Client/surface.h>
|
||||
|
||||
using namespace KWin;
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KWayland/Client/plasmashell.h>
|
||||
#include <KWayland/Client/plasmawindowmanagement.h>
|
||||
#include <KWayland/Client/surface.h>
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
|
||||
#include "decorations/decoratedclient.h"
|
||||
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KWayland/Client/surface.h>
|
||||
|
||||
#include <linux/input.h>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "composite.h"
|
||||
#include "cursor.h"
|
||||
#include "deleted.h"
|
||||
#include "effect_builtins.h"
|
||||
#include "effectloader.h"
|
||||
#include "effects.h"
|
||||
#include "kwin_wayland_test.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "scene.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KConfigGroup>
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KWayland/Client/surface.h>
|
||||
|
||||
using namespace KWin;
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "platform.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KConfigGroup>
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "platform.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KConfigGroup>
|
||||
|
||||
|
@ -53,7 +52,7 @@ void WindowGeometryTest::initTestCase()
|
|||
for (QString name : builtinNames) {
|
||||
plugins.writeEntry(name + QStringLiteral("Enabled"), false);
|
||||
}
|
||||
plugins.writeEntry(BuiltInEffects::nameForEffect(BuiltInEffect::WindowGeometry) + QStringLiteral("Enabled"), true);
|
||||
plugins.writeEntry(QStringLiteral("windowgeometryEnabled"), true);
|
||||
|
||||
config->sync();
|
||||
kwinApp()->setConfig(config);
|
||||
|
@ -78,7 +77,7 @@ void WindowGeometryTest::testStartup()
|
|||
{
|
||||
// just a test to load the effect to verify it doesn't crash
|
||||
EffectsHandlerImpl *e = static_cast<EffectsHandlerImpl*>(effects);
|
||||
QVERIFY(e->isEffectLoaded(BuiltInEffects::nameForEffect(BuiltInEffect::WindowGeometry)));
|
||||
QVERIFY(e->isEffectLoaded(QStringLiteral("windowgeometry")));
|
||||
}
|
||||
|
||||
WAYLANDTEST_MAIN(WindowGeometryTest)
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "platform.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KConfigGroup>
|
||||
|
||||
|
@ -98,8 +97,8 @@ void WobblyWindowsShadeTest::testShadeMove()
|
|||
{
|
||||
// this test simulates the condition from BUG 390953
|
||||
EffectsHandlerImpl *e = static_cast<EffectsHandlerImpl*>(effects);
|
||||
QVERIFY(e->loadEffect(BuiltInEffects::nameForEffect(BuiltInEffect::WobblyWindows)));
|
||||
QVERIFY(e->isEffectLoaded(BuiltInEffects::nameForEffect(BuiltInEffect::WobblyWindows)));
|
||||
QVERIFY(e->loadEffect(QStringLiteral("wobblywindows")));
|
||||
QVERIFY(e->isEffectLoaded(QStringLiteral("wobblywindows")));
|
||||
|
||||
|
||||
QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr));
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "platform.h"
|
||||
#include "scene.h"
|
||||
#include "wayland_server.h"
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KConfigGroup>
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "kwin_wayland_test.h"
|
||||
|
||||
#include "composite.h"
|
||||
#include "effect_builtins.h"
|
||||
#include "effects.h"
|
||||
#include "inputmethod.h"
|
||||
#include "platform.h"
|
||||
|
@ -37,6 +38,8 @@ Q_IMPORT_PLUGIN(KGlobalAccelImpl)
|
|||
Q_IMPORT_PLUGIN(KWindowSystemKWinPlugin)
|
||||
Q_IMPORT_PLUGIN(KWinIdleTimePoller)
|
||||
|
||||
KWIN_IMPORT_BUILTIN_EFFECTS
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "effects.h"
|
||||
#include "platform.h"
|
||||
#include "wayland_server.h"
|
||||
#include "effect_builtins.h"
|
||||
#include "workspace.h"
|
||||
|
||||
#include <KConfigGroup>
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#include <KConfigGroup>
|
||||
#include <KWayland/Client/surface.h>
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include "scripting/scripting.h"
|
||||
#include "effect_builtins.h"
|
||||
|
||||
#define private public
|
||||
#include "screenedge.h"
|
||||
|
|
|
@ -1,534 +0,0 @@
|
|||
/*
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
#include "effectloader.h"
|
||||
#include "effects/effect_builtins.h"
|
||||
#include "mock_effectshandler.h"
|
||||
#include "scripting/scriptedeffect.h" // for mocking ScriptedEffect::create
|
||||
#include "testutils.h"
|
||||
// KDE
|
||||
#include <KConfig>
|
||||
#include <KConfigGroup>
|
||||
// Qt
|
||||
#include <QtTest>
|
||||
#include <QStringList>
|
||||
#include <QScopedPointer>
|
||||
Q_DECLARE_METATYPE(KWin::CompositingType)
|
||||
Q_DECLARE_METATYPE(KWin::LoadEffectFlag)
|
||||
Q_DECLARE_METATYPE(KWin::LoadEffectFlags)
|
||||
Q_DECLARE_METATYPE(KWin::BuiltInEffect)
|
||||
Q_DECLARE_METATYPE(KWin::Effect*)
|
||||
|
||||
Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core")
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
ScriptedEffect *ScriptedEffect::create(const KPluginMetaData&)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ScriptedEffect::supported()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TestBuiltInEffectLoader : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testHasEffect_data();
|
||||
void testHasEffect();
|
||||
void testKnownEffects();
|
||||
void testSupported_data();
|
||||
void testSupported();
|
||||
void testLoadEffect_data();
|
||||
void testLoadEffect();
|
||||
void testLoadBuiltInEffect_data();
|
||||
void testLoadBuiltInEffect();
|
||||
void testLoadAllEffects();
|
||||
};
|
||||
|
||||
void TestBuiltInEffectLoader::initTestCase()
|
||||
{
|
||||
qApp->setProperty("x11Connection", QVariant::fromValue<void*>(QX11Info::connection()));
|
||||
}
|
||||
|
||||
void TestBuiltInEffectLoader::testHasEffect_data()
|
||||
{
|
||||
QTest::addColumn<QString>("name");
|
||||
QTest::addColumn<bool>("expected");
|
||||
|
||||
QTest::newRow("blur") << QStringLiteral("blur") << true;
|
||||
QTest::newRow("with kwin4_effect_ prefix") << QStringLiteral("kwin4_effect_blur") << false;
|
||||
QTest::newRow("case sensitive") << QStringLiteral("BlUR") << true;
|
||||
QTest::newRow("Colorpicker") << QStringLiteral("colorpicker") << true;
|
||||
QTest::newRow("Contrast") << QStringLiteral("contrast") << true;
|
||||
QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << true;
|
||||
QTest::newRow("DimInactive") << QStringLiteral("diminactive") << true;
|
||||
QTest::newRow("FallApart") << QStringLiteral("fallapart") << true;
|
||||
QTest::newRow("Glide") << QStringLiteral("glide") << true;
|
||||
QTest::newRow("HighlightWindow") << QStringLiteral("highlightwindow") << true;
|
||||
QTest::newRow("Invert") << QStringLiteral("invert") << true;
|
||||
QTest::newRow("Kscreen") << QStringLiteral("kscreen") << true;
|
||||
QTest::newRow("LookingGlass") << QStringLiteral("lookingglass") << true;
|
||||
QTest::newRow("MagicLamp") << QStringLiteral("magiclamp") << true;
|
||||
QTest::newRow("Magnifier") << QStringLiteral("magnifier") << true;
|
||||
QTest::newRow("MouseClick") << QStringLiteral("mouseclick") << true;
|
||||
QTest::newRow("MouseMark") << QStringLiteral("mousemark") << true;
|
||||
QTest::newRow("PresentWindows") << QStringLiteral("presentwindows") << true;
|
||||
QTest::newRow("Resize") << QStringLiteral("resize") << true;
|
||||
QTest::newRow("ScreenEdge") << QStringLiteral("screenedge") << true;
|
||||
QTest::newRow("ScreenShot") << QStringLiteral("screenshot") << true;
|
||||
QTest::newRow("Sheet") << QStringLiteral("sheet") << true;
|
||||
QTest::newRow("ShowFps") << QStringLiteral("showfps") << true;
|
||||
QTest::newRow("ShowPaint") << QStringLiteral("showpaint") << true;
|
||||
QTest::newRow("Slide") << QStringLiteral("slide") << true;
|
||||
QTest::newRow("SlideBack") << QStringLiteral("slideback") << true;
|
||||
QTest::newRow("SlidingPopups") << QStringLiteral("slidingpopups") << true;
|
||||
QTest::newRow("SnapHelper") << QStringLiteral("snaphelper") << true;
|
||||
QTest::newRow("StartupFeedback") << QStringLiteral("startupfeedback") << true;
|
||||
QTest::newRow("ThumbnailAside") << QStringLiteral("thumbnailaside") << true;
|
||||
QTest::newRow("Touchpoints") << QStringLiteral("touchpoints") << true;
|
||||
QTest::newRow("TrackMouse") << QStringLiteral("trackmouse") << true;
|
||||
QTest::newRow("WindowGeometry") << QStringLiteral("windowgeometry") << true;
|
||||
QTest::newRow("WobblyWindows") << QStringLiteral("wobblywindows") << true;
|
||||
QTest::newRow("Zoom") << QStringLiteral("zoom") << true;
|
||||
QTest::newRow("Non Existing") << QStringLiteral("InvalidName") << false;
|
||||
QTest::newRow("Fade - Scripted") << QStringLiteral("fade") << false;
|
||||
QTest::newRow("Fade - Scripted + kwin4_effect") << QStringLiteral("kwin4_effect_fade") << false;
|
||||
}
|
||||
|
||||
void TestBuiltInEffectLoader::testHasEffect()
|
||||
{
|
||||
QFETCH(QString, name);
|
||||
QFETCH(bool, expected);
|
||||
|
||||
KWin::BuiltInEffectLoader loader;
|
||||
QCOMPARE(loader.hasEffect(name), expected);
|
||||
}
|
||||
|
||||
void TestBuiltInEffectLoader::testKnownEffects()
|
||||
{
|
||||
QStringList expectedEffects;
|
||||
expectedEffects << QStringLiteral("blur")
|
||||
<< QStringLiteral("colorpicker")
|
||||
<< QStringLiteral("contrast")
|
||||
<< QStringLiteral("desktopgrid")
|
||||
<< QStringLiteral("diminactive")
|
||||
<< QStringLiteral("fallapart")
|
||||
<< QStringLiteral("glide")
|
||||
<< QStringLiteral("highlightwindow")
|
||||
<< QStringLiteral("invert")
|
||||
<< QStringLiteral("kscreen")
|
||||
<< QStringLiteral("lookingglass")
|
||||
<< QStringLiteral("magiclamp")
|
||||
<< QStringLiteral("magnifier")
|
||||
<< QStringLiteral("mouseclick")
|
||||
<< QStringLiteral("mousemark")
|
||||
<< QStringLiteral("overview")
|
||||
<< QStringLiteral("presentwindows")
|
||||
<< QStringLiteral("resize")
|
||||
<< QStringLiteral("screenedge")
|
||||
<< QStringLiteral("screenshot")
|
||||
<< QStringLiteral("screentransform")
|
||||
<< QStringLiteral("sheet")
|
||||
<< QStringLiteral("showfps")
|
||||
<< QStringLiteral("showpaint")
|
||||
<< QStringLiteral("slide")
|
||||
<< QStringLiteral("slideback")
|
||||
<< QStringLiteral("slidingpopups")
|
||||
<< QStringLiteral("snaphelper")
|
||||
<< QStringLiteral("startupfeedback")
|
||||
<< QStringLiteral("thumbnailaside")
|
||||
<< QStringLiteral("touchpoints")
|
||||
<< QStringLiteral("trackmouse")
|
||||
<< QStringLiteral("windowgeometry")
|
||||
<< QStringLiteral("wobblywindows")
|
||||
<< QStringLiteral("zoom");
|
||||
|
||||
KWin::BuiltInEffectLoader loader;
|
||||
QStringList result = loader.listOfKnownEffects();
|
||||
QCOMPARE(result.size(), expectedEffects.size());
|
||||
std::sort(result.begin(), result.end());
|
||||
for (int i = 0; i < expectedEffects.size(); ++i) {
|
||||
QCOMPARE(result.at(i), expectedEffects.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
void TestBuiltInEffectLoader::testSupported_data()
|
||||
{
|
||||
QTest::addColumn<QString>("name");
|
||||
QTest::addColumn<bool>("expected");
|
||||
QTest::addColumn<KWin::CompositingType>("type");
|
||||
QTest::addColumn<bool>("animationsSupported");
|
||||
|
||||
const KWin::CompositingType qc = KWin::QPainterCompositing;
|
||||
const KWin::CompositingType oc = KWin::OpenGLCompositing;
|
||||
|
||||
QTest::newRow("blur") << QStringLiteral("blur") << false << qc << true;
|
||||
// fails for GL as it does proper tests on what's supported and doesn't just check whether it's GL
|
||||
QTest::newRow("blur-GL") << QStringLiteral("blur") << false << oc << true;
|
||||
QTest::newRow("Colorpicker") << QStringLiteral("colorpicker") << false << qc << true;
|
||||
QTest::newRow("Colorpicker-GL") << QStringLiteral("colorpicker") << true << oc << true;
|
||||
QTest::newRow("Contrast") << QStringLiteral("contrast") << false << qc << true;
|
||||
// fails for GL as it does proper tests on what's supported and doesn't just check whether it's GL
|
||||
QTest::newRow("Contrast-GL") << QStringLiteral("contrast") << false << oc << true;
|
||||
QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << true << qc << true;
|
||||
QTest::newRow("DimInactive") << QStringLiteral("diminactive") << true << qc << true;
|
||||
QTest::newRow("FallApart") << QStringLiteral("fallapart") << false << qc << true;
|
||||
QTest::newRow("FallApart-GL") << QStringLiteral("fallapart") << true << oc << true;
|
||||
QTest::newRow("Glide") << QStringLiteral("glide") << false << qc << true;
|
||||
QTest::newRow("Glide-GL") << QStringLiteral("glide") << true << oc << true;
|
||||
QTest::newRow("Glide-GL-no-anim") << QStringLiteral("glide") << false << oc << false;
|
||||
QTest::newRow("HighlightWindow") << QStringLiteral("highlightwindow") << true << qc << true;
|
||||
QTest::newRow("Invert") << QStringLiteral("invert") << false << qc << true;
|
||||
QTest::newRow("Invert-GL") << QStringLiteral("invert") << true << oc << true;
|
||||
QTest::newRow("Kscreen") << QStringLiteral("kscreen") << true << qc << true;
|
||||
QTest::newRow("LookingGlass") << QStringLiteral("lookingglass") << false << qc << true;
|
||||
// Tries to create an opengl texture and crashes.
|
||||
// QTest::newRow("LookingGlass-GL") << QStringLiteral("lookingglass") << true << oc << true;
|
||||
QTest::newRow("MagicLamp") << QStringLiteral("magiclamp") << false << qc << true;
|
||||
QTest::newRow("MagicLamp-GL") << QStringLiteral("magiclamp") << true << oc << true;
|
||||
QTest::newRow("MagicLamp-GL-no-anim") << QStringLiteral("magiclamp") << false << oc << false;
|
||||
QTest::newRow("Magnifier") << QStringLiteral("magnifier") << false << qc << false;
|
||||
QTest::newRow("MouseClick") << QStringLiteral("mouseclick") << true << qc << true;
|
||||
QTest::newRow("MouseMark") << QStringLiteral("mousemark") << true << qc << true;
|
||||
QTest::newRow("Overview") << QStringLiteral("overview") << false << qc << false;
|
||||
QTest::newRow("OverviewGL") << QStringLiteral("overview") << true << oc << true;
|
||||
QTest::newRow("PresentWindows") << QStringLiteral("presentwindows") << true << qc << true;
|
||||
QTest::newRow("Resize") << QStringLiteral("resize") << true << qc << true;
|
||||
QTest::newRow("ScreenEdge") << QStringLiteral("screenedge") << true << qc << true;
|
||||
QTest::newRow("ScreenShot") << QStringLiteral("screenshot") << false << qc << false;
|
||||
QTest::newRow("Sheet") << QStringLiteral("sheet") << false << qc << true;
|
||||
QTest::newRow("Sheet-GL") << QStringLiteral("sheet") << true << oc << true;
|
||||
QTest::newRow("Sheet-GL-no-anim") << QStringLiteral("sheet") << false << oc << false;
|
||||
QTest::newRow("ShowFps") << QStringLiteral("showfps") << true << qc << true;
|
||||
QTest::newRow("ShowPaint") << QStringLiteral("showpaint") << true << qc << true;
|
||||
QTest::newRow("Slide") << QStringLiteral("slide") << true << qc << true;
|
||||
QTest::newRow("SlideBack") << QStringLiteral("slideback") << true << qc << true;
|
||||
QTest::newRow("SlidingPopups") << QStringLiteral("slidingpopups") << true << qc << true;
|
||||
QTest::newRow("SnapHelper") << QStringLiteral("snaphelper") << true << qc << true;
|
||||
QTest::newRow("StartupFeedback") << QStringLiteral("startupfeedback") << false << qc << true;
|
||||
QTest::newRow("StartupFeedback-GL") << QStringLiteral("startupfeedback") << true << oc << true;
|
||||
QTest::newRow("ThumbnailAside") << QStringLiteral("thumbnailaside") << true << qc << true;
|
||||
QTest::newRow("TouchPoints") << QStringLiteral("touchpoints") << true << qc << true;
|
||||
QTest::newRow("TrackMouse") << QStringLiteral("trackmouse") << true << qc << true;
|
||||
QTest::newRow("WindowGeometry") << QStringLiteral("windowgeometry") << true << qc << true;
|
||||
QTest::newRow("WobblyWindows") << QStringLiteral("wobblywindows") << false << qc << true;
|
||||
QTest::newRow("WobblyWindows-GL") << QStringLiteral("wobblywindows") << true << oc << true;
|
||||
QTest::newRow("WobblyWindows-GL-no-anim") << QStringLiteral("wobblywindows") << false << oc << false;
|
||||
QTest::newRow("Zoom") << QStringLiteral("zoom") << true << qc << true;
|
||||
QTest::newRow("Non Existing") << QStringLiteral("InvalidName") << false << qc << true;
|
||||
QTest::newRow("Fade - Scripted") << QStringLiteral("fade") << false << qc << true;
|
||||
QTest::newRow("Fade - Scripted + kwin4_effect") << QStringLiteral("kwin4_effect_fade") << false << qc << true;
|
||||
}
|
||||
|
||||
void TestBuiltInEffectLoader::testSupported()
|
||||
{
|
||||
QFETCH(QString, name);
|
||||
QFETCH(bool, expected);
|
||||
QFETCH(KWin::CompositingType, type);
|
||||
QFETCH(bool, animationsSupported);
|
||||
|
||||
MockEffectsHandler mockHandler(type);
|
||||
mockHandler.setAnimationsSupported(animationsSupported);
|
||||
QCOMPARE(mockHandler.animationsSupported(), animationsSupported);
|
||||
KWin::BuiltInEffectLoader loader;
|
||||
QCOMPARE(loader.isEffectSupported(name), expected);
|
||||
}
|
||||
|
||||
void TestBuiltInEffectLoader::testLoadEffect_data()
|
||||
{
|
||||
QTest::addColumn<QString>("name");
|
||||
QTest::addColumn<bool>("expected");
|
||||
QTest::addColumn<KWin::CompositingType>("type");
|
||||
|
||||
const KWin::CompositingType qc = KWin::QPainterCompositing;
|
||||
const KWin::CompositingType oc = KWin::OpenGLCompositing;
|
||||
|
||||
QTest::newRow("blur") << QStringLiteral("blur") << false << qc;
|
||||
// fails for GL as it does proper tests on what's supported and doesn't just check whether it's GL
|
||||
QTest::newRow("blur-GL") << QStringLiteral("blur") << false << oc;
|
||||
QTest::newRow("Colorpicker") << QStringLiteral("colorpicker") << false << qc;
|
||||
QTest::newRow("Colorpicker-GL") << QStringLiteral("colorpicker") << true << oc;
|
||||
QTest::newRow("Contrast") << QStringLiteral("contrast") << false << qc;
|
||||
// fails for GL as it does proper tests on what's supported and doesn't just check whether it's GL
|
||||
QTest::newRow("Contrast-GL") << QStringLiteral("contrast") << false << oc;
|
||||
QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << true << qc;
|
||||
QTest::newRow("DimInactive") << QStringLiteral("diminactive") << true << qc;
|
||||
QTest::newRow("FallApart") << QStringLiteral("fallapart") << false << qc;
|
||||
QTest::newRow("FallApart-GL") << QStringLiteral("fallapart") << true << oc;
|
||||
QTest::newRow("Glide") << QStringLiteral("glide") << false << qc;
|
||||
QTest::newRow("Glide-GL") << QStringLiteral("glide") << true << oc;
|
||||
QTest::newRow("HighlightWindow") << QStringLiteral("highlightwindow") << true << qc;
|
||||
QTest::newRow("Invert") << QStringLiteral("invert") << false << qc;
|
||||
QTest::newRow("Invert-GL") << QStringLiteral("invert") << true << oc;
|
||||
QTest::newRow("Kscreen") << QStringLiteral("kscreen") << true << qc;
|
||||
QTest::newRow("LookingGlass") << QStringLiteral("lookingglass") << false << qc;
|
||||
// Tries to create an opengl texture and crashes.
|
||||
// QTest::newRow("LookingGlass-GL") << QStringLiteral("lookingglass") << true << oc;
|
||||
QTest::newRow("MagicLamp") << QStringLiteral("magiclamp") << false << qc;
|
||||
QTest::newRow("MagicLamp-GL") << QStringLiteral("magiclamp") << true << oc;
|
||||
QTest::newRow("Magnifier") << QStringLiteral("magnifier") << false << qc;
|
||||
QTest::newRow("MouseClick") << QStringLiteral("mouseclick") << true << qc;
|
||||
QTest::newRow("MouseMark") << QStringLiteral("mousemark") << true << qc;
|
||||
QTest::newRow("Overview") << QStringLiteral("overview") << false << qc;
|
||||
QTest::newRow("OverviewGL") << QStringLiteral("overview") << true << oc;
|
||||
QTest::newRow("PresentWindows") << QStringLiteral("presentwindows") << true << qc;
|
||||
QTest::newRow("Resize") << QStringLiteral("resize") << true << qc;
|
||||
QTest::newRow("ScreenEdge") << QStringLiteral("screenedge") << true << qc;
|
||||
QTest::newRow("ScreenShot") << QStringLiteral("screenshot") << false << qc;
|
||||
QTest::newRow("Sheet") << QStringLiteral("sheet") << false << qc;
|
||||
QTest::newRow("Sheet-GL") << QStringLiteral("sheet") << true << oc;
|
||||
// TODO: Accesses EffectFrame and crashes
|
||||
// QTest::newRow("ShowFps") << QStringLiteral("showfps") << true << xc;
|
||||
QTest::newRow("ShowPaint") << QStringLiteral("showpaint") << true << qc;
|
||||
QTest::newRow("Slide") << QStringLiteral("slide") << true << qc;
|
||||
QTest::newRow("SlideBack") << QStringLiteral("slideback") << true << qc;
|
||||
QTest::newRow("SlidingPopups") << QStringLiteral("slidingpopups") << true << qc;
|
||||
QTest::newRow("SnapHelper") << QStringLiteral("snaphelper") << true << qc;
|
||||
QTest::newRow("StartupFeedback") << QStringLiteral("startupfeedback") << false << qc;
|
||||
// Tries to load shader and makes our test abort
|
||||
// QTest::newRow("StartupFeedback-GL") << QStringLiteral("startupfeedback") << true << oc;
|
||||
QTest::newRow("ThumbnailAside") << QStringLiteral("thumbnailaside") << true << qc;
|
||||
QTest::newRow("Touchpoints") << QStringLiteral("touchpoints") << true << qc;
|
||||
QTest::newRow("TrackMouse") << QStringLiteral("trackmouse") << true << qc;
|
||||
// TODO: Accesses EffectFrame and crashes
|
||||
// QTest::newRow("WindowGeometry") << QStringLiteral("windowgeometry") << true << xc;
|
||||
QTest::newRow("WobblyWindows") << QStringLiteral("wobblywindows") << false << qc;
|
||||
QTest::newRow("WobblyWindows-GL") << QStringLiteral("wobblywindows") << true << oc;
|
||||
QTest::newRow("Zoom") << QStringLiteral("zoom") << true << qc;
|
||||
QTest::newRow("Non Existing") << QStringLiteral("InvalidName") << false << qc;
|
||||
QTest::newRow("Fade - Scripted") << QStringLiteral("fade") << false << qc;
|
||||
QTest::newRow("Fade - Scripted + kwin4_effect") << QStringLiteral("kwin4_effect_fade") << false << qc;
|
||||
}
|
||||
|
||||
void TestBuiltInEffectLoader::testLoadEffect()
|
||||
{
|
||||
QFETCH(QString, name);
|
||||
QFETCH(bool, expected);
|
||||
QFETCH(KWin::CompositingType, type);
|
||||
|
||||
QScopedPointer<MockEffectsHandler, QScopedPointerDeleteLater> mockHandler(new MockEffectsHandler(type));
|
||||
KWin::BuiltInEffectLoader loader;
|
||||
KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig);
|
||||
loader.setConfig(config);
|
||||
|
||||
qRegisterMetaType<KWin::Effect*>();
|
||||
QSignalSpy spy(&loader, &KWin::BuiltInEffectLoader::effectLoaded);
|
||||
// connect to signal to ensure that we delete the Effect again as the Effect doesn't have a parent
|
||||
connect(&loader, &KWin::BuiltInEffectLoader::effectLoaded,
|
||||
[&name](KWin::Effect *effect, const QString &effectName) {
|
||||
QCOMPARE(effectName, name);
|
||||
effect->deleteLater();
|
||||
}
|
||||
);
|
||||
// try to load the Effect
|
||||
QCOMPARE(loader.loadEffect(name), expected);
|
||||
// loading again should fail
|
||||
QVERIFY(!loader.loadEffect(name));
|
||||
// signal spy should have got the signal if it was expected
|
||||
QCOMPARE(spy.isEmpty(), !expected);
|
||||
if (!spy.isEmpty()) {
|
||||
QCOMPARE(spy.count(), 1);
|
||||
// if we caught a signal it should have the effect name we passed in
|
||||
QList<QVariant> arguments = spy.takeFirst();
|
||||
QCOMPARE(arguments.count(), 2);
|
||||
QCOMPARE(arguments.at(1).toString(), name);
|
||||
}
|
||||
spy.clear();
|
||||
QVERIFY(spy.isEmpty());
|
||||
|
||||
// now if we wait for the events being processed, the effect will get deleted and it should load again
|
||||
QTest::qWait(1);
|
||||
QCOMPARE(loader.loadEffect(name), expected);
|
||||
// signal spy should have got the signal if it was expected
|
||||
QCOMPARE(spy.isEmpty(), !expected);
|
||||
if (!spy.isEmpty()) {
|
||||
QCOMPARE(spy.count(), 1);
|
||||
// if we caught a signal it should have the effect name we passed in
|
||||
QList<QVariant> arguments = spy.takeFirst();
|
||||
QCOMPARE(arguments.count(), 2);
|
||||
QCOMPARE(arguments.at(1).toString(), name);
|
||||
}
|
||||
}
|
||||
|
||||
void TestBuiltInEffectLoader::testLoadBuiltInEffect_data()
|
||||
{
|
||||
// TODO: this test cannot yet test the checkEnabledByDefault functionality as that requires
|
||||
// mocking enough of GL to get the blur effect to think it's supported and enabled by default
|
||||
QTest::addColumn<KWin::BuiltInEffect>("effect");
|
||||
QTest::addColumn<QString>("name");
|
||||
QTest::addColumn<bool>("expected");
|
||||
QTest::addColumn<KWin::CompositingType>("type");
|
||||
QTest::addColumn<KWin::LoadEffectFlags>("loadFlags");
|
||||
|
||||
const KWin::CompositingType qc = KWin::QPainterCompositing;
|
||||
const KWin::CompositingType oc = KWin::OpenGLCompositing;
|
||||
|
||||
const KWin::LoadEffectFlags checkDefault = KWin::LoadEffectFlag::Load | KWin::LoadEffectFlag::CheckDefaultFunction;
|
||||
const KWin::LoadEffectFlags forceFlags = KWin::LoadEffectFlag::Load;
|
||||
const KWin::LoadEffectFlags dontLoadFlags = KWin::LoadEffectFlags();
|
||||
|
||||
// enabled by default, but not supported
|
||||
QTest::newRow("blur") << KWin::BuiltInEffect::Blur << QStringLiteral("blur") << false << oc << checkDefault;
|
||||
// enabled by default
|
||||
QTest::newRow("HighlightWindow") << KWin::BuiltInEffect::HighlightWindow << QStringLiteral("highlightwindow") << true << qc << checkDefault;
|
||||
// supported but not enabled by default
|
||||
QTest::newRow("LookingGlass") << KWin::BuiltInEffect::LookingGlass << QStringLiteral("lookingglass") << false << qc << checkDefault;
|
||||
// not enabled by default
|
||||
QTest::newRow("MouseClick") << KWin::BuiltInEffect::MouseClick << QStringLiteral("mouseclick") << true << qc << checkDefault;
|
||||
// Force an Effect which will load
|
||||
QTest::newRow("MouseClick-Force") << KWin::BuiltInEffect::MouseClick << QStringLiteral("mouseclick") << true << qc << forceFlags;
|
||||
// Force an Effect which is not supported
|
||||
QTest::newRow("LookingGlass-Force") << KWin::BuiltInEffect::LookingGlass << QStringLiteral("lookingglass") << false << qc << forceFlags;
|
||||
// Force the Effect as supported
|
||||
// Enforce no load of effect which is enabled by default
|
||||
QTest::newRow("HighlightWindow-DontLoad") << KWin::BuiltInEffect::HighlightWindow << QStringLiteral("highlightwindow") << false << qc << dontLoadFlags;
|
||||
// Enforce no load of effect which is not enabled by default, but enforced
|
||||
QTest::newRow("MouseClick-DontLoad") << KWin::BuiltInEffect::MouseClick << QStringLiteral("mouseclick") << false << qc << dontLoadFlags;
|
||||
}
|
||||
|
||||
void TestBuiltInEffectLoader::testLoadBuiltInEffect()
|
||||
{
|
||||
QFETCH(KWin::BuiltInEffect, effect);
|
||||
QFETCH(QString, name);
|
||||
QFETCH(bool, expected);
|
||||
QFETCH(KWin::CompositingType, type);
|
||||
QFETCH(KWin::LoadEffectFlags, loadFlags);
|
||||
|
||||
QScopedPointer<MockEffectsHandler, QScopedPointerDeleteLater> mockHandler(new MockEffectsHandler(type));
|
||||
KWin::BuiltInEffectLoader loader;
|
||||
KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig);
|
||||
loader.setConfig(config);
|
||||
|
||||
qRegisterMetaType<KWin::Effect*>();
|
||||
QSignalSpy spy(&loader, &KWin::BuiltInEffectLoader::effectLoaded);
|
||||
// connect to signal to ensure that we delete the Effect again as the Effect doesn't have a parent
|
||||
connect(&loader, &KWin::BuiltInEffectLoader::effectLoaded,
|
||||
[&name](KWin::Effect *effect, const QString &effectName) {
|
||||
QCOMPARE(effectName, name);
|
||||
effect->deleteLater();
|
||||
}
|
||||
);
|
||||
// try to load the Effect
|
||||
QCOMPARE(loader.loadEffect(effect, loadFlags), expected);
|
||||
// loading again should fail
|
||||
QVERIFY(!loader.loadEffect(effect, loadFlags));
|
||||
|
||||
// signal spy should have got the signal if it was expected
|
||||
QCOMPARE(spy.isEmpty(), !expected);
|
||||
if (!spy.isEmpty()) {
|
||||
QCOMPARE(spy.count(), 1);
|
||||
// if we caught a signal it should have the effect name we passed in
|
||||
QList<QVariant> arguments = spy.takeFirst();
|
||||
QCOMPARE(arguments.count(), 2);
|
||||
QCOMPARE(arguments.at(1).toString(), name);
|
||||
}
|
||||
spy.clear();
|
||||
QVERIFY(spy.isEmpty());
|
||||
|
||||
// now if we wait for the events being processed, the effect will get deleted and it should load again
|
||||
QTest::qWait(1);
|
||||
QCOMPARE(loader.loadEffect(effect, loadFlags), expected);
|
||||
// signal spy should have got the signal if it was expected
|
||||
QCOMPARE(spy.isEmpty(), !expected);
|
||||
if (!spy.isEmpty()) {
|
||||
QCOMPARE(spy.count(), 1);
|
||||
// if we caught a signal it should have the effect name we passed in
|
||||
QList<QVariant> arguments = spy.takeFirst();
|
||||
QCOMPARE(arguments.count(), 2);
|
||||
QCOMPARE(arguments.at(1).toString(), name);
|
||||
}
|
||||
}
|
||||
|
||||
void TestBuiltInEffectLoader::testLoadAllEffects()
|
||||
{
|
||||
QScopedPointer<MockEffectsHandler, QScopedPointerDeleteLater>mockHandler(new MockEffectsHandler(KWin::QPainterCompositing));
|
||||
KWin::BuiltInEffectLoader loader;
|
||||
|
||||
KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig);
|
||||
|
||||
// prepare the configuration to hard enable/disable the effects we want to load
|
||||
KConfigGroup plugins = config->group("Plugins");
|
||||
plugins.writeEntry(QStringLiteral("desktopgridEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("highlightwindowEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("kscreenEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("presentwindowsEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("screenedgeEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("screenshotEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("slideEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("slidingpopupsEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("startupfeedbackEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("zoomEnabled"), false);
|
||||
// enable lookingglass as it's not supported
|
||||
plugins.writeEntry(QStringLiteral("lookingglassEnabled"), true);
|
||||
plugins.sync();
|
||||
|
||||
loader.setConfig(config);
|
||||
|
||||
qRegisterMetaType<KWin::Effect*>();
|
||||
QSignalSpy spy(&loader, &KWin::BuiltInEffectLoader::effectLoaded);
|
||||
// connect to signal to ensure that we delete the Effect again as the Effect doesn't have a parent
|
||||
connect(&loader, &KWin::BuiltInEffectLoader::effectLoaded,
|
||||
[](KWin::Effect *effect) {
|
||||
effect->deleteLater();
|
||||
}
|
||||
);
|
||||
|
||||
// the config is prepared so that no Effect gets loaded!
|
||||
loader.queryAndLoadAll();
|
||||
|
||||
// we need to wait some time because it's queued
|
||||
QVERIFY(!spy.wait(10));
|
||||
|
||||
// now let's prepare a config which has one effect explicitly enabled
|
||||
plugins.writeEntry(QStringLiteral("mouseclickEnabled"), true);
|
||||
plugins.sync();
|
||||
|
||||
loader.queryAndLoadAll();
|
||||
// should load one effect in first go
|
||||
QVERIFY(spy.wait(10));
|
||||
// and afterwards it should not load another one
|
||||
QVERIFY(!spy.wait(10));
|
||||
|
||||
QCOMPARE(spy.size(), 1);
|
||||
// if we caught a signal it should have the effect name we passed in
|
||||
QList<QVariant> arguments = spy.takeFirst();
|
||||
QCOMPARE(arguments.count(), 2);
|
||||
QCOMPARE(arguments.at(1).toString(), QStringLiteral("mouseclick"));
|
||||
spy.clear();
|
||||
|
||||
// let's delete one of the default entries
|
||||
plugins.deleteEntry(QStringLiteral("kscreenEnabled"));
|
||||
plugins.sync();
|
||||
|
||||
QVERIFY(spy.isEmpty());
|
||||
loader.queryAndLoadAll();
|
||||
|
||||
// let's use qWait as we need to wait for two signals to be emitted
|
||||
QTest::qWait(100);
|
||||
QCOMPARE(spy.size(), 2);
|
||||
QStringList loadedEffects;
|
||||
for (auto &list : spy) {
|
||||
QCOMPARE(list.size(), 2);
|
||||
loadedEffects << list.at(1).toString();
|
||||
}
|
||||
std::sort(loadedEffects.begin(), loadedEffects.end());
|
||||
QCOMPARE(loadedEffects.at(0), QStringLiteral("kscreen"));
|
||||
QCOMPARE(loadedEffects.at(1), QStringLiteral("mouseclick"));
|
||||
}
|
||||
|
||||
Q_CONSTRUCTOR_FUNCTION(forceXcb)
|
||||
QTEST_MAIN(TestBuiltInEffectLoader)
|
||||
#include "test_builtin_effectloader.moc"
|
|
@ -184,7 +184,6 @@ set_target_properties(kwin PROPERTIES
|
|||
)
|
||||
|
||||
target_link_libraries(kwin
|
||||
kwin4_effect_builtins
|
||||
kwineffects
|
||||
kwinglutils
|
||||
|
||||
|
@ -266,7 +265,12 @@ qt5_generate_dbus_interface(virtualkeyboard_dbus.h org.kde.kwin.VirtualKeyboard.
|
|||
generate_export_header(kwin EXPORT_FILE_NAME kwin_export.h)
|
||||
|
||||
add_executable(kwin_x11 main_x11.cpp)
|
||||
target_link_libraries(kwin_x11 kwin KF5::Crash Qt::X11Extras)
|
||||
target_link_libraries(kwin_x11
|
||||
kwin4_effect_builtins
|
||||
kwin
|
||||
KF5::Crash
|
||||
Qt::X11Extras
|
||||
)
|
||||
|
||||
install(TARGETS kwin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
|
||||
install(TARGETS kwin_x11 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
@ -278,6 +282,7 @@ add_executable(kwin_wayland
|
|||
tabletmodemanager.cpp
|
||||
)
|
||||
target_link_libraries(kwin_wayland
|
||||
kwin4_effect_builtins
|
||||
kwin
|
||||
KF5::Crash
|
||||
KWinXwaylandServerModule
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
// KWin
|
||||
#include <config-kwin.h>
|
||||
#include <kwineffects.h>
|
||||
#include "effects/effect_builtins.h"
|
||||
#include "plugin.h"
|
||||
#include "scripting/scriptedeffect.h"
|
||||
#include "utils.h"
|
||||
|
@ -64,115 +63,6 @@ LoadEffectFlags AbstractEffectLoader::readConfig(const QString &effectName, bool
|
|||
return LoadEffectFlags();
|
||||
}
|
||||
|
||||
BuiltInEffectLoader::BuiltInEffectLoader(QObject *parent)
|
||||
: AbstractEffectLoader(parent)
|
||||
, m_queue(new EffectLoadQueue<BuiltInEffectLoader, BuiltInEffect>(this))
|
||||
{
|
||||
}
|
||||
|
||||
BuiltInEffectLoader::~BuiltInEffectLoader()
|
||||
{
|
||||
}
|
||||
|
||||
bool BuiltInEffectLoader::hasEffect(const QString &name) const
|
||||
{
|
||||
return BuiltInEffects::available(internalName(name));
|
||||
}
|
||||
|
||||
bool BuiltInEffectLoader::isEffectSupported(const QString &name) const
|
||||
{
|
||||
return BuiltInEffects::supported(BuiltInEffects::builtInForName(internalName(name)));
|
||||
}
|
||||
|
||||
QStringList BuiltInEffectLoader::listOfKnownEffects() const
|
||||
{
|
||||
return BuiltInEffects::availableEffectNames();
|
||||
}
|
||||
|
||||
bool BuiltInEffectLoader::loadEffect(const QString &name)
|
||||
{
|
||||
return loadEffect(name, BuiltInEffects::builtInForName(internalName(name)), LoadEffectFlag::Load);
|
||||
}
|
||||
|
||||
void BuiltInEffectLoader::queryAndLoadAll()
|
||||
{
|
||||
const QList<BuiltInEffect> effects = BuiltInEffects::availableEffects();
|
||||
for (BuiltInEffect effect : effects) {
|
||||
// check whether it is already loaded
|
||||
if (m_loadedEffects.contains(effect)) {
|
||||
continue;
|
||||
}
|
||||
const QString key = BuiltInEffects::nameForEffect(effect);
|
||||
const LoadEffectFlags flags = readConfig(key, BuiltInEffects::enabledByDefault(effect));
|
||||
if (flags.testFlag(LoadEffectFlag::Load)) {
|
||||
m_queue->enqueue(qMakePair(effect, flags));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool BuiltInEffectLoader::loadEffect(BuiltInEffect effect, LoadEffectFlags flags)
|
||||
{
|
||||
return loadEffect(BuiltInEffects::nameForEffect(effect), effect, flags);
|
||||
}
|
||||
|
||||
bool BuiltInEffectLoader::loadEffect(const QString &name, BuiltInEffect effect, LoadEffectFlags flags)
|
||||
{
|
||||
if (effect == BuiltInEffect::Invalid) {
|
||||
return false;
|
||||
}
|
||||
if (!flags.testFlag(LoadEffectFlag::Load)) {
|
||||
qCDebug(KWIN_CORE) << "Loading flags disable effect: " << name;
|
||||
return false;
|
||||
}
|
||||
// check that it is not already loaded
|
||||
if (m_loadedEffects.contains(effect)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// supported might need a context
|
||||
#ifndef KWIN_UNIT_TEST
|
||||
effects->makeOpenGLContextCurrent();
|
||||
#endif
|
||||
if (!BuiltInEffects::supported(effect)) {
|
||||
qCDebug(KWIN_CORE) << "Effect is not supported: " << name;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (flags.testFlag(LoadEffectFlag::CheckDefaultFunction)) {
|
||||
if (!BuiltInEffects::checkEnabledByDefault(effect)) {
|
||||
qCDebug(KWIN_CORE) << "Enabled by default function disables effect: " << name;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ok, now we can try to create the Effect
|
||||
Effect *e = BuiltInEffects::create(effect);
|
||||
if (!e) {
|
||||
qCDebug(KWIN_CORE) << "Failed to create effect: " << name;
|
||||
return false;
|
||||
}
|
||||
// insert in our loaded effects
|
||||
m_loadedEffects.insert(effect, e);
|
||||
connect(e, &Effect::destroyed, this,
|
||||
[this, effect]() {
|
||||
m_loadedEffects.remove(effect);
|
||||
}
|
||||
);
|
||||
qCDebug(KWIN_CORE) << "Successfully loaded built-in effect: " << name;
|
||||
Q_EMIT effectLoaded(e, name);
|
||||
return true;
|
||||
}
|
||||
|
||||
QString BuiltInEffectLoader::internalName(const QString& name) const
|
||||
{
|
||||
return name.toLower();
|
||||
}
|
||||
|
||||
void BuiltInEffectLoader::clear()
|
||||
{
|
||||
m_queue->clear();
|
||||
}
|
||||
|
||||
static const QString s_nameProperty = QStringLiteral("X-KDE-PluginInfo-Name");
|
||||
static const QString s_jsConstraint = QStringLiteral("[X-Plasma-API] == 'javascript'");
|
||||
static const QString s_serviceType = QStringLiteral("KWin/Effect");
|
||||
|
@ -621,9 +511,8 @@ void PluginEffectLoader::clear()
|
|||
EffectLoader::EffectLoader(QObject *parent)
|
||||
: AbstractEffectLoader(parent)
|
||||
{
|
||||
m_loaders << new BuiltInEffectLoader(this)
|
||||
m_loaders << new StaticPluginEffectLoader(this)
|
||||
<< new ScriptedEffectLoader(this)
|
||||
<< new StaticPluginEffectLoader(this)
|
||||
<< new PluginEffectLoader(this);
|
||||
for (auto it = m_loaders.constBegin(); it != m_loaders.constEnd(); ++it) {
|
||||
connect(*it, &AbstractEffectLoader::effectLoaded, this, &AbstractEffectLoader::effectLoaded);
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace KWin
|
|||
{
|
||||
class Effect;
|
||||
class EffectPluginFactory;
|
||||
enum class BuiltInEffect;
|
||||
|
||||
/**
|
||||
* @brief Flags defining how a Loader should load an Effect.
|
||||
|
@ -268,32 +267,6 @@ private:
|
|||
QQueue<QPair<QueueType, LoadEffectFlags>> m_queue;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Can load the Built-In-Effects
|
||||
*/
|
||||
class BuiltInEffectLoader : public AbstractEffectLoader
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BuiltInEffectLoader(QObject *parent = nullptr);
|
||||
~BuiltInEffectLoader() override;
|
||||
|
||||
bool hasEffect(const QString &name) const override;
|
||||
bool isEffectSupported(const QString &name) const override;
|
||||
QStringList listOfKnownEffects() const override;
|
||||
|
||||
void clear() override;
|
||||
void queryAndLoadAll() override;
|
||||
bool loadEffect(const QString& name) override;
|
||||
bool loadEffect(BuiltInEffect effect, LoadEffectFlags flags);
|
||||
|
||||
private:
|
||||
bool loadEffect(const QString &name, BuiltInEffect effect, LoadEffectFlags flags);
|
||||
QString internalName(const QString &name) const;
|
||||
EffectLoadQueue<BuiltInEffectLoader, BuiltInEffect> *m_queue;
|
||||
QMap<BuiltInEffect, Effect*> m_loadedEffects;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Can load scripted Effects
|
||||
*/
|
||||
|
|
|
@ -57,17 +57,9 @@ macro(KWIN4_ADD_EFFECT_BACKEND name type)
|
|||
)
|
||||
endmacro()
|
||||
|
||||
# Adds effect plugin with given name. Sources are given after the name
|
||||
macro(KWIN4_ADD_EFFECT name)
|
||||
kwin4_add_effect_backend(${name} SHARED ${ARGN})
|
||||
|
||||
set_target_properties(${name} PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
set_target_properties(${name} PROPERTIES OUTPUT_NAME ${name})
|
||||
install(TARGETS ${name} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
endmacro()
|
||||
|
||||
macro(KWIN4_ADD_EFFECT_MODULE name)
|
||||
kwin4_add_effect_backend(${name} OBJECT ${ARGN})
|
||||
target_compile_definitions(${name} PRIVATE QT_STATICPLUGIN)
|
||||
endmacro()
|
||||
|
||||
# Install the KWin/Effect service type
|
||||
|
@ -144,14 +136,13 @@ add_subdirectory(wobblywindows)
|
|||
|
||||
# Add the builtins plugin
|
||||
set(kwin4_effect_builtins_sources
|
||||
effect_builtins.cpp
|
||||
logging.cpp
|
||||
../service_utils.cpp
|
||||
)
|
||||
|
||||
qt5_add_resources(kwin4_effect_builtins_sources shaders.qrc)
|
||||
|
||||
kwin4_add_effect(kwin4_effect_builtins ${kwin4_effect_builtins_sources})
|
||||
kwin4_add_effect_backend(kwin4_effect_builtins STATIC ${kwin4_effect_builtins_sources})
|
||||
target_link_libraries(kwin4_effect_builtins PRIVATE
|
||||
kwin4_effect_blur
|
||||
kwin4_effect_colorpicker
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
set(contrast_SOURCES
|
||||
contrast.cpp
|
||||
contrastshader.cpp
|
||||
main.cpp
|
||||
)
|
||||
kwin4_add_effect_module(kwin4_effect_contrast ${contrast_SOURCES})
|
||||
|
|
20
src/effects/backgroundcontrast/main.cpp
Normal file
20
src/effects/backgroundcontrast/main.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "contrast.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED(ContrastEffectFactory,
|
||||
ContrastEffect,
|
||||
"metadata.json",
|
||||
return ContrastEffect::supported();,
|
||||
return ContrastEffect::enabledByDefault();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
15
src/effects/backgroundcontrast/metadata.json
Normal file
15
src/effects/backgroundcontrast/metadata.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Improve contrast and readability behind semi-transparent windows",
|
||||
"Id": "contrast",
|
||||
"License": "GPL",
|
||||
"Name": "Background contrast",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"org.kde.kwin.effect": {
|
||||
"enabledByDefaultMethod": true
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
set(blur_SOURCES
|
||||
blur.cpp
|
||||
blurshader.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kconfig_add_kcfg_files(blur_SOURCES
|
||||
|
|
20
src/effects/blur/main.cpp
Normal file
20
src/effects/blur/main.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "blur.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED(BlurEffectFactory,
|
||||
BlurEffect,
|
||||
"metadata.json",
|
||||
return BlurEffect::supported();,
|
||||
return BlurEffect::enabledByDefault();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
16
src/effects/blur/metadata.json
Normal file
16
src/effects/blur/metadata.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Blurs the background behind semi-transparent windows",
|
||||
"Id": "blur",
|
||||
"License": "GPL",
|
||||
"Name": "Blur",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_blur_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"enabledByDefaultMethod": true
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
set(colorpicker_SOURCES
|
||||
colorpicker.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kwin4_add_effect_module(kwin4_effect_colorpicker ${colorpicker_SOURCES})
|
||||
|
|
19
src/effects/colorpicker/main.cpp
Normal file
19
src/effects/colorpicker/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "colorpicker.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(ColorPickerEffectFactory,
|
||||
ColorPickerEffect,
|
||||
"metadata.json",
|
||||
return ColorPickerEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
16
src/effects/colorpicker/metadata.json
Normal file
16
src/effects/colorpicker/metadata.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Accessibility",
|
||||
"Description": "Supports picking a color",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "colorpicker",
|
||||
"License": "GPL",
|
||||
"Name": "Color Picker",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"org.kde.kwin.effect": {
|
||||
"internal": true
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ install(FILES main.qml DESTINATION ${KDE_INSTALL_DATADIR}/kwin/effects/desktopgr
|
|||
|
||||
set(desktopgrid_SOURCES
|
||||
desktopgrid.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kconfig_add_kcfg_files(desktopgrid_SOURCES
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "desktopgridconfig.h"
|
||||
|
||||
#include "../presentwindows/presentwindows_proxy.h"
|
||||
#include "../effect_builtins.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
|
@ -1102,7 +1101,7 @@ void DesktopGridEffect::setup()
|
|||
|
||||
// setup the motion managers
|
||||
if (clickBehavior == SwitchDesktopAndActivateWindow)
|
||||
m_proxy = static_cast<PresentWindowsEffectProxy*>(effects->getProxy(BuiltInEffects::nameForEffect(BuiltInEffect::PresentWindows)));
|
||||
m_proxy = static_cast<PresentWindowsEffectProxy*>(effects->getProxy(QStringLiteral("presentwindows")));
|
||||
if (isUsingPresentWindows()) {
|
||||
m_proxy->reCreateGrids(); // revalidation on multiscreen, bug #351724
|
||||
for (int i = 1; i <= effects->numberOfDesktops(); i++) {
|
||||
|
|
18
src/effects/desktopgrid/main.cpp
Normal file
18
src/effects/desktopgrid/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "desktopgrid.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(DesktopGridEffectFactory,
|
||||
DesktopGridEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
17
src/effects/desktopgrid/metadata.json
Normal file
17
src/effects/desktopgrid/metadata.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Window Management",
|
||||
"Description": "Zoom out so all desktops are displayed side-by-side in a grid",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "desktopgrid",
|
||||
"License": "GPL",
|
||||
"Name": "Desktop Grid",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_desktopgrid_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"video": "https://files.kde.org/plasma/kwin/effect-videos/desktop_grid.mp4"
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
set(diminactive_SOURCES
|
||||
diminactive.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kconfig_add_kcfg_files(diminactive_SOURCES
|
||||
|
|
18
src/effects/diminactive/main.cpp
Normal file
18
src/effects/diminactive/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "diminactive.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(DimInactiveEffectFactory,
|
||||
DimInactiveEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
17
src/effects/diminactive/metadata.json
Normal file
17
src/effects/diminactive/metadata.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Focus",
|
||||
"Description": "Darken inactive windows",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "diminactive",
|
||||
"License": "GPL",
|
||||
"Name": "Dim Inactive",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_diminactive_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"video": "https://files.kde.org/plasma/kwin/effect-videos/dim_inactive.mp4"
|
||||
}
|
||||
}
|
|
@ -1,751 +0,0 @@
|
|||
/*
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
#include "effect_builtins.h"
|
||||
#ifdef EFFECT_BUILTINS
|
||||
// common effects
|
||||
#include "backgroundcontrast/contrast.h"
|
||||
#include "blur/blur.h"
|
||||
#include "colorpicker/colorpicker.h"
|
||||
#include "kscreen/kscreen.h"
|
||||
#include "overview/overvieweffect.h"
|
||||
#include "presentwindows/presentwindows.h"
|
||||
#include "screenedge/screenedgeeffect.h"
|
||||
#include "screenshot/screenshot.h"
|
||||
#include "screentransform/screentransform.h"
|
||||
#include "slidingpopups/slidingpopups.h"
|
||||
// Common effects only relevant to desktop
|
||||
#include "desktopgrid/desktopgrid.h"
|
||||
#include "diminactive/diminactive.h"
|
||||
#include "fallapart/fallapart.h"
|
||||
#include "highlightwindow/highlightwindow.h"
|
||||
#include "magiclamp/magiclamp.h"
|
||||
#include "resize/resize.h"
|
||||
#include "showfps/showfps.h"
|
||||
#include "showpaint/showpaint.h"
|
||||
#include "slide/slide.h"
|
||||
#include "slideback/slideback.h"
|
||||
#include "thumbnailaside/thumbnailaside.h"
|
||||
#include "touchpoints/touchpoints.h"
|
||||
#include "windowgeometry/windowgeometry.h"
|
||||
#include "zoom/zoom.h"
|
||||
// OpenGL-specific effects for desktop
|
||||
#include "glide/glide.h"
|
||||
#include "invert/invert.h"
|
||||
#include "lookingglass/lookingglass.h"
|
||||
#include "magnifier/magnifier.h"
|
||||
#include "mouseclick/mouseclick.h"
|
||||
#include "mousemark/mousemark.h"
|
||||
#include "sheet/sheet.h"
|
||||
#include "snaphelper/snaphelper.h"
|
||||
#include "startupfeedback/startupfeedback.h"
|
||||
#include "trackmouse/trackmouse.h"
|
||||
#include "wobblywindows/wobblywindows.h"
|
||||
#endif
|
||||
|
||||
#include <KLocalizedString>
|
||||
#include <kwineffects.h>
|
||||
|
||||
#ifndef EFFECT_BUILTINS
|
||||
#define EFFECT_FALLBACK nullptr, nullptr, nullptr,
|
||||
#else
|
||||
#define EFFECT_FALLBACK
|
||||
#endif
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
namespace BuiltInEffects
|
||||
{
|
||||
|
||||
template <class T>
|
||||
inline Effect *createHelper()
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
|
||||
static const QVector<EffectData> &effectData()
|
||||
{
|
||||
static const QVector<EffectData> s_effectData = {
|
||||
{
|
||||
QString(),
|
||||
QString(),
|
||||
QString(),
|
||||
QString(),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("blur"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Blur"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Blurs the background behind semi-transparent windows"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
true,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<BlurEffect>,
|
||||
&BlurEffect::supported,
|
||||
&BlurEffect::enabledByDefault,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_blur_config")
|
||||
}, {
|
||||
QStringLiteral("colorpicker"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Color Picker"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Supports picking a color"),
|
||||
QStringLiteral("Accessibility"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
true,
|
||||
true,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ColorPickerEffect>,
|
||||
&ColorPickerEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("contrast"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Background contrast"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Improve contrast and readability behind semi-transparent windows"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
true,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ContrastEffect>,
|
||||
&ContrastEffect::supported,
|
||||
&ContrastEffect::enabledByDefault,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("desktopgrid"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Desktop Grid"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Zoom out so all desktops are displayed side-by-side in a grid"),
|
||||
QStringLiteral("Window Management"),
|
||||
QString(),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/desktop_grid.mp4")),
|
||||
true,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<DesktopGridEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_desktopgrid_config")
|
||||
}, {
|
||||
QStringLiteral("diminactive"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Dim Inactive"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Darken inactive windows"),
|
||||
QStringLiteral("Focus"),
|
||||
QString(),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/dim_inactive.mp4")),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<DimInactiveEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_diminactive_config")
|
||||
}, {
|
||||
QStringLiteral("fallapart"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Fall Apart"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Closed windows fall into pieces"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<FallApartEffect>,
|
||||
&FallApartEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("glide"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Glide"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Glide windows as they appear or disappear"),
|
||||
QStringLiteral("Window Open/Close Animation"),
|
||||
QStringLiteral("toplevel-open-close-animation"),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<GlideEffect>,
|
||||
&GlideEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_glide_config")
|
||||
}, {
|
||||
QStringLiteral("highlightwindow"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Highlight Window"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Highlight the appropriate window when hovering over taskbar entries"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
true,
|
||||
true,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<HighlightWindowEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("invert"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Invert"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Inverts the color of the desktop and windows"),
|
||||
QStringLiteral("Accessibility"),
|
||||
QString(),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/invert.mp4")),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<InvertEffect>,
|
||||
&InvertEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_invert_config")
|
||||
}, {
|
||||
QStringLiteral("kscreen"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Kscreen"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Helper Effect for KScreen"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
true,
|
||||
true,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<KscreenEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("lookingglass"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Looking Glass"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "A screen magnifier that looks like a fisheye lens"),
|
||||
QStringLiteral("Accessibility"),
|
||||
QStringLiteral("magnifiers"),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/looking_glass.ogv")),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<LookingGlassEffect>,
|
||||
&LookingGlassEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_lookingglass_config")
|
||||
}, {
|
||||
QStringLiteral("magiclamp"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Magic Lamp"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Simulate a magic lamp when minimizing windows"),
|
||||
QStringLiteral("Appearance"),
|
||||
QStringLiteral("minimize"),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/magic_lamp.ogv")),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<MagicLampEffect>,
|
||||
&MagicLampEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_magiclamp_config")
|
||||
}, {
|
||||
QStringLiteral("magnifier"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Magnifier"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Magnify the section of the screen that is near the mouse cursor"),
|
||||
QStringLiteral("Accessibility"),
|
||||
QStringLiteral("magnifiers"),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/magnifier.ogv")),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<MagnifierEffect>,
|
||||
&MagnifierEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_magnifier_config")
|
||||
}, {
|
||||
QStringLiteral("mouseclick"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Mouse Click Animation"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Creates an animation whenever a mouse button is clicked. This is useful for screenrecordings/presentations"),
|
||||
QStringLiteral("Accessibility"),
|
||||
QString(),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/mouse_click.mp4")),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<MouseClickEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_mouseclick_config")
|
||||
}, {
|
||||
QStringLiteral("mousemark"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Mouse Mark"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Allows you to draw lines on the desktop"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<MouseMarkEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_mousemark_config")
|
||||
}, {
|
||||
QStringLiteral("overview"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Overview"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Allows you to overview virtual desktops and windows"),
|
||||
QStringLiteral("Window Management"),
|
||||
QString(),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/present_windows.mp4")),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<OverviewEffect>,
|
||||
&OverviewEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_overview_config")
|
||||
}, {
|
||||
QStringLiteral("presentwindows"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Present Windows"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Zoom out until all opened windows can be displayed side-by-side"),
|
||||
QStringLiteral("Window Management"),
|
||||
QString(),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/present_windows.mp4")),
|
||||
true,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<PresentWindowsEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_presentwindows_config")
|
||||
}, {
|
||||
QStringLiteral("resize"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Resize Window"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Resizes windows with a fast texture scale instead of updating contents"),
|
||||
QStringLiteral("Window Management"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ResizeEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_resize_config")
|
||||
}, {
|
||||
QStringLiteral("screenedge"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Screen Edge"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Highlights a screen edge when approaching"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
true,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ScreenEdgeEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("screenshot"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Screenshot"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Helper effect for screenshot tools"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
true,
|
||||
true,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ScreenShotEffect>,
|
||||
&ScreenShotEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("screentransform"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Transform"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Animates display transformations"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
true,
|
||||
true,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ScreenTransformEffect>,
|
||||
&ScreenTransformEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK QString()
|
||||
}, {
|
||||
QStringLiteral("sheet"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Sheet"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Make modal dialogs smoothly fly in and out when they are shown or hidden"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<SheetEffect>,
|
||||
&SheetEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("showfps"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Show FPS"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Display KWin's performance in the corner of the screen"),
|
||||
QStringLiteral("Tools"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ShowFpsEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_showfps_config")
|
||||
}, {
|
||||
QStringLiteral("showpaint"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Show Paint"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Highlight areas of the desktop that have been recently updated"),
|
||||
QStringLiteral("Tools"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ShowPaintEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_showpaint_config")
|
||||
}, {
|
||||
QStringLiteral("slide"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Slide"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Slide desktops when switching virtual desktops"),
|
||||
QStringLiteral("Virtual Desktop Switching Animation"),
|
||||
QStringLiteral("desktop-animations"),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/slide.ogv")),
|
||||
true,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<SlideEffect>,
|
||||
&SlideEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_slide_config")
|
||||
}, {
|
||||
QStringLiteral("slideback"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Slide Back"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Slide back windows when another window is raised"),
|
||||
QStringLiteral("Focus"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<SlideBackEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("slidingpopups"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Sliding popups"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Sliding animation for Plasma popups"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/sliding_popups.mp4")),
|
||||
true,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<SlidingPopupsEffect>,
|
||||
&SlidingPopupsEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("snaphelper"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Snap Helper"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Help you locate the center of the screen when moving a window"),
|
||||
QStringLiteral("Accessibility"),
|
||||
QString(),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/snap_helper.mp4")),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<SnapHelperEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("startupfeedback"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Startup Feedback"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Helper effect for startup feedback"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
true,
|
||||
true,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<StartupFeedbackEffect>,
|
||||
&StartupFeedbackEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("thumbnailaside"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Thumbnail Aside"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Display window thumbnails on the edge of the screen"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ThumbnailAsideEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_thumbnailaside_config")
|
||||
}, {
|
||||
QStringLiteral("touchpoints"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Touch Points"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Visualize touch points"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<TouchPointsEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QString()
|
||||
}, {
|
||||
QStringLiteral("trackmouse"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Track Mouse"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Display a mouse cursor locating effect when activated"),
|
||||
QStringLiteral("Accessibility"),
|
||||
QString(),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/track_mouse.mp4")),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<TrackMouseEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_trackmouse_config")
|
||||
}, {
|
||||
QStringLiteral("windowgeometry"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Window Geometry"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Display window geometries on move/resize"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
true,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<WindowGeometry>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_windowgeometry_config")
|
||||
}, {
|
||||
QStringLiteral("wobblywindows"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Wobbly Windows"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Deform windows while they are moving"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/wobbly_windows.ogv")),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<WobblyWindowsEffect>,
|
||||
&WobblyWindowsEffect::supported,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_wobblywindows_config")
|
||||
}, {
|
||||
QStringLiteral("zoom"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "Zoom"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Magnify the entire desktop"),
|
||||
QStringLiteral("Accessibility"),
|
||||
QStringLiteral("magnifiers"),
|
||||
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/zoom.ogv")),
|
||||
true,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ZoomEffect>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
QStringLiteral("kwin_zoom_config")
|
||||
}
|
||||
};
|
||||
return s_effectData;
|
||||
}
|
||||
|
||||
static inline int index(BuiltInEffect effect)
|
||||
{
|
||||
return static_cast<int>(effect);
|
||||
}
|
||||
|
||||
Effect *create(BuiltInEffect effect)
|
||||
{
|
||||
const EffectData &data = effectData(effect);
|
||||
if (data.createFunction == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
return data.createFunction();
|
||||
}
|
||||
|
||||
bool available(const QString &name)
|
||||
{
|
||||
auto it = std::find_if(effectData().begin(), effectData().end(),
|
||||
[name](const EffectData &data) {
|
||||
return data.name == name;
|
||||
}
|
||||
);
|
||||
return it != effectData().end();
|
||||
}
|
||||
|
||||
bool supported(BuiltInEffect effect)
|
||||
{
|
||||
if (effect == BuiltInEffect::Invalid) {
|
||||
return false;
|
||||
}
|
||||
const EffectData &data = effectData(effect);
|
||||
if (data.supportedFunction == nullptr) {
|
||||
return true;
|
||||
}
|
||||
return data.supportedFunction();
|
||||
}
|
||||
|
||||
bool checkEnabledByDefault(BuiltInEffect effect)
|
||||
{
|
||||
if (effect == BuiltInEffect::Invalid) {
|
||||
return false;
|
||||
}
|
||||
const EffectData &data = effectData(effect);
|
||||
if (data.enabledFunction == nullptr) {
|
||||
return true;
|
||||
}
|
||||
return data.enabledFunction();
|
||||
}
|
||||
|
||||
bool enabledByDefault(BuiltInEffect effect)
|
||||
{
|
||||
return effectData(effect).enabled;
|
||||
}
|
||||
|
||||
QStringList availableEffectNames()
|
||||
{
|
||||
QStringList result;
|
||||
for (const EffectData &data : effectData()) {
|
||||
if (data.name.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
result << data.name;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QList< BuiltInEffect > availableEffects()
|
||||
{
|
||||
QList<BuiltInEffect> result;
|
||||
for (int i = index(BuiltInEffect::Invalid) + 1; i <= index(BuiltInEffect::Zoom); ++i) {
|
||||
result << BuiltInEffect(i);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
BuiltInEffect builtInForName(const QString &name)
|
||||
{
|
||||
auto it = std::find_if(effectData().begin(), effectData().end(),
|
||||
[name](const EffectData &data) {
|
||||
return data.name == name;
|
||||
}
|
||||
);
|
||||
if (it == effectData().end()) {
|
||||
return BuiltInEffect::Invalid;
|
||||
}
|
||||
return BuiltInEffect(std::distance(effectData().begin(), it));
|
||||
}
|
||||
|
||||
QString nameForEffect(BuiltInEffect effect)
|
||||
{
|
||||
return effectData(effect).name;
|
||||
}
|
||||
|
||||
const EffectData &effectData(BuiltInEffect effect)
|
||||
{
|
||||
return effectData().at(index(effect));
|
||||
}
|
||||
|
||||
} // BuiltInEffects
|
||||
|
||||
} // namespace
|
|
@ -8,88 +8,42 @@
|
|||
*/
|
||||
#ifndef KWIN_EFFECT_BUILTINS_H
|
||||
#define KWIN_EFFECT_BUILTINS_H
|
||||
#include <kwineffects_export.h>
|
||||
#include <QStringList>
|
||||
#include <QUrl>
|
||||
#include <functional>
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
class Effect;
|
||||
|
||||
/**
|
||||
* Defines all the built in effects.
|
||||
*/
|
||||
enum class BuiltInEffect
|
||||
{
|
||||
Invalid, ///< not a valid Effect
|
||||
Blur,
|
||||
ColorPicker,
|
||||
Contrast,
|
||||
DesktopGrid,
|
||||
DimInactive,
|
||||
FallApart,
|
||||
Glide,
|
||||
HighlightWindow,
|
||||
Invert,
|
||||
Kscreen,
|
||||
LookingGlass,
|
||||
MagicLamp,
|
||||
Magnifier,
|
||||
MouseClick,
|
||||
MouseMark,
|
||||
Overview,
|
||||
PresentWindows,
|
||||
Resize,
|
||||
ScreenEdge,
|
||||
ScreenShot,
|
||||
ScreenTransform,
|
||||
Sheet,
|
||||
ShowFps,
|
||||
ShowPaint,
|
||||
Slide,
|
||||
SlideBack,
|
||||
SlidingPopups,
|
||||
SnapHelper,
|
||||
StartupFeedback,
|
||||
ThumbnailAside,
|
||||
TouchPoints,
|
||||
TrackMouse,
|
||||
WindowGeometry,
|
||||
WobblyWindows,
|
||||
Zoom
|
||||
};
|
||||
|
||||
namespace BuiltInEffects
|
||||
{
|
||||
|
||||
struct EffectData {
|
||||
QString name;
|
||||
QString displayName;
|
||||
QString comment;
|
||||
QString category;
|
||||
QString exclusiveCategory;
|
||||
QUrl video;
|
||||
bool enabled;
|
||||
bool internal;
|
||||
std::function<Effect*()> createFunction;
|
||||
std::function<bool()> supportedFunction;
|
||||
std::function<bool()> enabledFunction;
|
||||
QString configModule;
|
||||
};
|
||||
|
||||
KWINEFFECTS_EXPORT Effect *create(BuiltInEffect effect);
|
||||
KWINEFFECTS_EXPORT bool available(const QString &name);
|
||||
KWINEFFECTS_EXPORT bool supported(BuiltInEffect effect);
|
||||
KWINEFFECTS_EXPORT bool checkEnabledByDefault(BuiltInEffect effect);
|
||||
KWINEFFECTS_EXPORT bool enabledByDefault(BuiltInEffect effect);
|
||||
KWINEFFECTS_EXPORT QString nameForEffect(BuiltInEffect effect);
|
||||
KWINEFFECTS_EXPORT BuiltInEffect builtInForName(const QString &name);
|
||||
KWINEFFECTS_EXPORT QStringList availableEffectNames();
|
||||
KWINEFFECTS_EXPORT QList<BuiltInEffect> availableEffects();
|
||||
KWINEFFECTS_EXPORT const EffectData &effectData(BuiltInEffect effect);
|
||||
}
|
||||
|
||||
}
|
||||
#define KWIN_IMPORT_BUILTIN_EFFECTS \
|
||||
Q_IMPORT_PLUGIN(BlurEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(ColorPickerEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(ContrastEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(DesktopGridEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(DimInactiveEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(FallApartEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(GlideEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(HighlightWindowEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(InvertEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(KscreenEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(LookingGlassEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(MagicLampEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(MagnifierEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(MouseClickEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(MouseMarkEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(OverviewEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(PresentWindowsEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(ResizeEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(ScreenEdgeEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(ScreenShotEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(ScreenTransformEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(SheetEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(ShowFpsEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(ShowPaintEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(SlideEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(SlideBackEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(SlidingPopupsEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(SnapHelperEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(StartupFeedbackEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(ThumbnailAsideEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(TouchPointsEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(TrackMouseEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(WindowGeometryFactory) \
|
||||
Q_IMPORT_PLUGIN(WobblyWindowsEffectFactory) \
|
||||
Q_IMPORT_PLUGIN(ZoomEffectFactory)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
# Source files
|
||||
set(fallapart_SOURCES
|
||||
fallapart.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kconfig_add_kcfg_files(fallapart_SOURCES
|
||||
|
|
19
src/effects/fallapart/main.cpp
Normal file
19
src/effects/fallapart/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "fallapart.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(FallApartEffectFactory,
|
||||
FallApartEffect,
|
||||
"metadata.json",
|
||||
return FallApartEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
13
src/effects/fallapart/metadata.json
Normal file
13
src/effects/fallapart/metadata.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Closed windows fall into pieces",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "fallapart",
|
||||
"License": "GPL",
|
||||
"Name": "Fall Apart",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
set(glide_SOURCES
|
||||
glide.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kconfig_add_kcfg_files(glide_SOURCES
|
||||
|
|
19
src/effects/glide/main.cpp
Normal file
19
src/effects/glide/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "glide.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(GlideEffectFactory,
|
||||
GlideEffect,
|
||||
"metadata.json",
|
||||
return GlideEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
17
src/effects/glide/metadata.json
Normal file
17
src/effects/glide/metadata.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Window Open/Close Animation",
|
||||
"Description": "Glide windows as they appear or disappear",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "glide",
|
||||
"License": "GPL",
|
||||
"Name": "Glide",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_glide_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"exclusiveGroup": "toplevel-open-close-animation"
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
# Source files
|
||||
set(highlightwindow_SOURCES
|
||||
highlightwindow.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kwin4_add_effect_module(kwin4_effect_highlightwindow ${highlightwindow_SOURCES})
|
||||
|
|
18
src/effects/highlightwindow/main.cpp
Normal file
18
src/effects/highlightwindow/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "highlightwindow.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(HighlightWindowEffectFactory,
|
||||
HighlightWindowEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
16
src/effects/highlightwindow/metadata.json
Normal file
16
src/effects/highlightwindow/metadata.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Highlight the appropriate window when hovering over taskbar entries",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "highlightwindow",
|
||||
"License": "GPL",
|
||||
"Name": "Highlight Window",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"org.kde.kwin.effect": {
|
||||
"internal": true
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
set(invert_SOURCES
|
||||
invert.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kwin4_add_effect_module(kwin4_effect_invert ${invert_SOURCES})
|
||||
|
|
19
src/effects/invert/main.cpp
Normal file
19
src/effects/invert/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "invert.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(InvertEffectFactory,
|
||||
InvertEffect,
|
||||
"metadata.json",
|
||||
return InvertEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
17
src/effects/invert/metadata.json
Normal file
17
src/effects/invert/metadata.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Accessibility",
|
||||
"Description": "Inverts the color of the desktop and windows",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "invert",
|
||||
"License": "GPL",
|
||||
"Name": "Invert",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_invert_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"video": "https://files.kde.org/plasma/kwin/effect-videos/invert.mp4"
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
# Source files
|
||||
set(kscreen_SOURCES
|
||||
kscreen.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kconfig_add_kcfg_files(kscreen_SOURCES kscreenconfig.kcfgc)
|
||||
|
|
18
src/effects/kscreen/main.cpp
Normal file
18
src/effects/kscreen/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "kscreen.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(KscreenEffectFactory,
|
||||
KscreenEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
16
src/effects/kscreen/metadata.json
Normal file
16
src/effects/kscreen/metadata.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Helper Effect for KScreen",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "kscreen",
|
||||
"License": "GPL",
|
||||
"Name": "Kscreen",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"org.kde.kwin.effect": {
|
||||
"internal": true
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
set(lookingglass_SOURCES
|
||||
lookingglass.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kconfig_add_kcfg_files(lookingglass_SOURCES
|
||||
|
|
19
src/effects/lookingglass/main.cpp
Normal file
19
src/effects/lookingglass/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "lookingglass.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(LookingGlassEffectFactory,
|
||||
LookingGlassEffect,
|
||||
"metadata.json",
|
||||
return LookingGlassEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
18
src/effects/lookingglass/metadata.json
Normal file
18
src/effects/lookingglass/metadata.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Accessibility",
|
||||
"Description": "A screen magnifier that looks like a fisheye lens",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "lookingglass",
|
||||
"License": "GPL",
|
||||
"Name": "Looking Glass",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_lookingglass_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"exclusiveGroup": "magnifiers",
|
||||
"video": "https://files.kde.org/plasma/kwin/effect-videos/looking_glass.ogv"
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
set(magiclamp_SOURCES
|
||||
magiclamp.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kconfig_add_kcfg_files(magiclamp_SOURCES
|
||||
|
|
19
src/effects/magiclamp/main.cpp
Normal file
19
src/effects/magiclamp/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "magiclamp.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(MagicLampEffectFactory,
|
||||
MagicLampEffect,
|
||||
"metadata.json",
|
||||
return MagicLampEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
18
src/effects/magiclamp/metadata.json
Normal file
18
src/effects/magiclamp/metadata.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Simulate a magic lamp when minimizing windows",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "magiclamp",
|
||||
"License": "GPL",
|
||||
"Name": "Magic Lamp",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_magiclamp_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"exclusiveGroup": "minimize",
|
||||
"video": "https://files.kde.org/plasma/kwin/effect-videos/magic_lamp.ogv"
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
set(magnifier_SOURCES
|
||||
magnifier.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
kconfig_add_kcfg_files(magnifier_SOURCES
|
||||
|
|
19
src/effects/magnifier/main.cpp
Normal file
19
src/effects/magnifier/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "magnifier.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(MagnifierEffectFactory,
|
||||
MagnifierEffect,
|
||||
"metadata.json",
|
||||
return MagnifierEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
18
src/effects/magnifier/metadata.json
Normal file
18
src/effects/magnifier/metadata.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Accessibility",
|
||||
"Description": "Magnify the section of the screen that is near the mouse cursor",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "magnifier",
|
||||
"License": "GPL",
|
||||
"Name": "Magnifier",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_magnifier_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"exclusiveGroup": "magnifiers",
|
||||
"video": "https://files.kde.org/plasma/kwin/effect-videos/magnifier.ogv"
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
# Effect
|
||||
|
||||
set(mouseclick_SOURCES
|
||||
main.cpp
|
||||
mouseclick.cpp
|
||||
)
|
||||
|
||||
|
|
18
src/effects/mouseclick/main.cpp
Normal file
18
src/effects/mouseclick/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "mouseclick.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(MouseClickEffectFactory,
|
||||
MouseClickEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
17
src/effects/mouseclick/metadata.json
Normal file
17
src/effects/mouseclick/metadata.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Accessibility",
|
||||
"Description": "Creates an animation whenever a mouse button is clicked. This is useful for screenrecordings/presentations",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "mouseclick",
|
||||
"License": "GPL",
|
||||
"Name": "Mouse Click Animation",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_mouseclick_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"video": "https://files.kde.org/plasma/kwin/effect-videos/mouse_click.mp4"
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
# Effect
|
||||
|
||||
set(mousemark_SOURCES
|
||||
main.cpp
|
||||
mousemark.cpp
|
||||
)
|
||||
|
||||
|
|
18
src/effects/mousemark/main.cpp
Normal file
18
src/effects/mousemark/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "mousemark.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(MouseMarkEffectFactory,
|
||||
MouseMarkEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
14
src/effects/mousemark/metadata.json
Normal file
14
src/effects/mousemark/metadata.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Allows you to draw lines on the desktop",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "mousemark",
|
||||
"License": "GPL",
|
||||
"Name": "Mouse Mark",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_mousemark_config"
|
||||
}
|
|
@ -7,6 +7,7 @@ add_subdirectory(kcm)
|
|||
set(overview_SOURCES
|
||||
expoarea.cpp
|
||||
expolayout.cpp
|
||||
main.cpp
|
||||
overvieweffect.cpp
|
||||
)
|
||||
|
||||
|
|
19
src/effects/overview/main.cpp
Normal file
19
src/effects/overview/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "overvieweffect.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(OverviewEffectFactory,
|
||||
OverviewEffect,
|
||||
"metadata.json",
|
||||
return OverviewEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
17
src/effects/overview/metadata.json
Normal file
17
src/effects/overview/metadata.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Window Management",
|
||||
"Description": "Allows you to overview virtual desktops and windows",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "overview",
|
||||
"License": "GPL",
|
||||
"Name": "Overview",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_overview_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"video": "https://files.kde.org/plasma/kwin/effect-videos/present_windows.mp4"
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
install(FILES main.qml DESTINATION ${KDE_INSTALL_DATADIR}/kwin/effects/presentwindows/)
|
||||
|
||||
set(presentwindows_SOURCES
|
||||
main.cpp
|
||||
presentwindows.cpp
|
||||
presentwindows_proxy.cpp
|
||||
)
|
||||
|
|
18
src/effects/presentwindows/main.cpp
Normal file
18
src/effects/presentwindows/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "presentwindows.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(PresentWindowsEffectFactory,
|
||||
PresentWindowsEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
17
src/effects/presentwindows/metadata.json
Normal file
17
src/effects/presentwindows/metadata.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Window Management",
|
||||
"Description": "Zoom out until all opened windows can be displayed side-by-side",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "presentwindows",
|
||||
"License": "GPL",
|
||||
"Name": "Present Windows",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_presentwindows_config",
|
||||
"org.kde.kwin.effect": {
|
||||
"video": "https://files.kde.org/plasma/kwin/effect-videos/present_windows.mp4"
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
# Effect
|
||||
|
||||
set(resize_SOURCES
|
||||
main.cpp
|
||||
resize.cpp
|
||||
)
|
||||
|
||||
|
|
18
src/effects/resize/main.cpp
Normal file
18
src/effects/resize/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "resize.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(ResizeEffectFactory,
|
||||
ResizeEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
14
src/effects/resize/metadata.json
Normal file
14
src/effects/resize/metadata.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Window Management",
|
||||
"Description": "Resizes windows with a fast texture scale instead of updating contents",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "resize",
|
||||
"License": "GPL",
|
||||
"Name": "Resize Window",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_resize_config"
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
# Source files
|
||||
set(screenedge_SOURCES
|
||||
main.cpp
|
||||
screenedgeeffect.cpp
|
||||
)
|
||||
|
||||
|
|
18
src/effects/screenedge/main.cpp
Normal file
18
src/effects/screenedge/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "screenedgeeffect.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(ScreenEdgeEffectFactory,
|
||||
ScreenEdgeEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
13
src/effects/screenedge/metadata.json
Normal file
13
src/effects/screenedge/metadata.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Highlights a screen edge when approaching",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "screenedge",
|
||||
"License": "GPL",
|
||||
"Name": "Screen Edge",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
# Source files
|
||||
set(screenshot_SOURCES
|
||||
main.cpp
|
||||
screenshot.cpp
|
||||
screenshotdbusinterface1.cpp
|
||||
screenshotdbusinterface2.cpp
|
||||
|
|
19
src/effects/screenshot/main.cpp
Normal file
19
src/effects/screenshot/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "screenshot.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(ScreenShotEffectFactory,
|
||||
ScreenShotEffect,
|
||||
"metadata.json",
|
||||
return ScreenShotEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
16
src/effects/screenshot/metadata.json
Normal file
16
src/effects/screenshot/metadata.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Helper effect for screenshot tools",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "screenshot",
|
||||
"License": "GPL",
|
||||
"Name": "Screenshot",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"org.kde.kwin.effect": {
|
||||
"internal": true
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
# Effect
|
||||
|
||||
set(screentransform_SOURCES
|
||||
main.cpp
|
||||
screentransform.cpp
|
||||
)
|
||||
|
||||
|
|
19
src/effects/screentransform/main.cpp
Normal file
19
src/effects/screentransform/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "screentransform.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(ScreenTransformEffectFactory,
|
||||
ScreenTransformEffect,
|
||||
"metadata.json",
|
||||
return ScreenTransformEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
16
src/effects/screentransform/metadata.json
Normal file
16
src/effects/screentransform/metadata.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Animates display transformations",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "screentransform",
|
||||
"License": "GPL",
|
||||
"Name": "Transform",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"org.kde.kwin.effect": {
|
||||
"internal": true
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
# Source files
|
||||
set(sheet_SOURCES
|
||||
main.cpp
|
||||
sheet.cpp
|
||||
)
|
||||
kconfig_add_kcfg_files(sheet_SOURCES sheetconfig.kcfgc)
|
||||
|
|
19
src/effects/sheet/main.cpp
Normal file
19
src/effects/sheet/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "sheet.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(SheetEffectFactory,
|
||||
SheetEffect,
|
||||
"metadata.json",
|
||||
return SheetEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
13
src/effects/sheet/metadata.json
Normal file
13
src/effects/sheet/metadata.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Appearance",
|
||||
"Description": "Make modal dialogs smoothly fly in and out when they are shown or hidden",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "sheet",
|
||||
"License": "GPL",
|
||||
"Name": "Sheet",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
# Effect
|
||||
|
||||
set(showfps_SOURCES
|
||||
main.cpp
|
||||
showfps.cpp
|
||||
)
|
||||
|
||||
|
|
18
src/effects/showfps/main.cpp
Normal file
18
src/effects/showfps/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "showfps.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(ShowFpsEffectFactory,
|
||||
ShowFpsEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
14
src/effects/showfps/metadata.json
Normal file
14
src/effects/showfps/metadata.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Tools",
|
||||
"Description": "Display KWin's performance in the corner of the screen",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "showfps",
|
||||
"License": "GPL",
|
||||
"Name": "Show FPS",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_showfps_config"
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
# Effect
|
||||
|
||||
set(showpaint_SOURCES
|
||||
main.cpp
|
||||
showpaint.cpp
|
||||
)
|
||||
|
||||
|
|
18
src/effects/showpaint/main.cpp
Normal file
18
src/effects/showpaint/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "showpaint.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY(ShowPaintEffectFactory,
|
||||
ShowPaintEffect,
|
||||
"metadata.json")
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
14
src/effects/showpaint/metadata.json
Normal file
14
src/effects/showpaint/metadata.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"KPlugin": {
|
||||
"Category": "Tools",
|
||||
"Description": "Highlight areas of the desktop that have been recently updated",
|
||||
"EnabledByDefault": false,
|
||||
"Id": "showpaint",
|
||||
"License": "GPL",
|
||||
"Name": "Show Paint",
|
||||
"ServiceTypes": [
|
||||
"KWin/Effect"
|
||||
]
|
||||
},
|
||||
"X-KDE-ConfigModule": "kwin_showpaint_config"
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
# Effect
|
||||
|
||||
set(slide_SOURCES
|
||||
main.cpp
|
||||
slide.cpp
|
||||
)
|
||||
|
||||
|
|
19
src/effects/slide/main.cpp
Normal file
19
src/effects/slide/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "slide.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_FACTORY_SUPPORTED(SlideEffectFactory,
|
||||
SlideEffect,
|
||||
"metadata.json",
|
||||
return SlideEffect::supported();)
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "main.moc"
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue