7#include <qpa/qplatformwindow.h>
8#include <qpa/qplatformbackingstore.h>
9#include <qpa/qplatforminputcontextfactory_p.h>
10#include <qpa/qwindowsysteminterface.h>
12#include <QtGui/private/qguiapplication_p.h>
13#include <QtGui/private/qwindow_p.h>
14#include <QtGui/private/qgenericunixeventdispatcher_p.h>
15#include <QtGui/private/qgenericunixfontdatabase_p.h>
16#include <QtGui/private/qgenericunixthemes_p.h>
17#include <QtGui/private/qgenericunixservices_p.h>
19#include <QtFbSupport/private/qfbvthandler_p.h>
21#if QT_CONFIG(libinput)
22#include <QtInputSupport/private/qlibinputhandler_p.h>
26#include <QtInputSupport/private/qevdevmousemanager_p.h>
27#include <QtInputSupport/private/qevdevkeyboardmanager_p.h>
28#include <QtInputSupport/private/qevdevtouchmanager_p.h>
32#include <QtInputSupport/private/qtslib_p.h>
43 int depth()
const override {
return m_depth; }
60 qDebug() <<
"Screen will report geometry" << m_geometry;
66 if (
window->isTopLevel() &&
window->screen() == thisScreen)
82 VkSurfaceKHR m_surface = VK_NULL_HANDLE;
101 qWarning(
"Attempted to create Vulkan surface without an instance; was QWindow::setVulkanInstance() called?");
118 if (
rect != lastReportedGeometry)
154 delete m_fontDatabase;
173 m_primaryScreen->m_geometry =
QRect(0, 0, 1920, 1080);
174 m_primaryScreen->m_depth = 32;
184 createInputHandlers();
192 return m_fontDatabase;
205 return m_inputContext;
221 qWarning(
"vkkhrdisplay platform plugin only supports QWindow with surfaceType == VulkanSurface");
231 w->requestActivateWindow();
242 return createUnixEventDispatcher();
248 self->m_primaryScreen->setVk(inst);
290void QVkKhrDisplayIntegration::createInputHandlers()
292#if QT_CONFIG(libinput)
static QPlatformTheme * createUnixTheme(const QString &name)
Creates a UNIX theme according to the detected desktop environment.
static QWindowList allWindows()
Returns a list of all the windows in the application.
QScreen * primaryScreen
the primary (or default) screen of the application.
QSize size() const
Returns the size of the image, i.e.
Format
The following image formats are available in Qt.
@ Format_ARGB32_Premultiplied
static QPlatformInputContext * create()
The QPlatformInputContext class abstracts the input method dependent data and composing state.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
The QScreen class is used to query screen properties. \inmodule QtGui.
QPlatformScreen * handle() const
Get the platform screen handle.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QVkKhrDisplayBackingStore(QWindow *window)
void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override
Flushes the given region from the specified window.
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
void resize(const QSize &size, const QRegion &staticContents) override
bool hasCapability(QPlatformIntegration::Capability cap) const override
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
QPlatformTheme * createPlatformTheme(const QString &name) const override
QVkKhrDisplayIntegration(const QStringList ¶meters)
QPlatformVulkanInstance * createPlatformVulkanInstance(QVulkanInstance *instance) const override
~QVkKhrDisplayIntegration()
QPlatformServices * services() const override
QPlatformInputContext * inputContext() const override
Returns the platforms input context.
QPlatformNativeInterface * nativeInterface() const override
QPlatformFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
void initialize() override
Performs initialization steps that depend on having an event dispatcher available.
void * nativeResourceForWindow(const QByteArray &resource, QWindow *window) override
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
void setVk(QVkKhrDisplayVulkanInstance *inst)
int depth() const override
Reimplement in subclass to return current depth of the screen.
VkSurfaceKHR createSurface(QWindow *window)
void setCreatedCallback(CreatedCallback callback, void *userData)
QSize displaySize() const
void setGeometry(const QRect &r) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
void * vulkanSurfacePtr()
QVkKhrDisplayWindow(QWindow *window)
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
static void handleScreenGeometryChange(QScreen *screen, const QRect &newGeometry, const QRect &newAvailableGeometry)
static void handleGeometryChange(QWindow *window, const QRect &newRect)
static void handleScreenAdded(QPlatformScreen *screen, bool isPrimary=false)
Should be called by the implementation whenever a new screen is added.
static void handleScreenRemoved(QPlatformScreen *screen)
Should be called by the implementation whenever a screen is removed.
static bool handleExposeEvent(QWindow *window, const QRegion ®ion)
Combined button and popup list for selecting options.
#define QByteArrayLiteral(str)
static int resourceType(const QByteArray &key)
QPlatformFontDatabase QGenericUnixFontDatabase
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
static int resourceType(const QByteArray &key)
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)