c766e5da6d
The scripting api is not suitable for implementing all features that should not be implemented in libkwin. For example, the krunner integration or screencasting are the things that don't belong to be compiled right into kwin and yet we don't have any other choice. This change introduces a quick and dirty plugin infrastructure that can be used to implement things such as colord integration, krunner integration, etc.
46 lines
925 B
C++
46 lines
925 B
C++
/*
|
|
SPDX-FileCopyrightText: 2018-2020 Red Hat Inc
|
|
SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
|
|
SPDX-FileContributor: Jan Grulich <jgrulich@redhat.com>
|
|
|
|
SPDX-License-Identifier: LGPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QDebug>
|
|
#include <QObject>
|
|
|
|
#include <pipewire/pipewire.h>
|
|
#include <spa/utils/hook.h>
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
class PipeWireCore : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
PipeWireCore();
|
|
|
|
static void onCoreError(void *data, uint32_t id, int seq, int res, const char *message);
|
|
|
|
~PipeWireCore();
|
|
|
|
bool init();
|
|
|
|
static QSharedPointer<PipeWireCore> self();
|
|
|
|
struct pw_core *pwCore = nullptr;
|
|
struct pw_context *pwContext = nullptr;
|
|
struct pw_loop *pwMainLoop = nullptr;
|
|
spa_hook coreListener;
|
|
QString m_error;
|
|
|
|
pw_core_events pwCoreEvents = {};
|
|
|
|
Q_SIGNALS:
|
|
void pipewireFailed(const QString &message);
|
|
};
|
|
|
|
} // namespace KWin
|