diff options
Diffstat (limited to 'src/client/qwaylandintegration_p.h')
-rw-r--r-- | src/client/qwaylandintegration_p.h | 75 |
1 files changed, 31 insertions, 44 deletions
diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h index a66999c7f..f26cc3d29 100644 --- a/src/client/qwaylandintegration_p.h +++ b/src/client/qwaylandintegration_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or 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.GPL2 and 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-2.0.html and -** 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 LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPLATFORMINTEGRATION_WAYLAND_H #define QPLATFORMINTEGRATION_WAYLAND_H @@ -55,6 +19,7 @@ #include <qpa/qplatformintegration.h> #include <QtCore/QScopedPointer> #include <QtCore/QMutex> +#include <QtCore/private/qglobal_p.h> QT_BEGIN_NAMESPACE @@ -67,14 +32,19 @@ class QWaylandServerBufferIntegration; class QWaylandShellIntegration; class QWaylandInputDeviceIntegration; class QWaylandInputDevice; +class QWaylandScreen; +class QWaylandCursor; +class QWaylandPlatformServices; -class Q_WAYLAND_CLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration +class Q_WAYLANDCLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration { public: QWaylandIntegration(); ~QWaylandIntegration() override; - bool hasFailed() { return mFailed; } + static QWaylandIntegration *instance() { return sInstance; } + + bool init(); bool hasCapability(QPlatformIntegration::Capability cap) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; @@ -107,13 +77,23 @@ public: QWaylandDisplay *display() const; + Qt::KeyboardModifiers queryKeyboardModifiers() const override; + QList<int> possibleKeys(const QKeyEvent *event) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; - QWaylandInputDevice *createInputDevice(QWaylandDisplay *display, int version, uint32_t id); +#if QT_CONFIG(vulkan) + QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; +#endif + + void setApplicationBadge(qint64 number) override; + + virtual QWaylandInputDevice *createInputDevice(QWaylandDisplay *display, int version, uint32_t id) const; + virtual QWaylandScreen *createPlatformScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id) const; + virtual QWaylandCursor *createPlatformCursor(QWaylandDisplay *display) const; virtual QWaylandClientBufferIntegration *clientBufferIntegration() const; virtual QWaylandServerBufferIntegration *serverBufferIntegration() const; @@ -121,19 +101,25 @@ public: void reconfigureInputContext(); -private: +protected: // NOTE: mDisplay *must* be destructed after mDrag and mClientBufferIntegration // and mShellIntegration. // Do not move this definition into the private section at the bottom. QScopedPointer<QWaylandDisplay> mDisplay; protected: + void reset(); + virtual QPlatformNativeInterface *createPlatformNativeInterface(); + QScopedPointer<QWaylandClientBufferIntegration> mClientBufferIntegration; QScopedPointer<QWaylandServerBufferIntegration> mServerBufferIntegration; QScopedPointer<QWaylandShellIntegration> mShellIntegration; QScopedPointer<QWaylandInputDeviceIntegration> mInputDeviceIntegration; + QScopedPointer<QPlatformInputContext> mInputContext; + private: + void initializePlatform(); void initializeClientBufferIntegration(); void initializeServerBufferIntegration(); void initializeShellIntegration(); @@ -148,16 +134,17 @@ private: QScopedPointer<QPlatformDrag> mDrag; #endif QScopedPointer<QPlatformNativeInterface> mNativeInterface; - QScopedPointer<QPlatformInputContext> mInputContext; #if QT_CONFIG(accessibility) mutable QScopedPointer<QPlatformAccessibility> mAccessibility; #endif - bool mFailed = false; + QScopedPointer<QWaylandPlatformServices> mPlatformServices; QMutex mClientBufferInitLock; bool mClientBufferIntegrationInitialized = false; bool mServerBufferIntegrationInitialized = false; bool mShellIntegrationInitialized = false; + static QWaylandIntegration *sInstance; + friend class QWaylandDisplay; }; |