1fb9f6f13a
The main advantage of SPDX license identifiers over the traditional license headers is that it's more difficult to overlook inappropriate licenses for kwin, for example GPL 3. We also don't have to copy a lot of boilerplate text. In order to create this change, I ran licensedigger -r -c from the toplevel source directory.
61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
/********************************************************************
|
|
KWin - the KDE window manager
|
|
This file is part of the KDE project.
|
|
|
|
SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*********************************************************************/
|
|
#ifndef KWIN_XWL_CLIPBOARD
|
|
#define KWIN_XWL_CLIPBOARD
|
|
|
|
#include "selection.h"
|
|
|
|
namespace KWaylandServer
|
|
{
|
|
class AbstractDataSource;
|
|
}
|
|
|
|
namespace KWin
|
|
{
|
|
namespace Xwl
|
|
{
|
|
|
|
/**
|
|
* Represents the X clipboard, which is on Wayland side just called
|
|
* @e selection.
|
|
*/
|
|
class Clipboard : public Selection
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Clipboard(xcb_atom_t atom, QObject *parent);
|
|
|
|
private:
|
|
void doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) override;
|
|
void x11OffersChanged(const QStringList &added, const QStringList &removed) override;
|
|
/**
|
|
* React to Wl selection change.
|
|
*/
|
|
void wlSelectionChanged(KWaylandServer::AbstractDataSource *dsi);
|
|
/**
|
|
* Check the current state of the selection and if a source needs
|
|
* to be created or destroyed.
|
|
*/
|
|
void checkWlSource();
|
|
|
|
/**
|
|
* Returns of dsi is managed by our data bridge
|
|
*/
|
|
bool ownsSelection(KWaylandServer::AbstractDataSource *dsi) const;
|
|
|
|
QMetaObject::Connection m_checkConnection;
|
|
|
|
Q_DISABLE_COPY(Clipboard)
|
|
};
|
|
|
|
} // namespace Xwl
|
|
} // namespace KWin
|
|
|
|
#endif
|