93e0265e4e
Once in a while, we receive complaints from other fellow KDE developers about the file organization of kwin. This change addresses some of those complaints by moving all of source code in a separate directory, src/, thus making the project structure more traditional. Things such as tests are kept in their own toplevel directories. This change may wreak havoc on merge requests that add new files to kwin, but if a patch modifies an already existing file, git should be smart enough to figure out that the file has been relocated. We may potentially split the src/ directory further to make navigating the source code easier, but hopefully this is good enough already.
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
/*
|
|
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "kwinglobals.h"
|
|
|
|
#include <QHash>
|
|
#include <QObject>
|
|
#include <QStaticPlugin>
|
|
|
|
#include <KPluginMetaData>
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
class Plugin;
|
|
class PluginFactory;
|
|
|
|
/**
|
|
* The PluginManager class loads and unloads binary compositor extensions.
|
|
*/
|
|
class KWIN_EXPORT PluginManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
~PluginManager() override;
|
|
|
|
QStringList loadedPlugins() const;
|
|
QStringList availablePlugins() const;
|
|
|
|
public Q_SLOTS:
|
|
bool loadPlugin(const QString &pluginId);
|
|
void unloadPlugin(const QString &pluginId);
|
|
|
|
private:
|
|
bool loadStaticPlugin(const QString &pluginId);
|
|
bool loadDynamicPlugin(const KPluginMetaData &metadata);
|
|
bool loadDynamicPlugin(const QString &pluginId);
|
|
bool instantiatePlugin(const QString &pluginId, PluginFactory *factory);
|
|
|
|
QHash<QString, Plugin *> m_plugins;
|
|
QHash<QString, QStaticPlugin> m_staticPlugins;
|
|
KWIN_SINGLETON(PluginManager)
|
|
};
|
|
|
|
} // namespace KWin
|