Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
texturesharingextension.cpp
Go to the documentation of this file.
1// Copyright (C) 2019 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
5#include <QtWaylandClient/private/qwaylanddisplay_p.h>
6#include <QtWaylandClient/private/qwaylandintegration_p.h>
7#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
8#include <QtGui/QGuiApplication>
9#include <QtGui/private/qguiapplication_p.h>
10#include <QtGui/QWindow>
11#include <QtGui/QPlatformSurfaceEvent>
12#include <QtGui/qpa/qplatformnativeinterface.h>
13#include <QDebug>
14
16
18 : QWaylandClientExtensionTemplate(/* Supported protocol version */ 1 )
19{
21 m_server_buffer_integration = wayland_integration->serverBufferIntegration();
22 if (!m_server_buffer_integration) {
23 qCritical() << "This application requires a working serverBufferIntegration";
25 }
26}
27
29{
30 QtWaylandClient::QWaylandServerBuffer *serverBuffer = m_server_buffer_integration->serverBuffer(buffer);
31 emit bufferReceived(serverBuffer, key);
32}
33
35{
36 qWarning() << "TextureSharingExtension" << key << "not found" << message;
37 emit bufferReceived(nullptr, key);
38}
40{
41 request_image(key);
42}
43
45{
46 abandon_image(key);
47}
48
50
51#include "moc_texturesharingextension_p.cpp"
static void quit()
\threadsafe
static QPlatformIntegration * platformIntegration()
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
virtual QWaylandServerBuffer * serverBuffer(struct qt_server_buffer *buffer)=0
void abandonImage(const QString &key)
void zqt_texture_sharing_v1_image_failed(const QString &key, const QString &message) override
void zqt_texture_sharing_v1_provide_buffer(struct ::qt_server_buffer *buffer, const QString &key) override
void requestImage(const QString &key)
void bufferReceived(QtWaylandClient::QWaylandServerBuffer *buffer, const QString &key)
Combined button and popup list for selecting options.
#define qCritical
Definition qlogging.h:167
#define qWarning
Definition qlogging.h:166
GLuint64 key
GLenum GLuint buffer
GLuint GLsizei const GLchar * message
#define emit