| 1 | // Copyright (C) 2021 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QPLATFORMINTEGRATION_VKKHRDISPLAY_H |
| 5 | #define QPLATFORMINTEGRATION_VKKHRDISPLAY_H |
| 6 | |
| 7 | #include <qpa/qplatformintegration.h> |
| 8 | #include <qpa/qplatformnativeinterface.h> |
| 9 | #include <qpa/qplatformscreen.h> |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | class QVkKhrDisplayScreen; |
| 14 | class QVkKhrDisplayVulkanInstance; |
| 15 | class QFbVtHandler; |
| 16 | |
| 17 | class QVkKhrDisplayIntegration : public QPlatformIntegration, public QPlatformNativeInterface |
| 18 | { |
| 19 | public: |
| 20 | explicit QVkKhrDisplayIntegration(const QStringList ¶meters); |
| 21 | ~QVkKhrDisplayIntegration(); |
| 22 | |
| 23 | void initialize() override; |
| 24 | |
| 25 | bool hasCapability(QPlatformIntegration::Capability cap) const override; |
| 26 | QPlatformFontDatabase *fontDatabase() const override; |
| 27 | QPlatformServices *services() const override; |
| 28 | QPlatformInputContext *inputContext() const override; |
| 29 | QPlatformTheme *createPlatformTheme(const QString &name) const override; |
| 30 | QPlatformNativeInterface *nativeInterface() const override; |
| 31 | |
| 32 | QPlatformWindow *createPlatformWindow(QWindow *window) const override; |
| 33 | QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; |
| 34 | QAbstractEventDispatcher *createEventDispatcher() const override; |
| 35 | QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; |
| 36 | |
| 37 | void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) override; |
| 38 | |
| 39 | private: |
| 40 | static void handleInstanceCreated(QVkKhrDisplayVulkanInstance *, void *); |
| 41 | void createInputHandlers(); |
| 42 | |
| 43 | mutable QPlatformFontDatabase *m_fontDatabase = nullptr; |
| 44 | mutable QPlatformServices *m_services = nullptr; |
| 45 | QPlatformInputContext *m_inputContext = nullptr; |
| 46 | QFbVtHandler *m_vtHandler = nullptr; |
| 47 | QVkKhrDisplayScreen *m_primaryScreen = nullptr; |
| 48 | }; |
| 49 | |
| 50 | QT_END_NAMESPACE |
| 51 | |
| 52 | #endif |
| 53 |
