summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorJorgen Lind <jorgen.lind@digia.com>2013-11-21 13:43:23 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-27 15:32:43 +0100
commitab30cabb6383413ee3b2913615d75082c0c55686 (patch)
tree34ec3571f79dcb4e25f01467abe6c7516e9a10d2 /src/client
parent543e34f643efd7fdd3126244a8a6b2596fb21da4 (diff)
Rename QWaylandGLIntegration to QWaylandClientBufferIntegration
also add a factory to load QWaylandClientBufferIntegrationPlugins Change-Id: Ia6a03627659b0452439ae664fceef21eaf0f6de0 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/client')
-rw-r--r--src/client/client.pro5
-rw-r--r--src/client/hardwareintegration/hardwareintegration.pri10
-rw-r--r--src/client/hardwareintegration/qwaylandclientbufferintegration.cpp (renamed from src/client/qwaylandglintegration.cpp)6
-rw-r--r--src/client/hardwareintegration/qwaylandclientbufferintegration.h (renamed from src/client/qwaylandglintegration.h)14
-rw-r--r--src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp96
-rw-r--r--src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.h61
-rw-r--r--src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.cpp55
-rw-r--r--src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.h69
-rw-r--r--src/client/qwaylanddisplay.cpp6
-rw-r--r--src/client/qwaylanddisplay.h4
-rw-r--r--src/client/qwaylandintegration.cpp43
-rw-r--r--src/client/qwaylandintegration.h8
12 files changed, 344 insertions, 33 deletions
diff --git a/src/client/client.pro b/src/client/client.pro
index 7aac1d1b6..152370c0b 100644
--- a/src/client/client.pro
+++ b/src/client/client.pro
@@ -95,7 +95,4 @@ HEADERS += qwaylandintegration.h \
qwaylandinputcontext.h \
qwaylanddatadevice.h \
-contains(DEFINES, QT_WAYLAND_GL_SUPPORT) {
- SOURCES += qwaylandglintegration.cpp
- HEADERS += qwaylandglintegration.h
-}
+include(hardwareintegration/hardwareintegration.pri)
diff --git a/src/client/hardwareintegration/hardwareintegration.pri b/src/client/hardwareintegration/hardwareintegration.pri
new file mode 100644
index 000000000..2ed95368f
--- /dev/null
+++ b/src/client/hardwareintegration/hardwareintegration.pri
@@ -0,0 +1,10 @@
+SOURCES += \
+ $$PWD/qwaylandclientbufferintegration.cpp \
+ $$PWD/qwaylandclientbufferintegrationplugin.cpp \
+ $$PWD/qwaylandclientbufferintegrationfactory.cpp
+
+HEADERS += \
+ $$PWD/qwaylandclientbufferintegration.h \
+ $$PWD/qwaylandclientbufferintegrationplugin.h \
+ $$PWD/qwaylandclientbufferintegrationfactory.h
+
diff --git a/src/client/qwaylandglintegration.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegration.cpp
index bafb99443..c04ee1772 100644
--- a/src/client/qwaylandglintegration.cpp
+++ b/src/client/hardwareintegration/qwaylandclientbufferintegration.cpp
@@ -39,16 +39,16 @@
**
****************************************************************************/
-#include "qwaylandglintegration.h"
+#include "qwaylandclientbufferintegration.h"
QT_BEGIN_NAMESPACE
-QWaylandGLIntegration::QWaylandGLIntegration()
+QWaylandClientBufferIntegration::QWaylandClientBufferIntegration()
{
}
-QWaylandGLIntegration::~QWaylandGLIntegration()
+QWaylandClientBufferIntegration::~QWaylandClientBufferIntegration()
{
}
diff --git a/src/client/qwaylandglintegration.h b/src/client/hardwareintegration/qwaylandclientbufferintegration.h
index 7697d3103..12468537e 100644
--- a/src/client/qwaylandglintegration.h
+++ b/src/client/hardwareintegration/qwaylandclientbufferintegration.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QWAYLANDGLINTEGRATION_H
-#define QWAYLANDGLINTEGRATION_H
+#ifndef QWAYLANDCLIENTBUFFERINTEGRATION_H
+#define QWAYLANDCLIENTBUFFERINTEGRATION_H
#include <QtCore/qglobal.h>
#include <QtWaylandClient/qwaylandclientexport.h>
@@ -54,11 +54,11 @@ class QWindow;
class QPlatformOpenGLContext;
class QSurfaceFormat;
-class Q_WAYLAND_CLIENT_EXPORT QWaylandGLIntegration
+class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegration
{
public:
- QWaylandGLIntegration();
- virtual ~QWaylandGLIntegration();
+ QWaylandClientBufferIntegration();
+ virtual ~QWaylandClientBufferIntegration();
virtual void initialize() = 0;
virtual bool waitingForEvents() { return false; }
@@ -68,9 +68,9 @@ public:
virtual QWaylandWindow *createEglWindow(QWindow *window) = 0;
virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0;
- static QWaylandGLIntegration *createGLIntegration(QWaylandDisplay *waylandDisplay);
+ static QWaylandClientBufferIntegration *createGLIntegration(QWaylandDisplay *waylandDisplay);
};
QT_END_NAMESPACE
-#endif // QWAYLANDGLINTEGRATION_H
+#endif // QWAYLANDCLIENTBUFFERINTEGRATION_H
diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp
new file mode 100644
index 000000000..c87c016f5
--- /dev/null
+++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwaylandclientbufferintegrationfactory.h"
+#include "qwaylandclientbufferintegrationplugin.h"
+#include "qwaylandclientbufferintegration.h"
+#include <QtCore/private/qfactoryloader_p.h>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_LIBRARY
+Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
+ (QWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration/client"), Qt::CaseInsensitive))
+Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
+ (QWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
+#endif
+
+QStringList QWaylandClientBufferIntegrationFactory::keys(const QString &pluginPath)
+{
+#ifndef QT_NO_LIBRARY
+ QStringList list;
+ if (!pluginPath.isEmpty()) {
+ QCoreApplication::addLibraryPath(pluginPath);
+ list = directLoader()->keyMap().values();
+ if (!list.isEmpty()) {
+ const QString postFix = QStringLiteral(" (from ")
+ + QDir::toNativeSeparators(pluginPath)
+ + QLatin1Char(')');
+ const QStringList::iterator end = list.end();
+ for (QStringList::iterator it = list.begin(); it != end; ++it)
+ (*it).append(postFix);
+ }
+ }
+ list.append(loader()->keyMap().values());
+ return list;
+#else
+ return QStringList();
+#endif
+}
+
+QWaylandClientBufferIntegration *QWaylandClientBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
+{
+#ifndef QT_NO_LIBRARY
+ // Try loading the plugin from platformPluginPath first:
+ if (!pluginPath.isEmpty()) {
+ QCoreApplication::addLibraryPath(pluginPath);
+ if (QWaylandClientBufferIntegration *ret = qLoadPlugin1<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(directLoader(), name, args))
+ return ret;
+ }
+ if (QWaylandClientBufferIntegration *ret = qLoadPlugin1<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(loader(), name, args))
+ return ret;
+#endif
+ return 0;
+}
+
+QT_END_NAMESPACE
diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.h
new file mode 100644
index 000000000..12b2e8dbb
--- /dev/null
+++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H
+#define QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H
+
+#include <QtWaylandClient/qwaylandclientexport.h>
+#include <QtCore/QStringList>
+
+QT_BEGIN_NAMESPACE
+
+class QWaylandClientBufferIntegration;
+
+class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationFactory
+{
+public:
+ static QStringList keys(const QString &pluginPath = QString());
+ static QWaylandClientBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
+};
+
+QT_END_NAMESPACE
+
+#endif // QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H
diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.cpp
new file mode 100644
index 000000000..58bb26d19
--- /dev/null
+++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwaylandclientbufferintegrationplugin.h"
+
+QT_BEGIN_NAMESPACE
+
+QWaylandClientBufferIntegrationPlugin::QWaylandClientBufferIntegrationPlugin(QObject *parent) :
+ QObject(parent)
+{
+}
+
+QWaylandClientBufferIntegrationPlugin::~QWaylandClientBufferIntegrationPlugin()
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.h
new file mode 100644
index 000000000..685844061
--- /dev/null
+++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H
+#define QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H
+
+#include <QtWaylandClient/qwaylandclientexport.h>
+
+#include <QtCore/qplugin.h>
+#include <QtCore/qfactoryinterface.h>
+#include <QtCore/QObject>
+
+QT_BEGIN_NAMESPACE
+
+class QWaylandClientBufferIntegration;
+
+#define QWaylandClientBufferIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandClientBufferIntegrationFactoryInterface.5.1"
+
+class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationPlugin : public QObject
+{
+ Q_OBJECT
+public:
+ explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = 0);
+ ~QWaylandClientBufferIntegrationPlugin();
+
+ virtual QWaylandClientBufferIntegration *create(const QString &key, const QStringList &paramList) = 0;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 4bcf2f689..880c76df8 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -50,7 +50,7 @@
#include "qwaylandclipboard.h"
#include "qwaylanddatadevicemanager.h"
-#include "qwaylandglintegration.h"
+#include "qwaylandclientbufferintegration.h"
#include "qwaylandwindowmanagerintegration.h"
@@ -78,9 +78,9 @@ struct wl_surface *QWaylandDisplay::createSurface(void *handle)
return surface;
}
-QWaylandGLIntegration * QWaylandDisplay::glIntegration() const
+QWaylandClientBufferIntegration * QWaylandDisplay::clientBufferIntegration() const
{
- return mWaylandIntegration->glIntegration();
+ return mWaylandIntegration->clientBufferIntegration();
}
QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() const
diff --git a/src/client/qwaylanddisplay.h b/src/client/qwaylanddisplay.h
index c58a45f5d..4e76de256 100644
--- a/src/client/qwaylanddisplay.h
+++ b/src/client/qwaylanddisplay.h
@@ -62,7 +62,7 @@ class QSocketNotifier;
class QWaylandBuffer;
class QPlatformScreen;
class QWaylandScreen;
-class QWaylandGLIntegration;
+class QWaylandClientBufferIntegration;
class QWaylandWindowManagerIntegration;
class QWaylandDataDeviceManager;
class QWaylandTouchExtension;
@@ -98,7 +98,7 @@ public:
struct wl_surface *createSurface(void *handle);
- QWaylandGLIntegration *glIntegration() const;
+ QWaylandClientBufferIntegration *clientBufferIntegration() const;
QWaylandWindowManagerIntegration *windowManagerIntegration() const;
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index af4c4f7d4..3c0c12e4f 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -65,9 +65,8 @@
#include <qpa/qplatformaccessibility.h>
#include <qpa/qplatforminputcontext.h>
-#ifdef QT_WAYLAND_GL_SUPPORT
-#include "qwaylandglintegration.h"
-#endif
+#include "qwaylandclientbufferintegration.h"
+#include "qwaylandclientbufferintegrationfactory.h"
QT_BEGIN_NAMESPACE
@@ -102,13 +101,15 @@ public:
};
QWaylandIntegration::QWaylandIntegration()
- : mFontDb(new QGenericUnixFontDatabase())
+ : mClientBufferIntegration(0)
+ , mFontDb(new QGenericUnixFontDatabase())
, mNativeInterface(new QWaylandNativeInterface(this))
#ifndef QT_NO_ACCESSIBILITY
, mAccessibility(new QPlatformAccessibility())
#else
, mAccessibility(0)
#endif
+ , mClientBufferIntegrationInitialized(false)
{
mDisplay = new QWaylandDisplay(this);
mClipboard = new QWaylandClipboard(mDisplay);
@@ -141,9 +142,9 @@ bool QWaylandIntegration::hasCapability(QPlatformIntegration::Capability cap) co
switch (cap) {
case ThreadedPixmaps: return true;
case OpenGL:
- return mDisplay->glIntegration();
+ return mDisplay->clientBufferIntegration();
case ThreadedOpenGL:
- return mDisplay->glIntegration() && mDisplay->glIntegration()->supportsThreadedOpenGL();
+ return mDisplay->clientBufferIntegration() && mDisplay->clientBufferIntegration()->supportsThreadedOpenGL();
case BufferQueueingOpenGL:
return true;
case MultipleWindows:
@@ -155,15 +156,15 @@ bool QWaylandIntegration::hasCapability(QPlatformIntegration::Capability cap) co
QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) const
{
- if (window->surfaceType() == QWindow::OpenGLSurface && mDisplay->glIntegration())
- return mDisplay->glIntegration()->createEglWindow(window);
+ if (window->surfaceType() == QWindow::OpenGLSurface && mDisplay->clientBufferIntegration())
+ return mDisplay->clientBufferIntegration()->createEglWindow(window);
return new QWaylandShmWindow(window);
}
QPlatformOpenGLContext *QWaylandIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
- if (mDisplay->glIntegration())
- return mDisplay->glIntegration()->createPlatformOpenGLContext(context->format(), context->shareHandle());
+ if (mDisplay->clientBufferIntegration())
+ return mDisplay->clientBufferIntegration()->createPlatformOpenGLContext(context->format(), context->shareHandle());
return 0;
}
@@ -236,9 +237,27 @@ QPlatformTheme *QWaylandIntegration::createPlatformTheme(const QString &name) co
return GenericWaylandTheme::createUnixTheme(name);
}
-QWaylandGLIntegration *QWaylandIntegration::glIntegration() const
+QWaylandClientBufferIntegration *QWaylandIntegration::clientBufferIntegration() const
{
- return 0;
+ if (!mClientBufferIntegrationInitialized)
+ const_cast<QWaylandIntegration *>(this)->initializeBufferIntegration();
+
+ return mClientBufferIntegration;
+}
+
+void QWaylandIntegration::initializeBufferIntegration()
+{
+ mClientBufferIntegrationInitialized = true;
+
+ QByteArray clientBufferIntegrationName = qgetenv("QT_WAYLAND_CLIENT_BUFFER_INTEGRATION");
+ if (clientBufferIntegrationName.isEmpty())
+ clientBufferIntegrationName = QByteArrayLiteral("wayland-egl");
+
+ QStringList keys = QWaylandClientBufferIntegrationFactory::keys();
+ QString targetKey = QString::fromLocal8Bit(clientBufferIntegrationName);
+ if (keys.contains(targetKey)) {
+ mClientBufferIntegration = QWaylandClientBufferIntegrationFactory::create(targetKey, QStringList());
+ }
}
QT_END_NAMESPACE
diff --git a/src/client/qwaylandintegration.h b/src/client/qwaylandintegration.h
index ebda9b284..bbc3c928a 100644
--- a/src/client/qwaylandintegration.h
+++ b/src/client/qwaylandintegration.h
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
class QWaylandBuffer;
class QWaylandDisplay;
-class QWaylandGLIntegration;
+class QWaylandClientBufferIntegration;
class Q_WAYLAND_CLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration
{
@@ -87,8 +87,11 @@ public:
QPlatformTheme *createPlatformTheme(const QString &name) const;
- virtual QWaylandGLIntegration *glIntegration() const;
+ virtual QWaylandClientBufferIntegration *clientBufferIntegration() const;
+protected:
+ QWaylandClientBufferIntegration *mClientBufferIntegration;
private:
+ void initializeBufferIntegration();
QPlatformFontDatabase *mFontDb;
QPlatformClipboard *mClipboard;
QPlatformDrag *mDrag;
@@ -96,6 +99,7 @@ private:
QPlatformNativeInterface *mNativeInterface;
QScopedPointer<QPlatformInputContext> mInputContext;
QPlatformAccessibility *mAccessibility;
+ bool mClientBufferIntegrationInitialized;
};
QT_END_NAMESPACE