Commit 8deb2498 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Fix class names for data control wrappers

The data control protocol is unstable. Therefore, class names must have
"V1" suffix.
parent aac5265f
......@@ -27,9 +27,9 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "../../src/server/compositor_interface.h"
#include "../../src/server/display.h"
#include "../../src/server/seat_interface.h"
#include "../../src/server/datacontroldevice_interface.h"
#include "../../src/server/datacontroldevicemanager_interface.h"
#include "../../src/server/datacontrolsource_interface.h"
#include "../../src/server/datacontroldevice_v1_interface.h"
#include "../../src/server/datacontroldevicemanager_v1_interface.h"
#include "../../src/server/datacontrolsource_v1_interface.h"
#include <KWayland/Client/compositor.h>
#include <KWayland/Client/connection_thread.h>
......@@ -135,7 +135,7 @@ private:
SeatInterface *m_seat;
CompositorInterface *m_serverCompositor;
DataControlDeviceManagerInterface *m_dataControlDeviceManagerInterface;
DataControlDeviceManagerV1Interface *m_dataControlDeviceManagerInterface;
DataControlDeviceManager *m_dataControlDeviceManager;
......@@ -172,7 +172,7 @@ void DataControlInterfaceTest::initTestCase()
m_seat->create();
m_serverCompositor = m_display.createCompositor(this);
m_serverCompositor->create();
m_dataControlDeviceManagerInterface = m_display.createDataControlDeviceManager(this);
m_dataControlDeviceManagerInterface = m_display.createDataControlDeviceManagerV1(this);
QVERIFY(m_serverCompositor->isValid());
// setup connection
......
......@@ -7,10 +7,10 @@ set(SERVER_LIB_SRCS
clientconnection.cpp
compositor_interface.cpp
contrast_interface.cpp
datacontroldevice_interface.cpp
datacontroldevicemanager_interface.cpp
datacontroloffer_interface.cpp
datacontrolsource_interface.cpp
datacontroldevice_v1_interface.cpp
datacontroldevicemanager_v1_interface.cpp
datacontroloffer_v1_interface.cpp
datacontrolsource_v1_interface.cpp
datadevice_interface.cpp
datadevicemanager_interface.cpp
dataoffer_interface.cpp
......@@ -346,10 +346,10 @@ set(SERVER_LIB_HEADERS
clientconnection.h
compositor_interface.h
contrast_interface.h
datacontroldevice_interface.h
datacontroldevicemanager_interface.h
datacontroloffer_interface.h
datacontrolsource_interface.h
datacontroldevice_v1_interface.h
datacontroldevicemanager_v1_interface.h
datacontroloffer_v1_interface.h
datacontrolsource_v1_interface.h
datadevice_interface.h
datadevicemanager_interface.h
dataoffer_interface.h
......
......@@ -3,10 +3,10 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "datacontroldevice_interface.h"
#include "datacontroldevicemanager_interface.h"
#include "datacontroloffer_interface.h"
#include "datacontrolsource_interface.h"
#include "datacontroldevice_v1_interface.h"
#include "datacontroldevicemanager_v1_interface.h"
#include "datacontroloffer_v1_interface.h"
#include "datacontrolsource_v1_interface.h"
#include "display.h"
#include "seat_interface.h"
#include "surface_interface.h"
......@@ -18,16 +18,16 @@
namespace KWaylandServer
{
class DataControlDeviceInterfacePrivate: public QtWaylandServer::zwlr_data_control_device_v1
class DataControlDeviceV1InterfacePrivate: public QtWaylandServer::zwlr_data_control_device_v1
{
public:
DataControlDeviceInterfacePrivate(DataControlDeviceInterface *q, SeatInterface *seat, wl_resource *resource);
DataControlDeviceV1InterfacePrivate(DataControlDeviceV1Interface *q, SeatInterface *seat, wl_resource *resource);
DataControlOfferInterface *createDataOffer(AbstractDataSource *source);
DataControlOfferV1Interface *createDataOffer(AbstractDataSource *source);
DataControlDeviceInterface *q;
DataControlDeviceV1Interface *q;
QPointer<SeatInterface> seat;
QPointer<DataControlSourceInterface> selection;
QPointer<DataControlSourceV1Interface> selection;
protected:
void zwlr_data_control_device_v1_destroy_resource(Resource *resource) override;
......@@ -36,19 +36,19 @@ protected:
};
DataControlDeviceInterfacePrivate::DataControlDeviceInterfacePrivate(DataControlDeviceInterface *_q, SeatInterface *seat, wl_resource *resource)
DataControlDeviceV1InterfacePrivate::DataControlDeviceV1InterfacePrivate(DataControlDeviceV1Interface *_q, SeatInterface *seat, wl_resource *resource)
: QtWaylandServer::zwlr_data_control_device_v1(resource)
, q(_q)
, seat(seat)
{
}
void DataControlDeviceInterfacePrivate::zwlr_data_control_device_v1_set_selection(Resource *resource, wl_resource *source)
void DataControlDeviceV1InterfacePrivate::zwlr_data_control_device_v1_set_selection(Resource *resource, wl_resource *source)
{
DataControlSourceInterface *dataSource = nullptr;
DataControlSourceV1Interface *dataSource = nullptr;
if (source) {
dataSource = DataControlSourceInterface::get(source);
dataSource = DataControlSourceV1Interface::get(source);
Q_ASSERT(dataSource);
if (dataSource == seat->selection()) {
wl_resource_post_error(resource->handle, error::error_used_source,
......@@ -63,12 +63,12 @@ void DataControlDeviceInterfacePrivate::zwlr_data_control_device_v1_set_selectio
emit q->selectionChanged(selection);
}
void DataControlDeviceInterfacePrivate::zwlr_data_control_device_v1_destroy(QtWaylandServer::zwlr_data_control_device_v1::Resource *resource)
void DataControlDeviceV1InterfacePrivate::zwlr_data_control_device_v1_destroy(QtWaylandServer::zwlr_data_control_device_v1::Resource *resource)
{
wl_resource_destroy(resource->handle);
}
DataControlOfferInterface *DataControlDeviceInterfacePrivate::createDataOffer(AbstractDataSource *source)
DataControlOfferV1Interface *DataControlDeviceV1InterfacePrivate::createDataOffer(AbstractDataSource *source)
{
if (!source) {
// a data offer can only exist together with a source
......@@ -80,38 +80,38 @@ DataControlOfferInterface *DataControlDeviceInterfacePrivate::createDataOffer(Ab
return nullptr;
}
DataControlOfferInterface *offer = new DataControlOfferInterface(source, data_offer_resource);
DataControlOfferV1Interface *offer = new DataControlOfferV1Interface(source, data_offer_resource);
send_data_offer(offer->resource());
offer->sendAllOffers();
return offer;
}
void DataControlDeviceInterfacePrivate::zwlr_data_control_device_v1_destroy_resource(QtWaylandServer::zwlr_data_control_device_v1::Resource *resource)
void DataControlDeviceV1InterfacePrivate::zwlr_data_control_device_v1_destroy_resource(QtWaylandServer::zwlr_data_control_device_v1::Resource *resource)
{
Q_UNUSED(resource)
delete q;
}
DataControlDeviceInterface::DataControlDeviceInterface(SeatInterface *seat, wl_resource *resource)
DataControlDeviceV1Interface::DataControlDeviceV1Interface(SeatInterface *seat, wl_resource *resource)
: QObject()
, d(new DataControlDeviceInterfacePrivate(this, seat, resource))
, d(new DataControlDeviceV1InterfacePrivate(this, seat, resource))
{
seat->d_func()->registerDataControlDevice(this);
}
DataControlDeviceInterface::~DataControlDeviceInterface() = default;
DataControlDeviceV1Interface::~DataControlDeviceV1Interface() = default;
SeatInterface *DataControlDeviceInterface::seat() const
SeatInterface *DataControlDeviceV1Interface::seat() const
{
return d->seat;
}
DataControlSourceInterface *DataControlDeviceInterface::selection() const
DataControlSourceV1Interface *DataControlDeviceV1Interface::selection() const
{
return d->selection;
}
void DataControlDeviceInterface::sendSelection(AbstractDataSource *other)
void DataControlDeviceV1Interface::sendSelection(AbstractDataSource *other)
{
if (!other) {
sendClearSelection();
......@@ -124,7 +124,7 @@ void DataControlDeviceInterface::sendSelection(AbstractDataSource *other)
d->send_selection(r->resource());
}
void DataControlDeviceInterface::sendClearSelection()
void DataControlDeviceV1Interface::sendClearSelection()
{
d->send_selection(nullptr);
}
......
......@@ -16,9 +16,9 @@ namespace KWaylandServer
{
class AbstractDataSource;
class DataControlDeviceManagerInterface;
class DataControlOfferInterface;
class DataControlSourceInterface;
class DataControlDeviceManagerV1Interface;
class DataControlOfferV1Interface;
class DataControlSourceV1Interface;
class SeatInterface;
class SurfaceInterface;
......@@ -26,38 +26,38 @@ class SurfaceInterface;
* @brief Represents the Resource for the wl_data_device interface.
*
* @see SeatInterface
* @see DataControlSourceInterface
* @see DataControlSourceV1Interface
* Lifespan is mapped to the underlying object
**/
class DataControlDeviceInterfacePrivate;
class DataControlDeviceV1InterfacePrivate;
class KWAYLANDSERVER_EXPORT DataControlDeviceInterface : public QObject
class KWAYLANDSERVER_EXPORT DataControlDeviceV1Interface : public QObject
{
Q_OBJECT
public:
~DataControlDeviceInterface() override;
~DataControlDeviceV1Interface() override;
SeatInterface *seat() const;
DataControlSourceInterface *selection() const;
DataControlSourceV1Interface *selection() const;
void sendSelection(AbstractDataSource *other);
void sendClearSelection();
Q_SIGNALS:
void selectionChanged(KWaylandServer::DataControlSourceInterface*);
void selectionChanged(KWaylandServer::DataControlSourceV1Interface*);
void selectionCleared();
private:
friend class DataControlDeviceManagerInterfacePrivate;
explicit DataControlDeviceInterface(SeatInterface *seat, wl_resource *resource);
friend class DataControlDeviceManagerV1InterfacePrivate;
explicit DataControlDeviceV1Interface(SeatInterface *seat, wl_resource *resource);
QScopedPointer<DataControlDeviceInterfacePrivate> d;
QScopedPointer<DataControlDeviceV1InterfacePrivate> d;
};
}
Q_DECLARE_METATYPE(KWaylandServer::DataControlDeviceInterface*)
Q_DECLARE_METATYPE(KWaylandServer::DataControlDeviceV1Interface*)
#endif
......@@ -4,9 +4,9 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "datacontroldevicemanager_interface.h"
#include "datacontroldevice_interface.h"
#include "datacontrolsource_interface.h"
#include "datacontroldevicemanager_v1_interface.h"
#include "datacontroldevice_v1_interface.h"
#include "datacontrolsource_v1_interface.h"
#include "global_p.h"
#include "display.h"
#include "seat_interface_p.h"
......@@ -17,12 +17,12 @@ static const int s_version = 1;
namespace KWaylandServer
{
class DataControlDeviceManagerInterfacePrivate : public QtWaylandServer::zwlr_data_control_manager_v1
class DataControlDeviceManagerV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_manager_v1
{
public:
DataControlDeviceManagerInterfacePrivate(DataControlDeviceManagerInterface *q, Display *d);
DataControlDeviceManagerV1InterfacePrivate(DataControlDeviceManagerV1Interface *q, Display *d);
DataControlDeviceManagerInterface *q;
DataControlDeviceManagerV1Interface *q;
protected:
void zwlr_data_control_manager_v1_create_data_source(Resource *resource, uint32_t id) override;
......@@ -30,24 +30,24 @@ protected:
void zwlr_data_control_manager_v1_destroy(Resource *resource) override;
};
DataControlDeviceManagerInterfacePrivate::DataControlDeviceManagerInterfacePrivate(DataControlDeviceManagerInterface *q, Display *d)
DataControlDeviceManagerV1InterfacePrivate::DataControlDeviceManagerV1InterfacePrivate(DataControlDeviceManagerV1Interface *q, Display *d)
: QtWaylandServer::zwlr_data_control_manager_v1(*d, s_version)
, q(q)
{
}
void DataControlDeviceManagerInterfacePrivate::zwlr_data_control_manager_v1_create_data_source(Resource *resource, uint32_t id)
void DataControlDeviceManagerV1InterfacePrivate::zwlr_data_control_manager_v1_create_data_source(Resource *resource, uint32_t id)
{
wl_resource *data_source_resource = wl_resource_create(resource->client(), &zwlr_data_control_source_v1_interface, resource->version(), id);
if (!data_source_resource) {
wl_resource_post_no_memory(resource->handle);
return;
}
DataControlSourceInterface *dataSource = new DataControlSourceInterface(q, data_source_resource);
DataControlSourceV1Interface *dataSource = new DataControlSourceV1Interface(q, data_source_resource);
emit q->dataSourceCreated(dataSource);
}
void DataControlDeviceManagerInterfacePrivate::zwlr_data_control_manager_v1_get_data_device(Resource *resource, uint32_t id, wl_resource *seat)
void DataControlDeviceManagerV1InterfacePrivate::zwlr_data_control_manager_v1_get_data_device(Resource *resource, uint32_t id, wl_resource *seat)
{
SeatInterface *s = SeatInterface::get(seat);
Q_ASSERT(s);
......@@ -60,22 +60,22 @@ void DataControlDeviceManagerInterfacePrivate::zwlr_data_control_manager_v1_get_
wl_resource_post_no_memory(resource->handle);
return;
}
DataControlDeviceInterface *dataDevice = new DataControlDeviceInterface(s, data_device_resource);
DataControlDeviceV1Interface *dataDevice = new DataControlDeviceV1Interface(s, data_device_resource);
emit q->dataDeviceCreated(dataDevice);
}
void DataControlDeviceManagerInterfacePrivate::zwlr_data_control_manager_v1_destroy(QtWaylandServer::zwlr_data_control_manager_v1::Resource *resource)
void DataControlDeviceManagerV1InterfacePrivate::zwlr_data_control_manager_v1_destroy(QtWaylandServer::zwlr_data_control_manager_v1::Resource *resource)
{
wl_resource_destroy(resource->handle);
}
DataControlDeviceManagerInterface::DataControlDeviceManagerInterface(Display *display, QObject *parent)
DataControlDeviceManagerV1Interface::DataControlDeviceManagerV1Interface(Display *display, QObject *parent)
: QObject(parent)
, d(new DataControlDeviceManagerInterfacePrivate(this, display))
, d(new DataControlDeviceManagerV1InterfacePrivate(this, display))
{
}
DataControlDeviceManagerInterface::~DataControlDeviceManagerInterface() = default;
DataControlDeviceManagerV1Interface::~DataControlDeviceManagerV1Interface() = default;
}
......@@ -14,29 +14,29 @@ namespace KWaylandServer
{
class Display;
class DataControlSourceInterface;
class DataControlDeviceManagerInterfacePrivate;
class DataControlDeviceInterface;
class DataControlSourceV1Interface;
class DataControlDeviceManagerV1InterfacePrivate;
class DataControlDeviceV1Interface;
/**
* @brief Represents the Global for zwlr_data_control_manager_v1 interface.
*
**/
class KWAYLANDSERVER_EXPORT DataControlDeviceManagerInterface : public QObject
class KWAYLANDSERVER_EXPORT DataControlDeviceManagerV1Interface : public QObject
{
Q_OBJECT
public:
~DataControlDeviceManagerInterface() override;
~DataControlDeviceManagerV1Interface() override;
Q_SIGNALS:
void dataSourceCreated(KWaylandServer::DataControlSourceInterface *dataSource);
void dataDeviceCreated(KWaylandServer::DataControlDeviceInterface *dataDevice);
void dataSourceCreated(KWaylandServer::DataControlSourceV1Interface *dataSource);
void dataDeviceCreated(KWaylandServer::DataControlDeviceV1Interface *dataDevice);
private:
explicit DataControlDeviceManagerInterface(Display *display, QObject *parent = nullptr);
explicit DataControlDeviceManagerV1Interface(Display *display, QObject *parent = nullptr);
friend class Display;
QScopedPointer<DataControlDeviceManagerInterfacePrivate> d;
QScopedPointer<DataControlDeviceManagerV1InterfacePrivate> d;
};
}
......
......@@ -3,9 +3,9 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "datacontroloffer_interface.h"
#include "datacontroldevice_interface.h"
#include "datacontrolsource_interface.h"
#include "datacontroloffer_v1_interface.h"
#include "datacontroldevice_v1_interface.h"
#include "datacontrolsource_v1_interface.h"
// Qt
#include <QStringList>
#include <QPointer>
......@@ -17,12 +17,12 @@
namespace KWaylandServer
{
class DataControlOfferInterfacePrivate : public QtWaylandServer::zwlr_data_control_offer_v1
class DataControlOfferV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_offer_v1
{
public:
DataControlOfferInterfacePrivate(DataControlOfferInterface *q, AbstractDataSource *source, wl_resource *resource);
DataControlOfferV1InterfacePrivate(DataControlOfferV1Interface *q, AbstractDataSource *source, wl_resource *resource);
DataControlOfferInterface *q;
DataControlOfferV1Interface *q;
QPointer<AbstractDataSource> source;
protected:
......@@ -31,25 +31,25 @@ protected:
void zwlr_data_control_offer_v1_destroy_resource(Resource *resource) override;
};
DataControlOfferInterfacePrivate::DataControlOfferInterfacePrivate(DataControlOfferInterface *_q, AbstractDataSource *source, wl_resource *resource)
DataControlOfferV1InterfacePrivate::DataControlOfferV1InterfacePrivate(DataControlOfferV1Interface *_q, AbstractDataSource *source, wl_resource *resource)
: QtWaylandServer::zwlr_data_control_offer_v1(resource)
, q(_q)
, source(source)
{
}
void DataControlOfferInterfacePrivate::zwlr_data_control_offer_v1_destroy(QtWaylandServer::zwlr_data_control_offer_v1::Resource *resource)
void DataControlOfferV1InterfacePrivate::zwlr_data_control_offer_v1_destroy(QtWaylandServer::zwlr_data_control_offer_v1::Resource *resource)
{
wl_resource_destroy(resource->handle);
}
void DataControlOfferInterfacePrivate::zwlr_data_control_offer_v1_destroy_resource(QtWaylandServer::zwlr_data_control_offer_v1::Resource *resource)
void DataControlOfferV1InterfacePrivate::zwlr_data_control_offer_v1_destroy_resource(QtWaylandServer::zwlr_data_control_offer_v1::Resource *resource)
{
Q_UNUSED(resource)
delete q;
}
void DataControlOfferInterfacePrivate::zwlr_data_control_offer_v1_receive(Resource *resource, const QString &mimeType, qint32 fd)
void DataControlOfferV1InterfacePrivate::zwlr_data_control_offer_v1_receive(Resource *resource, const QString &mimeType, qint32 fd)
{
Q_UNUSED(resource)
if (!source) {
......@@ -59,9 +59,9 @@ void DataControlOfferInterfacePrivate::zwlr_data_control_offer_v1_receive(Resour
source->requestData(mimeType, fd);
}
DataControlOfferInterface::DataControlOfferInterface(AbstractDataSource *source, wl_resource *resource)
DataControlOfferV1Interface::DataControlOfferV1Interface(AbstractDataSource *source, wl_resource *resource)
: QObject()
, d(new DataControlOfferInterfacePrivate(this, source, resource))
, d(new DataControlOfferV1InterfacePrivate(this, source, resource))
{
Q_ASSERT(source);
connect(source, &AbstractDataSource::mimeTypeOffered, this,
......@@ -71,9 +71,9 @@ DataControlOfferInterface::DataControlOfferInterface(AbstractDataSource *source,
);
}
DataControlOfferInterface::~DataControlOfferInterface() = default;
DataControlOfferV1Interface::~DataControlOfferV1Interface() = default;
void DataControlOfferInterface::sendAllOffers()
void DataControlOfferV1Interface::sendAllOffers()
{
Q_ASSERT(d->source);
for (const QString &mimeType : d->source->mimeTypes()) {
......@@ -81,7 +81,7 @@ void DataControlOfferInterface::sendAllOffers()
}
}
wl_resource *DataControlOfferInterface::resource() const
wl_resource *DataControlOfferV1Interface::resource() const
{
return d->resource()->handle;
}
......
......@@ -10,7 +10,7 @@
#include <KWaylandServer/kwaylandserver_export.h>
#include "datacontroldevicemanager_interface.h"
#include "datacontroldevicemanager_v1_interface.h"
struct wl_resource;
......@@ -18,33 +18,33 @@ namespace KWaylandServer
{
class AbstractDataSource;
class DataControlDeviceInterface;
class DataControlSourceInterface;
class DataControlOfferInterfacePrivate;
class DataControlDeviceV1Interface;
class DataControlSourceV1Interface;
class DataControlOfferV1InterfacePrivate;
/**
* @brief Represents the Resource for the wl_data_offer interface.
* Lifespan is mapped to the underlying object
**/
class KWAYLANDSERVER_EXPORT DataControlOfferInterface : public QObject
class KWAYLANDSERVER_EXPORT DataControlOfferV1Interface : public QObject
{
Q_OBJECT
public:
~DataControlOfferInterface() override;
~DataControlOfferV1Interface() override;
void sendAllOffers();
wl_resource *resource() const;
private:
friend class DataControlDeviceInterfacePrivate;
explicit DataControlOfferInterface(AbstractDataSource *source, wl_resource *resource);
friend class DataControlDeviceV1InterfacePrivate;
explicit DataControlOfferV1Interface(AbstractDataSource *source, wl_resource *resource);
QScopedPointer<DataControlOfferInterfacePrivate> d;
QScopedPointer<DataControlOfferV1InterfacePrivate> d;
};
}
Q_DECLARE_METATYPE(KWaylandServer::DataControlOfferInterface*)
Q_DECLARE_METATYPE(KWaylandServer::DataControlOfferV1Interface*)
#endif
......@@ -3,8 +3,8 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "datacontrolsource_interface.h"
#include "datacontroldevicemanager_interface.h"
#include "datacontrolsource_v1_interface.h"
#include "datacontroldevicemanager_v1_interface.h"
#include "clientconnection.h"
#include "resource_p.h"
// Qt
......@@ -17,13 +17,13 @@
namespace KWaylandServer
{
class DataControlSourceInterfacePrivate : public QtWaylandServer::zwlr_data_control_source_v1
class DataControlSourceV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_source_v1
{
public:
DataControlSourceInterfacePrivate(DataControlSourceInterface *q, ::wl_resource *resource);
DataControlSourceV1InterfacePrivate(DataControlSourceV1Interface *q, ::wl_resource *resource);
QStringList mimeTypes;
DataControlSourceInterface *q;
DataControlSourceV1Interface *q;
protected:
void zwlr_data_control_source_v1_destroy_resource(Resource *resource) override;
......@@ -31,61 +31,61 @@ protected:
void zwlr_data_control_source_v1_destroy(Resource *resource) override;
};
DataControlSourceInterfacePrivate::DataControlSourceInterfacePrivate(DataControlSourceInterface *_q, ::wl_resource *resource)
DataControlSourceV1InterfacePrivate::DataControlSourceV1InterfacePrivate(DataControlSourceV1Interface *_q, ::wl_resource *resource)
: QtWaylandServer::zwlr_data_control_source_v1(resource)
, q(_q)
{
}
void DataControlSourceInterfacePrivate::zwlr_data_control_source_v1_destroy_resource(QtWaylandServer::zwlr_data_control_source_v1::Resource *resource)
void DataControlSourceV1InterfacePrivate::zwlr_data_control_source_v1_destroy_resource(QtWaylandServer::zwlr_data_control_source_v1::Resource *resource)
{
Q_UNUSED(resource)
delete q;
}
void DataControlSourceInterfacePrivate::zwlr_data_control_source_v1_offer(Resource *, const QString &mimeType)
void DataControlSourceV1InterfacePrivate::zwlr_data_control_source_v1_offer(Resource *, const QString &mimeType)
{
mimeTypes << mimeType;
emit q->mimeTypeOffered(mimeType);
}
void DataControlSourceInterfacePrivate::zwlr_data_control_source_v1_destroy(QtWaylandServer::zwlr_data_control_source_v1::Resource *resource)
void DataControlSourceV1InterfacePrivate::zwlr_data_control_source_v1_destroy(QtWaylandServer::zwlr_data_control_source_v1::Resource *resource)
{
wl_resource_destroy(resource->handle);
}
DataControlSourceInterface::DataControlSourceInterface(DataControlDeviceManagerInterface *parent, ::wl_resource *resource)
DataControlSourceV1Interface::DataControlSourceV1Interface(DataControlDeviceManagerV1Interface *parent, ::wl_resource *resource)
: AbstractDataSource(nullptr, parent)
, d(new DataControlSourceInterfacePrivate(this, resource))
, d(new DataControlSourceV1InterfacePrivate(this, resource))
{
}
DataControlSourceInterface::~DataControlSourceInterface() = default;
DataControlSourceV1Interface::~DataControlSourceV1Interface() = default;
void DataControlSourceInterface::requestData(const QString &mimeType, qint32 fd)
void DataControlSourceV1Interface::requestData(const QString &mimeType, qint32 fd)
{
d->send_send(mimeType, fd);
close(fd);
}
void DataControlSourceInterface::cancel()
void DataControlSourceV1Interface::cancel()
{
d->send_cancelled();
}
QStringList DataControlSourceInterface::mimeTypes() const
QStringList DataControlSourceV1Interface::mimeTypes() const
{
return d->mimeTypes;
}