2020-11-07 19:34:55 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-11-17 08:59:08 +00:00
|
|
|
#include "effect/globals.h"
|
2020-11-07 19:34:55 +00:00
|
|
|
|
|
|
|
#include <QHash>
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include <KPluginMetaData>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class Plugin;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The PluginManager class loads and unloads binary compositor extensions.
|
|
|
|
*/
|
|
|
|
class KWIN_EXPORT PluginManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-07-20 09:52:22 +00:00
|
|
|
PluginManager();
|
2020-11-07 19:34:55 +00:00
|
|
|
~PluginManager() override;
|
|
|
|
|
|
|
|
QStringList loadedPlugins() const;
|
|
|
|
QStringList availablePlugins() const;
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
bool loadPlugin(const QString &pluginId);
|
|
|
|
void unloadPlugin(const QString &pluginId);
|
|
|
|
|
|
|
|
private:
|
2023-02-28 20:38:10 +00:00
|
|
|
bool loadPlugin(const KPluginMetaData &metadata);
|
2020-11-07 19:34:55 +00:00
|
|
|
|
2022-07-05 12:00:41 +00:00
|
|
|
std::map<QString, std::unique_ptr<Plugin>> m_plugins;
|
2020-11-07 19:34:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace KWin
|