summaryrefslogtreecommitdiffstats
path: root/src/client/hardwareintegration
diff options
context:
space:
mode:
authorJorgen Lind <jorgen.lind@digia.com>2013-11-25 10:49:02 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-27 21:39:45 +0100
commitd747b0a3cac5e9a3d7c3f4f53bf9da3b88187698 (patch)
tree628ba8ead251324ba8eb52882c62c3b0726c9af2 /src/client/hardwareintegration
parentdcef544fb24f810b21fa38cc0e9e77f3a4f86ba8 (diff)
Add hardware integration protocol
This sends to clients what HW integration is being used in the compositor. This is useful when the wayland clients are loading their buffer integrations with plugins since they then can pick the correct plugin automatically. Change-Id: Ib4eac3b855c6772ac1581b7f06aa929aeb1a1db0 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/client/hardwareintegration')
-rw-r--r--src/client/hardwareintegration/hardwareintegration.pri9
-rw-r--r--src/client/hardwareintegration/qwaylandhardwareintegration.cpp72
-rw-r--r--src/client/hardwareintegration/qwaylandhardwareintegration.h71
3 files changed, 149 insertions, 3 deletions
diff --git a/src/client/hardwareintegration/hardwareintegration.pri b/src/client/hardwareintegration/hardwareintegration.pri
index 0ace4777e..1588ca977 100644
--- a/src/client/hardwareintegration/hardwareintegration.pri
+++ b/src/client/hardwareintegration/hardwareintegration.pri
@@ -1,5 +1,6 @@
WAYLANDCLIENTSOURCES += \
- $$PWD/../../extensions/server-buffer-extension.xml
+ $$PWD/../../extensions/server-buffer-extension.xml \
+ $$PWD/../../extensions/hardware-integration.xml
SOURCES += \
$$PWD/qwaylandclientbufferintegration.cpp \
@@ -7,7 +8,8 @@ SOURCES += \
$$PWD/qwaylandclientbufferintegrationfactory.cpp \
$$PWD/qwaylandserverbufferintegration.cpp \
$$PWD/qwaylandserverbufferintegrationplugin.cpp \
- $$PWD/qwaylandserverbufferintegrationfactory.cpp
+ $$PWD/qwaylandserverbufferintegrationfactory.cpp \
+ $$PWD/qwaylandhardwareintegration.cpp
HEADERS += \
$$PWD/qwaylandclientbufferintegration.h \
@@ -15,5 +17,6 @@ HEADERS += \
$$PWD/qwaylandclientbufferintegrationfactory.h \
$$PWD/qwaylandserverbufferintegration.h \
$$PWD/qwaylandserverbufferintegrationplugin.h \
- $$PWD/qwaylandserverbufferintegrationfactory.h
+ $$PWD/qwaylandserverbufferintegrationfactory.h \
+ $$PWD/qwaylandhardwareintegration.h
diff --git a/src/client/hardwareintegration/qwaylandhardwareintegration.cpp b/src/client/hardwareintegration/qwaylandhardwareintegration.cpp
new file mode 100644
index 000000000..67c951eac
--- /dev/null
+++ b/src/client/hardwareintegration/qwaylandhardwareintegration.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** 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 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 "qwaylandhardwareintegration.h"
+
+#include "qwaylanddisplay.h"
+QT_BEGIN_NAMESPACE
+
+QWaylandHardwareIntegration::QWaylandHardwareIntegration(struct ::wl_registry *registry, int id)
+ : qt_hardware_integration(registry, id)
+{
+}
+
+QString QWaylandHardwareIntegration::clientBufferIntegration()
+{
+ return m_client_buffer;
+}
+
+QString QWaylandHardwareIntegration::serverBufferIntegration()
+{
+ return m_server_buffer;
+}
+
+void QWaylandHardwareIntegration::hardware_integration_client_backend(const QString &name)
+{
+ m_client_buffer = name;
+}
+
+void QWaylandHardwareIntegration::hardware_integration_server_backend(const QString &name)
+{
+ m_server_buffer = name;
+}
+
+QT_END_NAMESPACE
diff --git a/src/client/hardwareintegration/qwaylandhardwareintegration.h b/src/client/hardwareintegration/qwaylandhardwareintegration.h
new file mode 100644
index 000000000..faa578567
--- /dev/null
+++ b/src/client/hardwareintegration/qwaylandhardwareintegration.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** 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 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 QWAYLANDHARDWAREINTEGRATION_H
+#define QWAYLANDHARDWAREINTEGRATION_H
+
+#include <QtWaylandClient/private/qwayland-hardware-integration.h>
+#include <QtWaylandClient/qwaylandclientexport.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWaylandDisplay;
+
+class Q_WAYLAND_CLIENT_EXPORT QWaylandHardwareIntegration : public QtWayland::qt_hardware_integration
+{
+public:
+ QWaylandHardwareIntegration(struct ::wl_registry *registry, int id);
+
+ QString clientBufferIntegration();
+ QString serverBufferIntegration();
+
+protected:
+ void hardware_integration_client_backend(const QString &name);
+ void hardware_integration_server_backend(const QString &name);
+
+private:
+ QString m_client_buffer;
+ QString m_server_buffer;
+};
+
+QT_END_NAMESPACE
+
+#endif