summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/wayland_wrapper')
-rw-r--r--src/compositor/wayland_wrapper/qwlbuffermanager.cpp60
-rw-r--r--src/compositor/wayland_wrapper/qwlbuffermanager_p.h34
-rw-r--r--src/compositor/wayland_wrapper/qwlclientbuffer.cpp39
-rw-r--r--src/compositor/wayland_wrapper/qwlclientbuffer_p.h38
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevice.cpp49
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevice_p.h30
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevicemanager.cpp38
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevicemanager_p.h30
-rw-r--r--src/compositor/wayland_wrapper/qwldataoffer.cpp30
-rw-r--r--src/compositor/wayland_wrapper/qwldataoffer_p.h30
-rw-r--r--src/compositor/wayland_wrapper/qwldatasource.cpp30
-rw-r--r--src/compositor/wayland_wrapper/qwldatasource_p.h30
-rw-r--r--src/compositor/wayland_wrapper/qwlregion.cpp30
-rw-r--r--src/compositor/wayland_wrapper/qwlregion_p.h33
14 files changed, 86 insertions, 415 deletions
diff --git a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp
index 9a7b58299..7eb000ba4 100644
--- a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp
+++ b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qwlbuffermanager_p.h"
#include <QWaylandCompositor>
@@ -55,6 +29,16 @@ struct buffer_manager_destroy_listener : wl_listener
BufferManager *d = nullptr;
};
+void BufferManager::registerBuffer(wl_resource *buffer_resource, ClientBuffer *clientBuffer)
+{
+ m_buffers[buffer_resource] = clientBuffer;
+
+ auto *destroy_listener = new buffer_manager_destroy_listener;
+ destroy_listener->d = this;
+ wl_resource_add_destroy_listener(buffer_resource, destroy_listener);
+
+}
+
ClientBuffer *BufferManager::getBuffer(wl_resource *buffer_resource)
{
if (!buffer_resource)
@@ -64,17 +48,19 @@ ClientBuffer *BufferManager::getBuffer(wl_resource *buffer_resource)
if (it != m_buffers.end())
return it.value();
- auto bufferIntegration = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration();
ClientBuffer *newBuffer = nullptr;
- if (bufferIntegration)
- newBuffer = bufferIntegration->createBufferFor(buffer_resource);
- if (!newBuffer)
- newBuffer = new SharedMemoryBuffer(buffer_resource);
- m_buffers[buffer_resource] = newBuffer;
- auto *destroy_listener = new buffer_manager_destroy_listener;
- destroy_listener->d = this;
- wl_resource_add_destroy_listener(buffer_resource, destroy_listener);
+ for (auto *integration : QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegrations()) {
+ newBuffer = integration->createBufferFor(buffer_resource);
+ if (newBuffer)
+ break;
+ }
+
+ if (newBuffer)
+ registerBuffer(buffer_resource, newBuffer);
+ else
+ qCWarning(qLcWaylandCompositorHardwareIntegration) << "Could not create buffer for resource.";
+
return newBuffer;
}
diff --git a/src/compositor/wayland_wrapper/qwlbuffermanager_p.h b/src/compositor/wayland_wrapper/qwlbuffermanager_p.h
index d6eaeb79d..4a43a1a28 100644
--- a/src/compositor/wayland_wrapper/qwlbuffermanager_p.h
+++ b/src/compositor/wayland_wrapper/qwlbuffermanager_p.h
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QWLBUFFERMANAGER_H
#define QWLBUFFERMANAGER_H
@@ -42,6 +16,7 @@
//
#include <QtCore/QObject>
+#include <QtCore/QHash>
#include "qwlclientbuffer_p.h"
QT_BEGIN_NAMESPACE
@@ -51,11 +26,12 @@ namespace QtWayland {
class ClientBuffer;
-class Q_WAYLAND_COMPOSITOR_EXPORT BufferManager : public QObject
+class Q_WAYLANDCOMPOSITOR_EXPORT BufferManager : public QObject
{
public:
BufferManager(QWaylandCompositor *compositor);
ClientBuffer *getBuffer(struct ::wl_resource *buffer_resource);
+ void registerBuffer(struct ::wl_resource *buffer_resource, ClientBuffer *clientBuffer);
private:
friend struct buffer_manager_destroy_listener;
static void destroy_listener_callback(wl_listener *listener, void *data);
diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp
index 381b173f6..55de6573a 100644
--- a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp
+++ b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qwlclientbuffer_p.h"
@@ -123,6 +97,12 @@ QWaylandSurface::Origin SharedMemoryBuffer::origin() const
return QWaylandSurface::OriginTopLeft;
}
+static void shmBufferCleanup(void *data)
+{
+ auto *pool = static_cast<struct wl_shm_pool *>(data);
+ wl_shm_pool_unref(pool);
+}
+
QImage SharedMemoryBuffer::image() const
{
if (wl_shm_buffer *shmBuffer = wl_shm_buffer_get(m_buffer)) {
@@ -134,8 +114,9 @@ QImage SharedMemoryBuffer::image() const
wl_shm_format shmFormat = wl_shm_format(wl_shm_buffer_get_format(shmBuffer));
QImage::Format format = QWaylandSharedMemoryFormatHelper::fromWaylandShmFormat(shmFormat);
+ auto *pool = wl_shm_buffer_ref_pool(shmBuffer);
uchar *data = static_cast<uchar *>(wl_shm_buffer_get_data(shmBuffer));
- return QImage(data, width, height, bytesPerLine, format);
+ return QImage(data, width, height, bytesPerLine, format, &shmBufferCleanup, pool);
}
return QImage();
diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h
index a6503e86e..424243873 100644
--- a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h
+++ b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QWLCLIENTBUFFER_P_H
#define QWLCLIENTBUFFER_P_H
@@ -48,6 +22,7 @@
#include <QtWaylandCompositor/QWaylandSurface>
#include <QtWaylandCompositor/QWaylandBufferRef>
+#include <QtCore/private/qglobal_p.h>
#include <wayland-server-core.h>
@@ -66,7 +41,7 @@ struct surface_buffer_destroy_listener
class ClientBuffer *surfaceBuffer = nullptr;
};
-class Q_WAYLAND_COMPOSITOR_EXPORT ClientBuffer
+class Q_WAYLANDCOMPOSITOR_EXPORT ClientBuffer
{
public:
ClientBuffer(struct ::wl_resource *bufferResource);
@@ -86,6 +61,8 @@ public:
virtual void setCommitted(QRegion &damage);
bool isDestroyed() { return m_destroyed; }
+ virtual bool isProtected() { return false; }
+
inline struct ::wl_resource *waylandBufferHandle() const { return m_buffer; }
bool isSharedMemory() const { return wl_shm_buffer_get(m_buffer); }
@@ -95,6 +72,7 @@ public:
#endif
static bool hasContent(ClientBuffer *buffer) { return buffer && buffer->waylandBufferHandle(); }
+ static bool hasProtectedContent(ClientBuffer *buffer) { return buffer && buffer->isProtected(); }
protected:
void ref();
@@ -116,7 +94,7 @@ private:
friend class BufferManager;
};
-class Q_WAYLAND_COMPOSITOR_EXPORT SharedMemoryBuffer : public ClientBuffer
+class Q_WAYLANDCOMPOSITOR_EXPORT SharedMemoryBuffer : public ClientBuffer
{
public:
SharedMemoryBuffer(struct ::wl_resource *bufferResource);
diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp
index a3a795f9b..440401d05 100644
--- a/src/compositor/wayland_wrapper/qwldatadevice.cpp
+++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qwldatadevice_p.h"
@@ -76,6 +50,9 @@ void DataDevice::sourceDestroyed(DataSource *source)
{
if (m_selectionSource == source)
m_selectionSource = nullptr;
+
+ if (m_dragDataSource == source)
+ m_dragDataSource = nullptr;
}
#if QT_CONFIG(draganddrop)
@@ -105,9 +82,11 @@ void DataDevice::setDragFocus(QWaylandSurface *focus, const QPointF &localPositi
if (m_dragDataSource && !offer)
return;
- send_enter(resource->handle, serial, focus->resource(),
- wl_fixed_from_double(localPosition.x()), wl_fixed_from_double(localPosition.y()),
- offer->resource()->handle);
+ if (offer) {
+ send_enter(resource->handle, serial, focus->resource(),
+ wl_fixed_from_double(localPosition.x()), wl_fixed_from_double(localPosition.y()),
+ offer->resource()->handle);
+ }
m_dragFocus = focus;
m_dragFocusResource = resource;
@@ -127,7 +106,7 @@ void DataDevice::dragMove(QWaylandSurface *target, const QPointF &pos)
{
if (target != m_dragFocus)
setDragFocus(target, pos);
- if (!target)
+ if (!target || !m_dragFocusResource)
return;
uint time = m_compositor->currentTimeMsecs(); //### should be serial
send_motion(m_dragFocusResource->handle, time,
@@ -139,7 +118,7 @@ void DataDevice::drop()
if (m_dragFocusResource) {
send_drop(m_dragFocusResource->handle);
setDragFocus(nullptr, QPoint());
- } else {
+ } else if (m_dragDataSource) {
m_dragDataSource->cancel();
}
m_dragOrigin = nullptr;
@@ -150,11 +129,13 @@ void DataDevice::cancelDrag()
{
setDragFocus(nullptr, QPoint());
}
-
+
void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial)
{
m_dragClient = resource->client();
m_dragDataSource = source ? DataSource::fromResource(source) : nullptr;
+ if (m_dragDataSource)
+ m_dragDataSource->setDevice(this);
m_dragOrigin = QWaylandSurface::fromResource(origin);
QWaylandDrag *drag = m_seat->drag();
setDragIcon(icon ? QWaylandSurface::fromResource(icon) : nullptr);
diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h
index 18a97e8ca..839d93881 100644
--- a/src/compositor/wayland_wrapper/qwldatadevice_p.h
+++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef WLDATADEVICE_H
#define WLDATADEVICE_H
diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
index 46df52109..04add014f 100644
--- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
+++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qwldatadevicemanager_p.h"
@@ -93,7 +67,7 @@ void DataDeviceManager::retain()
{
QList<QString> offers = m_current_selection_source->mimeTypes();
finishReadFromClient();
- if (m_retainedReadIndex >= offers.count()) {
+ if (m_retainedReadIndex >= offers.size()) {
QWaylandCompositorPrivate::get(m_compositor)->feedRetainedSelectionData(&m_retainedData);
return;
}
@@ -107,7 +81,7 @@ void DataDeviceManager::retain()
fcntl(fd[0], F_SETFL, fcntl(fd[0], F_GETFL, 0) | O_NONBLOCK);
m_current_selection_source->send(mimeType, fd[1]);
m_retainedReadNotifier = new QSocketNotifier(fd[0], QSocketNotifier::Read, this);
- connect(m_retainedReadNotifier, SIGNAL(activated(int)), SLOT(readFromClient(int)));
+ connect(m_retainedReadNotifier, &QSocketNotifier::activated, this, &DataDeviceManager::readFromClient);
}
void DataDeviceManager::finishReadFromClient(bool exhausted)
@@ -130,7 +104,7 @@ void DataDeviceManager::finishReadFromClient(bool exhausted)
void DataDeviceManager::readFromClient(int fd)
{
static char buf[4096];
- int obsCount = m_obsoleteRetainedReadNotifiers.count();
+ int obsCount = m_obsoleteRetainedReadNotifiers.size();
for (int i = 0; i < obsCount; ++i) {
QSocketNotifier *sn = m_obsoleteRetainedReadNotifiers.at(i);
if (sn->socket() == fd) {
@@ -271,3 +245,5 @@ const struct wl_data_offer_interface DataDeviceManager::compositor_offer_interfa
} //namespace
QT_END_NAMESPACE
+
+#include "moc_qwldatadevicemanager_p.cpp"
diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h
index 730e22190..954a4c355 100644
--- a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h
+++ b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef WLDATADEVICEMANAGER_H
#define WLDATADEVICEMANAGER_H
diff --git a/src/compositor/wayland_wrapper/qwldataoffer.cpp b/src/compositor/wayland_wrapper/qwldataoffer.cpp
index 06c5118df..a612ca682 100644
--- a/src/compositor/wayland_wrapper/qwldataoffer.cpp
+++ b/src/compositor/wayland_wrapper/qwldataoffer.cpp
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qwldataoffer_p.h"
diff --git a/src/compositor/wayland_wrapper/qwldataoffer_p.h b/src/compositor/wayland_wrapper/qwldataoffer_p.h
index ef470a697..aeac6d62f 100644
--- a/src/compositor/wayland_wrapper/qwldataoffer_p.h
+++ b/src/compositor/wayland_wrapper/qwldataoffer_p.h
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef WLDATAOFFER_H
#define WLDATAOFFER_H
diff --git a/src/compositor/wayland_wrapper/qwldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp
index ff7ec024d..eba8ae302 100644
--- a/src/compositor/wayland_wrapper/qwldatasource.cpp
+++ b/src/compositor/wayland_wrapper/qwldatasource.cpp
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qwldatasource_p.h"
#include "qwldataoffer_p.h"
diff --git a/src/compositor/wayland_wrapper/qwldatasource_p.h b/src/compositor/wayland_wrapper/qwldatasource_p.h
index 5f6842f73..2f846e8a5 100644
--- a/src/compositor/wayland_wrapper/qwldatasource_p.h
+++ b/src/compositor/wayland_wrapper/qwldatasource_p.h
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef WLDATASOURCE_H
#define WLDATASOURCE_H
diff --git a/src/compositor/wayland_wrapper/qwlregion.cpp b/src/compositor/wayland_wrapper/qwlregion.cpp
index 69032c849..30511b773 100644
--- a/src/compositor/wayland_wrapper/qwlregion.cpp
+++ b/src/compositor/wayland_wrapper/qwlregion.cpp
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qwlregion_p.h"
diff --git a/src/compositor/wayland_wrapper/qwlregion_p.h b/src/compositor/wayland_wrapper/qwlregion_p.h
index bf036d182..b9e5d42e7 100644
--- a/src/compositor/wayland_wrapper/qwlregion_p.h
+++ b/src/compositor/wayland_wrapper/qwlregion_p.h
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef WL_REGION_H
#define WL_REGION_H
@@ -44,6 +18,7 @@
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
#include <QRegion>
+#include <private/qglobal_p.h>
#include <wayland-util.h>
#include <QtWaylandCompositor/private/qwayland-server-wayland.h>
@@ -52,7 +27,7 @@ QT_BEGIN_NAMESPACE
namespace QtWayland {
-class Q_WAYLAND_COMPOSITOR_EXPORT Region : public QtWaylandServer::wl_region
+class Q_WAYLANDCOMPOSITOR_EXPORT Region : public QtWaylandServer::wl_region
{
public:
Region(struct wl_client *client, uint32_t id);