diff options
58 files changed, 2 insertions, 3206 deletions
@@ -18,7 +18,6 @@ config.tests/egl/egl config.tests/glx/glx config.tests/wayland_cursor/wayland_cursor config.tests/wayland_egl/wayland_egl -config.tests/xcomposite/xcomposite config.tests/xkbcommon/xkbcommon config.tests/wayland/wayland config.tests/drm_egl_server/drm_egl_server diff --git a/cmake/FindXComposite.cmake b/cmake/FindXComposite.cmake deleted file mode 100644 index 0111bb03..00000000 --- a/cmake/FindXComposite.cmake +++ /dev/null @@ -1,12 +0,0 @@ -if (TARGET PkgConfig::XComposite) - set(XComposite_FOUND 1) - return() -endif() - -find_package(PkgConfig QUIET) - -pkg_check_modules(XComposite xcomposite IMPORTED_TARGET) - -if (NOT TARGET PkgConfig::XComposite) - set(XComposite_FOUND 0) -endif() diff --git a/features/wayland-scanner-client-wayland-protocol-include.prf b/features/wayland-scanner-client-wayland-protocol-include.prf index 9c5d2d1e..d21533c6 100644 --- a/features/wayland-scanner-client-wayland-protocol-include.prf +++ b/features/wayland-scanner-client-wayland-protocol-include.prf @@ -2,7 +2,7 @@ # have requests that create objects with interfaces defined in the core # wayland protocol. # -# E.g. the xcomposite protocol has a request which creates a wl_buffer. With +# E.g. if a protocol has a request which creates a wl_buffer. With # the regular wayland-scanner.prf compilation would fail because # wl_buffer_interface is not defined. # diff --git a/src/client/Qt6WaylandClientMacros.cmake b/src/client/Qt6WaylandClientMacros.cmake index c8103259..568c3349 100644 --- a/src/client/Qt6WaylandClientMacros.cmake +++ b/src/client/Qt6WaylandClientMacros.cmake @@ -53,15 +53,8 @@ function(qt6_generate_wayland_protocol_client_sources target) DEPENDS ${protocol_file} Qt6::qtwaylandscanner ) - # TODO: We need this hack in order to get the xcomposite plugins to build... - # unfortunately, it's not going to work outside QtWayland because we're using waylandclient-private includes set(qtwaylandscanner_code_include "") - set (targets_that_need_include - "QWaylandXCompositeEglClientBufferPlugin" - "QWaylandXCompositeGlxClientBufferPlugin" - "QWaylandXCompositeEglPlatformIntegrationPlugin" - "QWaylandXCompositeGlxPlatformIntegrationPlugin") - if ("${target}" IN_LIST targets_that_need_include OR is_for_module) + if (is_for_module) set(qtwaylandscanner_code_include "<QtWaylandClient/private/wayland-wayland-client-protocol.h>") endif() diff --git a/src/configure.cmake b/src/configure.cmake index ce7fcf59..1c1cf1e8 100644 --- a/src/configure.cmake +++ b/src/configure.cmake @@ -22,9 +22,6 @@ if(LINUX OR QT_FIND_ALL_PACKAGES_ALWAYS) PROVIDED_TARGETS Wayland::Egl MODULE_NAME waylandclient QMAKE_LIB wayland-egl) - qt_find_package(XComposite - PROVIDED_TARGETS PkgConfig::XComposite - MODULE_NAME waylandclient QMAKE_LIB xcomposite) # waylandcompositor libraries qt_find_package(Wayland @@ -35,9 +32,6 @@ if(LINUX OR QT_FIND_ALL_PACKAGES_ALWAYS) PROVIDED_TARGETS Wayland::Egl MODULE_NAME waylandcompositor QMAKE_LIB wayland-egl) - qt_find_package(XComposite - PROVIDED_TARGETS PkgConfig::XComposite - MODULE_NAME waylandcompositor QMAKE_LIB xcomposite) # X11 is not a public dependency of QtGui anymore, so we need to find it manually in a shared build. # In a static build the dependency is still propagated, so check for the target existence to prevent @@ -222,18 +216,6 @@ qt_feature("wayland-vulkan-server-buffer" PRIVATE qt_feature("wayland-datadevice" PRIVATE CONDITION QT_FEATURE_draganddrop OR QT_FEATURE_clipboard ) -qt_feature("xcomposite-egl" PRIVATE - LABEL "XComposite EGL" - CONDITION FALSE AND (QT_FEATURE_wayland_client OR QT_FEATURE_wayland_server) - AND QT_FEATURE_opengl AND QT_FEATURE_egl AND QT_FEATURE_xlib - AND XComposite_FOUND AND QT_FEATURE_egl_x11 -) -qt_feature("xcomposite-glx" PRIVATE - LABEL "XComposite GLX" - CONDITION FALSE AND (QT_FEATURE_wayland_client OR QT_FEATURE_wayland_server) - AND QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2 - AND QT_FEATURE_xlib AND XComposite_FOUND -) qt_feature("wayland-text-input-v4-wip" PRIVATE LABEL "Qt Wayland TextInput Protocol V4(WIP)" PURPOSE "Enables wayland_text_input_unstable_v4(wip)" @@ -250,6 +232,4 @@ qt_configure_add_summary_entry(ARGS "wayland-libhybris-egl-server-buffer") qt_configure_add_summary_entry(ARGS "wayland-dmabuf-server-buffer") qt_configure_add_summary_entry(ARGS "wayland-shm-emulation-server-buffer") qt_configure_add_summary_entry(ARGS "wayland-vulkan-server-buffer") -qt_configure_add_summary_entry(ARGS "xcomposite-egl") -qt_configure_add_summary_entry(ARGS "xcomposite-glx") qt_configure_end_summary_section() # end of "Qt Wayland Drivers" section diff --git a/src/extensions/xcomposite.xml b/src/extensions/xcomposite.xml deleted file mode 100644 index 44ecdd27..00000000 --- a/src/extensions/xcomposite.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<protocol name="xcomposite"> - <!-- XComposite support. This object is created by the server and published - using the display's global event. --> - <copyright> - Copyright (C) 2015 The Qt Company Ltd. - Contact: http://www.qt.io/licensing/ - - This file is part of the plugins of the Qt Toolkit. - - $QT_BEGIN_LICENSE:BSD$ - You may use this file under the terms of the BSD license as follows: - - "Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of The Qt Company Ltd nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - - $QT_END_LICENSE$ - </copyright> - <interface name="qt_xcomposite" version="1"> - - <!-- Create a wayland buffer for X Window. --> - <request name="create_buffer"> - <arg name="id" type="new_id" interface="wl_buffer"/> - <arg name="x_window" type="uint"/> - <arg name="width" type="int"/> - <arg name="height" type="int"/> - </request> - - <!-- Notification of the root window to use for the X Window created - on the client side. Also passes in the Display name to use --> - <event name="root"> - <arg name="display_name" type="string"/> - <arg name="root_window" type="uint"/> - </event> - - </interface> - -</protocol> diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp deleted file mode 100644 index 1809aa21..00000000 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandxcompositeeglclientbufferintegration.h" - -#include "qwaylandxcompositeeglwindow.h" - -#include <QtCore/QDebug> -#include <QtGui/private/qeglconvenience_p.h> - -#include <QtWaylandClient/private/qwaylanddisplay_p.h> - -#include "wayland-xcomposite-client-protocol.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -QWaylandXCompositeEGLClientBufferIntegration::QWaylandXCompositeEGLClientBufferIntegration() - : QWaylandClientBufferIntegration() -{ - qDebug() << "Using XComposite-EGL"; -} - -QWaylandXCompositeEGLClientBufferIntegration::~QWaylandXCompositeEGLClientBufferIntegration() -{ - XCloseDisplay(mDisplay); -} - -void QWaylandXCompositeEGLClientBufferIntegration::initialize(QWaylandDisplay *display) -{ - mWaylandDisplay = display; - mWaylandDisplay->addRegistryListener(&wlDisplayHandleGlobal, this); - while (!mDisplay) { - display->flushRequests(); - display->blockingReadEvents(); - } -} - -QWaylandWindow * QWaylandXCompositeEGLClientBufferIntegration::createEglWindow(QWindow *window) -{ - return new QWaylandXCompositeEGLWindow(window,this); -} - -QPlatformOpenGLContext *QWaylandXCompositeEGLClientBufferIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const -{ - EGLDisplay display = eglDisplay(); - EGLConfig config = q_configFromGLFormat(display, glFormat, true, EGL_WINDOW_BIT | EGL_PIXMAP_BIT); - return new QWaylandXCompositeEGLContext(glFormat, share, display, config); -} - -Display * QWaylandXCompositeEGLClientBufferIntegration::xDisplay() const -{ - return mDisplay; -} - -EGLDisplay QWaylandXCompositeEGLClientBufferIntegration::eglDisplay() const -{ - return mEglDisplay; -} - -int QWaylandXCompositeEGLClientBufferIntegration::screen() const -{ - return mScreen; -} - -Window QWaylandXCompositeEGLClientBufferIntegration::rootWindow() const -{ - return mRootWindow; -} - -QWaylandDisplay * QWaylandXCompositeEGLClientBufferIntegration::waylandDisplay() const -{ - return mWaylandDisplay; -} -qt_xcomposite * QWaylandXCompositeEGLClientBufferIntegration::waylandXComposite() const -{ - return mWaylandComposite; -} - -const struct qt_xcomposite_listener QWaylandXCompositeEGLClientBufferIntegration::xcomposite_listener = { - QWaylandXCompositeEGLClientBufferIntegration::rootInformation -}; - -void QWaylandXCompositeEGLClientBufferIntegration::wlDisplayHandleGlobal(void *data, ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version) -{ - Q_UNUSED(version); - if (interface == "qt_xcomposite") { - QWaylandXCompositeEGLClientBufferIntegration *integration = static_cast<QWaylandXCompositeEGLClientBufferIntegration *>(data); - integration->mWaylandComposite = static_cast<struct qt_xcomposite *>(wl_registry_bind(registry,id,&qt_xcomposite_interface,1)); - qt_xcomposite_add_listener(integration->mWaylandComposite,&xcomposite_listener,integration); - } - -} - -void QWaylandXCompositeEGLClientBufferIntegration::rootInformation(void *data, qt_xcomposite *xcomposite, const char *display_name, uint32_t root_window) -{ - Q_UNUSED(xcomposite); - QWaylandXCompositeEGLClientBufferIntegration *integration = static_cast<QWaylandXCompositeEGLClientBufferIntegration *>(data); - - integration->mDisplay = XOpenDisplay(display_name); - integration->mRootWindow = (Window) root_window; - integration->mScreen = XDefaultScreen(integration->mDisplay); - integration->mEglDisplay = eglGetDisplay(integration->mDisplay); - eglBindAPI(EGL_OPENGL_ES_API); - EGLint minor,major; - if (!eglInitialize(integration->mEglDisplay,&major,&minor)) { - qFatal("Failed to initialize EGL"); - } - eglSwapInterval(integration->eglDisplay(),0); - qDebug() << "ROOT INFORMATION" << integration->mDisplay << integration->mRootWindow << integration->mScreen; -} - -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h deleted file mode 100644 index 6327ffd4..00000000 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDXCOMPOSITEEGLCLIENTBUFFERINTEGRATION_H -#define QWAYLANDXCOMPOSITEEGLCLIENTBUFFERINTEGRATION_H - -#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h> -#include <wayland-client-core.h> - -#include <QtCore/QTextStream> -#include <QtCore/QDataStream> -#include <QtCore/QMetaType> -#include <QtCore/QVariant> -#include <QtGui/QWindow> - -#include <qpa/qplatformopenglcontext.h> - -#include <QWaitCondition> - -#include <X11/Xlib.h> -// conflict with QInputDevice::Capability::None -#undef None -#include <EGL/egl.h> - -// avoid clashes with Qt::CursorShape -#ifdef CursorShape -# define X_CursorShape CursorShape -# undef CursorShape -#endif - -struct qt_xcomposite; -struct qt_xcomposite_listener; -struct wl_registry; - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeEGLClientBufferIntegration : public QWaylandClientBufferIntegration -{ -public: - QWaylandXCompositeEGLClientBufferIntegration(); - ~QWaylandXCompositeEGLClientBufferIntegration() override; - - void initialize(QWaylandDisplay *dispaly) override; - - QWaylandWindow *createEglWindow(QWindow *window) override; - QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const override; - - QWaylandDisplay *waylandDisplay() const; - struct qt_xcomposite *waylandXComposite() const; - - Display *xDisplay() const; - EGLDisplay eglDisplay() const; - int screen() const; - Window rootWindow() const; - - bool supportsThreadedOpenGL() const override { return true; } - bool supportsWindowDecoration() const override { return false; } - -private: - QWaylandDisplay *mWaylandDisplay = nullptr; - struct qt_xcomposite *mWaylandComposite = nullptr; - - Display *mDisplay = nullptr; - EGLDisplay mEglDisplay = EGL_NO_DISPLAY; - int mScreen = 0; - Window mRootWindow = -1; - - static void wlDisplayHandleGlobal(void *data, struct ::wl_registry *registry, uint32_t id, - const QString &interface, uint32_t version); - - static const struct ::qt_xcomposite_listener xcomposite_listener; - static void rootInformation(void *data, - struct qt_xcomposite *xcomposite, - const char *display_name, - uint32_t root_window); -}; - -} - -QT_END_NAMESPACE - -#endif // QWAYLANDXCOMPOSITEEGLCLIENTBUFFERINTEGRATION_H diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp deleted file mode 100644 index ed739f81..00000000 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandxcompositeeglcontext.h" - -#include "qwaylandxcompositeeglwindow.h" - -#include <QtCore/QDebug> -#include <QtGui/QRegion> - -#include <QtGui/private/qeglconvenience_p.h> - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -QWaylandXCompositeEGLContext::QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLConfig config) - : QEGLPlatformContext(format, share, display, &config) -{ -} - -void QWaylandXCompositeEGLContext::swapBuffers(QPlatformSurface *surface) -{ - QEGLPlatformContext::swapBuffers(surface); - - QWaylandXCompositeEGLWindow *w = - static_cast<QWaylandXCompositeEGLWindow *>(surface); - - QSize size = w->geometry().size(); - - w->commit(w->buffer(), QRegion(0, 0, size.width(), size.height())); - w->waitForFrameSync(100); -} - -EGLSurface QWaylandXCompositeEGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface) -{ - return static_cast<QWaylandXCompositeEGLWindow *>(surface)->eglSurface(); -} - -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h deleted file mode 100644 index 266c9816..00000000 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDXCOMPOSITEEGLCONTEXT_H -#define QWAYLANDXCOMPOSITEEGLCONTEXT_H - -#include <qpa/qplatformopenglcontext.h> - -#include "qwaylandxcompositeeglclientbufferintegration.h" - -#include <QtGui/private/qeglplatformcontext_p.h> - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeEGLWindow; - -class QWaylandXCompositeEGLContext : public QEGLPlatformContext -{ -public: - QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLConfig config); - - void swapBuffers(QPlatformSurface *surface) override; - -private: - EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override; -}; - -} - -QT_END_NAMESPACE - -#endif // QWAYLANDXCOMPOSITEEGLCONTEXT_H diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp deleted file mode 100644 index 4c6bc7b9..00000000 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandxcompositeeglwindow.h" -#include "qwaylandxcompositebuffer.h" - -#include <QtGui/private/qeglconvenience_p.h> -#include <QtGui/private/qxlibeglintegration_p.h> - -#include "wayland-xcomposite-client-protocol.h" - -#include <X11/extensions/Xcomposite.h> -#include "qwaylandxcompositeeglclientbufferintegration.h" - -#include <QtCore/QDebug> - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -QWaylandXCompositeEGLWindow::QWaylandXCompositeEGLWindow(QWindow *window, QWaylandXCompositeEGLClientBufferIntegration *glxIntegration) - : QWaylandWindow(window, glxIntegration->waylandDisplay()) - , m_glxIntegration(glxIntegration) - , m_config(q_configFromGLFormat(glxIntegration->eglDisplay(), window->format(), true, EGL_WINDOW_BIT | EGL_PIXMAP_BIT)) -{ -} - -QWaylandWindow::WindowType QWaylandXCompositeEGLWindow::windowType() const -{ - //yeah. this type needs a new name - return QWaylandWindow::Egl; -} - -void QWaylandXCompositeEGLWindow::setGeometry(const QRect &rect) -{ - QWaylandWindow::setGeometry(rect); - - if (m_surface) { - eglDestroySurface(m_glxIntegration->eglDisplay(), m_surface); - m_surface = 0; - } -} - -EGLSurface QWaylandXCompositeEGLWindow::eglSurface() const -{ - if (!m_surface) - const_cast<QWaylandXCompositeEGLWindow *>(this)->createEglSurface(); - return m_surface; -} - -void QWaylandXCompositeEGLWindow::createEglSurface() -{ - QSize size(geometry().size()); - if (size.isEmpty()) { - // QGLWidget wants a context for a window without geometry - size = QSize(1,1); - } - - delete m_buffer; - //XFreePixmap deletes the glxPixmap as well - if (m_xWindow) { - XDestroyWindow(m_glxIntegration->xDisplay(), m_xWindow); - } - - VisualID visualId = QXlibEglIntegration::getCompatibleVisualId(m_glxIntegration->xDisplay(), m_glxIntegration->eglDisplay(), m_config); - - XVisualInfo visualInfoTemplate; - memset(&visualInfoTemplate, 0, sizeof(XVisualInfo)); - visualInfoTemplate.visualid = visualId; - - int matchingCount = 0; - XVisualInfo *visualInfo = XGetVisualInfo(m_glxIntegration->xDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount); - - Colormap cmap = XCreateColormap(m_glxIntegration->xDisplay(),m_glxIntegration->rootWindow(),visualInfo->visual,AllocNone); - - XSetWindowAttributes a; - a.colormap = cmap; - m_xWindow = XCreateWindow(m_glxIntegration->xDisplay(), m_glxIntegration->rootWindow(),0, 0, size.width(), size.height(), - 0, visualInfo->depth, InputOutput, visualInfo->visual, - CWColormap, &a); - - XCompositeRedirectWindow(m_glxIntegration->xDisplay(), m_xWindow, CompositeRedirectManual); - XMapWindow(m_glxIntegration->xDisplay(), m_xWindow); - - m_surface = eglCreateWindowSurface(m_glxIntegration->eglDisplay(), m_config, reinterpret_cast<EGLNativeWindowType>(m_xWindow), nullptr); - if (m_surface == EGL_NO_SURFACE) { - qFatal("Could not make eglsurface"); - } - - XSync(m_glxIntegration->xDisplay(),False); - m_buffer = new QWaylandXCompositeBuffer(m_glxIntegration->waylandXComposite(), - (uint32_t)m_xWindow, - size); -} - -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h deleted file mode 100644 index 0c8bcf44..00000000 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDXCOMPOSITEEGLWINDOW_H -#define QWAYLANDXCOMPOSITEEGLWINDOW_H - -#include <QtWaylandClient/private/qwaylandwindow_p.h> -#include <QtWaylandClient/private/qwaylandbuffer_p.h> - -#include "qwaylandxcompositeeglclientbufferintegration.h" -#include "qwaylandxcompositeeglcontext.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeEGLWindow : public QWaylandWindow -{ -public: - QWaylandXCompositeEGLWindow(QWindow *window, QWaylandXCompositeEGLClientBufferIntegration *glxIntegration); - WindowType windowType() const override; - - void setGeometry(const QRect &rect) override; - - EGLSurface eglSurface() const; - - QWaylandBuffer *buffer() { return m_buffer; } - -private: - void createEglSurface(); - - QWaylandXCompositeEGLClientBufferIntegration *m_glxIntegration = nullptr; - QWaylandBuffer *m_buffer = nullptr; - - Window m_xWindow = 0; - EGLConfig m_config; - EGLSurface m_surface = EGL_NO_SURFACE; -}; - -} - -QT_END_NAMESPACE - -#endif // QWAYLANDXCOMPOSITEEGLWINDOW_H diff --git a/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri b/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri deleted file mode 100644 index ecbaae64..00000000 --- a/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri +++ /dev/null @@ -1,14 +0,0 @@ -INCLUDEPATH += $$PWD -include($$PWD/../xcomposite_share/xcomposite_share.pri) - -QMAKE_USE += egl wayland-client - -SOURCES += \ - $$PWD/qwaylandxcompositeeglcontext.cpp \ - $$PWD/qwaylandxcompositeeglclientbufferintegration.cpp \ - $$PWD/qwaylandxcompositeeglwindow.cpp - -HEADERS += \ - $$PWD/qwaylandxcompositeeglcontext.h \ - $$PWD/qwaylandxcompositeeglclientbufferintegration.h \ - $$PWD/qwaylandxcompositeeglwindow.h diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp deleted file mode 100644 index 35188741..00000000 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtCore/QDebug> - -#include "qwaylandxcompositeglxcontext.h" - -#include "qwaylandxcompositeglxwindow.h" - -#include <QRegion> - -#include <dlfcn.h> - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -QWaylandXCompositeGLXContext::QWaylandXCompositeGLXContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, Display *display, int screen) - : m_display(display), - m_format(format) -{ - qDebug("creating XComposite-GLX context"); - - if (m_format.renderableType() == QSurfaceFormat::DefaultRenderableType) - m_format.setRenderableType(QSurfaceFormat::OpenGL); - - if (m_format.renderableType() != QSurfaceFormat::OpenGL) { - qWarning("Unsupported renderable type"); - return; - } - - GLXContext shareContext = share ? static_cast<QWaylandXCompositeGLXContext *>(share)->m_context : 0; - GLXFBConfig config = qglx_findConfig(display, screen, m_format, GLX_WINDOW_BIT | GLX_PIXMAP_BIT); - XVisualInfo *visualInfo = glXGetVisualFromFBConfig(display, config); - m_context = glXCreateContext(display, visualInfo, shareContext, true); - qglx_surfaceFormatFromGLXFBConfig(&m_format, display, config); -} - -bool QWaylandXCompositeGLXContext::makeCurrent(QPlatformSurface *surface) -{ - Window xWindow = static_cast<QWaylandXCompositeGLXWindow *>(surface)->xWindow(); - - return glXMakeCurrent(m_display, xWindow, m_context); -} - -void QWaylandXCompositeGLXContext::doneCurrent() -{ - glXMakeCurrent(m_display, 0, 0); -} - -void QWaylandXCompositeGLXContext::swapBuffers(QPlatformSurface *surface) -{ - QWaylandXCompositeGLXWindow *w = static_cast<QWaylandXCompositeGLXWindow *>(surface); - - QSize size = w->geometry().size(); - - glXSwapBuffers(m_display, w->xWindow()); - - w->commit(w->buffer(), QRegion(0, 0, size.width(), size.height())); - w->waitForFrameSync(100); -} - -QFunctionPointer QWaylandXCompositeGLXContext::getProcAddress(const char *procName) -{ - QFunctionPointer proc = glXGetProcAddress(reinterpret_cast<const GLubyte *>(procName)); - if (!proc) - proc = (QFunctionPointer) dlsym(RTLD_DEFAULT, procName); - return proc; -} - -QSurfaceFormat QWaylandXCompositeGLXContext::format() const -{ - return m_format; -} - -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h deleted file mode 100644 index edb74a89..00000000 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDXCOMPOSITEGLXCONTEXT_H -#define QWAYLANDXCOMPOSITEGLXCONTEXT_H - -#include <qpa/qplatformopenglcontext.h> - -#include "qwaylandxcompositeglxintegration.h" -#include <QtGui/private/qglxconvenience_p.h> - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeGLXWindow; -class QWaylandShmBuffer; - -class QWaylandXCompositeGLXContext : public QPlatformOpenGLContext -{ -public: - QWaylandXCompositeGLXContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, Display *display, int screen); - - QSurfaceFormat format() const override; - - void swapBuffers(QPlatformSurface *surface) override; - - bool makeCurrent(QPlatformSurface *surface) override; - void doneCurrent() override; - - QFunctionPointer getProcAddress(const char *procName) override; - -private: - GLXContext m_context; - - Display *m_display = nullptr; - QSurfaceFormat m_format; -}; - -} - -QT_END_NAMESPACE - -#endif // QWAYLANDXCOMPOSITEGLXCONTEXT_H diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp deleted file mode 100644 index 8be47fa2..00000000 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandxcompositeglxintegration.h" - -#include "qwaylandxcompositeglxwindow.h" - -#include <QtCore/QDebug> - -#include "wayland-xcomposite-client-protocol.h" - -#include <QtWaylandClient/private/qwaylanddisplay_p.h> - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -QWaylandXCompositeGLXIntegration::QWaylandXCompositeGLXIntegration() -{ - qDebug() << "Using XComposite-GLX"; -} - -QWaylandXCompositeGLXIntegration::~QWaylandXCompositeGLXIntegration() -{ - XCloseDisplay(mDisplay); -} - -void QWaylandXCompositeGLXIntegration::initialize(QWaylandDisplay *display) -{ - mWaylandDisplay = display; - mWaylandDisplay->addRegistryListener(QWaylandXCompositeGLXIntegration::wlDisplayHandleGlobal, this); - while (!mDisplay) { - display->flushRequests(); - display->blockingReadEvents(); - } -} - -QWaylandWindow * QWaylandXCompositeGLXIntegration::createEglWindow(QWindow *window) -{ - return new QWaylandXCompositeGLXWindow(window, this); -} - -QPlatformOpenGLContext *QWaylandXCompositeGLXIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const -{ - return new QWaylandXCompositeGLXContext(glFormat, share, mDisplay, mScreen); -} - -Display * QWaylandXCompositeGLXIntegration::xDisplay() const -{ - return mDisplay; -} - -int QWaylandXCompositeGLXIntegration::screen() const -{ - return mScreen; -} - -Window QWaylandXCompositeGLXIntegration::rootWindow() const -{ - return mRootWindow; -} - -QWaylandDisplay * QWaylandXCompositeGLXIntegration::waylandDisplay() const -{ - return mWaylandDisplay; -} -qt_xcomposite * QWaylandXCompositeGLXIntegration::waylandXComposite() const -{ - return mWaylandComposite; -} - -const struct qt_xcomposite_listener QWaylandXCompositeGLXIntegration::xcomposite_listener = { - QWaylandXCompositeGLXIntegration::rootInformation -}; - -void QWaylandXCompositeGLXIntegration::wlDisplayHandleGlobal(void *data, ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version) -{ - Q_UNUSED(version); - if (interface == "qt_xcomposite") { - qDebug("XComposite-GLX: got qt_xcomposite global"); - QWaylandXCompositeGLXIntegration *integration = static_cast<QWaylandXCompositeGLXIntegration *>(data); - integration->mWaylandComposite = static_cast<struct qt_xcomposite *>(wl_registry_bind(registry, id, &qt_xcomposite_interface, 1)); - qt_xcomposite_add_listener(integration->mWaylandComposite,&xcomposite_listener,integration); - } - -} - -void QWaylandXCompositeGLXIntegration::rootInformation(void *data, qt_xcomposite *xcomposite, const char *display_name, uint32_t root_window) -{ - Q_UNUSED(xcomposite); - QWaylandXCompositeGLXIntegration *integration = static_cast<QWaylandXCompositeGLXIntegration *>(data); - - qDebug("XComposite-GLX: xcomposite listener callback"); - - integration->mDisplay = XOpenDisplay(display_name); - integration->mRootWindow = (Window) root_window; - integration->mScreen = XDefaultScreen(integration->mDisplay); -} - -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h deleted file mode 100644 index b86de4e9..00000000 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDXCOMPOSITEGLXINTEGRATION_H -#define QWAYLANDXCOMPOSITEGLXINTEGRATION_H - -#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h> -#include <wayland-client-core.h> - -#include <QtCore/QTextStream> -#include <QtCore/QDataStream> -#include <QtCore/QMetaType> -#include <QtCore/QVariant> -#include <QtGui/QWindow> - -#include <X11/Xlib.h> -// conflict with QInputDevice::Capability::None -#undef None - -// avoid clashes with Qt::CursorShape -#ifdef CursorShape -# define X_CursorShape CursorShape -# undef CursorShape -#endif - -struct qt_xcomposite; -struct qt_xcomposite_listener; -struct wl_registry; - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeGLXIntegration : public QWaylandClientBufferIntegration -{ -public: - QWaylandXCompositeGLXIntegration(); - ~QWaylandXCompositeGLXIntegration() override; - - void initialize(QWaylandDisplay *display) override; - - QWaylandWindow *createEglWindow(QWindow *window) override; - QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const override; - - QWaylandDisplay *waylandDisplay() const; - struct qt_xcomposite *waylandXComposite() const; - - Display *xDisplay() const; - int screen() const; - Window rootWindow() const; - - bool supportsThreadedOpenGL() const override { return false; } - bool supportsWindowDecoration() const override { return false; } - -private: - QWaylandDisplay *mWaylandDisplay = nullptr; - struct qt_xcomposite *mWaylandComposite = nullptr; - - Display *mDisplay = nullptr; - int mScreen = 0; - Window mRootWindow = 0; - - static void wlDisplayHandleGlobal(void *data, struct ::wl_registry *registry, uint32_t id, - const QString &interface, uint32_t version); - - static const struct qt_xcomposite_listener xcomposite_listener; - static void rootInformation(void *data, - struct qt_xcomposite *xcomposite, - const char *display_name, - uint32_t root_window); -}; - -} - -QT_END_NAMESPACE - -#endif // QWAYLANDXCOMPOSITEGLXINTEGRATION_H diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp deleted file mode 100644 index b0c78b63..00000000 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandxcompositeglxwindow.h" -#include "qwaylandxcompositebuffer.h" - -#include <QtCore/QDebug> - -#include "wayland-xcomposite-client-protocol.h" -#include <QtGui/QRegion> - -#include <X11/extensions/Xcomposite.h> - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -QWaylandXCompositeGLXWindow::QWaylandXCompositeGLXWindow(QWindow *window, QWaylandXCompositeGLXIntegration *glxIntegration) - : QWaylandWindow(window, glxIntegration->waylandDisplay()) - , m_glxIntegration(glxIntegration) - , m_config(qglx_findConfig(glxIntegration->xDisplay(), glxIntegration->screen(), window->format(), GLX_WINDOW_BIT | GLX_PIXMAP_BIT)) -{ -} - -QWaylandWindow::WindowType QWaylandXCompositeGLXWindow::windowType() const -{ - //yeah. this type needs a new name - return QWaylandWindow::Egl; -} - -void QWaylandXCompositeGLXWindow::setGeometry(const QRect &rect) -{ - QWaylandWindow::setGeometry(rect); - - if (m_xWindow) { - XDestroyWindow(m_glxIntegration->xDisplay(), m_xWindow); - m_xWindow = 0; - } -} - -Window QWaylandXCompositeGLXWindow::xWindow() const -{ - if (!m_xWindow) - const_cast<QWaylandXCompositeGLXWindow *>(this)->createSurface(); - - return m_xWindow; -} - -void QWaylandXCompositeGLXWindow::createSurface() -{ - QSize size(geometry().size()); - if (size.isEmpty()) { - //QGLWidget wants a context for a window without geometry - size = QSize(1,1); - } - - if (!m_glxIntegration->xDisplay()) { - qWarning("XCompositeGLXWindow: X display still null?!"); - return; - } - - XVisualInfo *visualInfo = glXGetVisualFromFBConfig(m_glxIntegration->xDisplay(), m_config); - Colormap cmap = XCreateColormap(m_glxIntegration->xDisplay(), m_glxIntegration->rootWindow(), - visualInfo->visual, AllocNone); - - XSetWindowAttributes a; - a.background_pixel = WhitePixel(m_glxIntegration->xDisplay(), m_glxIntegration->screen()); - a.border_pixel = BlackPixel(m_glxIntegration->xDisplay(), m_glxIntegration->screen()); - a.colormap = cmap; - m_xWindow = XCreateWindow(m_glxIntegration->xDisplay(), m_glxIntegration->rootWindow(),0, 0, size.width(), size.height(), - 0, visualInfo->depth, InputOutput, visualInfo->visual, - CWBackPixel|CWBorderPixel|CWColormap, &a); - - XCompositeRedirectWindow(m_glxIntegration->xDisplay(), m_xWindow, CompositeRedirectManual); - XMapWindow(m_glxIntegration->xDisplay(), m_xWindow); - - XSync(m_glxIntegration->xDisplay(), False); - mBuffer = new QWaylandXCompositeBuffer(m_glxIntegration->waylandXComposite(), - (uint32_t)m_xWindow, - size); -} - -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h deleted file mode 100644 index 45a77a29..00000000 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDXCOMPOSITEGLXWINDOW_H -#define QWAYLANDXCOMPOSITEGLXWINDOW_H - -#include <QtWaylandClient/private/qwaylandwindow_p.h> -#include "qwaylandxcompositeglxintegration.h" -#include "qwaylandxcompositeglxcontext.h" - -#include <QtCore/QWaitCondition> - -#include <QtWaylandClient/private/qwaylandbuffer_p.h> - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeGLXWindow : public QWaylandWindow -{ -public: - QWaylandXCompositeGLXWindow(QWindow *window, QWaylandXCompositeGLXIntegration *glxIntegration); - WindowType windowType() const override; - - void setGeometry(const QRect &rect) override; - - Window xWindow() const; - - QWaylandBuffer *buffer() { return mBuffer; } - -private: - void createSurface(); - - QWaylandXCompositeGLXIntegration *m_glxIntegration = nullptr; - - Window m_xWindow = 0; - GLXFBConfig m_config; - QWaylandBuffer *mBuffer = nullptr; -}; - -} - -QT_END_NAMESPACE - -#endif // QWAYLANDXCOMPOSITEGLXWINDOW_H diff --git a/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri b/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri deleted file mode 100644 index b836724f..00000000 --- a/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri +++ /dev/null @@ -1,14 +0,0 @@ -INCLUDEPATH += $$PWD -include ($$PWD/../xcomposite_share/xcomposite_share.pri) - -QMAKE_USE += wayland-client libdl - -SOURCES += \ - $$PWD/qwaylandxcompositeglxcontext.cpp \ - $$PWD/qwaylandxcompositeglxintegration.cpp \ - $$PWD/qwaylandxcompositeglxwindow.cpp - -HEADERS += \ - $$PWD/qwaylandxcompositeglxcontext.h \ - $$PWD/qwaylandxcompositeglxintegration.h \ - $$PWD/qwaylandxcompositeglxwindow.h diff --git a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp b/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp deleted file mode 100644 index 33d9a603..00000000 --- a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandxcompositebuffer.h" - -#include "wayland-xcomposite-client-protocol.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -QWaylandXCompositeBuffer::QWaylandXCompositeBuffer(qt_xcomposite *xcomposite, uint32_t window, const QSize &size) - :mSize(size) -{ - mBuffer = qt_xcomposite_create_buffer(xcomposite, - window, - size.width(), - size.height()); -} - -QSize QWaylandXCompositeBuffer::size() const -{ - return mSize; -} - -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h b/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h deleted file mode 100644 index 2c11fd52..00000000 --- a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDXCOMPOSITEBUFFER_H -#define QWAYLANDXCOMPOSITEBUFFER_H - -#include <QtWaylandClient/private/qwaylandbuffer_p.h> -#include <stdint.h> - -struct qt_xcomposite; -struct wl_visual; - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeBuffer : public QWaylandBuffer -{ -public: - QWaylandXCompositeBuffer(qt_xcomposite *xcomposite, - uint32_t window, - const QSize &size); - - QSize size() const override; -private: - QSize mSize; -}; - -} - -QT_END_NAMESPACE - -#endif // QWAYLANDXCOMPOSITEBUFFER_H diff --git a/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri b/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri deleted file mode 100644 index d2b129d0..00000000 --- a/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri +++ /dev/null @@ -1,11 +0,0 @@ -INCLUDEPATH += $$PWD - -QMAKE_USE += xcomposite x11 -CONFIG += wayland-scanner-client-wayland-protocol-include -WAYLANDCLIENTSOURCES += $$PWD/../../../extensions/xcomposite.xml - -HEADERS += \ - $$PWD/qwaylandxcompositebuffer.h - -SOURCES += \ - $$PWD/qwaylandxcompositebuffer.cpp diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pri b/src/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pri deleted file mode 100644 index 6d0f8165..00000000 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pri +++ /dev/null @@ -1,11 +0,0 @@ -include($$PWD/../xcomposite_share/xcomposite_share.pri) - -QMAKE_USE_PRIVATE += egl wayland-server x11 - -INCLUDEPATH += $$PWD - -HEADERS += \ - $$PWD/xcompositeeglintegration.h - -SOURCES += \ - $$PWD/xcompositeeglintegration.cpp diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp deleted file mode 100644 index 770656c2..00000000 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "xcompositeeglintegration.h" - -#include "wayland-xcomposite-server-protocol.h" - -#include <QtWaylandCompositor/QWaylandCompositor> -#include <QtOpenGL/QOpenGLTexture> -#include <QtGui/QGuiApplication> -#include <qpa/qplatformnativeinterface.h> -#include <qpa/qplatformopenglcontext.h> - -#include "xcompositebuffer.h" -#include "xcompositehandler.h" -#include <X11/extensions/Xcomposite.h> - -#include <QtCore/QDebug> - -QT_BEGIN_NAMESPACE - -QList<EGLint> eglbuildSpec() -{ - QList<EGLint> spec; - - spec.append(EGL_SURFACE_TYPE); spec.append(EGL_WINDOW_BIT | EGL_PIXMAP_BIT); - spec.append(EGL_RENDERABLE_TYPE); spec.append(EGL_OPENGL_ES2_BIT); - spec.append(EGL_BIND_TO_TEXTURE_RGBA); spec.append(EGL_TRUE); - spec.append(EGL_ALPHA_SIZE); spec.append(8); - spec.append(EGL_NONE); - return spec; -} - -XCompositeEglClientBufferIntegration::XCompositeEglClientBufferIntegration() -{ - -} - -void XCompositeEglClientBufferIntegration::initializeHardware(struct ::wl_display *) -{ - QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); - if (nativeInterface) { - mDisplay = static_cast<Display *>(nativeInterface->nativeResourceForIntegration("Display")); - if (!mDisplay) - qFatal("could not retrieve Display from platform integration"); - mEglDisplay = static_cast<EGLDisplay>(nativeInterface->nativeResourceForIntegration("EGLDisplay")); - if (!mEglDisplay) - qFatal("could not retrieve EGLDisplay from platform integration"); - } else { - qFatal("Platform integration doesn't have native interface"); - } - mHandler = new XCompositeHandler(m_compositor, mDisplay); -} - -QtWayland::ClientBuffer *XCompositeEglClientBufferIntegration::createBufferFor(wl_resource *buffer) -{ - if (!mHandler->isXCompositeBuffer(buffer)) - return nullptr; - return new XCompositeEglClientBuffer(this, buffer); -} - - -XCompositeEglClientBuffer::XCompositeEglClientBuffer(XCompositeEglClientBufferIntegration *integration, wl_resource *bufferResource) - : QtWayland::ClientBuffer(bufferResource) - , m_integration(integration) -{ -} - -QOpenGLTexture *XCompositeEglClientBuffer::toOpenGlTexture(int plane) -{ - Q_UNUSED(plane); - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(m_buffer); - Pixmap pixmap = XCompositeNameWindowPixmap(m_integration->xDisplay(), compositorBuffer->window()); - - QList<EGLint> eglConfigSpec = eglbuildSpec(); - - EGLint matching = 0; - EGLConfig config; - bool matched = eglChooseConfig(m_integration->eglDisplay(),eglConfigSpec.constData(),&config,1,&matching); - if (!matched || !matching) { - qWarning("Could not retrieve a suitable EGL config"); - return nullptr; - } - - QList<EGLint> attribList; - - attribList.append(EGL_TEXTURE_FORMAT); - attribList.append(EGL_TEXTURE_RGBA); - attribList.append(EGL_TEXTURE_TARGET); - attribList.append(EGL_TEXTURE_2D); - attribList.append(EGL_NONE); - - EGLSurface surface = eglCreatePixmapSurface(m_integration->eglDisplay(), config, reinterpret_cast<EGLNativePixmapType>(pixmap), attribList.constData()); - if (surface == EGL_NO_SURFACE) { - qDebug() << "Failed to create eglsurface" << pixmap << compositorBuffer->window(); - } - - compositorBuffer->setOrigin(QWaylandSurface::OriginTopLeft); - - if (!m_texture) { - m_texture = new QOpenGLTexture(QOpenGLTexture::Target2D); - m_texture->create(); - } - m_texture->bind(); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - if (!eglBindTexImage(m_integration->eglDisplay(),surface,EGL_BACK_BUFFER)) { - qWarning() << "Failed to bind"; - } - - // eglDestroySurface(mEglDisplay,surface); - return m_texture; -} - - -QWaylandSurface::Origin XCompositeEglClientBuffer::origin() const -{ - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(m_buffer); - return compositorBuffer->origin(); -} - -QSize XCompositeEglClientBuffer::size() const -{ - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(m_buffer); - - return compositorBuffer->size(); -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h deleted file mode 100644 index ae7354f8..00000000 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XCOMPOSITEEGLINTEGRATION_H -#define XCOMPOSITEEGLINTEGRATION_H - -#include <QtWaylandCompositor/private/qwlclientbufferintegration_p.h> - -#include <QtWaylandCompositor/QWaylandCompositor> -#include <QtWaylandCompositor/private/qwlclientbuffer_p.h> -#include "xlibinclude.h" - -#include <EGL/egl.h> - -QT_BEGIN_NAMESPACE - -class XCompositeHandler; - -class XCompositeEglClientBufferIntegration : public QtWayland::ClientBufferIntegration -{ -public: - XCompositeEglClientBufferIntegration(); - - void initializeHardware(struct ::wl_display *display) override; - QtWayland::ClientBuffer *createBufferFor(wl_resource *buffer) override; - inline Display *xDisplay() const { return mDisplay; } - inline EGLDisplay eglDisplay() const { return mEglDisplay; } - -private: - Display *mDisplay = nullptr; - EGLDisplay mEglDisplay = EGL_NO_DISPLAY; - XCompositeHandler *mHandler = nullptr; -}; - -class XCompositeEglClientBuffer : public QtWayland::ClientBuffer -{ -public: - XCompositeEglClientBuffer(XCompositeEglClientBufferIntegration *integration, wl_resource *bufferResource); - - QSize size() const override; - QWaylandSurface::Origin origin() const override; - QOpenGLTexture *toOpenGlTexture(int plane) override; - QWaylandBufferRef::BufferFormatEgl bufferFormatEgl() const override { - return QWaylandBufferRef::BufferFormatEgl_RGBA; - } - -private: - QOpenGLTexture *m_texture = nullptr; - XCompositeEglClientBufferIntegration *m_integration = nullptr; -}; - -QT_END_NAMESPACE - -#endif // XCOMPOSITEEGLINTEGRATION_H diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pri b/src/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pri deleted file mode 100644 index c02c873a..00000000 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pri +++ /dev/null @@ -1,11 +0,0 @@ -include($$PWD/../xcomposite_share/xcomposite_share.pri) - -QMAKE_USE_PRIVATE += wayland-server xlib - -INCLUDEPATH += $$PWD - -HEADERS += \ - $$PWD/xcompositeglxintegration.h - -SOURCES += \ - $$PWD/xcompositeglxintegration.cpp diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp deleted file mode 100644 index b8415e88..00000000 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "xcompositeglxintegration.h" - -#include "wayland-xcomposite-server-protocol.h" - -#include <qpa/qplatformnativeinterface.h> -#include <qpa/qplatformintegration.h> -#include <QtOpenGL/QOpenGLTexture> -#include <QtGui/QOpenGLContext> - -#include "xcompositebuffer.h" -#include "xcompositehandler.h" -#include <X11/extensions/Xcomposite.h> - -#include <QtCore/QDebug> - -QT_BEGIN_NAMESPACE - -QList<int> qglx_buildSpec() -{ - QList<int> spec(48); - int i = 0; - - spec[i++] = GLX_LEVEL; - spec[i++] = 0; - spec[i++] = GLX_DRAWABLE_TYPE; spec[i++] = GLX_PIXMAP_BIT | GLX_WINDOW_BIT; - spec[i++] = GLX_BIND_TO_TEXTURE_TARGETS_EXT; spec[i++] = GLX_TEXTURE_2D_BIT_EXT; - spec[i++] = GLX_BIND_TO_TEXTURE_RGB_EXT; spec[i++] = true; - - spec[i++] = 0; - return spec; -} - - -XCompositeGLXClientBufferIntegration::XCompositeGLXClientBufferIntegration() -{ - qDebug() << "Loading GLX integration"; -} - -XCompositeGLXClientBufferIntegration::~XCompositeGLXClientBufferIntegration() -{ - delete mHandler; -} - -void XCompositeGLXClientBufferIntegration::initializeHardware(struct ::wl_display *) -{ - qDebug() << "Initializing GLX integration"; - QPlatformNativeInterface *nativeInterface = QGuiApplicationPrivate::platformIntegration()->nativeInterface(); - if (nativeInterface) { - mDisplay = static_cast<Display *>(nativeInterface->nativeResourceForIntegration("Display")); - if (!mDisplay) - qFatal("could not retrieve Display from platform integration"); - } else { - qFatal("Platform integration doesn't have native interface"); - } - mScreen = XDefaultScreen(mDisplay); - - mHandler = new XCompositeHandler(m_compositor, mDisplay); - - QOpenGLContext *glContext = new QOpenGLContext(); - glContext->create(); - - m_glxBindTexImageEXT = reinterpret_cast<PFNGLXBINDTEXIMAGEEXTPROC>(glContext->getProcAddress("glXBindTexImageEXT")); - if (!m_glxBindTexImageEXT) { - qDebug() << "Did not find glxBindTexImageExt, everything will FAIL!"; - } - m_glxReleaseTexImageEXT = reinterpret_cast<PFNGLXRELEASETEXIMAGEEXTPROC>(glContext->getProcAddress("glXReleaseTexImageEXT")); - if (!m_glxReleaseTexImageEXT) { - qDebug() << "Did not find glxReleaseTexImageExt"; - } - - delete glContext; -} - -QtWayland::ClientBuffer *XCompositeGLXClientBufferIntegration::createBufferFor(wl_resource *buffer) -{ - if (!mHandler->isXCompositeBuffer(buffer)) - return nullptr; - return new XCompositeGLXClientBuffer(this, buffer); -} - -XCompositeGLXClientBuffer::XCompositeGLXClientBuffer(XCompositeGLXClientBufferIntegration *integration, wl_resource *bufferResource) - : QtWayland::ClientBuffer(bufferResource) - , m_integration(integration) -{ -} - - -QOpenGLTexture *XCompositeGLXClientBuffer::toOpenGlTexture(int plane) -{ - Q_UNUSED(plane); - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(m_buffer); - Pixmap pixmap = XCompositeNameWindowPixmap(m_integration->xDisplay(), compositorBuffer->window()); - - QList<int> glxConfigSpec = qglx_buildSpec(); - int numberOfConfigs; - GLXFBConfig *configs = glXChooseFBConfig(m_integration->xDisplay(),m_integration->xScreen(),glxConfigSpec.constData(),&numberOfConfigs); - - QList<int> attribList; - attribList.append(GLX_TEXTURE_FORMAT_EXT); - attribList.append(GLX_TEXTURE_FORMAT_RGB_EXT); - attribList.append(GLX_TEXTURE_TARGET_EXT); - attribList.append(GLX_TEXTURE_2D_EXT); - attribList.append(0); - - if (!m_glxPixmap) - m_glxPixmap = glXCreatePixmap(m_integration->xDisplay(), *configs, pixmap, attribList.constData()); - - uint inverted = 0; - glXQueryDrawable(m_integration->xDisplay(), m_glxPixmap, GLX_Y_INVERTED_EXT,&inverted); - compositorBuffer->setOrigin(inverted ? QWaylandSurface::OriginBottomLeft : QWaylandSurface::OriginTopLeft); - - XFree(configs); - auto tex = m_texture; - if (!m_texture) { - tex = new QOpenGLTexture(QOpenGLTexture::Target2D); - tex->create(); - m_texture = tex; - } - tex->bind(); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - m_integration->m_glxBindTexImageEXT(m_integration->xDisplay(),m_glxPixmap,GLX_FRONT_EXT, nullptr); - - // TODO: release in the destructor? - // m_glxReleaseTexImageEXT(mDisplay,glxPixmap,GLX_FRONT_EXT); - return tex; -} - - -QWaylandSurface::Origin XCompositeGLXClientBuffer::origin() const -{ - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(m_buffer); - return compositorBuffer->origin(); -} - -QSize XCompositeGLXClientBuffer::size() const -{ - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(m_buffer); - - return compositorBuffer->size(); -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h deleted file mode 100644 index e783d41b..00000000 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XCOMPOSITEGLXINTEGRATION_H -#define XCOMPOSITEGLXINTEGRATION_H - -#include <QtWaylandCompositor/private/qwlclientbufferintegration_p.h> -#include <QtWaylandCompositor/private/qwlclientbuffer_p.h> -#include "xlibinclude.h" - -#define GLX_GLXEXT_PROTOTYPES -#include <GL/glx.h> -#include <GL/glxext.h> - -QT_BEGIN_NAMESPACE - -class XCompositeHandler; - -class XCompositeGLXClientBufferIntegration : public QtWayland::ClientBufferIntegration -{ -public: - XCompositeGLXClientBufferIntegration(); - ~XCompositeGLXClientBufferIntegration() override; - - void initializeHardware(struct ::wl_display *display) override; - QtWayland::ClientBuffer *createBufferFor(wl_resource *buffer) override; - - inline Display *xDisplay() const { return mDisplay; } - inline int xScreen() const { return mScreen; } - - PFNGLXBINDTEXIMAGEEXTPROC m_glxBindTexImageEXT; - PFNGLXRELEASETEXIMAGEEXTPROC m_glxReleaseTexImageEXT; - -private: - Display *mDisplay = nullptr; - int mScreen; - XCompositeHandler *mHandler = nullptr; -}; - -class XCompositeGLXClientBuffer : public QtWayland::ClientBuffer -{ -public: - XCompositeGLXClientBuffer(XCompositeGLXClientBufferIntegration *integration, wl_resource *bufferResource); - - QSize size() const override; - QWaylandSurface::Origin origin() const override; - QOpenGLTexture *toOpenGlTexture(int plane) override; - QWaylandBufferRef::BufferFormatEgl bufferFormatEgl() const override { - return QWaylandBufferRef::BufferFormatEgl_RGBA; - } - -private: - QOpenGLTexture *m_texture = nullptr; - XCompositeGLXClientBufferIntegration *m_integration = nullptr; - GLXPixmap m_glxPixmap = 0; -}; - -QT_END_NAMESPACE - -#endif // XCOMPOSITEGLXINTEGRATION_H diff --git a/src/hardwareintegration/compositor/xcomposite_share/xcomposite_share.pri b/src/hardwareintegration/compositor/xcomposite_share/xcomposite_share.pri deleted file mode 100644 index 69ab6aa1..00000000 --- a/src/hardwareintegration/compositor/xcomposite_share/xcomposite_share.pri +++ /dev/null @@ -1,16 +0,0 @@ -INCLUDEPATH += $$PWD - -QMAKE_USE += xcomposite -CONFIG += wayland-scanner -WAYLANDSERVERSOURCES += $$PWD/../../../extensions/xcomposite.xml $$PWD/../../../3rdparty/protocol/wayland.xml - -HEADERS += \ - $$PWD/xcompositebuffer.h \ - $$PWD/xcompositehandler.h \ - $$PWD/xlibinclude.h - -SOURCES += \ - $$PWD/xcompositebuffer.cpp \ - $$PWD/xcompositehandler.cpp - -QT += gui-private diff --git a/src/hardwareintegration/compositor/xcomposite_share/xcompositebuffer.cpp b/src/hardwareintegration/compositor/xcomposite_share/xcompositebuffer.cpp deleted file mode 100644 index b79a713a..00000000 --- a/src/hardwareintegration/compositor/xcomposite_share/xcompositebuffer.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "xcompositehandler.h" -#include "xcompositebuffer.h" - -QT_BEGIN_NAMESPACE - -XCompositeBuffer::XCompositeBuffer(Window window, const QSize &size, - struct ::wl_client *client, uint32_t id, XCompositeHandler *handler) - : QtWaylandServer::wl_buffer(client, id, 1) - , mWindow(window) - , mOrigin(QWaylandSurface::OriginBottomLeft) - , mSize(size) - , mHandler(handler) -{ -} - -void XCompositeBuffer::buffer_destroy_resource(Resource *resource) -{ - mHandler->removeBuffer(resource->handle); - delete this; -} - -void XCompositeBuffer::buffer_destroy(Resource *resource) -{ - wl_resource_destroy(resource->handle); -} - -Window XCompositeBuffer::window() -{ - return mWindow; -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/compositor/xcomposite_share/xcompositebuffer.h b/src/hardwareintegration/compositor/xcomposite_share/xcompositebuffer.h deleted file mode 100644 index 0e6e6345..00000000 --- a/src/hardwareintegration/compositor/xcomposite_share/xcompositebuffer.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XCOMPOSITEBUFFER_H -#define XCOMPOSITEBUFFER_H - -#include <qwayland-server-wayland.h> - -#include <QtWaylandCompositor/private/qwaylandutils_p.h> - -#include <QtWaylandCompositor/QWaylandSurface> -#include <QtWaylandCompositor/QWaylandCompositor> - -#include <QtCore/QSize> - -#include <QtCore/QTextStream> -#include <QtCore/QDataStream> -#include <QtCore/QMetaType> -#include <QtCore/QVariant> - -#include <X11/X.h> - -QT_BEGIN_NAMESPACE - -class XCompositeHandler; - -class XCompositeBuffer : public QtWaylandServer::wl_buffer -{ -public: - XCompositeBuffer(Window window, const QSize &size, - struct ::wl_client *client, uint32_t id, XCompositeHandler *handler); - - Window window(); - - QWaylandSurface::Origin origin() const { return mOrigin; } - void setOrigin(QWaylandSurface::Origin origin) { mOrigin = origin; } - - QSize size() const { return mSize; } - - static XCompositeBuffer *fromResource(struct ::wl_resource *resource) { return QtWayland::fromResource<XCompositeBuffer *>(resource); } - -protected: - void buffer_destroy_resource(Resource *) override; - void buffer_destroy(Resource *) override; - -private: - Window mWindow; - QWaylandSurface::Origin mOrigin; - QSize mSize; - XCompositeHandler *mHandler = nullptr; -}; - -QT_END_NAMESPACE - -#endif // XCOMPOSITORBUFFER_H diff --git a/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.cpp b/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.cpp deleted file mode 100644 index c4e2d226..00000000 --- a/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "xcompositehandler.h" - -#include "wayland-xcomposite-server-protocol.h" - -#include "xcompositebuffer.h" -#include <X11/extensions/Xcomposite.h> - -QT_BEGIN_NAMESPACE - -XCompositeHandler::XCompositeHandler(QWaylandCompositor *compositor, Display *display) - : QtWaylandServer::qt_xcomposite(compositor->display(), 1) -{ - mFakeRootWindow = new QWindow(); - mFakeRootWindow->setGeometry(QRect(-1,-1,1,1)); - mFakeRootWindow->create(); - mFakeRootWindow->show(); - - int composite_event_base, composite_error_base; - if (!XCompositeQueryExtension(display, &composite_event_base, &composite_error_base)) - qFatal("XComposite required"); - - mDisplayString = QString::fromLocal8Bit(XDisplayString(display)); -} - -void XCompositeHandler::xcomposite_bind_resource(Resource *resource) -{ - send_root(resource->handle, mDisplayString, mFakeRootWindow->winId()); -} - -void XCompositeHandler::xcomposite_create_buffer(Resource *resource, uint32_t id, uint32_t window, - int32_t width, int32_t height) -{ - auto *buf = new XCompositeBuffer(Window(window), QSize(width, height), resource->client(), id, this); - mKnownBuffers.insert(buf->resource()->handle); -} - -QT_END_NAMESPACE diff --git a/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.h b/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.h deleted file mode 100644 index 4f7dc406..00000000 --- a/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XCOMPOSITEHANDLER_H -#define XCOMPOSITEHANDLER_H - -#include <QtWaylandCompositor/QWaylandCompositor> - -#include "xlibinclude.h" - -#include "qwayland-server-xcomposite.h" -#include <wayland-server-core.h> - -QT_BEGIN_NAMESPACE - -class XCompositeHandler : public QtWaylandServer::qt_xcomposite -{ -public: - XCompositeHandler(QWaylandCompositor *compositor, Display *display); - bool isXCompositeBuffer(wl_resource *resource) { return mKnownBuffers.contains(resource); } - void removeBuffer(wl_resource *resource) { mKnownBuffers.remove(resource); } - -private: - QWindow *mFakeRootWindow = nullptr; - QString mDisplayString; - QSet<wl_resource *> mKnownBuffers; - - void xcomposite_bind_resource(Resource *resource) override; - void xcomposite_create_buffer(Resource *resource, uint32_t id, uint32_t x_window, - int32_t width, int32_t height) override; -}; - -QT_END_NAMESPACE - -#endif // XCOMPOSITEHANDLER_H diff --git a/src/hardwareintegration/compositor/xcomposite_share/xlibinclude.h b/src/hardwareintegration/compositor/xcomposite_share/xlibinclude.h deleted file mode 100644 index ca3542aa..00000000 --- a/src/hardwareintegration/compositor/xcomposite_share/xlibinclude.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XLIBINCLUDE_H -#define XLIBINCLUDE_H - -#include <QtCore/QEvent> -#include <QtCore/QTextStream> -#include <QtCore/QDataStream> -#include <QtCore/QMetaType> -#include <QtCore/QVariant> -#include <QtGui/QCursor> -#include <QtGui/private/qguiapplication_p.h> - -#include <X11/Xlib.h> -#include "X11/extensions/Xcomposite.h" - -enum { - XFocusOut = FocusOut, - XFocusIn = FocusIn, - XKeyPress = KeyPress, - XKeyRelease = KeyRelease, - XNone = None, - XRevertToParent = RevertToParent, - XGrayScale = GrayScale, - XCursorShape = CursorShape -}; -#undef FocusOut -#undef FocusIn -#undef KeyPress -#undef KeyRelease -#undef None -#undef RevertToParent -#undef GrayScale -#undef CursorShape - -#ifdef FontChange -#undef FontChange -#endif - -#endif //XLIBINCLUDE_H diff --git a/src/plugins/hardwareintegration/client/CMakeLists.txt b/src/plugins/hardwareintegration/client/CMakeLists.txt index 32493e4b..e86b6460 100644 --- a/src/plugins/hardwareintegration/client/CMakeLists.txt +++ b/src/plugins/hardwareintegration/client/CMakeLists.txt @@ -6,12 +6,6 @@ endif() if(QT_FEATURE_wayland_brcm) add_subdirectory(brcm-egl) endif() -if(QT_FEATURE_xcomposite_egl) - add_subdirectory(xcomposite-egl) -endif() -if(QT_FEATURE_xcomposite_glx) - add_subdirectory(xcomposite-glx) -endif() if(QT_FEATURE_wayland_drm_egl_server_buffer) add_subdirectory(drm-egl-server) endif() diff --git a/src/plugins/hardwareintegration/client/xcomposite-egl/CMakeLists.txt b/src/plugins/hardwareintegration/client/xcomposite-egl/CMakeLists.txt deleted file mode 100644 index fe546d7d..00000000 --- a/src/plugins/hardwareintegration/client/xcomposite-egl/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -# Generated from xcomposite-egl.pro. - -##################################################################### -## QWaylandXCompositeEglClientBufferPlugin Plugin: -##################################################################### -qt_find_package(EGL) # special case - -qt_internal_add_plugin(QWaylandXCompositeEglClientBufferPlugin - OUTPUT_NAME xcomposite-egl - PLUGIN_TYPE wayland-graphics-integration-client - SOURCES - ../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp ../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h - ../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp ../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h - ../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp ../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h - ../../../../hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp ../../../../hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h - main.cpp - INCLUDE_DIRECTORIES - ../../../../hardwareintegration/client/xcomposite-egl - ../../../../hardwareintegration/client/xcomposite_share - LIBRARIES - EGL::EGL - PkgConfig::XComposite - Qt::Core - Qt::Gui - Qt::WaylandClientPrivate - Wayland::Client - X11::X11 -) - -qt6_generate_wayland_protocol_client_sources(QWaylandXCompositeEglClientBufferPlugin - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../hardwareintegration/client/xcomposite_share/../../../extensions/xcomposite.xml -) - -#### Keys ignored in scope 1:.:.:xcomposite-egl.pro:<TRUE>: -# OTHER_FILES = "xcomposite-egl.json" -# QMAKE_CXXFLAGS_WARN_ON = "--Wcast-qual" diff --git a/src/plugins/hardwareintegration/client/xcomposite-egl/main.cpp b/src/plugins/hardwareintegration/client/xcomposite-egl/main.cpp deleted file mode 100644 index 585285fa..00000000 --- a/src/plugins/hardwareintegration/client/xcomposite-egl/main.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtWaylandClient/private/qwaylandclientbufferintegrationplugin_p.h> -#include "qwaylandxcompositeeglclientbufferintegration.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeEglClientBufferPlugin : public QWaylandClientBufferIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QWaylandClientBufferIntegrationFactoryInterface_iid FILE "xcomposite-egl.json") -public: - QWaylandClientBufferIntegration *create(const QString&, const QStringList&) override; -}; - -QWaylandClientBufferIntegration *QWaylandXCompositeEglClientBufferPlugin::create(const QString& system, const QStringList& paramList) -{ - Q_UNUSED(paramList); - Q_UNUSED(system); - return new QWaylandXCompositeEGLClientBufferIntegration(); -} - -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/hardwareintegration/client/xcomposite-egl/xcomposite-egl.json b/src/plugins/hardwareintegration/client/xcomposite-egl/xcomposite-egl.json deleted file mode 100644 index 0d119ff8..00000000 --- a/src/plugins/hardwareintegration/client/xcomposite-egl/xcomposite-egl.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "xcomposite-egl" ] -} diff --git a/src/plugins/hardwareintegration/client/xcomposite-glx/CMakeLists.txt b/src/plugins/hardwareintegration/client/xcomposite-glx/CMakeLists.txt deleted file mode 100644 index b4d7340b..00000000 --- a/src/plugins/hardwareintegration/client/xcomposite-glx/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# Generated from xcomposite-glx.pro. - -##################################################################### -## QWaylandXCompositeGlxClientBufferPlugin Plugin: -##################################################################### - -qt_internal_add_plugin(QWaylandXCompositeGlxClientBufferPlugin - OUTPUT_NAME xcomposite-glx - PLUGIN_TYPE wayland-graphics-integration-client - SOURCES - ../../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp ../../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h - ../../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp ../../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h - ../../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp ../../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h - ../../../../hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp ../../../../hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h - main.cpp - INCLUDE_DIRECTORIES - ../../../../hardwareintegration/client/xcomposite-glx - ../../../../hardwareintegration/client/xcomposite_share - LIBRARIES - ${CMAKE_DL_LIBS} - PkgConfig::XComposite - Qt::Core - Qt::Gui - Qt::WaylandClientPrivate - Wayland::Client - X11::X11 -) - -qt6_generate_wayland_protocol_client_sources(QWaylandXCompositeGlxClientBufferPlugin - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../hardwareintegration/client/xcomposite_share/../../../extensions/xcomposite.xml -) - -#### Keys ignored in scope 1:.:.:xcomposite-glx.pro:<TRUE>: -# OTHER_FILES = "xcomposite-glx.json" diff --git a/src/plugins/hardwareintegration/client/xcomposite-glx/main.cpp b/src/plugins/hardwareintegration/client/xcomposite-glx/main.cpp deleted file mode 100644 index f7b878d9..00000000 --- a/src/plugins/hardwareintegration/client/xcomposite-glx/main.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtWaylandClient/private/qwaylandclientbufferintegrationplugin_p.h> -#include "qwaylandxcompositeglxintegration.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeGlxClientBufferPlugin : public QWaylandClientBufferIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QWaylandClientBufferIntegrationFactoryInterface_iid FILE "xcomposite-glx.json") -public: - QWaylandClientBufferIntegration *create(const QString&, const QStringList&) override; -}; - -QWaylandClientBufferIntegration *QWaylandXCompositeGlxClientBufferPlugin::create(const QString& system, const QStringList& paramList) -{ - Q_UNUSED(paramList); - Q_UNUSED(system); - return new QWaylandXCompositeGLXIntegration(); -} - -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/hardwareintegration/client/xcomposite-glx/xcomposite-glx.json b/src/plugins/hardwareintegration/client/xcomposite-glx/xcomposite-glx.json deleted file mode 100644 index e2c4cecd..00000000 --- a/src/plugins/hardwareintegration/client/xcomposite-glx/xcomposite-glx.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "xcomposite-glx" ] -} diff --git a/src/plugins/hardwareintegration/compositor/CMakeLists.txt b/src/plugins/hardwareintegration/compositor/CMakeLists.txt index 67ca5a4b..ff8b8de7 100644 --- a/src/plugins/hardwareintegration/compositor/CMakeLists.txt +++ b/src/plugins/hardwareintegration/compositor/CMakeLists.txt @@ -11,12 +11,6 @@ endif() if(QT_FEATURE_wayland_brcm) add_subdirectory(brcm-egl) endif() -if(QT_FEATURE_xcomposite_egl) - add_subdirectory(xcomposite-egl) -endif() -if(QT_FEATURE_xcomposite_glx) - add_subdirectory(xcomposite-glx) -endif() if(QT_FEATURE_wayland_drm_egl_server_buffer) add_subdirectory(drm-egl-server) endif() diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-egl/CMakeLists.txt b/src/plugins/hardwareintegration/compositor/xcomposite-egl/CMakeLists.txt deleted file mode 100644 index e68a0584..00000000 --- a/src/plugins/hardwareintegration/compositor/xcomposite-egl/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -# Generated from xcomposite-egl.pro. - -##################################################################### -## QWaylandXCompositeEglClientBufferIntegrationPlugin Plugin: -##################################################################### -qt_find_package(EGL) # special case - -qt_internal_add_plugin(QWaylandXCompositeEglClientBufferIntegrationPlugin - OUTPUT_NAME qt-wayland-compositor-xcomposite-egl - PLUGIN_TYPE wayland-graphics-integration-server - SOURCES - ../../../../hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp ../../../../hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h - ../../../../hardwareintegration/compositor/xcomposite_share/xcompositebuffer.cpp ../../../../hardwareintegration/compositor/xcomposite_share/xcompositebuffer.h - ../../../../hardwareintegration/compositor/xcomposite_share/xcompositehandler.cpp ../../../../hardwareintegration/compositor/xcomposite_share/xcompositehandler.h - ../../../../hardwareintegration/compositor/xcomposite_share/xlibinclude.h - main.cpp - INCLUDE_DIRECTORIES - ../../../../hardwareintegration/compositor/xcomposite-egl - ../../../../hardwareintegration/compositor/xcomposite_share - LIBRARIES - EGL::EGL - PkgConfig::XComposite - Qt::Core - Qt::CorePrivate - Qt::Gui - Qt::GuiPrivate - Qt::WaylandCompositor - Qt::WaylandCompositorPrivate - Wayland::Server - X11::X11 -) - -qt6_generate_wayland_protocol_server_sources(QWaylandXCompositeEglClientBufferIntegrationPlugin - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../hardwareintegration/compositor/xcomposite_share/../../../3rdparty/protocol/wayland.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../hardwareintegration/compositor/xcomposite_share/../../../extensions/xcomposite.xml -) - -#### Keys ignored in scope 1:.:.:xcomposite-egl.pro:<TRUE>: -# OTHER_FILES = "xcomposite-egl.json" diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-egl/main.cpp b/src/plugins/hardwareintegration/compositor/xcomposite-egl/main.cpp deleted file mode 100644 index dda589e2..00000000 --- a/src/plugins/hardwareintegration/compositor/xcomposite-egl/main.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtWaylandCompositor/private/qwlclientbufferintegrationplugin_p.h> -#include "xcompositeeglintegration.h" - -QT_BEGIN_NAMESPACE - -class QWaylandXCompositeEglClientBufferIntegrationPlugin : public QtWayland::ClientBufferIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QtWaylandClientBufferIntegrationFactoryInterface_iid FILE "xcomposite-egl.json") -public: - QtWayland::ClientBufferIntegration *create(const QString&, const QStringList&) override; -}; - -QtWayland::ClientBufferIntegration *QWaylandXCompositeEglClientBufferIntegrationPlugin::create(const QString& system, const QStringList& paramList) -{ - Q_UNUSED(paramList); - Q_UNUSED(system); - return new XCompositeEglClientBufferIntegration(); -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.json b/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.json deleted file mode 100644 index 0d119ff8..00000000 --- a/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "xcomposite-egl" ] -} diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-glx/CMakeLists.txt b/src/plugins/hardwareintegration/compositor/xcomposite-glx/CMakeLists.txt deleted file mode 100644 index a0befcc2..00000000 --- a/src/plugins/hardwareintegration/compositor/xcomposite-glx/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -# Generated from xcomposite-glx.pro. - -##################################################################### -## QWaylandXCompositeGlxClientBufferIntegrationPlugin Plugin: -##################################################################### - -qt_internal_add_plugin(QWaylandXCompositeGlxClientBufferIntegrationPlugin - OUTPUT_NAME qt-wayland-compositor-xcomposite-glx - PLUGIN_TYPE wayland-graphics-integration-server - SOURCES - ../../../../hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp ../../../../hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h - ../../../../hardwareintegration/compositor/xcomposite_share/xcompositebuffer.cpp ../../../../hardwareintegration/compositor/xcomposite_share/xcompositebuffer.h - ../../../../hardwareintegration/compositor/xcomposite_share/xcompositehandler.cpp ../../../../hardwareintegration/compositor/xcomposite_share/xcompositehandler.h - ../../../../hardwareintegration/compositor/xcomposite_share/xlibinclude.h - main.cpp - INCLUDE_DIRECTORIES - ../../../../hardwareintegration/compositor/xcomposite-glx - ../../../../hardwareintegration/compositor/xcomposite_share - LIBRARIES - PkgConfig::XComposite - Qt::Core - Qt::CorePrivate - Qt::Gui - Qt::GuiPrivate - Qt::WaylandCompositor - Qt::WaylandCompositorPrivate - Wayland::Server - X11::X11 -) - -qt6_generate_wayland_protocol_server_sources(QWaylandXCompositeGlxClientBufferIntegrationPlugin - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../hardwareintegration/compositor/xcomposite_share/../../../3rdparty/protocol/wayland.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../hardwareintegration/compositor/xcomposite_share/../../../extensions/xcomposite.xml -) - -#### Keys ignored in scope 1:.:.:xcomposite-glx.pro:<TRUE>: -# OTHER_FILES = "xcomposite-glx.json" diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-glx/main.cpp b/src/plugins/hardwareintegration/compositor/xcomposite-glx/main.cpp deleted file mode 100644 index b33ee6b9..00000000 --- a/src/plugins/hardwareintegration/compositor/xcomposite-glx/main.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtWaylandCompositor/private/qwlclientbufferintegrationplugin_p.h> -#include "xcompositeglxintegration.h" - -QT_BEGIN_NAMESPACE - -class QWaylandXCompositeGlxClientBufferIntegrationPlugin : public QtWayland::ClientBufferIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QtWaylandClientBufferIntegrationFactoryInterface_iid FILE "xcomposite-glx.json") -public: - QtWayland::ClientBufferIntegration *create(const QString&, const QStringList&) override; -}; - -QtWayland::ClientBufferIntegration *QWaylandXCompositeGlxClientBufferIntegrationPlugin::create(const QString& system, const QStringList& paramList) -{ - Q_UNUSED(paramList); - Q_UNUSED(system); - return new XCompositeGLXClientBufferIntegration(); -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.json b/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.json deleted file mode 100644 index e2c4cecd..00000000 --- a/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "xcomposite-glx" ] -} diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index 68a49e4c..21f008ef 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -7,9 +7,3 @@ endif() if(QT_FEATURE_wayland_brcm) add_subdirectory(qwayland-brcm-egl) endif() -if(QT_FEATURE_xcomposite_egl) - add_subdirectory(qwayland-xcomposite-egl) -endif() -if(QT_FEATURE_xcomposite_glx) - add_subdirectory(qwayland-xcomposite-glx) -endif() diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/CMakeLists.txt b/src/plugins/platforms/qwayland-xcomposite-egl/CMakeLists.txt deleted file mode 100644 index 3029061f..00000000 --- a/src/plugins/platforms/qwayland-xcomposite-egl/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# Generated from qwayland-xcomposite-egl.pro. - -##################################################################### -## QWaylandXCompositeEglPlatformIntegrationPlugin Plugin: -##################################################################### -qt_find_package(EGL) # special case - -qt_internal_add_plugin(QWaylandXCompositeEglPlatformIntegrationPlugin - OUTPUT_NAME qwayland-xcomposite-egl - PLUGIN_TYPE platforms - SOURCES - ../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp ../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h - ../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp ../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h - ../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp ../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h - ../../../hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp ../../../hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h - main.cpp - INCLUDE_DIRECTORIES - ../../../hardwareintegration/client/xcomposite-egl - ../../../hardwareintegration/client/xcomposite_share - LIBRARIES - EGL::EGL - PkgConfig::XComposite - Qt::Core - Qt::Gui - Qt::WaylandClientPrivate - Wayland::Client - X11::X11 -) - -qt6_generate_wayland_protocol_client_sources(QWaylandXCompositeEglPlatformIntegrationPlugin - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/../../../hardwareintegration/client/xcomposite_share/../../../extensions/xcomposite.xml -) - -#### Keys ignored in scope 1:.:.:qwayland-xcomposite-egl.pro:<TRUE>: -# OTHER_FILES = "qwayland-xcomposite-egl.json" diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/main.cpp b/src/plugins/platforms/qwayland-xcomposite-egl/main.cpp deleted file mode 100644 index d191bba9..00000000 --- a/src/plugins/platforms/qwayland-xcomposite-egl/main.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qpa/qplatformintegrationplugin.h> -#include "qwaylandxcompositeeglplatformintegration.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeEglPlatformIntegrationPlugin : public QPlatformIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "qwayland-xcomposite-egl.json") -public: - QPlatformIntegration *create(const QString&, const QStringList&) override; -}; - -QPlatformIntegration *QWaylandXCompositeEglPlatformIntegrationPlugin::create(const QString& system, const QStringList& paramList) -{ - Q_UNUSED(paramList); - Q_UNUSED(system); - auto *integration = new QWaylandXCompositeEglPlatformIntegration(); - - if (integration->hasFailed()) { - delete integration; - integration = nullptr; - } - - return integration; -} - -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.json b/src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.json deleted file mode 100644 index 03dac08b..00000000 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "wayland-xcomposite-egl" ] -} diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h deleted file mode 100644 index 4889f646..00000000 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDXCOMPOSITEEGLPLATFORMINTEGRATION_H -#define QWAYLANDXCOMPOSITEEGLPLATFORMINTEGRATION_H - -#include <QtWaylandClient/private/qwaylandintegration_p.h> - -#include "qwaylandxcompositeeglclientbufferintegration.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeEglPlatformIntegration : public QWaylandIntegration -{ -public: - QWaylandXCompositeEglPlatformIntegration() - : m_client_buffer_integration(new QWaylandXCompositeEGLClientBufferIntegration()) - { - m_client_buffer_integration->initialize(display()); - } - - QWaylandClientBufferIntegration *clientBufferIntegration() const override - { return m_client_buffer_integration; } - -private: - QWaylandClientBufferIntegration *m_client_buffer_integration; -}; - -} - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/CMakeLists.txt b/src/plugins/platforms/qwayland-xcomposite-glx/CMakeLists.txt deleted file mode 100644 index 38f56d33..00000000 --- a/src/plugins/platforms/qwayland-xcomposite-glx/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# Generated from qwayland-xcomposite-glx.pro. - -##################################################################### -## QWaylandXCompositeGlxPlatformIntegrationPlugin Plugin: -##################################################################### - -qt_internal_add_plugin(QWaylandXCompositeGlxPlatformIntegrationPlugin - OUTPUT_NAME qwayland-xcomposite-glx - PLUGIN_TYPE platforms - SOURCES - ../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp ../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h - ../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp ../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h - ../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp ../../../hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h - ../../../hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp ../../../hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h - main.cpp - qwaylandxcompositeglxplatformintegration.h - INCLUDE_DIRECTORIES - ../../../hardwareintegration/client/xcomposite-glx - ../../../hardwareintegration/client/xcomposite_share - LIBRARIES - ${CMAKE_DL_LIBS} - PkgConfig::XComposite - Qt::Core - Qt::Gui - Qt::WaylandClientPrivate - Wayland::Client - X11::X11 -) - -qt6_generate_wayland_protocol_client_sources(QWaylandXCompositeGlxPlatformIntegrationPlugin - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/../../../hardwareintegration/client/xcomposite_share/../../../extensions/xcomposite.xml -) - -#### Keys ignored in scope 1:.:.:qwayland-xcomposite-glx.pro:<TRUE>: -# OTHER_FILES = "qwayland-xcomposite-glx.json" diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/main.cpp b/src/plugins/platforms/qwayland-xcomposite-glx/main.cpp deleted file mode 100644 index 1dfbc0cf..00000000 --- a/src/plugins/platforms/qwayland-xcomposite-glx/main.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qpa/qplatformintegrationplugin.h> -#include <QtWaylandClient/private/qwaylandintegration_p.h> - -#include "qwaylandxcompositeglxplatformintegration.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeGlxPlatformIntegrationPlugin : public QPlatformIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "qwayland-xcomposite-glx.json") -public: - QPlatformIntegration *create(const QString&, const QStringList&) override; -}; - -QPlatformIntegration *QWaylandXCompositeGlxPlatformIntegrationPlugin::create(const QString& system, const QStringList& paramList) -{ - Q_UNUSED(paramList); - Q_UNUSED(system); - auto *integration = new QWaylandXCompositeGlxPlatformIntegration(); - - if (integration->hasFailed()) { - delete integration; - integration = nullptr; - } - - return integration; -} - -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.json b/src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.json deleted file mode 100644 index 0f4a3bf6..00000000 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "wayland-xcomposite-glx" ] -} diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxplatformintegration.h b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxplatformintegration.h deleted file mode 100644 index 3e6eeea4..00000000 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxplatformintegration.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDXCOMPOSITEGLXPLATFORMINTEGRATION_H -#define QWAYLANDXCOMPOSITEGLXPLATFORMINTEGRATION_H - -#include <QtWaylandClient/private/qwaylandintegration_p.h> -#include <QtWaylandClient/private/qwaylanddisplay_p.h> - -#include "qwaylandxcompositeglxintegration.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandXCompositeGlxPlatformIntegration : public QWaylandIntegration -{ -public: - QWaylandXCompositeGlxPlatformIntegration() - : m_client_buffer_integration(new QWaylandXCompositeGLXIntegration()) - { - m_client_buffer_integration->initialize(display()); - } - - QWaylandClientBufferIntegration *clientBufferIntegration() const override - { return m_client_buffer_integration; } - -private: - QWaylandClientBufferIntegration *m_client_buffer_integration = nullptr; -}; - -} - -QT_END_NAMESPACE - -#endif |