From b6713ec4262c05f7d103bc3b75ab81aedc690853 Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Wed, 18 Dec 2013 07:59:53 +0100 Subject: Make classes in client private Change-Id: Ibf400b32f78a6a0fcf0991914d2d9ad684483979 Reviewed-by: Andy Nichols --- src/client/client.pro | 52 ++--- .../hardwareintegration/hardwareintegration.pri | 16 +- .../qwaylandclientbufferintegration.cpp | 2 +- .../qwaylandclientbufferintegration.h | 74 ------- .../qwaylandclientbufferintegration_p.h | 74 +++++++ .../qwaylandclientbufferintegrationfactory.cpp | 6 +- .../qwaylandclientbufferintegrationfactory.h | 61 ------ .../qwaylandclientbufferintegrationfactory_p.h | 61 ++++++ .../qwaylandclientbufferintegrationplugin.cpp | 2 +- .../qwaylandclientbufferintegrationplugin.h | 69 ------ .../qwaylandclientbufferintegrationplugin_p.h | 69 ++++++ .../qwaylandhardwareintegration.cpp | 4 +- .../qwaylandhardwareintegration.h | 71 ------- .../qwaylandhardwareintegration_p.h | 71 +++++++ .../qwaylandserverbufferintegration.cpp | 2 +- .../qwaylandserverbufferintegration.h | 93 -------- .../qwaylandserverbufferintegration_p.h | 93 ++++++++ .../qwaylandserverbufferintegrationfactory.cpp | 4 +- .../qwaylandserverbufferintegrationfactory.h | 61 ------ .../qwaylandserverbufferintegrationfactory_p.h | 61 ++++++ .../qwaylandserverbufferintegrationplugin.cpp | 2 +- .../qwaylandserverbufferintegrationplugin.h | 69 ------ .../qwaylandserverbufferintegrationplugin_p.h | 69 ++++++ src/client/qwaylandbuffer.h | 68 ------ src/client/qwaylandbuffer_p.h | 68 ++++++ src/client/qwaylandclientexport.h | 60 ------ src/client/qwaylandclientexport_p.h | 60 ++++++ src/client/qwaylandclipboard.cpp | 12 +- src/client/qwaylandclipboard.h | 72 ------- src/client/qwaylandclipboard_p.h | 72 +++++++ src/client/qwaylandcursor.cpp | 10 +- src/client/qwaylandcursor.h | 116 ---------- src/client/qwaylandcursor_p.h | 116 ++++++++++ src/client/qwaylanddatadevice.cpp | 12 +- src/client/qwaylanddatadevice.h | 97 --------- src/client/qwaylanddatadevice_p.h | 97 +++++++++ src/client/qwaylanddatadevicemanager.cpp | 8 +- src/client/qwaylanddatadevicemanager.h | 69 ------ src/client/qwaylanddatadevicemanager_p.h | 69 ++++++ src/client/qwaylanddataoffer.cpp | 4 +- src/client/qwaylanddataoffer.h | 92 -------- src/client/qwaylanddataoffer_p.h | 92 ++++++++ src/client/qwaylanddatasource.cpp | 8 +- src/client/qwaylanddatasource.h | 79 ------- src/client/qwaylanddatasource_p.h | 79 +++++++ src/client/qwaylanddecoration.cpp | 10 +- src/client/qwaylanddecoration.h | 155 -------------- src/client/qwaylanddecoration_p.h | 155 ++++++++++++++ src/client/qwaylanddisplay.cpp | 40 ++-- src/client/qwaylanddisplay.h | 192 ----------------- src/client/qwaylanddisplay_p.h | 192 +++++++++++++++++ src/client/qwaylanddnd.cpp | 10 +- src/client/qwaylanddnd.h | 80 ------- src/client/qwaylanddnd_p.h | 80 +++++++ src/client/qwaylandeventthread.cpp | 2 +- src/client/qwaylandeventthread.h | 46 ---- src/client/qwaylandeventthread_p.h | 46 ++++ src/client/qwaylandextendedoutput.cpp | 4 +- src/client/qwaylandextendedoutput.h | 69 ------ src/client/qwaylandextendedoutput_p.h | 69 ++++++ src/client/qwaylandextendedsurface.cpp | 8 +- src/client/qwaylandextendedsurface.h | 85 -------- src/client/qwaylandextendedsurface_p.h | 85 ++++++++ src/client/qwaylandinputcontext.cpp | 8 +- src/client/qwaylandinputcontext.h | 103 --------- src/client/qwaylandinputcontext_p.h | 103 +++++++++ src/client/qwaylandinputdevice.cpp | 20 +- src/client/qwaylandinputdevice.h | 204 ------------------ src/client/qwaylandinputdevice_p.h | 204 ++++++++++++++++++ src/client/qwaylandintegration.cpp | 28 +-- src/client/qwaylandintegration.h | 112 ---------- src/client/qwaylandintegration_p.h | 112 ++++++++++ src/client/qwaylandnativeinterface.cpp | 14 +- src/client/qwaylandnativeinterface.h | 79 ------- src/client/qwaylandnativeinterface_p.h | 79 +++++++ src/client/qwaylandqtkey.cpp | 4 +- src/client/qwaylandqtkey.h | 76 ------- src/client/qwaylandqtkey_p.h | 76 +++++++ src/client/qwaylandscreen.cpp | 8 +- src/client/qwaylandscreen.h | 110 ---------- src/client/qwaylandscreen_p.h | 110 ++++++++++ src/client/qwaylandshellsurface.cpp | 12 +- src/client/qwaylandshellsurface.h | 96 --------- src/client/qwaylandshellsurface_p.h | 96 +++++++++ src/client/qwaylandshmbackingstore.cpp | 10 +- src/client/qwaylandshmbackingstore.h | 134 ------------ src/client/qwaylandshmbackingstore_p.h | 134 ++++++++++++ src/client/qwaylandshmwindow.cpp | 4 +- src/client/qwaylandshmwindow.h | 75 ------- src/client/qwaylandshmwindow_p.h | 75 +++++++ src/client/qwaylandsubsurface.cpp | 4 +- src/client/qwaylandsubsurface.h | 73 ------- src/client/qwaylandsubsurface_p.h | 73 +++++++ src/client/qwaylandtouch.cpp | 4 +- src/client/qwaylandtouch.h | 97 --------- src/client/qwaylandtouch_p.h | 97 +++++++++ src/client/qwaylandwindow.cpp | 22 +- src/client/qwaylandwindow.h | 233 --------------------- src/client/qwaylandwindow_p.h | 233 +++++++++++++++++++++ src/client/qwaylandwindowmanagerintegration.cpp | 6 +- src/client/qwaylandwindowmanagerintegration.h | 88 -------- src/client/qwaylandwindowmanagerintegration_p.h | 88 ++++++++ .../drmeglserverbufferintegration.cpp | 2 +- .../drm-egl-server/drmeglserverbufferintegration.h | 4 +- .../qwaylandeglclientbufferintegration.h | 2 +- .../client/wayland-egl/qwaylandeglwindow.cpp | 2 +- .../client/wayland-egl/qwaylandeglwindow.h | 2 +- .../client/wayland-egl/qwaylandglcontext.cpp | 6 +- .../client/wayland-egl/qwaylandglcontext.h | 2 +- .../qwaylandxcompositeeglclientbufferintegration.h | 2 +- .../xcomposite-egl/qwaylandxcompositeeglwindow.h | 4 +- .../xcomposite_share/qwaylandxcompositebuffer.h | 2 +- .../client/drm-egl-server/main.cpp | 2 +- .../client/wayland-egl/main.cpp | 2 +- .../client/xcomposite-egl/main.cpp | 2 +- .../qwayland-egl/qwaylandeglplatformintegration.h | 2 +- src/plugins/platforms/qwayland-generic/main.cpp | 2 +- .../qwaylandxcompositeeglplatformintegration.h | 2 +- 118 files changed, 3460 insertions(+), 3458 deletions(-) delete mode 100644 src/client/hardwareintegration/qwaylandclientbufferintegration.h create mode 100644 src/client/hardwareintegration/qwaylandclientbufferintegration_p.h delete mode 100644 src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.h create mode 100644 src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h delete mode 100644 src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.h create mode 100644 src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h delete mode 100644 src/client/hardwareintegration/qwaylandhardwareintegration.h create mode 100644 src/client/hardwareintegration/qwaylandhardwareintegration_p.h delete mode 100644 src/client/hardwareintegration/qwaylandserverbufferintegration.h create mode 100644 src/client/hardwareintegration/qwaylandserverbufferintegration_p.h delete mode 100644 src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.h create mode 100644 src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h delete mode 100644 src/client/hardwareintegration/qwaylandserverbufferintegrationplugin.h create mode 100644 src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h delete mode 100644 src/client/qwaylandbuffer.h create mode 100644 src/client/qwaylandbuffer_p.h delete mode 100644 src/client/qwaylandclientexport.h create mode 100644 src/client/qwaylandclientexport_p.h delete mode 100644 src/client/qwaylandclipboard.h create mode 100644 src/client/qwaylandclipboard_p.h delete mode 100644 src/client/qwaylandcursor.h create mode 100644 src/client/qwaylandcursor_p.h delete mode 100644 src/client/qwaylanddatadevice.h create mode 100644 src/client/qwaylanddatadevice_p.h delete mode 100644 src/client/qwaylanddatadevicemanager.h create mode 100644 src/client/qwaylanddatadevicemanager_p.h delete mode 100644 src/client/qwaylanddataoffer.h create mode 100644 src/client/qwaylanddataoffer_p.h delete mode 100644 src/client/qwaylanddatasource.h create mode 100644 src/client/qwaylanddatasource_p.h delete mode 100644 src/client/qwaylanddecoration.h create mode 100644 src/client/qwaylanddecoration_p.h delete mode 100644 src/client/qwaylanddisplay.h create mode 100644 src/client/qwaylanddisplay_p.h delete mode 100644 src/client/qwaylanddnd.h create mode 100644 src/client/qwaylanddnd_p.h delete mode 100644 src/client/qwaylandeventthread.h create mode 100644 src/client/qwaylandeventthread_p.h delete mode 100644 src/client/qwaylandextendedoutput.h create mode 100644 src/client/qwaylandextendedoutput_p.h delete mode 100644 src/client/qwaylandextendedsurface.h create mode 100644 src/client/qwaylandextendedsurface_p.h delete mode 100644 src/client/qwaylandinputcontext.h create mode 100644 src/client/qwaylandinputcontext_p.h delete mode 100644 src/client/qwaylandinputdevice.h create mode 100644 src/client/qwaylandinputdevice_p.h delete mode 100644 src/client/qwaylandintegration.h create mode 100644 src/client/qwaylandintegration_p.h delete mode 100644 src/client/qwaylandnativeinterface.h create mode 100644 src/client/qwaylandnativeinterface_p.h delete mode 100644 src/client/qwaylandqtkey.h create mode 100644 src/client/qwaylandqtkey_p.h delete mode 100644 src/client/qwaylandscreen.h create mode 100644 src/client/qwaylandscreen_p.h delete mode 100644 src/client/qwaylandshellsurface.h create mode 100644 src/client/qwaylandshellsurface_p.h delete mode 100644 src/client/qwaylandshmbackingstore.h create mode 100644 src/client/qwaylandshmbackingstore_p.h delete mode 100644 src/client/qwaylandshmwindow.h create mode 100644 src/client/qwaylandshmwindow_p.h delete mode 100644 src/client/qwaylandsubsurface.h create mode 100644 src/client/qwaylandsubsurface_p.h delete mode 100644 src/client/qwaylandtouch.h create mode 100644 src/client/qwaylandtouch_p.h delete mode 100644 src/client/qwaylandwindow.h create mode 100644 src/client/qwaylandwindow_p.h delete mode 100644 src/client/qwaylandwindowmanagerintegration.h create mode 100644 src/client/qwaylandwindowmanagerintegration_p.h diff --git a/src/client/client.pro b/src/client/client.pro index 152370c0b..01d704a94 100644 --- a/src/client/client.pro +++ b/src/client/client.pro @@ -67,32 +67,32 @@ SOURCES += qwaylandintegration.cpp \ qwaylandinputcontext.cpp \ qwaylanddatadevice.cpp \ -HEADERS += qwaylandintegration.h \ - qwaylandnativeinterface.h \ - qwaylandcursor.h \ - qwaylanddisplay.h \ - qwaylandwindow.h \ - qwaylandscreen.h \ - qwaylandshmbackingstore.h \ - qwaylandinputdevice.h \ - qwaylandbuffer.h \ - qwaylandshmwindow.h \ - qwaylandclipboard.h \ - qwaylanddnd.h \ - qwaylanddataoffer.h \ - qwaylanddatadevicemanager.h \ - qwaylanddatasource.h \ - qwaylandshellsurface.h \ - qwaylandextendedoutput.h \ - qwaylandextendedsurface.h \ - qwaylandsubsurface.h \ - qwaylandtouch.h \ - qwaylandqtkey.h \ +HEADERS += qwaylandintegration_p.h \ + qwaylandnativeinterface_p.h \ + qwaylandcursor_p.h \ + qwaylanddisplay_p.h \ + qwaylandwindow_p.h \ + qwaylandscreen_p.h \ + qwaylandshmbackingstore_p.h \ + qwaylandinputdevice_p.h \ + qwaylandbuffer_p.h \ + qwaylandshmwindow_p.h \ + qwaylandclipboard_p.h \ + qwaylanddnd_p.h \ + qwaylanddataoffer_p.h \ + qwaylanddatadevicemanager_p.h \ + qwaylanddatasource_p.h \ + qwaylandshellsurface_p.h \ + qwaylandextendedoutput_p.h \ + qwaylandextendedsurface_p.h \ + qwaylandsubsurface_p.h \ + qwaylandtouch_p.h \ + qwaylandqtkey_p.h \ ../shared/qwaylandmimehelper.h \ - qwaylanddecoration.h \ - qwaylandeventthread.h \ - qwaylandwindowmanagerintegration.h \ - qwaylandinputcontext.h \ - qwaylanddatadevice.h \ + qwaylanddecoration_p.h \ + qwaylandeventthread_p.h \ + qwaylandwindowmanagerintegration_p.h \ + qwaylandinputcontext_p.h \ + qwaylanddatadevice_p.h \ include(hardwareintegration/hardwareintegration.pri) diff --git a/src/client/hardwareintegration/hardwareintegration.pri b/src/client/hardwareintegration/hardwareintegration.pri index 1588ca977..bb4fe76d6 100644 --- a/src/client/hardwareintegration/hardwareintegration.pri +++ b/src/client/hardwareintegration/hardwareintegration.pri @@ -2,6 +2,8 @@ WAYLANDCLIENTSOURCES += \ $$PWD/../../extensions/server-buffer-extension.xml \ $$PWD/../../extensions/hardware-integration.xml +INCLUDEPATH += $$PWD + SOURCES += \ $$PWD/qwaylandclientbufferintegration.cpp \ $$PWD/qwaylandclientbufferintegrationplugin.cpp \ @@ -12,11 +14,11 @@ SOURCES += \ $$PWD/qwaylandhardwareintegration.cpp HEADERS += \ - $$PWD/qwaylandclientbufferintegration.h \ - $$PWD/qwaylandclientbufferintegrationplugin.h \ - $$PWD/qwaylandclientbufferintegrationfactory.h \ - $$PWD/qwaylandserverbufferintegration.h \ - $$PWD/qwaylandserverbufferintegrationplugin.h \ - $$PWD/qwaylandserverbufferintegrationfactory.h \ - $$PWD/qwaylandhardwareintegration.h + $$PWD/qwaylandclientbufferintegration_p.h \ + $$PWD/qwaylandclientbufferintegrationplugin_p.h \ + $$PWD/qwaylandclientbufferintegrationfactory_p.h \ + $$PWD/qwaylandserverbufferintegration_p.h \ + $$PWD/qwaylandserverbufferintegrationplugin_p.h \ + $$PWD/qwaylandserverbufferintegrationfactory_p.h \ + $$PWD/qwaylandhardwareintegration_p.h diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegration.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegration.cpp index c04ee1772..2c4d8ff1b 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegration.cpp +++ b/src/client/hardwareintegration/qwaylandclientbufferintegration.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qwaylandclientbufferintegration.h" +#include "qwaylandclientbufferintegration_p.h" QT_BEGIN_NAMESPACE diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegration.h b/src/client/hardwareintegration/qwaylandclientbufferintegration.h deleted file mode 100644 index 608a8cb22..000000000 --- a/src/client/hardwareintegration/qwaylandclientbufferintegration.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDCLIENTBUFFERINTEGRATION_H -#define QWAYLANDCLIENTBUFFERINTEGRATION_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandWindow; -class QWaylandDisplay; -class QWindow; - -class QPlatformOpenGLContext; -class QSurfaceFormat; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegration -{ -public: - QWaylandClientBufferIntegration(); - virtual ~QWaylandClientBufferIntegration(); - - virtual void initialize(QWaylandDisplay *display) = 0; - virtual bool waitingForEvents() { return false; } - - virtual bool supportsThreadedOpenGL() const { return false; } - - virtual QWaylandWindow *createEglWindow(QWindow *window) = 0; - virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDCLIENTBUFFERINTEGRATION_H diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h new file mode 100644 index 000000000..153b3f591 --- /dev/null +++ b/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCLIENTBUFFERINTEGRATION_H +#define QWAYLANDCLIENTBUFFERINTEGRATION_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandWindow; +class QWaylandDisplay; +class QWindow; + +class QPlatformOpenGLContext; +class QSurfaceFormat; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegration +{ +public: + QWaylandClientBufferIntegration(); + virtual ~QWaylandClientBufferIntegration(); + + virtual void initialize(QWaylandDisplay *display) = 0; + virtual bool waitingForEvents() { return false; } + + virtual bool supportsThreadedOpenGL() const { return false; } + + virtual QWaylandWindow *createEglWindow(QWindow *window) = 0; + virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDCLIENTBUFFERINTEGRATION_H diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp index c87c016f5..e168f612f 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qwaylandclientbufferintegrationfactory.h" -#include "qwaylandclientbufferintegrationplugin.h" -#include "qwaylandclientbufferintegration.h" +#include "qwaylandclientbufferintegrationfactory_p.h" +#include "qwaylandclientbufferintegrationplugin_p.h" +#include "qwaylandclientbufferintegration_p.h" #include #include #include diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.h deleted file mode 100644 index 12b2e8dbb..000000000 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H -#define QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandClientBufferIntegration; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationFactory -{ -public: - static QStringList keys(const QString &pluginPath = QString()); - static QWaylandClientBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h new file mode 100644 index 000000000..4a1c41286 --- /dev/null +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H +#define QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandClientBufferIntegration; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationFactory +{ +public: + static QStringList keys(const QString &pluginPath = QString()); + static QWaylandClientBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.cpp index 58bb26d19..afc105106 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.cpp +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qwaylandclientbufferintegrationplugin.h" +#include "qwaylandclientbufferintegrationplugin_p.h" QT_BEGIN_NAMESPACE diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.h deleted file mode 100644 index 685844061..000000000 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H -#define QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H - -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandClientBufferIntegration; - -#define QWaylandClientBufferIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandClientBufferIntegrationFactoryInterface.5.1" - -class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationPlugin : public QObject -{ - Q_OBJECT -public: - explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = 0); - ~QWaylandClientBufferIntegrationPlugin(); - - virtual QWaylandClientBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h new file mode 100644 index 000000000..476e31a78 --- /dev/null +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H +#define QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H + +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandClientBufferIntegration; + +#define QWaylandClientBufferIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandClientBufferIntegrationFactoryInterface.5.1" + +class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationPlugin : public QObject +{ + Q_OBJECT +public: + explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = 0); + ~QWaylandClientBufferIntegrationPlugin(); + + virtual QWaylandClientBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H diff --git a/src/client/hardwareintegration/qwaylandhardwareintegration.cpp b/src/client/hardwareintegration/qwaylandhardwareintegration.cpp index 67c951eac..a7269ce9e 100644 --- a/src/client/hardwareintegration/qwaylandhardwareintegration.cpp +++ b/src/client/hardwareintegration/qwaylandhardwareintegration.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qwaylandhardwareintegration.h" +#include "qwaylandhardwareintegration_p.h" -#include "qwaylanddisplay.h" +#include "qwaylanddisplay_p.h" QT_BEGIN_NAMESPACE QWaylandHardwareIntegration::QWaylandHardwareIntegration(struct ::wl_registry *registry, int id) diff --git a/src/client/hardwareintegration/qwaylandhardwareintegration.h b/src/client/hardwareintegration/qwaylandhardwareintegration.h deleted file mode 100644 index faa578567..000000000 --- a/src/client/hardwareintegration/qwaylandhardwareintegration.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDHARDWAREINTEGRATION_H -#define QWAYLANDHARDWAREINTEGRATION_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandHardwareIntegration : public QtWayland::qt_hardware_integration -{ -public: - QWaylandHardwareIntegration(struct ::wl_registry *registry, int id); - - QString clientBufferIntegration(); - QString serverBufferIntegration(); - -protected: - void hardware_integration_client_backend(const QString &name); - void hardware_integration_server_backend(const QString &name); - -private: - QString m_client_buffer; - QString m_server_buffer; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/client/hardwareintegration/qwaylandhardwareintegration_p.h b/src/client/hardwareintegration/qwaylandhardwareintegration_p.h new file mode 100644 index 000000000..84aa18ace --- /dev/null +++ b/src/client/hardwareintegration/qwaylandhardwareintegration_p.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDHARDWAREINTEGRATION_H +#define QWAYLANDHARDWAREINTEGRATION_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandHardwareIntegration : public QtWayland::qt_hardware_integration +{ +public: + QWaylandHardwareIntegration(struct ::wl_registry *registry, int id); + + QString clientBufferIntegration(); + QString serverBufferIntegration(); + +protected: + void hardware_integration_client_backend(const QString &name); + void hardware_integration_server_backend(const QString &name); + +private: + QString m_client_buffer; + QString m_server_buffer; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp index 9b4174d31..ee64624ad 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp @@ -1,4 +1,4 @@ -#include "qwaylandserverbufferintegration.h" +#include "qwaylandserverbufferintegration_p.h" QT_BEGIN_NAMESPACE diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration.h b/src/client/hardwareintegration/qwaylandserverbufferintegration.h deleted file mode 100644 index fcb92aecd..000000000 --- a/src/client/hardwareintegration/qwaylandserverbufferintegration.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDSERVERBUFFERINTEGRATION_H -#define QWAYLANDSERVERBUFFERINTEGRATION_H - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBuffer -{ -public: - enum Format { - RGBA32, - A8 - }; - - QWaylandServerBuffer(); - virtual ~QWaylandServerBuffer(); - - //creates new texture for buffer - virtual GLuint createTexture() = 0; - - void setUserData(void *userData); - void *userData() const; - - Format format() const; - -protected: - Format m_format; - -private: - void *m_user_data; -}; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegration -{ -public: - QWaylandServerBufferIntegration(); - virtual ~QWaylandServerBufferIntegration(); - - virtual void initialize(QWaylandDisplay *display) = 0; - - virtual QWaylandServerBuffer *serverBuffer(struct qt_server_buffer *buffer) = 0; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h new file mode 100644 index 000000000..7241aec1f --- /dev/null +++ b/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDSERVERBUFFERINTEGRATION_H +#define QWAYLANDSERVERBUFFERINTEGRATION_H + +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBuffer +{ +public: + enum Format { + RGBA32, + A8 + }; + + QWaylandServerBuffer(); + virtual ~QWaylandServerBuffer(); + + //creates new texture for buffer + virtual GLuint createTexture() = 0; + + void setUserData(void *userData); + void *userData() const; + + Format format() const; + +protected: + Format m_format; + +private: + void *m_user_data; +}; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegration +{ +public: + QWaylandServerBufferIntegration(); + virtual ~QWaylandServerBufferIntegration(); + + virtual void initialize(QWaylandDisplay *display) = 0; + + virtual QWaylandServerBuffer *serverBuffer(struct qt_server_buffer *buffer) = 0; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp index e36de7e72..bd7661c2f 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qwaylandserverbufferintegrationfactory.h" -#include "qwaylandserverbufferintegrationplugin.h" +#include "qwaylandserverbufferintegrationfactory_p.h" +#include "qwaylandserverbufferintegrationplugin_p.h" #include #include diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.h deleted file mode 100644 index 5e48e7b51..000000000 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H -#define QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandServerBufferIntegration; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationFactory -{ -public: - static QStringList keys(const QString &pluginPath = QString()); - static QWaylandServerBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h new file mode 100644 index 000000000..48e5e13d9 --- /dev/null +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H +#define QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandServerBufferIntegration; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationFactory +{ +public: + static QStringList keys(const QString &pluginPath = QString()); + static QWaylandServerBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin.cpp index 2bb3eb216..8fc31a883 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qwaylandserverbufferintegrationplugin.h" +#include "qwaylandserverbufferintegrationplugin_p.h" QT_BEGIN_NAMESPACE diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin.h deleted file mode 100644 index c3605dc70..000000000 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H -#define QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H - -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandServerBufferIntegration; - -#define QWaylandServerBufferIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandServerBufferIntegrationFactoryInterface.5.1" - -class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationPlugin : public QObject -{ - Q_OBJECT -public: - explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = 0); - ~QWaylandServerBufferIntegrationPlugin(); - - virtual QWaylandServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h new file mode 100644 index 000000000..39d9a8ba6 --- /dev/null +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H +#define QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H + +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandServerBufferIntegration; + +#define QWaylandServerBufferIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandServerBufferIntegrationFactoryInterface.5.1" + +class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationPlugin : public QObject +{ + Q_OBJECT +public: + explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = 0); + ~QWaylandServerBufferIntegrationPlugin(); + + virtual QWaylandServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H diff --git a/src/client/qwaylandbuffer.h b/src/client/qwaylandbuffer.h deleted file mode 100644 index 9548eadf8..000000000 --- a/src/client/qwaylandbuffer.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDBUFFER_H -#define QWAYLANDBUFFER_H - -#include - -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_WAYLAND_CLIENT_EXPORT QWaylandBuffer { -public: - QWaylandBuffer() { } - virtual ~QWaylandBuffer() { } - wl_buffer *buffer() {return mBuffer;} - virtual QSize size() const = 0; - -protected: - struct wl_buffer *mBuffer; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDBUFFER_H diff --git a/src/client/qwaylandbuffer_p.h b/src/client/qwaylandbuffer_p.h new file mode 100644 index 000000000..2bb9990f3 --- /dev/null +++ b/src/client/qwaylandbuffer_p.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDBUFFER_H +#define QWAYLANDBUFFER_H + +#include + +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_WAYLAND_CLIENT_EXPORT QWaylandBuffer { +public: + QWaylandBuffer() { } + virtual ~QWaylandBuffer() { } + wl_buffer *buffer() {return mBuffer;} + virtual QSize size() const = 0; + +protected: + struct wl_buffer *mBuffer; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDBUFFER_H diff --git a/src/client/qwaylandclientexport.h b/src/client/qwaylandclientexport.h deleted file mode 100644 index d9d6d7f7c..000000000 --- a/src/client/qwaylandclientexport.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDCLIENTEXPORT_H -#define QWAYLANDCLIENTEXPORT_H - -#include - -QT_BEGIN_NAMESPACE - -#if !defined(Q_WAYLAND_CLIENT_EXPORT) -# if defined(QT_SHARED) -# define Q_WAYLAND_CLIENT_EXPORT Q_DECL_EXPORT -# else -# define Q_WAYLAND_CLIENT_EXPORT -# endif -#endif - -QT_END_NAMESPACE - -#endif //QWAYLANDCLIENTEXPORT_H - diff --git a/src/client/qwaylandclientexport_p.h b/src/client/qwaylandclientexport_p.h new file mode 100644 index 000000000..d9d6d7f7c --- /dev/null +++ b/src/client/qwaylandclientexport_p.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCLIENTEXPORT_H +#define QWAYLANDCLIENTEXPORT_H + +#include + +QT_BEGIN_NAMESPACE + +#if !defined(Q_WAYLAND_CLIENT_EXPORT) +# if defined(QT_SHARED) +# define Q_WAYLAND_CLIENT_EXPORT Q_DECL_EXPORT +# else +# define Q_WAYLAND_CLIENT_EXPORT +# endif +#endif + +QT_END_NAMESPACE + +#endif //QWAYLANDCLIENTEXPORT_H + diff --git a/src/client/qwaylandclipboard.cpp b/src/client/qwaylandclipboard.cpp index 838f6d231..c40f023b5 100644 --- a/src/client/qwaylandclipboard.cpp +++ b/src/client/qwaylandclipboard.cpp @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#include "qwaylandclipboard.h" -#include "qwaylanddisplay.h" -#include "qwaylandinputdevice.h" -#include "qwaylanddataoffer.h" -#include "qwaylanddatasource.h" -#include "qwaylanddatadevice.h" +#include "qwaylandclipboard_p.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandinputdevice_p.h" +#include "qwaylanddataoffer_p.h" +#include "qwaylanddatasource_p.h" +#include "qwaylanddatadevice_p.h" QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandclipboard.h b/src/client/qwaylandclipboard.h deleted file mode 100644 index 692a31255..000000000 --- a/src/client/qwaylandclipboard.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDCLIPBOARD_H -#define QWAYLANDCLIPBOARD_H - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandClipboard : public QPlatformClipboard -{ -public: - QWaylandClipboard(QWaylandDisplay *display); - - ~QWaylandClipboard(); - - QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE; - void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE; - bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; - bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; - -private: - QWaylandDisplay *mDisplay; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDCLIPBOARD_H diff --git a/src/client/qwaylandclipboard_p.h b/src/client/qwaylandclipboard_p.h new file mode 100644 index 000000000..0dea3371a --- /dev/null +++ b/src/client/qwaylandclipboard_p.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCLIPBOARD_H +#define QWAYLANDCLIPBOARD_H + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandClipboard : public QPlatformClipboard +{ +public: + QWaylandClipboard(QWaylandDisplay *display); + + ~QWaylandClipboard(); + + QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE; + void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE; + bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; + bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; + +private: + QWaylandDisplay *mDisplay; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDCLIPBOARD_H diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp index 05ab6d496..90789b0df 100644 --- a/src/client/qwaylandcursor.cpp +++ b/src/client/qwaylandcursor.cpp @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#include "qwaylandcursor.h" +#include "qwaylandcursor_p.h" -#include "qwaylanddisplay.h" -#include "qwaylandinputdevice.h" -#include "qwaylandscreen.h" -#include "qwaylandshmbackingstore.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandinputdevice_p.h" +#include "qwaylandscreen_p.h" +#include "qwaylandshmbackingstore_p.h" #include #include diff --git a/src/client/qwaylandcursor.h b/src/client/qwaylandcursor.h deleted file mode 100644 index 894d322a6..000000000 --- a/src/client/qwaylandcursor.h +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDCURSOR_H -#define QWAYLANDCURSOR_H - -#include -#include -#include - -struct wl_cursor; -struct wl_cursor_image; -struct wl_cursor_theme; - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; -class QWaylandScreen; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandCursor : public QPlatformCursor -{ -public: - QWaylandCursor(QWaylandScreen *screen); - ~QWaylandCursor(); - - void changeCursor(QCursor *cursor, QWindow *window); - void pointerEvent(const QMouseEvent &event); - QPoint pos() const; - void setPos(const QPoint &pos); - - struct wl_cursor_image *cursorImage(Qt::CursorShape shape); - -private: - enum WaylandCursor { - ArrowCursor = Qt::ArrowCursor, - UpArrowCursor, - CrossCursor, - WaitCursor, - IBeamCursor, - SizeVerCursor, - SizeHorCursor, - SizeBDiagCursor, - SizeFDiagCursor, - SizeAllCursor, - BlankCursor, - SplitVCursor, - SplitHCursor, - PointingHandCursor, - ForbiddenCursor, - WhatsThisCursor, - BusyCursor, - OpenHandCursor, - ClosedHandCursor, - DragCopyCursor, - DragMoveCursor, - DragLinkCursor, - ResizeNorthCursor = Qt::CustomCursor + 1, - ResizeSouthCursor, - ResizeEastCursor, - ResizeWestCursor, - ResizeNorthWestCursor, - ResizeSouthEastCursor, - ResizeNorthEastCursor, - ResizeSouthWestCursor - }; - - struct wl_cursor* requestCursor(WaylandCursor shape); - void initCursorMap(); - QWaylandDisplay *mDisplay; - struct wl_cursor_theme *mCursorTheme; - QPoint mLastPos; - QMap mCursors; - QMultiMap mCursorNamesMap; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDCURSOR_H diff --git a/src/client/qwaylandcursor_p.h b/src/client/qwaylandcursor_p.h new file mode 100644 index 000000000..282ac685f --- /dev/null +++ b/src/client/qwaylandcursor_p.h @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCURSOR_H +#define QWAYLANDCURSOR_H + +#include +#include +#include + +struct wl_cursor; +struct wl_cursor_image; +struct wl_cursor_theme; + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; +class QWaylandScreen; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandCursor : public QPlatformCursor +{ +public: + QWaylandCursor(QWaylandScreen *screen); + ~QWaylandCursor(); + + void changeCursor(QCursor *cursor, QWindow *window); + void pointerEvent(const QMouseEvent &event); + QPoint pos() const; + void setPos(const QPoint &pos); + + struct wl_cursor_image *cursorImage(Qt::CursorShape shape); + +private: + enum WaylandCursor { + ArrowCursor = Qt::ArrowCursor, + UpArrowCursor, + CrossCursor, + WaitCursor, + IBeamCursor, + SizeVerCursor, + SizeHorCursor, + SizeBDiagCursor, + SizeFDiagCursor, + SizeAllCursor, + BlankCursor, + SplitVCursor, + SplitHCursor, + PointingHandCursor, + ForbiddenCursor, + WhatsThisCursor, + BusyCursor, + OpenHandCursor, + ClosedHandCursor, + DragCopyCursor, + DragMoveCursor, + DragLinkCursor, + ResizeNorthCursor = Qt::CustomCursor + 1, + ResizeSouthCursor, + ResizeEastCursor, + ResizeWestCursor, + ResizeNorthWestCursor, + ResizeSouthEastCursor, + ResizeNorthEastCursor, + ResizeSouthWestCursor + }; + + struct wl_cursor* requestCursor(WaylandCursor shape); + void initCursorMap(); + QWaylandDisplay *mDisplay; + struct wl_cursor_theme *mCursorTheme; + QPoint mLastPos; + QMap mCursors; + QMultiMap mCursorNamesMap; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDCURSOR_H diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp index faa04c3db..2d6a6f4b6 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -38,13 +38,13 @@ ** ****************************************************************************/ -#include "qwaylanddatadevice.h" +#include "qwaylanddatadevice_p.h" -#include "qwaylanddatadevicemanager.h" -#include "qwaylanddataoffer.h" -#include "qwaylanddatasource.h" -#include "qwaylanddnd.h" -#include "qwaylandinputdevice.h" +#include "qwaylanddatadevicemanager_p.h" +#include "qwaylanddataoffer_p.h" +#include "qwaylanddatasource_p.h" +#include "qwaylanddnd_p.h" +#include "qwaylandinputdevice_p.h" #include #include diff --git a/src/client/qwaylanddatadevice.h b/src/client/qwaylanddatadevice.h deleted file mode 100644 index e258d8776..000000000 --- a/src/client/qwaylanddatadevice.h +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#ifndef QWAYLANDDATADEVICE_H -#define QWAYLANDDATADEVICE_H - -#include "qwaylanddisplay.h" - -QT_BEGIN_NAMESPACE - -class QMimeData; -class QWaylandDataDeviceManager; -class QWaylandDataOffer; -class QWaylandDataSource; -class QWindow; - -class QWaylandDataDevice : public QObject, public QtWayland::wl_data_device -{ - Q_OBJECT -public: - QWaylandDataDevice(QWaylandDataDeviceManager *manager, QWaylandInputDevice *inputDevice); - ~QWaylandDataDevice(); - - QWaylandDataOffer *selectionOffer() const; - QWaylandDataSource *selectionSource() const; - void setSelectionSource(QWaylandDataSource *source); - - QWaylandDataOffer *dragOffer() const; - void startDrag(QMimeData *mimeData, QWaylandWindow *icon); - void cancelDrag(); - -protected: - void data_device_data_offer(struct ::wl_data_offer *id) Q_DECL_OVERRIDE; - void data_device_drop() Q_DECL_OVERRIDE; - void data_device_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct ::wl_data_offer *id) Q_DECL_OVERRIDE; - void data_device_leave() Q_DECL_OVERRIDE; - void data_device_motion(uint32_t time, wl_fixed_t x, wl_fixed_t y) Q_DECL_OVERRIDE; - void data_device_selection(struct ::wl_data_offer *id) Q_DECL_OVERRIDE; - -private Q_SLOTS: - void selectionSourceCancelled(); - void dragSourceCancelled(); - void dragSourceTargetChanged(const QString &mimeType); - -private: - QWaylandDisplay *m_display; - - uint32_t m_enterSerial; - QWindow *m_dragWindow; - QPoint m_dragPoint; - QScopedPointer m_dragOffer; - QScopedPointer m_selectionOffer; - QScopedPointer m_selectionSource; - - QScopedPointer m_dragSource; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDDATADEVICE_H diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h new file mode 100644 index 000000000..4e98424e5 --- /dev/null +++ b/src/client/qwaylanddatadevice_p.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Compositor. +** +** $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 Digia Plc and its Subsidiary(-ies) 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$ +** +****************************************************************************/ + +#ifndef QWAYLANDDATADEVICE_H +#define QWAYLANDDATADEVICE_H + +#include "qwaylanddisplay_p.h" + +QT_BEGIN_NAMESPACE + +class QMimeData; +class QWaylandDataDeviceManager; +class QWaylandDataOffer; +class QWaylandDataSource; +class QWindow; + +class QWaylandDataDevice : public QObject, public QtWayland::wl_data_device +{ + Q_OBJECT +public: + QWaylandDataDevice(QWaylandDataDeviceManager *manager, QWaylandInputDevice *inputDevice); + ~QWaylandDataDevice(); + + QWaylandDataOffer *selectionOffer() const; + QWaylandDataSource *selectionSource() const; + void setSelectionSource(QWaylandDataSource *source); + + QWaylandDataOffer *dragOffer() const; + void startDrag(QMimeData *mimeData, QWaylandWindow *icon); + void cancelDrag(); + +protected: + void data_device_data_offer(struct ::wl_data_offer *id) Q_DECL_OVERRIDE; + void data_device_drop() Q_DECL_OVERRIDE; + void data_device_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct ::wl_data_offer *id) Q_DECL_OVERRIDE; + void data_device_leave() Q_DECL_OVERRIDE; + void data_device_motion(uint32_t time, wl_fixed_t x, wl_fixed_t y) Q_DECL_OVERRIDE; + void data_device_selection(struct ::wl_data_offer *id) Q_DECL_OVERRIDE; + +private Q_SLOTS: + void selectionSourceCancelled(); + void dragSourceCancelled(); + void dragSourceTargetChanged(const QString &mimeType); + +private: + QWaylandDisplay *m_display; + + uint32_t m_enterSerial; + QWindow *m_dragWindow; + QPoint m_dragPoint; + QScopedPointer m_dragOffer; + QScopedPointer m_selectionOffer; + QScopedPointer m_selectionSource; + + QScopedPointer m_dragSource; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDDATADEVICE_H diff --git a/src/client/qwaylanddatadevicemanager.cpp b/src/client/qwaylanddatadevicemanager.cpp index 4a96dbce3..5de28c001 100644 --- a/src/client/qwaylanddatadevicemanager.cpp +++ b/src/client/qwaylanddatadevicemanager.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "qwaylanddatadevicemanager.h" +#include "qwaylanddatadevicemanager_p.h" -#include "qwaylandinputdevice.h" -#include "qwaylanddatadevice.h" -#include "qwaylanddataoffer.h" +#include "qwaylandinputdevice_p.h" +#include "qwaylanddatadevice_p.h" +#include "qwaylanddataoffer_p.h" #include diff --git a/src/client/qwaylanddatadevicemanager.h b/src/client/qwaylanddatadevicemanager.h deleted file mode 100644 index c51e12e78..000000000 --- a/src/client/qwaylanddatadevicemanager.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDDATADEVICEMANAGER_H -#define QWAYLANDDATADEVICEMANAGER_H - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandDataDevice; -class QWaylandDataSource; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandDataDeviceManager : public QtWayland::wl_data_device_manager -{ -public: - QWaylandDataDeviceManager(QWaylandDisplay *display, uint32_t id); - ~QWaylandDataDeviceManager(); - - QWaylandDataDevice *getDataDevice(QWaylandInputDevice *inputDevice); - - QWaylandDisplay *display() const; - -private: - struct wl_data_device_manager *m_data_device_manager; - QWaylandDisplay *m_display; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDDATADEVICEMANAGER_H diff --git a/src/client/qwaylanddatadevicemanager_p.h b/src/client/qwaylanddatadevicemanager_p.h new file mode 100644 index 000000000..6e2beafbe --- /dev/null +++ b/src/client/qwaylanddatadevicemanager_p.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDDATADEVICEMANAGER_H +#define QWAYLANDDATADEVICEMANAGER_H + +#include + +QT_BEGIN_NAMESPACE + +class QWaylandDataDevice; +class QWaylandDataSource; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandDataDeviceManager : public QtWayland::wl_data_device_manager +{ +public: + QWaylandDataDeviceManager(QWaylandDisplay *display, uint32_t id); + ~QWaylandDataDeviceManager(); + + QWaylandDataDevice *getDataDevice(QWaylandInputDevice *inputDevice); + + QWaylandDisplay *display() const; + +private: + struct wl_data_device_manager *m_data_device_manager; + QWaylandDisplay *m_display; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDDATADEVICEMANAGER_H diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp index e237d0b9a..adaeb5214 100644 --- a/src/client/qwaylanddataoffer.cpp +++ b/src/client/qwaylanddataoffer.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qwaylanddataoffer.h" -#include "qwaylanddatadevicemanager.h" +#include "qwaylanddataoffer_p.h" +#include "qwaylanddatadevicemanager_p.h" #include #include diff --git a/src/client/qwaylanddataoffer.h b/src/client/qwaylanddataoffer.h deleted file mode 100644 index 7dc3baa38..000000000 --- a/src/client/qwaylanddataoffer.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDDATAOFFER_H -#define QWAYLANDDATAOFFER_H - -#include "qwaylanddisplay.h" - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; -class QWaylandMimeData; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandDataOffer : public QtWayland::wl_data_offer -{ -public: - explicit QWaylandDataOffer(QWaylandDisplay *display, struct ::wl_data_offer *offer); - ~QWaylandDataOffer(); - - QString firstFormat() const; - - QMimeData *mimeData(); - -protected: - void data_offer_offer(const QString &mime_type) Q_DECL_OVERRIDE; - -private: - QScopedPointer m_mimeData; -}; - - -class QWaylandMimeData : public QInternalMimeData { -public: - explicit QWaylandMimeData(QWaylandDataOffer *dataOffer, QWaylandDisplay *display); - ~QWaylandMimeData(); - - void appendFormat(const QString &mimeType); - -protected: - bool hasFormat_sys(const QString &mimeType) const Q_DECL_OVERRIDE; - QStringList formats_sys() const Q_DECL_OVERRIDE; - QVariant retrieveData_sys(const QString &mimeType, QVariant::Type type) const Q_DECL_OVERRIDE; - -private: - mutable QWaylandDataOffer *m_dataOffer; - QWaylandDisplay *m_display; - QStringList m_offered_mime_types; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/client/qwaylanddataoffer_p.h b/src/client/qwaylanddataoffer_p.h new file mode 100644 index 000000000..ab34e177f --- /dev/null +++ b/src/client/qwaylanddataoffer_p.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDDATAOFFER_H +#define QWAYLANDDATAOFFER_H + +#include "qwaylanddisplay_p.h" + +#include + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; +class QWaylandMimeData; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandDataOffer : public QtWayland::wl_data_offer +{ +public: + explicit QWaylandDataOffer(QWaylandDisplay *display, struct ::wl_data_offer *offer); + ~QWaylandDataOffer(); + + QString firstFormat() const; + + QMimeData *mimeData(); + +protected: + void data_offer_offer(const QString &mime_type) Q_DECL_OVERRIDE; + +private: + QScopedPointer m_mimeData; +}; + + +class QWaylandMimeData : public QInternalMimeData { +public: + explicit QWaylandMimeData(QWaylandDataOffer *dataOffer, QWaylandDisplay *display); + ~QWaylandMimeData(); + + void appendFormat(const QString &mimeType); + +protected: + bool hasFormat_sys(const QString &mimeType) const Q_DECL_OVERRIDE; + QStringList formats_sys() const Q_DECL_OVERRIDE; + QVariant retrieveData_sys(const QString &mimeType, QVariant::Type type) const Q_DECL_OVERRIDE; + +private: + mutable QWaylandDataOffer *m_dataOffer; + QWaylandDisplay *m_display; + QStringList m_offered_mime_types; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp index ba4b68110..3376db567 100644 --- a/src/client/qwaylanddatasource.cpp +++ b/src/client/qwaylanddatasource.cpp @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#include "qwaylanddatasource.h" -#include "qwaylanddataoffer.h" -#include "qwaylanddatadevicemanager.h" -#include "qwaylandinputdevice.h" +#include "qwaylanddatasource_p.h" +#include "qwaylanddataoffer_p.h" +#include "qwaylanddatadevicemanager_p.h" +#include "qwaylandinputdevice_p.h" #include "qwaylandmimehelper.h" #include diff --git a/src/client/qwaylanddatasource.h b/src/client/qwaylanddatasource.h deleted file mode 100644 index 63a2150f8..000000000 --- a/src/client/qwaylanddatasource.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDDATASOURCE_H -#define QWAYLANDDATASOURCE_H - -#include - -#include - -QT_BEGIN_NAMESPACE - -class QMimeData; -class QWaylandDataDeviceManager; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandDataSource : public QObject, public QtWayland::wl_data_source -{ - Q_OBJECT -public: - QWaylandDataSource(QWaylandDataDeviceManager *dataDeviceManager, QMimeData *mimeData); - ~QWaylandDataSource(); - - QMimeData *mimeData() const; - -Q_SIGNALS: - void targetChanged(const QString &mime_type); - void cancelled(); - -protected: - void data_source_cancelled() Q_DECL_OVERRIDE; - void data_source_send(const QString &mime_type, int32_t fd) Q_DECL_OVERRIDE; - void data_source_target(const QString &mime_type) Q_DECL_OVERRIDE; - -private: - QWaylandDisplay *m_display; - QMimeData *m_mime_data; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDDATASOURCE_H diff --git a/src/client/qwaylanddatasource_p.h b/src/client/qwaylanddatasource_p.h new file mode 100644 index 000000000..9568f507c --- /dev/null +++ b/src/client/qwaylanddatasource_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDDATASOURCE_H +#define QWAYLANDDATASOURCE_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QMimeData; +class QWaylandDataDeviceManager; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandDataSource : public QObject, public QtWayland::wl_data_source +{ + Q_OBJECT +public: + QWaylandDataSource(QWaylandDataDeviceManager *dataDeviceManager, QMimeData *mimeData); + ~QWaylandDataSource(); + + QMimeData *mimeData() const; + +Q_SIGNALS: + void targetChanged(const QString &mime_type); + void cancelled(); + +protected: + void data_source_cancelled() Q_DECL_OVERRIDE; + void data_source_send(const QString &mime_type, int32_t fd) Q_DECL_OVERRIDE; + void data_source_target(const QString &mime_type) Q_DECL_OVERRIDE; + +private: + QWaylandDisplay *m_display; + QMimeData *m_mime_data; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDDATASOURCE_H diff --git a/src/client/qwaylanddecoration.cpp b/src/client/qwaylanddecoration.cpp index 74c01f93a..8e7d03143 100644 --- a/src/client/qwaylanddecoration.cpp +++ b/src/client/qwaylanddecoration.cpp @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#include "qwaylanddecoration.h" +#include "qwaylanddecoration_p.h" -#include "qwaylandwindow.h" -#include "qwaylandshellsurface.h" -#include "qwaylandinputdevice.h" -#include "qwaylandscreen.h" +#include "qwaylandwindow_p.h" +#include "qwaylandshellsurface_p.h" +#include "qwaylandinputdevice_p.h" +#include "qwaylandscreen_p.h" #include #include diff --git a/src/client/qwaylanddecoration.h b/src/client/qwaylanddecoration.h deleted file mode 100644 index f99723588..000000000 --- a/src/client/qwaylanddecoration.h +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDDECORATION_H -#define QWAYLANDDECORATION_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWindow; -class QPaintDevice; -class QPainter; -class QEvent; -class QWaylandScreen; -class QWaylandWindow; -class QWaylandInputDevice; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandDecoration -{ -public: - QWaylandDecoration(QWaylandWindow *window); - virtual ~QWaylandDecoration(); - - void update(); - bool isDirty() const; - - bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods); - bool inMouseButtonPressedState() const; - - void startResize(QWaylandInputDevice *inputDevice,enum wl_shell_surface_resize resize, Qt::MouseButtons buttons); - void startMove(QWaylandInputDevice *inputDevice, Qt::MouseButtons buttons); - QMargins margins() const; - QWindow *window() const; - QWaylandWindow *waylandWindow() const; - const QImage &contentImage(); - - void setForegroundColor(const QColor &c); - inline QColor foregroundColor() const; - - void setBackgroundColor(const QColor &c); - inline QColor backgroundColor() const; - -protected: - void paint(QPaintDevice *device); - -private: - void processMouseTop(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods); - void processMouseBottom(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods); - void processMouseLeft(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods); - void processMouseRight(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods); - - bool isLeftClicked(Qt::MouseButtons newMouseButtonState); - bool isLeftReleased(Qt::MouseButtons newMouseButtonState); - - QRectF closeButtonRect() const; - QRectF maximizeButtonRect() const; - QRectF minimizeButtonRect() const; - - QWindow *m_window; - QWaylandWindow *m_wayland_window; - - bool m_isDirty; - QImage m_decorationContentImage; - - QMargins m_margins; - Qt::MouseButtons m_mouseButtons; - - QColor m_foregroundColor; - QColor m_backgroundColor; - QStaticText m_windowTitle; -}; - -inline bool QWaylandDecoration::isDirty() const -{ - return m_isDirty; -} - -inline QMargins QWaylandDecoration::margins() const -{ - return m_margins; -} - -inline QWindow *QWaylandDecoration::window() const -{ - return m_window; -} - -inline QWaylandWindow *QWaylandDecoration::waylandWindow() const -{ - return m_wayland_window; -} - -inline QColor QWaylandDecoration::foregroundColor() const -{ - return m_foregroundColor; -} - -inline QColor QWaylandDecoration::backgroundColor() const -{ - return m_backgroundColor; -} - -QT_END_NAMESPACE - -#endif // QWAYLANDDECORATION_H diff --git a/src/client/qwaylanddecoration_p.h b/src/client/qwaylanddecoration_p.h new file mode 100644 index 000000000..3f53721f7 --- /dev/null +++ b/src/client/qwaylanddecoration_p.h @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDDECORATION_H +#define QWAYLANDDECORATION_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QWindow; +class QPaintDevice; +class QPainter; +class QEvent; +class QWaylandScreen; +class QWaylandWindow; +class QWaylandInputDevice; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandDecoration +{ +public: + QWaylandDecoration(QWaylandWindow *window); + virtual ~QWaylandDecoration(); + + void update(); + bool isDirty() const; + + bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods); + bool inMouseButtonPressedState() const; + + void startResize(QWaylandInputDevice *inputDevice,enum wl_shell_surface_resize resize, Qt::MouseButtons buttons); + void startMove(QWaylandInputDevice *inputDevice, Qt::MouseButtons buttons); + QMargins margins() const; + QWindow *window() const; + QWaylandWindow *waylandWindow() const; + const QImage &contentImage(); + + void setForegroundColor(const QColor &c); + inline QColor foregroundColor() const; + + void setBackgroundColor(const QColor &c); + inline QColor backgroundColor() const; + +protected: + void paint(QPaintDevice *device); + +private: + void processMouseTop(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods); + void processMouseBottom(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods); + void processMouseLeft(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods); + void processMouseRight(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b,Qt::KeyboardModifiers mods); + + bool isLeftClicked(Qt::MouseButtons newMouseButtonState); + bool isLeftReleased(Qt::MouseButtons newMouseButtonState); + + QRectF closeButtonRect() const; + QRectF maximizeButtonRect() const; + QRectF minimizeButtonRect() const; + + QWindow *m_window; + QWaylandWindow *m_wayland_window; + + bool m_isDirty; + QImage m_decorationContentImage; + + QMargins m_margins; + Qt::MouseButtons m_mouseButtons; + + QColor m_foregroundColor; + QColor m_backgroundColor; + QStaticText m_windowTitle; +}; + +inline bool QWaylandDecoration::isDirty() const +{ + return m_isDirty; +} + +inline QMargins QWaylandDecoration::margins() const +{ + return m_margins; +} + +inline QWindow *QWaylandDecoration::window() const +{ + return m_window; +} + +inline QWaylandWindow *QWaylandDecoration::waylandWindow() const +{ + return m_wayland_window; +} + +inline QColor QWaylandDecoration::foregroundColor() const +{ + return m_foregroundColor; +} + +inline QColor QWaylandDecoration::backgroundColor() const +{ + return m_backgroundColor; +} + +QT_END_NAMESPACE + +#endif // QWAYLANDDECORATION_H diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 922c4bcb8..ec439b5d2 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -39,26 +39,26 @@ ** ****************************************************************************/ -#include "qwaylanddisplay.h" - -#include "qwaylandeventthread.h" -#include "qwaylandintegration.h" -#include "qwaylandwindow.h" -#include "qwaylandscreen.h" -#include "qwaylandcursor.h" -#include "qwaylandinputdevice.h" -#include "qwaylandclipboard.h" -#include "qwaylanddatadevicemanager.h" -#include "qwaylandhardwareintegration.h" - - -#include "qwaylandwindowmanagerintegration.h" - -#include "qwaylandextendedoutput.h" -#include "qwaylandextendedsurface.h" -#include "qwaylandsubsurface.h" -#include "qwaylandtouch.h" -#include "qwaylandqtkey.h" +#include "qwaylanddisplay_p.h" + +#include "qwaylandeventthread_p.h" +#include "qwaylandintegration_p.h" +#include "qwaylandwindow_p.h" +#include "qwaylandscreen_p.h" +#include "qwaylandcursor_p.h" +#include "qwaylandinputdevice_p.h" +#include "qwaylandclipboard_p.h" +#include "qwaylanddatadevicemanager_p.h" +#include "qwaylandhardwareintegration_p.h" + + +#include "qwaylandwindowmanagerintegration_p.h" + +#include "qwaylandextendedoutput_p.h" +#include "qwaylandextendedsurface_p.h" +#include "qwaylandsubsurface_p.h" +#include "qwaylandtouch_p.h" +#include "qwaylandqtkey_p.h" #include diff --git a/src/client/qwaylanddisplay.h b/src/client/qwaylanddisplay.h deleted file mode 100644 index 4f9dacf42..000000000 --- a/src/client/qwaylanddisplay.h +++ /dev/null @@ -1,192 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDDISPLAY_H -#define QWAYLANDDISPLAY_H - -#include -#include - -#include - -#include - -#include -#include - -struct wl_cursor_image; - -QT_BEGIN_NAMESPACE - -class QAbstractEventDispatcher; -class QWaylandInputDevice; -class QSocketNotifier; -class QWaylandBuffer; -class QPlatformScreen; -class QWaylandScreen; -class QWaylandClientBufferIntegration; -class QWaylandWindowManagerIntegration; -class QWaylandDataDeviceManager; -class QWaylandTouchExtension; -class QWaylandQtKeyExtension; -class QWaylandWindow; -class QWaylandEventThread; -class QWaylandIntegration; -class QWaylandHardwareIntegration; - -namespace QtWayland { - class qt_output_extension; - class qt_shell; - class qt_sub_surface_extension; - class qt_surface_extension; - class wl_text_input_manager; -} - -typedef void (*RegistryListener)(void *data, - struct wl_registry *registry, - uint32_t id, - const QString &interface, - uint32_t version); - -class Q_WAYLAND_CLIENT_EXPORT QWaylandDisplay : public QObject, public QtWayland::wl_registry { - Q_OBJECT - -public: - QWaylandDisplay(QWaylandIntegration *waylandIntegration); - ~QWaylandDisplay(void); - - QList screens() const { return mScreens; } - - QWaylandScreen *screenForOutput(struct wl_output *output) const; - - struct wl_surface *createSurface(void *handle); - - QWaylandClientBufferIntegration *clientBufferIntegration() const; - - QWaylandWindowManagerIntegration *windowManagerIntegration() const; - - void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image); - - struct wl_display *wl_display() const { return mDisplay; } - struct wl_event_queue *wl_event_queue() const { return mEventQueue; } - struct ::wl_registry *wl_registry() { return object(); } - - const struct wl_compositor *wl_compositor() const { return mCompositor.object(); } - QtWayland::wl_compositor *compositor() { return &mCompositor; } - - QtWayland::wl_shell *shell() { return mShell.data(); } - - QList inputDevices() const { return mInputDevices; } - QWaylandInputDevice *defaultInputDevice() const; - QWaylandInputDevice *currentInputDevice() const { return defaultInputDevice(); } - - QWaylandInputDevice *lastKeyboardFocusInputDevice() const; - void setLastKeyboardFocusInputDevice(QWaylandInputDevice *device); - - QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); } - - QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); } - QtWayland::qt_sub_surface_extension *subSurfaceExtension() const { return mSubSurfaceExtension.data(); } - QtWayland::qt_output_extension *outputExtension() const { return mOutputExtension.data(); } - QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); } - QtWayland::wl_text_input_manager *textInputManager() const { return mTextInputManager.data(); } - QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.data(); } - - /* wl_registry_add_listener does not add but rather sets a listener, so this function is used - * to enable many listeners at once. */ - void addRegistryListener(RegistryListener listener, void *data); - - struct wl_shm *shm() const { return mShm; } - - static uint32_t currentTimeMillisec(); - - void forceRoundTrip(); - -public slots: - void blockingReadEvents(); - void flushRequests(); - -private: - void waitForScreens(); - - struct Listener { - RegistryListener listener; - void *data; - }; - - struct wl_display *mDisplay; - struct wl_event_queue *mEventQueue; - QtWayland::wl_compositor mCompositor; - struct wl_shm *mShm; - QThread *mEventThread; - QWaylandEventThread *mEventThreadObject; - QScopedPointer mShell; - QList mScreens; - QList mInputDevices; - QList mRegistryListeners; - QWaylandIntegration *mWaylandIntegration; - QWaylandInputDevice *mLastKeyboardFocusInputDevice; - QScopedPointer mDndSelectionHandler; - QScopedPointer mWindowExtension; - QScopedPointer mSubSurfaceExtension; - QScopedPointer mOutputExtension; - QScopedPointer mTouchExtension; - QScopedPointer mQtKeyExtension; - QScopedPointer mWindowManagerIntegration; - QScopedPointer mTextInputManager; - QScopedPointer mHardwareIntegration; - - QSocketNotifier *mReadNotifier; - int mFd; - int mWritableNotificationFd; - bool mScreensInitialized; - - void registry_global(uint32_t id, const QString &interface, uint32_t version) Q_DECL_OVERRIDE; - - static void shellHandleConfigure(void *data, struct wl_shell *shell, - uint32_t time, uint32_t edges, - struct wl_surface *surface, - int32_t width, int32_t height); -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDDISPLAY_H diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h new file mode 100644 index 000000000..5ba4f51be --- /dev/null +++ b/src/client/qwaylanddisplay_p.h @@ -0,0 +1,192 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDDISPLAY_H +#define QWAYLANDDISPLAY_H + +#include +#include + +#include + +#include + +#include +#include + +struct wl_cursor_image; + +QT_BEGIN_NAMESPACE + +class QAbstractEventDispatcher; +class QWaylandInputDevice; +class QSocketNotifier; +class QWaylandBuffer; +class QPlatformScreen; +class QWaylandScreen; +class QWaylandClientBufferIntegration; +class QWaylandWindowManagerIntegration; +class QWaylandDataDeviceManager; +class QWaylandTouchExtension; +class QWaylandQtKeyExtension; +class QWaylandWindow; +class QWaylandEventThread; +class QWaylandIntegration; +class QWaylandHardwareIntegration; + +namespace QtWayland { + class qt_output_extension; + class qt_shell; + class qt_sub_surface_extension; + class qt_surface_extension; + class wl_text_input_manager; +} + +typedef void (*RegistryListener)(void *data, + struct wl_registry *registry, + uint32_t id, + const QString &interface, + uint32_t version); + +class Q_WAYLAND_CLIENT_EXPORT QWaylandDisplay : public QObject, public QtWayland::wl_registry { + Q_OBJECT + +public: + QWaylandDisplay(QWaylandIntegration *waylandIntegration); + ~QWaylandDisplay(void); + + QList screens() const { return mScreens; } + + QWaylandScreen *screenForOutput(struct wl_output *output) const; + + struct wl_surface *createSurface(void *handle); + + QWaylandClientBufferIntegration *clientBufferIntegration() const; + + QWaylandWindowManagerIntegration *windowManagerIntegration() const; + + void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image); + + struct wl_display *wl_display() const { return mDisplay; } + struct wl_event_queue *wl_event_queue() const { return mEventQueue; } + struct ::wl_registry *wl_registry() { return object(); } + + const struct wl_compositor *wl_compositor() const { return mCompositor.object(); } + QtWayland::wl_compositor *compositor() { return &mCompositor; } + + QtWayland::wl_shell *shell() { return mShell.data(); } + + QList inputDevices() const { return mInputDevices; } + QWaylandInputDevice *defaultInputDevice() const; + QWaylandInputDevice *currentInputDevice() const { return defaultInputDevice(); } + + QWaylandInputDevice *lastKeyboardFocusInputDevice() const; + void setLastKeyboardFocusInputDevice(QWaylandInputDevice *device); + + QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); } + + QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); } + QtWayland::qt_sub_surface_extension *subSurfaceExtension() const { return mSubSurfaceExtension.data(); } + QtWayland::qt_output_extension *outputExtension() const { return mOutputExtension.data(); } + QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); } + QtWayland::wl_text_input_manager *textInputManager() const { return mTextInputManager.data(); } + QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.data(); } + + /* wl_registry_add_listener does not add but rather sets a listener, so this function is used + * to enable many listeners at once. */ + void addRegistryListener(RegistryListener listener, void *data); + + struct wl_shm *shm() const { return mShm; } + + static uint32_t currentTimeMillisec(); + + void forceRoundTrip(); + +public slots: + void blockingReadEvents(); + void flushRequests(); + +private: + void waitForScreens(); + + struct Listener { + RegistryListener listener; + void *data; + }; + + struct wl_display *mDisplay; + struct wl_event_queue *mEventQueue; + QtWayland::wl_compositor mCompositor; + struct wl_shm *mShm; + QThread *mEventThread; + QWaylandEventThread *mEventThreadObject; + QScopedPointer mShell; + QList mScreens; + QList mInputDevices; + QList mRegistryListeners; + QWaylandIntegration *mWaylandIntegration; + QWaylandInputDevice *mLastKeyboardFocusInputDevice; + QScopedPointer mDndSelectionHandler; + QScopedPointer mWindowExtension; + QScopedPointer mSubSurfaceExtension; + QScopedPointer mOutputExtension; + QScopedPointer mTouchExtension; + QScopedPointer mQtKeyExtension; + QScopedPointer mWindowManagerIntegration; + QScopedPointer mTextInputManager; + QScopedPointer mHardwareIntegration; + + QSocketNotifier *mReadNotifier; + int mFd; + int mWritableNotificationFd; + bool mScreensInitialized; + + void registry_global(uint32_t id, const QString &interface, uint32_t version) Q_DECL_OVERRIDE; + + static void shellHandleConfigure(void *data, struct wl_shell *shell, + uint32_t time, uint32_t edges, + struct wl_surface *surface, + int32_t width, int32_t height); +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDDISPLAY_H diff --git a/src/client/qwaylanddnd.cpp b/src/client/qwaylanddnd.cpp index 635fd9678..0d5eddf5b 100644 --- a/src/client/qwaylanddnd.cpp +++ b/src/client/qwaylanddnd.cpp @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#include "qwaylanddnd.h" +#include "qwaylanddnd_p.h" -#include "qwaylanddatadevice.h" -#include "qwaylanddatadevicemanager.h" -#include "qwaylanddataoffer.h" -#include "qwaylandinputdevice.h" +#include "qwaylanddatadevice_p.h" +#include "qwaylanddatadevicemanager_p.h" +#include "qwaylanddataoffer_p.h" +#include "qwaylandinputdevice_p.h" #include diff --git a/src/client/qwaylanddnd.h b/src/client/qwaylanddnd.h deleted file mode 100644 index 8879a1d4e..000000000 --- a/src/client/qwaylanddnd.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDDND_H -#define QWAYLANDDND_H - -#include -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_WAYLAND_CLIENT_EXPORT QWaylandDrag : public QBasicDrag -{ -public: - QWaylandDrag(QWaylandDisplay *display); - ~QWaylandDrag(); - - QMimeData *platformDropData() Q_DECL_OVERRIDE; - - void updateTarget(const QString &mimeType); - void setResponse(const QPlatformDragQtResponse &response); - void finishDrag(const QPlatformDropQtResponse &response); - -protected: - void startDrag() Q_DECL_OVERRIDE; - void cancel() Q_DECL_OVERRIDE; - void move(const QMouseEvent *me) Q_DECL_OVERRIDE; - void drop(const QMouseEvent *me) Q_DECL_OVERRIDE; - void endDrag() Q_DECL_OVERRIDE; - - -private: - QWaylandDisplay *m_display; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDDND_H diff --git a/src/client/qwaylanddnd_p.h b/src/client/qwaylanddnd_p.h new file mode 100644 index 000000000..22b004712 --- /dev/null +++ b/src/client/qwaylanddnd_p.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDDND_H +#define QWAYLANDDND_H + +#include +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_WAYLAND_CLIENT_EXPORT QWaylandDrag : public QBasicDrag +{ +public: + QWaylandDrag(QWaylandDisplay *display); + ~QWaylandDrag(); + + QMimeData *platformDropData() Q_DECL_OVERRIDE; + + void updateTarget(const QString &mimeType); + void setResponse(const QPlatformDragQtResponse &response); + void finishDrag(const QPlatformDropQtResponse &response); + +protected: + void startDrag() Q_DECL_OVERRIDE; + void cancel() Q_DECL_OVERRIDE; + void move(const QMouseEvent *me) Q_DECL_OVERRIDE; + void drop(const QMouseEvent *me) Q_DECL_OVERRIDE; + void endDrag() Q_DECL_OVERRIDE; + + +private: + QWaylandDisplay *m_display; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDDND_H diff --git a/src/client/qwaylandeventthread.cpp b/src/client/qwaylandeventthread.cpp index 3392d36c6..b94110c25 100644 --- a/src/client/qwaylandeventthread.cpp +++ b/src/client/qwaylandeventthread.cpp @@ -1,4 +1,4 @@ -#include "qwaylandeventthread.h" +#include "qwaylandeventthread_p.h" #include #include diff --git a/src/client/qwaylandeventthread.h b/src/client/qwaylandeventthread.h deleted file mode 100644 index ba7e33e09..000000000 --- a/src/client/qwaylandeventthread.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef QWAYLANDEVENTTHREAD_H -#define QWAYLANDEVENTTHREAD_H - -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QSocketNotifier; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandEventThread : public QObject -{ - Q_OBJECT -public: - explicit QWaylandEventThread(QObject *parent = 0); - ~QWaylandEventThread(); - - void displayConnect(); - - wl_display *display() const; - -private slots: - void readWaylandEvents(); - - void waylandDisplayConnect(); - -signals: - void newEventsRead(); - -private: - - struct wl_display *m_display; - int m_fileDescriptor; - - QSocketNotifier *m_readNotifier; - - QMutex *m_displayLock; - -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDEVENTTHREAD_H diff --git a/src/client/qwaylandeventthread_p.h b/src/client/qwaylandeventthread_p.h new file mode 100644 index 000000000..4174c96cf --- /dev/null +++ b/src/client/qwaylandeventthread_p.h @@ -0,0 +1,46 @@ +#ifndef QWAYLANDEVENTTHREAD_H +#define QWAYLANDEVENTTHREAD_H + +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class QSocketNotifier; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandEventThread : public QObject +{ + Q_OBJECT +public: + explicit QWaylandEventThread(QObject *parent = 0); + ~QWaylandEventThread(); + + void displayConnect(); + + wl_display *display() const; + +private slots: + void readWaylandEvents(); + + void waylandDisplayConnect(); + +signals: + void newEventsRead(); + +private: + + struct wl_display *m_display; + int m_fileDescriptor; + + QSocketNotifier *m_readNotifier; + + QMutex *m_displayLock; + +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDEVENTTHREAD_H diff --git a/src/client/qwaylandextendedoutput.cpp b/src/client/qwaylandextendedoutput.cpp index d7c684be9..c79685af4 100644 --- a/src/client/qwaylandextendedoutput.cpp +++ b/src/client/qwaylandextendedoutput.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qwaylandextendedoutput.h" +#include "qwaylandextendedoutput_p.h" -#include "qwaylandscreen.h" +#include "qwaylandscreen_p.h" #include diff --git a/src/client/qwaylandextendedoutput.h b/src/client/qwaylandextendedoutput.h deleted file mode 100644 index d1ef3397f..000000000 --- a/src/client/qwaylandextendedoutput.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDEXTENDEDOUTPUT_H -#define QWAYLANDEXTENDEDOUTPUT_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandExtendedOutput; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandExtendedOutput : public QtWayland::qt_extended_output -{ -public: - QWaylandExtendedOutput(QWaylandScreen *screen, struct ::qt_extended_output *extended_output); - - Qt::ScreenOrientation currentOrientation() const; - void setOrientationUpdateMask(Qt::ScreenOrientations mask); - -private: - void extended_output_set_screen_rotation(int32_t rotation) Q_DECL_OVERRIDE; - - QWaylandScreen *m_screen; - Qt::ScreenOrientation m_orientation; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDEXTENDEDOUTPUT_H diff --git a/src/client/qwaylandextendedoutput_p.h b/src/client/qwaylandextendedoutput_p.h new file mode 100644 index 000000000..f18fb8e57 --- /dev/null +++ b/src/client/qwaylandextendedoutput_p.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDEXTENDEDOUTPUT_H +#define QWAYLANDEXTENDEDOUTPUT_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandExtendedOutput; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandExtendedOutput : public QtWayland::qt_extended_output +{ +public: + QWaylandExtendedOutput(QWaylandScreen *screen, struct ::qt_extended_output *extended_output); + + Qt::ScreenOrientation currentOrientation() const; + void setOrientationUpdateMask(Qt::ScreenOrientations mask); + +private: + void extended_output_set_screen_rotation(int32_t rotation) Q_DECL_OVERRIDE; + + QWaylandScreen *m_screen; + Qt::ScreenOrientation m_orientation; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDEXTENDEDOUTPUT_H diff --git a/src/client/qwaylandextendedsurface.cpp b/src/client/qwaylandextendedsurface.cpp index bfd2a1d0b..9d5a49708 100644 --- a/src/client/qwaylandextendedsurface.cpp +++ b/src/client/qwaylandextendedsurface.cpp @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qwaylandextendedsurface.h" +#include "qwaylandextendedsurface_p.h" -#include "qwaylandwindow.h" +#include "qwaylandwindow_p.h" #include "wayland-client.h" -#include "qwaylanddisplay.h" +#include "qwaylanddisplay_p.h" -#include "qwaylandnativeinterface.h" +#include "qwaylandnativeinterface_p.h" #include #include diff --git a/src/client/qwaylandextendedsurface.h b/src/client/qwaylandextendedsurface.h deleted file mode 100644 index 8c0546473..000000000 --- a/src/client/qwaylandextendedsurface.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDEXTENDEDSURFACE_H -#define QWAYLANDEXTENDEDSURFACE_H - -#include -#include - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; -class QWaylandWindow; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandExtendedSurface : public QtWayland::qt_extended_surface -{ -public: - QWaylandExtendedSurface(QWaylandWindow *window, struct ::qt_extended_surface *extended_surface); - ~QWaylandExtendedSurface(); - - void setContentOrientation(Qt::ScreenOrientation orientation); - - void updateGenericProperty(const QString &name, const QVariant &value); - - QVariantMap properties() const; - QVariant property(const QString &name); - QVariant property(const QString &name, const QVariant &defaultValue); - - Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags); - -private: - void extended_surface_onscreen_visibility(int32_t visibility) Q_DECL_OVERRIDE; - void extended_surface_set_generic_property(const QString &name, wl_array *value) Q_DECL_OVERRIDE; - void extended_surface_close() Q_DECL_OVERRIDE; - - QWaylandWindow *m_window; - QVariantMap m_properties; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDEXTENDEDSURFACE_H diff --git a/src/client/qwaylandextendedsurface_p.h b/src/client/qwaylandextendedsurface_p.h new file mode 100644 index 000000000..00b961d38 --- /dev/null +++ b/src/client/qwaylandextendedsurface_p.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDEXTENDEDSURFACE_H +#define QWAYLANDEXTENDEDSURFACE_H + +#include +#include + +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; +class QWaylandWindow; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandExtendedSurface : public QtWayland::qt_extended_surface +{ +public: + QWaylandExtendedSurface(QWaylandWindow *window, struct ::qt_extended_surface *extended_surface); + ~QWaylandExtendedSurface(); + + void setContentOrientation(Qt::ScreenOrientation orientation); + + void updateGenericProperty(const QString &name, const QVariant &value); + + QVariantMap properties() const; + QVariant property(const QString &name); + QVariant property(const QString &name, const QVariant &defaultValue); + + Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags); + +private: + void extended_surface_onscreen_visibility(int32_t visibility) Q_DECL_OVERRIDE; + void extended_surface_set_generic_property(const QString &name, wl_array *value) Q_DECL_OVERRIDE; + void extended_surface_close() Q_DECL_OVERRIDE; + + QWaylandWindow *m_window; + QVariantMap m_properties; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDEXTENDEDSURFACE_H diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp index e9fb87179..8a711955e 100644 --- a/src/client/qwaylandinputcontext.cpp +++ b/src/client/qwaylandinputcontext.cpp @@ -38,7 +38,7 @@ ** ****************************************************************************/ -#include "qwaylandinputcontext.h" +#include "qwaylandinputcontext_p.h" #include #include @@ -46,9 +46,9 @@ #include #endif -#include "qwaylanddisplay.h" -#include "qwaylandinputdevice.h" -#include "qwaylandwindow.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandinputdevice_p.h" +#include "qwaylandwindow_p.h" QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandinputcontext.h b/src/client/qwaylandinputcontext.h deleted file mode 100644 index 1f7e4e361..000000000 --- a/src/client/qwaylandinputcontext.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#ifndef QWAYLANDINPUTCONTEXT_H -#define QWAYLANDINPUTCONTEXT_H - -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; - -class QWaylandTextInput : public QtWayland::wl_text_input -{ -public: - QWaylandTextInput(struct ::wl_text_input *text_input); - - QString commitString() const; - - void reset(); - void updateState(); - -protected: - void text_input_commit_string(uint32_t serial, const QString &text) Q_DECL_OVERRIDE; - void text_input_enter(wl_surface *surface) Q_DECL_OVERRIDE; - void text_input_leave() Q_DECL_OVERRIDE; - void text_input_keysym(uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); - -private: - QString m_commit; - - uint32_t m_serial; - uint32_t m_resetSerial; -}; - -class QWaylandInputContext : public QPlatformInputContext -{ - Q_OBJECT -public: - explicit QWaylandInputContext(QWaylandDisplay *display); - - bool isValid() const Q_DECL_OVERRIDE; - - void reset() Q_DECL_OVERRIDE; - void commit() Q_DECL_OVERRIDE; - void update(Qt::InputMethodQueries) Q_DECL_OVERRIDE; - void invokeAction(QInputMethod::Action, int cursorPosition) Q_DECL_OVERRIDE; - - void showInputPanel() Q_DECL_OVERRIDE; - void hideInputPanel() Q_DECL_OVERRIDE; - bool isInputPanelVisible() const Q_DECL_OVERRIDE; - - void setFocusObject(QObject *object) Q_DECL_OVERRIDE; - -private: - bool ensureTextInput(); - - QWaylandDisplay *mDisplay; - QScopedPointer mTextInput; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDINPUTCONTEXT_H diff --git a/src/client/qwaylandinputcontext_p.h b/src/client/qwaylandinputcontext_p.h new file mode 100644 index 000000000..1f7e4e361 --- /dev/null +++ b/src/client/qwaylandinputcontext_p.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Compositor. +** +** $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 Digia Plc and its Subsidiary(-ies) 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$ +** +****************************************************************************/ + +#ifndef QWAYLANDINPUTCONTEXT_H +#define QWAYLANDINPUTCONTEXT_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; + +class QWaylandTextInput : public QtWayland::wl_text_input +{ +public: + QWaylandTextInput(struct ::wl_text_input *text_input); + + QString commitString() const; + + void reset(); + void updateState(); + +protected: + void text_input_commit_string(uint32_t serial, const QString &text) Q_DECL_OVERRIDE; + void text_input_enter(wl_surface *surface) Q_DECL_OVERRIDE; + void text_input_leave() Q_DECL_OVERRIDE; + void text_input_keysym(uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); + +private: + QString m_commit; + + uint32_t m_serial; + uint32_t m_resetSerial; +}; + +class QWaylandInputContext : public QPlatformInputContext +{ + Q_OBJECT +public: + explicit QWaylandInputContext(QWaylandDisplay *display); + + bool isValid() const Q_DECL_OVERRIDE; + + void reset() Q_DECL_OVERRIDE; + void commit() Q_DECL_OVERRIDE; + void update(Qt::InputMethodQueries) Q_DECL_OVERRIDE; + void invokeAction(QInputMethod::Action, int cursorPosition) Q_DECL_OVERRIDE; + + void showInputPanel() Q_DECL_OVERRIDE; + void hideInputPanel() Q_DECL_OVERRIDE; + bool isInputPanelVisible() const Q_DECL_OVERRIDE; + + void setFocusObject(QObject *object) Q_DECL_OVERRIDE; + +private: + bool ensureTextInput(); + + QWaylandDisplay *mDisplay; + QScopedPointer mTextInput; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDINPUTCONTEXT_H diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index b9338b4c3..81bb0703a 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -39,16 +39,16 @@ ** ****************************************************************************/ -#include "qwaylandinputdevice.h" - -#include "qwaylandintegration.h" -#include "qwaylandwindow.h" -#include "qwaylandbuffer.h" -#include "qwaylanddatadevice.h" -#include "qwaylanddatadevicemanager.h" -#include "qwaylandtouch.h" -#include "qwaylandscreen.h" -#include "qwaylandcursor.h" +#include "qwaylandinputdevice_p.h" + +#include "qwaylandintegration_p.h" +#include "qwaylandwindow_p.h" +#include "qwaylandbuffer_p.h" +#include "qwaylanddatadevice_p.h" +#include "qwaylanddatadevicemanager_p.h" +#include "qwaylandtouch_p.h" +#include "qwaylandscreen_p.h" +#include "qwaylandcursor_p.h" #include #include diff --git a/src/client/qwaylandinputdevice.h b/src/client/qwaylandinputdevice.h deleted file mode 100644 index 641c8b840..000000000 --- a/src/client/qwaylandinputdevice.h +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDINPUTDEVICE_H -#define QWAYLANDINPUTDEVICE_H - -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include - -#ifndef QT_NO_WAYLAND_XKB -struct xkb_context; -struct xkb_keymap; -struct xkb_state; -#endif - -QT_BEGIN_NAMESPACE - -class QWaylandWindow; -class QWaylandDisplay; -class QWaylandDataDevice; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice - : public QObject - , public QtWayland::wl_pointer - , public QtWayland::wl_keyboard - , public QtWayland::wl_touch - , public QtWayland::wl_seat -{ - Q_OBJECT -public: - QWaylandInputDevice(QWaylandDisplay *display, uint32_t id); - ~QWaylandInputDevice(); - - uint32_t capabilities() const { return mCaps; } - - struct ::wl_seat *wl_seat() { return QtWayland::wl_seat::object(); } - - void setCursor(Qt::CursorShape cursor, QWaylandScreen *screen); - void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image); - void handleWindowDestroyed(QWaylandWindow *window); - - void setDataDevice(QWaylandDataDevice *device); - QWaylandDataDevice *dataDevice() const; - - void removeMouseButtonFromState(Qt::MouseButton button); - - QWaylandWindow *pointerFocus() const; - - Qt::KeyboardModifiers modifiers() const; - - uint32_t serial() const; - uint32_t cursorSerial() const { return mCursorSerial; } - -private slots: - void repeatKey(); - -private: - QWaylandDisplay *mQDisplay; - struct wl_display *mDisplay; - struct wl_callback *mFocusCallback; - - uint32_t mCaps; - - struct wl_surface *pointerSurface; - - QWaylandDataDevice *mDataDevice; - QWaylandWindow *mPointerFocus; - QWaylandWindow *mKeyboardFocus; - QWaylandWindow *mTouchFocus; - - Qt::MouseButtons mButtons; - QPointF mSurfacePos; - QPointF mGlobalPos; - uint32_t mTime; - uint32_t mSerial; - uint32_t mEnterSerial; - uint32_t mCursorSerial; - - void seat_capabilities(uint32_t caps) Q_DECL_OVERRIDE; - - void pointer_enter(uint32_t serial, struct wl_surface *surface, - wl_fixed_t sx, wl_fixed_t sy) Q_DECL_OVERRIDE; - void pointer_leave(uint32_t time, struct wl_surface *surface); - void pointer_motion(uint32_t time, - wl_fixed_t sx, wl_fixed_t sy) Q_DECL_OVERRIDE; - void pointer_button(uint32_t serial, uint32_t time, - uint32_t button, uint32_t state) Q_DECL_OVERRIDE; - void pointer_axis(uint32_t time, - uint32_t axis, - wl_fixed_t value) Q_DECL_OVERRIDE; - - void keyboard_keymap(uint32_t format, - int32_t fd, - uint32_t size) Q_DECL_OVERRIDE; - void keyboard_enter(uint32_t time, - struct wl_surface *surface, - struct wl_array *keys) Q_DECL_OVERRIDE; - void keyboard_leave(uint32_t time, - struct wl_surface *surface) Q_DECL_OVERRIDE; - void keyboard_key(uint32_t serial, uint32_t time, - uint32_t key, uint32_t state) Q_DECL_OVERRIDE; - void keyboard_modifiers(uint32_t serial, - uint32_t mods_depressed, - uint32_t mods_latched, - uint32_t mods_locked, - uint32_t group) Q_DECL_OVERRIDE; - - void touch_down(uint32_t serial, - uint32_t time, - struct wl_surface *surface, - int32_t id, - wl_fixed_t x, - wl_fixed_t y) Q_DECL_OVERRIDE; - void touch_up(uint32_t serial, - uint32_t time, - int32_t id) Q_DECL_OVERRIDE; - void touch_motion(uint32_t time, - int32_t id, - wl_fixed_t x, - wl_fixed_t y) Q_DECL_OVERRIDE; - void touch_frame() Q_DECL_OVERRIDE; - void touch_cancel() Q_DECL_OVERRIDE; - - void handleTouchPoint(int id, double x, double y, Qt::TouchPointState state); - - static const wl_callback_listener callback; - static void focusCallback(void *data, struct wl_callback *callback, uint32_t time); - - QList mTouchPoints; - QList mPrevTouchPoints; - QTouchDevice *mTouchDevice; - -#ifndef QT_NO_WAYLAND_XKB - xkb_context *mXkbContext; - xkb_keymap *mXkbMap; - xkb_state *mXkbState; -#endif - - int mRepeatKey; - uint32_t mRepeatCode; - uint32_t mRepeatTime; - QString mRepeatText; - QTimer mRepeatTimer; - - friend class QWaylandTouchExtension; - friend class QWaylandQtKeyExtension; -}; - -inline uint32_t QWaylandInputDevice::serial() const -{ - return mSerial; -} - -QT_END_NAMESPACE - -#endif diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h new file mode 100644 index 000000000..9e955f5d2 --- /dev/null +++ b/src/client/qwaylandinputdevice_p.h @@ -0,0 +1,204 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDINPUTDEVICE_H +#define QWAYLANDINPUTDEVICE_H + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#ifndef QT_NO_WAYLAND_XKB +struct xkb_context; +struct xkb_keymap; +struct xkb_state; +#endif + +QT_BEGIN_NAMESPACE + +class QWaylandWindow; +class QWaylandDisplay; +class QWaylandDataDevice; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice + : public QObject + , public QtWayland::wl_pointer + , public QtWayland::wl_keyboard + , public QtWayland::wl_touch + , public QtWayland::wl_seat +{ + Q_OBJECT +public: + QWaylandInputDevice(QWaylandDisplay *display, uint32_t id); + ~QWaylandInputDevice(); + + uint32_t capabilities() const { return mCaps; } + + struct ::wl_seat *wl_seat() { return QtWayland::wl_seat::object(); } + + void setCursor(Qt::CursorShape cursor, QWaylandScreen *screen); + void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image); + void handleWindowDestroyed(QWaylandWindow *window); + + void setDataDevice(QWaylandDataDevice *device); + QWaylandDataDevice *dataDevice() const; + + void removeMouseButtonFromState(Qt::MouseButton button); + + QWaylandWindow *pointerFocus() const; + + Qt::KeyboardModifiers modifiers() const; + + uint32_t serial() const; + uint32_t cursorSerial() const { return mCursorSerial; } + +private slots: + void repeatKey(); + +private: + QWaylandDisplay *mQDisplay; + struct wl_display *mDisplay; + struct wl_callback *mFocusCallback; + + uint32_t mCaps; + + struct wl_surface *pointerSurface; + + QWaylandDataDevice *mDataDevice; + QWaylandWindow *mPointerFocus; + QWaylandWindow *mKeyboardFocus; + QWaylandWindow *mTouchFocus; + + Qt::MouseButtons mButtons; + QPointF mSurfacePos; + QPointF mGlobalPos; + uint32_t mTime; + uint32_t mSerial; + uint32_t mEnterSerial; + uint32_t mCursorSerial; + + void seat_capabilities(uint32_t caps) Q_DECL_OVERRIDE; + + void pointer_enter(uint32_t serial, struct wl_surface *surface, + wl_fixed_t sx, wl_fixed_t sy) Q_DECL_OVERRIDE; + void pointer_leave(uint32_t time, struct wl_surface *surface); + void pointer_motion(uint32_t time, + wl_fixed_t sx, wl_fixed_t sy) Q_DECL_OVERRIDE; + void pointer_button(uint32_t serial, uint32_t time, + uint32_t button, uint32_t state) Q_DECL_OVERRIDE; + void pointer_axis(uint32_t time, + uint32_t axis, + wl_fixed_t value) Q_DECL_OVERRIDE; + + void keyboard_keymap(uint32_t format, + int32_t fd, + uint32_t size) Q_DECL_OVERRIDE; + void keyboard_enter(uint32_t time, + struct wl_surface *surface, + struct wl_array *keys) Q_DECL_OVERRIDE; + void keyboard_leave(uint32_t time, + struct wl_surface *surface) Q_DECL_OVERRIDE; + void keyboard_key(uint32_t serial, uint32_t time, + uint32_t key, uint32_t state) Q_DECL_OVERRIDE; + void keyboard_modifiers(uint32_t serial, + uint32_t mods_depressed, + uint32_t mods_latched, + uint32_t mods_locked, + uint32_t group) Q_DECL_OVERRIDE; + + void touch_down(uint32_t serial, + uint32_t time, + struct wl_surface *surface, + int32_t id, + wl_fixed_t x, + wl_fixed_t y) Q_DECL_OVERRIDE; + void touch_up(uint32_t serial, + uint32_t time, + int32_t id) Q_DECL_OVERRIDE; + void touch_motion(uint32_t time, + int32_t id, + wl_fixed_t x, + wl_fixed_t y) Q_DECL_OVERRIDE; + void touch_frame() Q_DECL_OVERRIDE; + void touch_cancel() Q_DECL_OVERRIDE; + + void handleTouchPoint(int id, double x, double y, Qt::TouchPointState state); + + static const wl_callback_listener callback; + static void focusCallback(void *data, struct wl_callback *callback, uint32_t time); + + QList mTouchPoints; + QList mPrevTouchPoints; + QTouchDevice *mTouchDevice; + +#ifndef QT_NO_WAYLAND_XKB + xkb_context *mXkbContext; + xkb_keymap *mXkbMap; + xkb_state *mXkbState; +#endif + + int mRepeatKey; + uint32_t mRepeatCode; + uint32_t mRepeatTime; + QString mRepeatText; + QTimer mRepeatTimer; + + friend class QWaylandTouchExtension; + friend class QWaylandQtKeyExtension; +}; + +inline uint32_t QWaylandInputDevice::serial() const +{ + return mSerial; +} + +QT_END_NAMESPACE + +#endif diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index 9acda2107..2e36a16da 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -39,16 +39,16 @@ ** ****************************************************************************/ -#include "qwaylandintegration.h" +#include "qwaylandintegration_p.h" -#include "qwaylanddisplay.h" -#include "qwaylandinputcontext.h" -#include "qwaylandshmbackingstore.h" -#include "qwaylandshmwindow.h" -#include "qwaylandnativeinterface.h" -#include "qwaylandclipboard.h" -#include "qwaylanddnd.h" -#include "qwaylandwindowmanagerintegration.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandinputcontext_p.h" +#include "qwaylandshmbackingstore_p.h" +#include "qwaylandshmwindow_p.h" +#include "qwaylandnativeinterface_p.h" +#include "qwaylandclipboard_p.h" +#include "qwaylanddnd_p.h" +#include "qwaylandwindowmanagerintegration_p.h" #include "QtPlatformSupport/private/qgenericunixfontdatabase_p.h" #include @@ -65,12 +65,12 @@ #include #include -#include "qwaylandhardwareintegration.h" -#include "qwaylandclientbufferintegration.h" -#include "qwaylandclientbufferintegrationfactory.h" +#include "qwaylandhardwareintegration_p.h" +#include "qwaylandclientbufferintegration_p.h" +#include "qwaylandclientbufferintegrationfactory_p.h" -#include "qwaylandserverbufferintegration.h" -#include "qwaylandserverbufferintegrationfactory.h" +#include "qwaylandserverbufferintegration_p.h" +#include "qwaylandserverbufferintegrationfactory_p.h" QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandintegration.h b/src/client/qwaylandintegration.h deleted file mode 100644 index bc51c23bb..000000000 --- a/src/client/qwaylandintegration.h +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMINTEGRATION_WAYLAND_H -#define QPLATFORMINTEGRATION_WAYLAND_H - -#include - -#include -QT_BEGIN_NAMESPACE - -class QWaylandBuffer; -class QWaylandDisplay; -class QWaylandClientBufferIntegration; -class QWaylandServerBufferIntegration; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration -{ -public: - QWaylandIntegration(); - ~QWaylandIntegration(); - - bool hasCapability(QPlatformIntegration::Capability cap) const; - QPlatformWindow *createPlatformWindow(QWindow *window) const; - QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; - QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; - - QAbstractEventDispatcher *createEventDispatcher() const; - void initialize(); - - QPlatformFontDatabase *fontDatabase() const; - - QPlatformNativeInterface *nativeInterface() const; - - QPlatformClipboard *clipboard() const; - - QPlatformDrag *drag() const; - - QPlatformInputContext *inputContext() const; - - QVariant styleHint(StyleHint hint) const; - - QPlatformAccessibility *accessibility() const; - - QPlatformServices *services() const; - - QWaylandDisplay *display() const; - - QStringList themeNames() const; - - QPlatformTheme *createPlatformTheme(const QString &name) const; - - virtual QWaylandClientBufferIntegration *clientBufferIntegration() const; - virtual QWaylandServerBufferIntegration *serverBufferIntegration() const; -protected: - QWaylandClientBufferIntegration *mClientBufferIntegration; - QWaylandServerBufferIntegration *mServerBufferIntegration; -private: - void initializeClientBufferIntegration(); - void initializeServerBufferIntegration(); - QPlatformFontDatabase *mFontDb; - QPlatformClipboard *mClipboard; - QPlatformDrag *mDrag; - QWaylandDisplay *mDisplay; - QPlatformNativeInterface *mNativeInterface; - QScopedPointer mInputContext; - QPlatformAccessibility *mAccessibility; - bool mClientBufferIntegrationInitialized; - bool mServerBufferIntegrationInitialized; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h new file mode 100644 index 000000000..7c062c0ee --- /dev/null +++ b/src/client/qwaylandintegration_p.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMINTEGRATION_WAYLAND_H +#define QPLATFORMINTEGRATION_WAYLAND_H + +#include + +#include +QT_BEGIN_NAMESPACE + +class QWaylandBuffer; +class QWaylandDisplay; +class QWaylandClientBufferIntegration; +class QWaylandServerBufferIntegration; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration +{ +public: + QWaylandIntegration(); + ~QWaylandIntegration(); + + bool hasCapability(QPlatformIntegration::Capability cap) const; + QPlatformWindow *createPlatformWindow(QWindow *window) const; + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; + QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; + + QAbstractEventDispatcher *createEventDispatcher() const; + void initialize(); + + QPlatformFontDatabase *fontDatabase() const; + + QPlatformNativeInterface *nativeInterface() const; + + QPlatformClipboard *clipboard() const; + + QPlatformDrag *drag() const; + + QPlatformInputContext *inputContext() const; + + QVariant styleHint(StyleHint hint) const; + + QPlatformAccessibility *accessibility() const; + + QPlatformServices *services() const; + + QWaylandDisplay *display() const; + + QStringList themeNames() const; + + QPlatformTheme *createPlatformTheme(const QString &name) const; + + virtual QWaylandClientBufferIntegration *clientBufferIntegration() const; + virtual QWaylandServerBufferIntegration *serverBufferIntegration() const; +protected: + QWaylandClientBufferIntegration *mClientBufferIntegration; + QWaylandServerBufferIntegration *mServerBufferIntegration; +private: + void initializeClientBufferIntegration(); + void initializeServerBufferIntegration(); + QPlatformFontDatabase *mFontDb; + QPlatformClipboard *mClipboard; + QPlatformDrag *mDrag; + QWaylandDisplay *mDisplay; + QPlatformNativeInterface *mNativeInterface; + QScopedPointer mInputContext; + QPlatformAccessibility *mAccessibility; + bool mClientBufferIntegrationInitialized; + bool mServerBufferIntegrationInitialized; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp index 291f1711f..f8d95bb25 100644 --- a/src/client/qwaylandnativeinterface.cpp +++ b/src/client/qwaylandnativeinterface.cpp @@ -39,13 +39,13 @@ ** ****************************************************************************/ -#include "qwaylandnativeinterface.h" -#include "qwaylanddisplay.h" -#include "qwaylandwindow.h" -#include "qwaylandextendedsurface.h" -#include "qwaylandintegration.h" -#include "qwaylanddisplay.h" -#include "qwaylandwindowmanagerintegration.h" +#include "qwaylandnativeinterface_p.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandwindow_p.h" +#include "qwaylandextendedsurface_p.h" +#include "qwaylandintegration_p.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandwindowmanagerintegration_p.h" #include #include diff --git a/src/client/qwaylandnativeinterface.h b/src/client/qwaylandnativeinterface.h deleted file mode 100644 index bc0807693..000000000 --- a/src/client/qwaylandnativeinterface.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDNATIVEINTERFACE_H -#define QWAYLANDNATIVEINTERFACE_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandIntegration; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandNativeInterface : public QPlatformNativeInterface -{ -public: - QWaylandNativeInterface(QWaylandIntegration *integration); - void *nativeResourceForIntegration(const QByteArray &resource); - void *nativeResourceForWindow(const QByteArray &resourceString, - QWindow *window); - void *nativeResourceForScreen(const QByteArray &resourceString, - QScreen *screen); - - QVariantMap windowProperties(QPlatformWindow *window) const; - QVariant windowProperty(QPlatformWindow *window, const QString &name) const; - QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const; - void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value); - - void emitWindowPropertyChanged(QPlatformWindow *window, const QString &name); -private: - static QWaylandScreen *qPlatformScreenForWindow(QWindow *window); - -private: - QWaylandIntegration *m_integration; - QHash m_windowProperties; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDNATIVEINTERFACE_H diff --git a/src/client/qwaylandnativeinterface_p.h b/src/client/qwaylandnativeinterface_p.h new file mode 100644 index 000000000..b9ee2d0e8 --- /dev/null +++ b/src/client/qwaylandnativeinterface_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDNATIVEINTERFACE_H +#define QWAYLANDNATIVEINTERFACE_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandIntegration; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandNativeInterface : public QPlatformNativeInterface +{ +public: + QWaylandNativeInterface(QWaylandIntegration *integration); + void *nativeResourceForIntegration(const QByteArray &resource); + void *nativeResourceForWindow(const QByteArray &resourceString, + QWindow *window); + void *nativeResourceForScreen(const QByteArray &resourceString, + QScreen *screen); + + QVariantMap windowProperties(QPlatformWindow *window) const; + QVariant windowProperty(QPlatformWindow *window, const QString &name) const; + QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const; + void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value); + + void emitWindowPropertyChanged(QPlatformWindow *window, const QString &name); +private: + static QWaylandScreen *qPlatformScreenForWindow(QWindow *window); + +private: + QWaylandIntegration *m_integration; + QHash m_windowProperties; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDNATIVEINTERFACE_H diff --git a/src/client/qwaylandqtkey.cpp b/src/client/qwaylandqtkey.cpp index 6cc4597d9..a6b99cb42 100644 --- a/src/client/qwaylandqtkey.cpp +++ b/src/client/qwaylandqtkey.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qwaylandqtkey.h" -#include "qwaylandinputdevice.h" +#include "qwaylandqtkey_p.h" +#include "qwaylandinputdevice_p.h" QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandqtkey.h b/src/client/qwaylandqtkey.h deleted file mode 100644 index 49563b78e..000000000 --- a/src/client/qwaylandqtkey.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDQTKEY_H -#define QWAYLANDQTKEY_H - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class Q_WAYLAND_CLIENT_EXPORT QWaylandQtKeyExtension : public QtWayland::qt_key_extension -{ -public: - QWaylandQtKeyExtension(QWaylandDisplay *display, uint32_t id); - -private: - QWaylandDisplay *m_display; - - void key_extension_qtkey(struct wl_surface *surface, - uint32_t time, - uint32_t type, - uint32_t key, - uint32_t modifiers, - uint32_t nativeScanCode, - uint32_t nativeVirtualKey, - uint32_t nativeModifiers, - const QString &text, - uint32_t autorep, - uint32_t count) Q_DECL_OVERRIDE; - -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDQTKEY_H diff --git a/src/client/qwaylandqtkey_p.h b/src/client/qwaylandqtkey_p.h new file mode 100644 index 000000000..a9c4e99fa --- /dev/null +++ b/src/client/qwaylandqtkey_p.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDQTKEY_H +#define QWAYLANDQTKEY_H + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class Q_WAYLAND_CLIENT_EXPORT QWaylandQtKeyExtension : public QtWayland::qt_key_extension +{ +public: + QWaylandQtKeyExtension(QWaylandDisplay *display, uint32_t id); + +private: + QWaylandDisplay *m_display; + + void key_extension_qtkey(struct wl_surface *surface, + uint32_t time, + uint32_t type, + uint32_t key, + uint32_t modifiers, + uint32_t nativeScanCode, + uint32_t nativeVirtualKey, + uint32_t nativeModifiers, + const QString &text, + uint32_t autorep, + uint32_t count) Q_DECL_OVERRIDE; + +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDQTKEY_H diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp index cda94a7e1..416b320aa 100644 --- a/src/client/qwaylandscreen.cpp +++ b/src/client/qwaylandscreen.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "qwaylandscreen.h" +#include "qwaylandscreen_p.h" -#include "qwaylanddisplay.h" -#include "qwaylandcursor.h" -#include "qwaylandextendedoutput.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandcursor_p.h" +#include "qwaylandextendedoutput_p.h" #include diff --git a/src/client/qwaylandscreen.h b/src/client/qwaylandscreen.h deleted file mode 100644 index 15ae5189a..000000000 --- a/src/client/qwaylandscreen.h +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDSCREEN_H -#define QWAYLANDSCREEN_H - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; -class QWaylandCursor; -class QWaylandExtendedOutput; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandScreen : public QPlatformScreen, QtWayland::wl_output -{ -public: - QWaylandScreen(QWaylandDisplay *waylandDisplay, uint32_t id); - ~QWaylandScreen(); - - QWaylandDisplay *display() const; - - QRect geometry() const; - int depth() const; - QImage::Format format() const; - - QDpi logicalDpi() const Q_DECL_OVERRIDE; - - void setOrientationUpdateMask(Qt::ScreenOrientations mask); - - Qt::ScreenOrientation orientation() const; - qreal refreshRate() const; - - QString name() const { return mOutputName; } - - QPlatformCursor *cursor() const; - QWaylandCursor *waylandCursor() const { return mWaylandCursor; }; - - ::wl_output *output() { return object(); } - - QWaylandExtendedOutput *extendedOutput() const; - void createExtendedOutput(); - - static QWaylandScreen *waylandScreenFromWindow(QWindow *window); - -private: - void output_mode(uint32_t flags, int width, int height, int refresh) Q_DECL_OVERRIDE; - void output_geometry(int32_t x, int32_t y, - int32_t width, int32_t height, - int subpixel, - const QString &make, - const QString &model, - int32_t transform) Q_DECL_OVERRIDE; - - QWaylandDisplay *mWaylandDisplay; - QWaylandExtendedOutput *mExtendedOutput; - QRect mGeometry; - int mDepth; - int mRefreshRate; - QImage::Format mFormat; - QSize mPhysicalSize; - QString mOutputName; - - QWaylandCursor *mWaylandCursor; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDSCREEN_H diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h new file mode 100644 index 000000000..42408acf4 --- /dev/null +++ b/src/client/qwaylandscreen_p.h @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDSCREEN_H +#define QWAYLANDSCREEN_H + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; +class QWaylandCursor; +class QWaylandExtendedOutput; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandScreen : public QPlatformScreen, QtWayland::wl_output +{ +public: + QWaylandScreen(QWaylandDisplay *waylandDisplay, uint32_t id); + ~QWaylandScreen(); + + QWaylandDisplay *display() const; + + QRect geometry() const; + int depth() const; + QImage::Format format() const; + + QDpi logicalDpi() const Q_DECL_OVERRIDE; + + void setOrientationUpdateMask(Qt::ScreenOrientations mask); + + Qt::ScreenOrientation orientation() const; + qreal refreshRate() const; + + QString name() const { return mOutputName; } + + QPlatformCursor *cursor() const; + QWaylandCursor *waylandCursor() const { return mWaylandCursor; }; + + ::wl_output *output() { return object(); } + + QWaylandExtendedOutput *extendedOutput() const; + void createExtendedOutput(); + + static QWaylandScreen *waylandScreenFromWindow(QWindow *window); + +private: + void output_mode(uint32_t flags, int width, int height, int refresh) Q_DECL_OVERRIDE; + void output_geometry(int32_t x, int32_t y, + int32_t width, int32_t height, + int subpixel, + const QString &make, + const QString &model, + int32_t transform) Q_DECL_OVERRIDE; + + QWaylandDisplay *mWaylandDisplay; + QWaylandExtendedOutput *mExtendedOutput; + QRect mGeometry; + int mDepth; + int mRefreshRate; + QImage::Format mFormat; + QSize mPhysicalSize; + QString mOutputName; + + QWaylandCursor *mWaylandCursor; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDSCREEN_H diff --git a/src/client/qwaylandshellsurface.cpp b/src/client/qwaylandshellsurface.cpp index 4c8ff1bc4..b7a819fd3 100644 --- a/src/client/qwaylandshellsurface.cpp +++ b/src/client/qwaylandshellsurface.cpp @@ -39,13 +39,13 @@ ** ****************************************************************************/ -#include "qwaylandshellsurface.h" +#include "qwaylandshellsurface_p.h" -#include "qwaylanddisplay.h" -#include "qwaylandwindow.h" -#include "qwaylandinputdevice.h" -#include "qwaylanddecoration.h" -#include "qwaylandscreen.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandwindow_p.h" +#include "qwaylandinputdevice_p.h" +#include "qwaylanddecoration_p.h" +#include "qwaylandscreen_p.h" #include diff --git a/src/client/qwaylandshellsurface.h b/src/client/qwaylandshellsurface.h deleted file mode 100644 index 25f703334..000000000 --- a/src/client/qwaylandshellsurface.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDSHELLSURFACE_H -#define QWAYLANDSHELLSURFACE_H - -#include - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandWindow; -class QWaylandInputDevice; -class QWindow; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandShellSurface : public QtWayland::wl_shell_surface -{ -public: - QWaylandShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window); - ~QWaylandShellSurface(); - - using QtWayland::wl_shell_surface::resize; - void resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges); - - using QtWayland::wl_shell_surface::move; - void move(QWaylandInputDevice *inputDevice); - -private: - void setMaximized(); - void setFullscreen(); - void setNormal(); - void setMinimized(); - - void setTopLevel(); - void updateTransientParent(QWindow *parent); - void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial); - - QWaylandWindow *m_window; - bool m_maximized; - bool m_fullscreen; - QSize m_size; - - void shell_surface_ping(uint32_t serial) Q_DECL_OVERRIDE; - void shell_surface_configure(uint32_t edges, - int32_t width, - int32_t height) Q_DECL_OVERRIDE; - void shell_surface_popup_done() Q_DECL_OVERRIDE; - - friend class QWaylandWindow; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDSHELLSURFACE_H diff --git a/src/client/qwaylandshellsurface_p.h b/src/client/qwaylandshellsurface_p.h new file mode 100644 index 000000000..2477c3f08 --- /dev/null +++ b/src/client/qwaylandshellsurface_p.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDSHELLSURFACE_H +#define QWAYLANDSHELLSURFACE_H + +#include + +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandWindow; +class QWaylandInputDevice; +class QWindow; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandShellSurface : public QtWayland::wl_shell_surface +{ +public: + QWaylandShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window); + ~QWaylandShellSurface(); + + using QtWayland::wl_shell_surface::resize; + void resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges); + + using QtWayland::wl_shell_surface::move; + void move(QWaylandInputDevice *inputDevice); + +private: + void setMaximized(); + void setFullscreen(); + void setNormal(); + void setMinimized(); + + void setTopLevel(); + void updateTransientParent(QWindow *parent); + void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial); + + QWaylandWindow *m_window; + bool m_maximized; + bool m_fullscreen; + QSize m_size; + + void shell_surface_ping(uint32_t serial) Q_DECL_OVERRIDE; + void shell_surface_configure(uint32_t edges, + int32_t width, + int32_t height) Q_DECL_OVERRIDE; + void shell_surface_popup_done() Q_DECL_OVERRIDE; + + friend class QWaylandWindow; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDSHELLSURFACE_H diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index 00a4b13a2..41f7da200 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -38,14 +38,14 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "qwaylandshmbackingstore.h" +#include "qwaylandshmbackingstore_p.h" #include -#include "qwaylanddisplay.h" -#include "qwaylandshmwindow.h" -#include "qwaylandscreen.h" -#include "qwaylanddecoration.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandshmwindow_p.h" +#include "qwaylandscreen_p.h" +#include "qwaylanddecoration_p.h" #include diff --git a/src/client/qwaylandshmbackingstore.h b/src/client/qwaylandshmbackingstore.h deleted file mode 100644 index b5ee3a38c..000000000 --- a/src/client/qwaylandshmbackingstore.h +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDSHMBACKINGSTORE_H -#define QWAYLANDSHMBACKINGSTORE_H - -#include - -#include -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBuffer : public QWaylandBuffer { -public: - QWaylandShmBuffer(QWaylandDisplay *display, - const QSize &size, QImage::Format format); - ~QWaylandShmBuffer(); - QSize size() const { return mImage.size(); } - QImage *image() { return &mImage; } - - QImage *imageInsideMargins(const QMargins &margins); -private: - QImage mImage; - struct wl_shm_pool *mShmPool; - QMargins mMargins; - QImage *mMarginsImage; -}; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBackingStore : public QPlatformBackingStore -{ -public: - QWaylandShmBackingStore(QWindow *window); - ~QWaylandShmBackingStore(); - - QPaintDevice *paintDevice(); - void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); - void resize(const QSize &size, const QRegion &staticContents); - void resize(const QSize &size); - void beginPaint(const QRegion &); - void endPaint(); - - QWaylandDecoration *windowDecoration() const; - - QMargins windowDecorationMargins() const; - QImage *entireSurface() const; - void ensureSize(); - - QWaylandShmWindow *waylandWindow() const; - void iterateBuffer(); - -private: - void updateDecorations(); - - QWaylandDisplay *mDisplay; - QWaylandShmBuffer *mFrontBuffer; - QWaylandShmBuffer *mBackBuffer; - bool mFrontBufferIsDirty; - bool mPainting; - - QSize mRequestedSize; - Qt::WindowFlags mCurrentWindowFlags; - - static const struct wl_callback_listener frameCallbackListener; - static void done(void *data, - struct wl_callback *callback, - uint32_t time); - struct wl_callback *mFrameCallback; -}; - -inline QWaylandDecoration *QWaylandShmBackingStore::windowDecoration() const -{ - return waylandWindow()->decoration(); -} - -inline QMargins QWaylandShmBackingStore::windowDecorationMargins() const -{ - if (windowDecoration()) - return windowDecoration()->margins(); - return QMargins(); -} - -inline QWaylandShmWindow *QWaylandShmBackingStore::waylandWindow() const -{ - return static_cast(window()->handle()); -} - -QT_END_NAMESPACE - -#endif diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h new file mode 100644 index 000000000..1affafabc --- /dev/null +++ b/src/client/qwaylandshmbackingstore_p.h @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDSHMBACKINGSTORE_H +#define QWAYLANDSHMBACKINGSTORE_H + +#include + +#include +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBuffer : public QWaylandBuffer { +public: + QWaylandShmBuffer(QWaylandDisplay *display, + const QSize &size, QImage::Format format); + ~QWaylandShmBuffer(); + QSize size() const { return mImage.size(); } + QImage *image() { return &mImage; } + + QImage *imageInsideMargins(const QMargins &margins); +private: + QImage mImage; + struct wl_shm_pool *mShmPool; + QMargins mMargins; + QImage *mMarginsImage; +}; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBackingStore : public QPlatformBackingStore +{ +public: + QWaylandShmBackingStore(QWindow *window); + ~QWaylandShmBackingStore(); + + QPaintDevice *paintDevice(); + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); + void resize(const QSize &size, const QRegion &staticContents); + void resize(const QSize &size); + void beginPaint(const QRegion &); + void endPaint(); + + QWaylandDecoration *windowDecoration() const; + + QMargins windowDecorationMargins() const; + QImage *entireSurface() const; + void ensureSize(); + + QWaylandShmWindow *waylandWindow() const; + void iterateBuffer(); + +private: + void updateDecorations(); + + QWaylandDisplay *mDisplay; + QWaylandShmBuffer *mFrontBuffer; + QWaylandShmBuffer *mBackBuffer; + bool mFrontBufferIsDirty; + bool mPainting; + + QSize mRequestedSize; + Qt::WindowFlags mCurrentWindowFlags; + + static const struct wl_callback_listener frameCallbackListener; + static void done(void *data, + struct wl_callback *callback, + uint32_t time); + struct wl_callback *mFrameCallback; +}; + +inline QWaylandDecoration *QWaylandShmBackingStore::windowDecoration() const +{ + return waylandWindow()->decoration(); +} + +inline QMargins QWaylandShmBackingStore::windowDecorationMargins() const +{ + if (windowDecoration()) + return windowDecoration()->margins(); + return QMargins(); +} + +inline QWaylandShmWindow *QWaylandShmBackingStore::waylandWindow() const +{ + return static_cast(window()->handle()); +} + +QT_END_NAMESPACE + +#endif diff --git a/src/client/qwaylandshmwindow.cpp b/src/client/qwaylandshmwindow.cpp index 48a1bfd53..de87682ce 100644 --- a/src/client/qwaylandshmwindow.cpp +++ b/src/client/qwaylandshmwindow.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qwaylandshmwindow.h" +#include "qwaylandshmwindow_p.h" -#include "qwaylandbuffer.h" +#include "qwaylandbuffer_p.h" #include diff --git a/src/client/qwaylandshmwindow.h b/src/client/qwaylandshmwindow.h deleted file mode 100644 index f915c545f..000000000 --- a/src/client/qwaylandshmwindow.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDSHMWINDOW_H -#define QWAYLANDSHMWINDOW_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandShmBackingStore; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandShmWindow : public QWaylandWindow -{ -public: - QWaylandShmWindow(QWindow *window); - ~QWaylandShmWindow(); - - WindowType windowType() const; - QSurfaceFormat format() const { return QSurfaceFormat(); } - - void setBackingStore(QWaylandShmBackingStore *backingStore); - QWaylandShmBackingStore *backingStore() const; - -private: - QWaylandShmBackingStore *mBackingStore; -}; - -inline QWaylandShmBackingStore *QWaylandShmWindow::backingStore() const -{ - return mBackingStore; -} - -QT_END_NAMESPACE - -#endif // QWAYLANDSHMWINDOW_H diff --git a/src/client/qwaylandshmwindow_p.h b/src/client/qwaylandshmwindow_p.h new file mode 100644 index 000000000..83479f313 --- /dev/null +++ b/src/client/qwaylandshmwindow_p.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDSHMWINDOW_H +#define QWAYLANDSHMWINDOW_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWaylandShmBackingStore; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandShmWindow : public QWaylandWindow +{ +public: + QWaylandShmWindow(QWindow *window); + ~QWaylandShmWindow(); + + WindowType windowType() const; + QSurfaceFormat format() const { return QSurfaceFormat(); } + + void setBackingStore(QWaylandShmBackingStore *backingStore); + QWaylandShmBackingStore *backingStore() const; + +private: + QWaylandShmBackingStore *mBackingStore; +}; + +inline QWaylandShmBackingStore *QWaylandShmWindow::backingStore() const +{ + return mBackingStore; +} + +QT_END_NAMESPACE + +#endif // QWAYLANDSHMWINDOW_H diff --git a/src/client/qwaylandsubsurface.cpp b/src/client/qwaylandsubsurface.cpp index 0e9d575a9..6db59fa20 100644 --- a/src/client/qwaylandsubsurface.cpp +++ b/src/client/qwaylandsubsurface.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qwaylandsubsurface.h" +#include "qwaylandsubsurface_p.h" -#include "qwaylandwindow.h" +#include "qwaylandwindow_p.h" #include diff --git a/src/client/qwaylandsubsurface.h b/src/client/qwaylandsubsurface.h deleted file mode 100644 index 97158b6aa..000000000 --- a/src/client/qwaylandsubsurface.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDSUBSURFACE_H -#define QWAYLANDSUBSURFACE_H - -#include - -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; -class QWaylandWindow; -class QWaylandSubSurface; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandSubSurface : public QtWayland::qt_sub_surface -{ -public: - QWaylandSubSurface(QWaylandWindow *window, struct ::qt_sub_surface *sub_surface); - - void setParent(const QWaylandWindow *parent); - void adjustPositionOfChildren(); - -private: - QWaylandWindow *m_window; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDSUBSURFACE_H diff --git a/src/client/qwaylandsubsurface_p.h b/src/client/qwaylandsubsurface_p.h new file mode 100644 index 000000000..bd0da96d2 --- /dev/null +++ b/src/client/qwaylandsubsurface_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDSUBSURFACE_H +#define QWAYLANDSUBSURFACE_H + +#include + +#include + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; +class QWaylandWindow; +class QWaylandSubSurface; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandSubSurface : public QtWayland::qt_sub_surface +{ +public: + QWaylandSubSurface(QWaylandWindow *window, struct ::qt_sub_surface *sub_surface); + + void setParent(const QWaylandWindow *parent); + void adjustPositionOfChildren(); + +private: + QWaylandWindow *m_window; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDSUBSURFACE_H diff --git a/src/client/qwaylandtouch.cpp b/src/client/qwaylandtouch.cpp index 5835d9d3c..db6d4b92d 100644 --- a/src/client/qwaylandtouch.cpp +++ b/src/client/qwaylandtouch.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qwaylandtouch.h" -#include "qwaylandinputdevice.h" +#include "qwaylandtouch_p.h" +#include "qwaylandinputdevice_p.h" QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandtouch.h b/src/client/qwaylandtouch.h deleted file mode 100644 index e6f57ab57..000000000 --- a/src/client/qwaylandtouch.h +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDTOUCh_H -#define QWAYLANDTOUCH_H - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class Q_WAYLAND_CLIENT_EXPORT QWaylandTouchExtension : public QtWayland::qt_touch_extension -{ -public: - QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id); - - void touchCanceled(); - -private: - void registerDevice(int caps); - - QWaylandDisplay *mDisplay; - - void touch_extension_touch(uint32_t time, - uint32_t id, - uint32_t state, - int32_t x, - int32_t y, - int32_t normalized_x, - int32_t normalized_y, - int32_t width, - int32_t height, - uint32_t pressure, - int32_t velocity_x, - int32_t velocity_y, - uint32_t flags, - struct wl_array *rawdata) Q_DECL_OVERRIDE; - void touch_extension_configure(uint32_t flags) Q_DECL_OVERRIDE; - - void sendTouchEvent(); - - QList mTouchPoints; - QList mPrevTouchPoints; - QTouchDevice *mTouchDevice; - uint32_t mTimestamp; - int mPointsLeft; - uint32_t mFlags; - int mMouseSourceId; - QPointF mLastMouseLocal; - QPointF mLastMouseGlobal; - QWindow *mTargetWindow; - QWaylandInputDevice *mInputDevice; -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDTOUCH_H diff --git a/src/client/qwaylandtouch_p.h b/src/client/qwaylandtouch_p.h new file mode 100644 index 000000000..c00c7c0d3 --- /dev/null +++ b/src/client/qwaylandtouch_p.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDTOUCh_H +#define QWAYLANDTOUCH_H + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class Q_WAYLAND_CLIENT_EXPORT QWaylandTouchExtension : public QtWayland::qt_touch_extension +{ +public: + QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id); + + void touchCanceled(); + +private: + void registerDevice(int caps); + + QWaylandDisplay *mDisplay; + + void touch_extension_touch(uint32_t time, + uint32_t id, + uint32_t state, + int32_t x, + int32_t y, + int32_t normalized_x, + int32_t normalized_y, + int32_t width, + int32_t height, + uint32_t pressure, + int32_t velocity_x, + int32_t velocity_y, + uint32_t flags, + struct wl_array *rawdata) Q_DECL_OVERRIDE; + void touch_extension_configure(uint32_t flags) Q_DECL_OVERRIDE; + + void sendTouchEvent(); + + QList mTouchPoints; + QList mPrevTouchPoints; + QTouchDevice *mTouchDevice; + uint32_t mTimestamp; + int mPointsLeft; + uint32_t mFlags; + int mMouseSourceId; + QPointF mLastMouseLocal; + QPointF mLastMouseGlobal; + QWindow *mTargetWindow; + QWaylandInputDevice *mInputDevice; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDTOUCH_H diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index b64d3e6ab..810239a7b 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -39,17 +39,17 @@ ** ****************************************************************************/ -#include "qwaylandwindow.h" - -#include "qwaylandbuffer.h" -#include "qwaylanddisplay.h" -#include "qwaylandinputdevice.h" -#include "qwaylandscreen.h" -#include "qwaylandshellsurface.h" -#include "qwaylandextendedsurface.h" -#include "qwaylandsubsurface.h" -#include "qwaylanddecoration.h" -#include "qwaylandwindowmanagerintegration.h" +#include "qwaylandwindow_p.h" + +#include "qwaylandbuffer_p.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandinputdevice_p.h" +#include "qwaylandscreen_p.h" +#include "qwaylandshellsurface_p.h" +#include "qwaylandextendedsurface_p.h" +#include "qwaylandsubsurface_p.h" +#include "qwaylanddecoration_p.h" +#include "qwaylandwindowmanagerintegration_p.h" #include #include diff --git a/src/client/qwaylandwindow.h b/src/client/qwaylandwindow.h deleted file mode 100644 index 1f7344dc2..000000000 --- a/src/client/qwaylandwindow.h +++ /dev/null @@ -1,233 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDWINDOW_H -#define QWAYLANDWINDOW_H - -#include -#include -#include - -#include - -#include - -#include - -struct wl_egl_window; - -QT_BEGIN_NAMESPACE - -class QWaylandDisplay; -class QWaylandBuffer; -class QWaylandShellSurface; -class QWaylandExtendedSurface; -class QWaylandSubSurface; -class QWaylandDecoration; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowConfigure -{ -public: - QWaylandWindowConfigure() - : width(0) - , height(0) - , edges(0) - { } - - void clear() - { width = height = edges = 0; } - - bool isEmpty() const - { return !height || !width; } - - int width; - int height; - uint32_t edges; -}; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandWindow : public QObject, public QPlatformWindow, public QtWayland::wl_surface -{ - Q_OBJECT -public: - enum WindowType { - Shm, - Egl - }; - - QWaylandWindow(QWindow *window); - ~QWaylandWindow(); - - virtual WindowType windowType() const = 0; - WId winId() const; - void setVisible(bool visible); - void setParent(const QPlatformWindow *parent); - - void setWindowTitle(const QString &title); - - inline QIcon windowIcon() const; - void setWindowIcon(const QIcon &icon); - - void setGeometry(const QRect &rect); - - void configure(uint32_t edges, int32_t width, int32_t height); - - using QtWayland::wl_surface::attach; - void attach(QWaylandBuffer *buffer, int x, int y); - void attachOffset(QWaylandBuffer *buffer); - QWaylandBuffer *attached() const; - QPoint attachOffset() const; - - using QtWayland::wl_surface::damage; - void damage(const QRect &rect); - - void waitForFrameSync(); - - QMargins frameMargins() const; - - static QWaylandWindow *fromWlSurface(::wl_surface *surface); - - QWaylandShellSurface *shellSurface() const; - QWaylandExtendedSurface *extendedWindow() const; - QWaylandSubSurface *subSurfaceWindow() const; - - void handleContentOrientationChange(Qt::ScreenOrientation orientation); - - void setWindowState(Qt::WindowState state); - void setWindowFlags(Qt::WindowFlags flags); - - void raise() Q_DECL_OVERRIDE; - void lower() Q_DECL_OVERRIDE; - - void requestActivateWindow() Q_DECL_OVERRIDE; - - QWaylandDecoration *decoration() const; - void setDecoration(QWaylandDecoration *decoration); - - - void handleMouse(QWaylandInputDevice *inputDevice, - ulong timestamp, - const QPointF & local, - const QPointF & global, - Qt::MouseButtons b, - Qt::KeyboardModifiers mods); - void handleMouseEnter(QWaylandInputDevice *inputDevice); - void handleMouseLeave(QWaylandInputDevice *inputDevice); - - bool createDecoration(); - - inline bool isMaximized() const { return mState == Qt::WindowMaximized; } - inline bool isFullscreen() const { return mState == Qt::WindowFullScreen; } - - void setMouseCursor(QWaylandInputDevice *device, Qt::CursorShape shape); - void restoreMouseCursor(QWaylandInputDevice *device); - - QWaylandWindow *transientParent() const; - - QMutex *resizeMutex() { return &mResizeLock; } - void doResize(); - void setCanResize(bool canResize); - - bool setMouseGrabEnabled(bool grab); - static QWaylandWindow *mouseGrab() { return mMouseGrab; } - -public slots: - void requestResize(); - -protected: - QWaylandScreen *mScreen; - QWaylandDisplay *mDisplay; - QWaylandShellSurface *mShellSurface; - QWaylandExtendedSurface *mExtendedWindow; - QWaylandSubSurface *mSubSurfaceWindow; - - QWaylandDecoration *mWindowDecoration; - bool mMouseEventsInContentArea; - Qt::MouseButtons mMousePressedInContentArea; - Qt::CursorShape m_cursorShape; - - QWaylandBuffer *mBuffer; - WId mWindowId; - bool mWaitingForFrameSync; - struct wl_callback *mFrameCallback; - QWaitCondition mFrameSyncWait; - - QMutex mResizeLock; - QWaylandWindowConfigure mConfigure; - bool mRequestResizeSent; - bool mCanResize; - - bool mSentInitialResize; - QPoint mOffset; - - QIcon mWindowIcon; - QWaylandInputDevice *mMouseDevice; - int mMouseSerial; - - Qt::WindowState mState; - -private: - void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, - ulong timestamp, - const QPointF & local, - const QPointF & global, - Qt::MouseButtons b, - Qt::KeyboardModifiers mods); - - static const wl_callback_listener callbackListener; - static void frameCallback(void *data, struct wl_callback *wl_callback, uint32_t time); - - static QMutex mFrameSyncMutex; - static QWaylandWindow *mMouseGrab; -}; - -inline QIcon QWaylandWindow::windowIcon() const -{ - return mWindowIcon; -} - -inline QPoint QWaylandWindow::attachOffset() const -{ - return mOffset; -} - -QT_END_NAMESPACE - -#endif // QWAYLANDWINDOW_H diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h new file mode 100644 index 000000000..6078dab7f --- /dev/null +++ b/src/client/qwaylandwindow_p.h @@ -0,0 +1,233 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDWINDOW_H +#define QWAYLANDWINDOW_H + +#include +#include +#include + +#include + +#include + +#include + +struct wl_egl_window; + +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; +class QWaylandBuffer; +class QWaylandShellSurface; +class QWaylandExtendedSurface; +class QWaylandSubSurface; +class QWaylandDecoration; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowConfigure +{ +public: + QWaylandWindowConfigure() + : width(0) + , height(0) + , edges(0) + { } + + void clear() + { width = height = edges = 0; } + + bool isEmpty() const + { return !height || !width; } + + int width; + int height; + uint32_t edges; +}; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandWindow : public QObject, public QPlatformWindow, public QtWayland::wl_surface +{ + Q_OBJECT +public: + enum WindowType { + Shm, + Egl + }; + + QWaylandWindow(QWindow *window); + ~QWaylandWindow(); + + virtual WindowType windowType() const = 0; + WId winId() const; + void setVisible(bool visible); + void setParent(const QPlatformWindow *parent); + + void setWindowTitle(const QString &title); + + inline QIcon windowIcon() const; + void setWindowIcon(const QIcon &icon); + + void setGeometry(const QRect &rect); + + void configure(uint32_t edges, int32_t width, int32_t height); + + using QtWayland::wl_surface::attach; + void attach(QWaylandBuffer *buffer, int x, int y); + void attachOffset(QWaylandBuffer *buffer); + QWaylandBuffer *attached() const; + QPoint attachOffset() const; + + using QtWayland::wl_surface::damage; + void damage(const QRect &rect); + + void waitForFrameSync(); + + QMargins frameMargins() const; + + static QWaylandWindow *fromWlSurface(::wl_surface *surface); + + QWaylandShellSurface *shellSurface() const; + QWaylandExtendedSurface *extendedWindow() const; + QWaylandSubSurface *subSurfaceWindow() const; + + void handleContentOrientationChange(Qt::ScreenOrientation orientation); + + void setWindowState(Qt::WindowState state); + void setWindowFlags(Qt::WindowFlags flags); + + void raise() Q_DECL_OVERRIDE; + void lower() Q_DECL_OVERRIDE; + + void requestActivateWindow() Q_DECL_OVERRIDE; + + QWaylandDecoration *decoration() const; + void setDecoration(QWaylandDecoration *decoration); + + + void handleMouse(QWaylandInputDevice *inputDevice, + ulong timestamp, + const QPointF & local, + const QPointF & global, + Qt::MouseButtons b, + Qt::KeyboardModifiers mods); + void handleMouseEnter(QWaylandInputDevice *inputDevice); + void handleMouseLeave(QWaylandInputDevice *inputDevice); + + bool createDecoration(); + + inline bool isMaximized() const { return mState == Qt::WindowMaximized; } + inline bool isFullscreen() const { return mState == Qt::WindowFullScreen; } + + void setMouseCursor(QWaylandInputDevice *device, Qt::CursorShape shape); + void restoreMouseCursor(QWaylandInputDevice *device); + + QWaylandWindow *transientParent() const; + + QMutex *resizeMutex() { return &mResizeLock; } + void doResize(); + void setCanResize(bool canResize); + + bool setMouseGrabEnabled(bool grab); + static QWaylandWindow *mouseGrab() { return mMouseGrab; } + +public slots: + void requestResize(); + +protected: + QWaylandScreen *mScreen; + QWaylandDisplay *mDisplay; + QWaylandShellSurface *mShellSurface; + QWaylandExtendedSurface *mExtendedWindow; + QWaylandSubSurface *mSubSurfaceWindow; + + QWaylandDecoration *mWindowDecoration; + bool mMouseEventsInContentArea; + Qt::MouseButtons mMousePressedInContentArea; + Qt::CursorShape m_cursorShape; + + QWaylandBuffer *mBuffer; + WId mWindowId; + bool mWaitingForFrameSync; + struct wl_callback *mFrameCallback; + QWaitCondition mFrameSyncWait; + + QMutex mResizeLock; + QWaylandWindowConfigure mConfigure; + bool mRequestResizeSent; + bool mCanResize; + + bool mSentInitialResize; + QPoint mOffset; + + QIcon mWindowIcon; + QWaylandInputDevice *mMouseDevice; + int mMouseSerial; + + Qt::WindowState mState; + +private: + void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, + ulong timestamp, + const QPointF & local, + const QPointF & global, + Qt::MouseButtons b, + Qt::KeyboardModifiers mods); + + static const wl_callback_listener callbackListener; + static void frameCallback(void *data, struct wl_callback *wl_callback, uint32_t time); + + static QMutex mFrameSyncMutex; + static QWaylandWindow *mMouseGrab; +}; + +inline QIcon QWaylandWindow::windowIcon() const +{ + return mWindowIcon; +} + +inline QPoint QWaylandWindow::attachOffset() const +{ + return mOffset; +} + +QT_END_NAMESPACE + +#endif // QWAYLANDWINDOW_H diff --git a/src/client/qwaylandwindowmanagerintegration.cpp b/src/client/qwaylandwindowmanagerintegration.cpp index d396f1452..9e8ce88c6 100644 --- a/src/client/qwaylandwindowmanagerintegration.cpp +++ b/src/client/qwaylandwindowmanagerintegration.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qwaylandwindowmanagerintegration.h" -#include "qwaylandscreen.h" -#include "qwaylandwindow.h" +#include "qwaylandwindowmanagerintegration_p.h" +#include "qwaylandscreen_p.h" +#include "qwaylandwindow_p.h" #include #include diff --git a/src/client/qwaylandwindowmanagerintegration.h b/src/client/qwaylandwindowmanagerintegration.h deleted file mode 100644 index 2164f4c8d..000000000 --- a/src/client/qwaylandwindowmanagerintegration.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDWINDOWMANAGERINTEGRATION_H -#define QWAYLANDWINDOWMANAGERINTEGRATION_H - -#include -#include - -#include "wayland-client.h" -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandWindow; -class QWaylandWindowManagerIntegrationPrivate; - -class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowManagerIntegration : public QObject, public QPlatformServices, public QtWayland::qt_windowmanager -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QWaylandWindowManagerIntegration) -public: - explicit QWaylandWindowManagerIntegration(QWaylandDisplay *waylandDisplay); - virtual ~QWaylandWindowManagerIntegration(); - - QByteArray desktopEnvironment() const; - - bool openUrl(const QUrl &url); - bool openDocument(const QUrl &url); - - bool showIsFullScreen() const; - -private: - static void wlHandleListenerGlobal(void *data, wl_registry *registry, uint32_t id, - const QString &interface, uint32_t version); - - QScopedPointer d_ptr; - - void windowmanager_hints(int32_t showIsFullScreen) Q_DECL_OVERRIDE; - void windowmanager_quit() Q_DECL_OVERRIDE; - - void openUrl_helper(const QUrl &url); -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDWINDOWMANAGERINTEGRATION_H diff --git a/src/client/qwaylandwindowmanagerintegration_p.h b/src/client/qwaylandwindowmanagerintegration_p.h new file mode 100644 index 000000000..8c8f3c32a --- /dev/null +++ b/src/client/qwaylandwindowmanagerintegration_p.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDWINDOWMANAGERINTEGRATION_H +#define QWAYLANDWINDOWMANAGERINTEGRATION_H + +#include +#include + +#include "wayland-client.h" +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class QWaylandWindow; +class QWaylandWindowManagerIntegrationPrivate; + +class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowManagerIntegration : public QObject, public QPlatformServices, public QtWayland::qt_windowmanager +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QWaylandWindowManagerIntegration) +public: + explicit QWaylandWindowManagerIntegration(QWaylandDisplay *waylandDisplay); + virtual ~QWaylandWindowManagerIntegration(); + + QByteArray desktopEnvironment() const; + + bool openUrl(const QUrl &url); + bool openDocument(const QUrl &url); + + bool showIsFullScreen() const; + +private: + static void wlHandleListenerGlobal(void *data, wl_registry *registry, uint32_t id, + const QString &interface, uint32_t version); + + QScopedPointer d_ptr; + + void windowmanager_hints(int32_t showIsFullScreen) Q_DECL_OVERRIDE; + void windowmanager_quit() Q_DECL_OVERRIDE; + + void openUrl_helper(const QUrl &url); +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDWINDOWMANAGERINTEGRATION_H diff --git a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp index 74793dfc3..7edfa2c90 100644 --- a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "drmeglserverbufferintegration.h" -#include +#include #include #include diff --git a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.h b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.h index 4a039d12b..c47362825 100644 --- a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.h +++ b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.h @@ -44,10 +44,10 @@ #include #include "qwayland-drm-egl-server-buffer.h" -#include +#include #include "drmeglserverbufferintegration.h" -#include +#include #include #include diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h index 6b4719b7d..0c7d76cb9 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDEGLINTEGRATION_H #define QWAYLANDEGLINTEGRATION_H -#include +#include #include "qwaylandeglinclude.h" diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index 5be78b5db..1e86bd313 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -41,7 +41,7 @@ #include "qwaylandeglwindow.h" -#include "qwaylandscreen.h" +#include #include "qwaylandglcontext.h" #include diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h index 06ba1b0b0..9f08559d1 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDEGLWINDOW_H #define QWAYLANDEGLWINDOW_H -#include +#include #include "qwaylandeglinclude.h" #include "qwaylandeglclientbufferintegration.h" diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 92d79db36..3bc1ff2b1 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -41,10 +41,10 @@ #include "qwaylandglcontext.h" -#include "qwaylanddisplay.h" -#include "qwaylandwindow.h" +#include +#include +#include #include "qwaylandeglwindow.h" -#include "qwaylanddecoration.h" #include #include diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h index 1da849556..38548ac81 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDGLCONTEXT_H #define QWAYLANDGLCONTEXT_H -#include +#include #include #include diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h index 9f27a1f7b..068a35df0 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDXCOMPOSITEEGLCLIENTBUFFERINTEGRATION_H #define QWAYLANDXCOMPOSITEEGLCLIENTBUFFERINTEGRATION_H -#include +#include #include "wayland-client.h" #include diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h index 9e512ec7c..6bba18a14 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h @@ -42,8 +42,8 @@ #ifndef QWAYLANDXCOMPOSITEEGLWINDOW_H #define QWAYLANDXCOMPOSITEEGLWINDOW_H -#include -#include +#include +#include #include "qwaylandxcompositeeglclientbufferintegration.h" #include "qwaylandxcompositeeglcontext.h" diff --git a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h b/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h index 934abb531..a2f421666 100644 --- a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h +++ b/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDXCOMPOSITEBUFFER_H #define QWAYLANDXCOMPOSITEBUFFER_H -#include +#include #include struct qt_xcomposite; diff --git a/src/plugins/hardwareintegration/client/drm-egl-server/main.cpp b/src/plugins/hardwareintegration/client/drm-egl-server/main.cpp index 33f484287..460ccb7a1 100644 --- a/src/plugins/hardwareintegration/client/drm-egl-server/main.cpp +++ b/src/plugins/hardwareintegration/client/drm-egl-server/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "drmeglserverbufferintegration.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/hardwareintegration/client/wayland-egl/main.cpp b/src/plugins/hardwareintegration/client/wayland-egl/main.cpp index a6b7bbb69..44ce6019d 100644 --- a/src/plugins/hardwareintegration/client/wayland-egl/main.cpp +++ b/src/plugins/hardwareintegration/client/wayland-egl/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "qwaylandeglclientbufferintegration.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/hardwareintegration/client/xcomposite-egl/main.cpp b/src/plugins/hardwareintegration/client/xcomposite-egl/main.cpp index 161657c8f..7c6135ccc 100644 --- a/src/plugins/hardwareintegration/client/xcomposite-egl/main.cpp +++ b/src/plugins/hardwareintegration/client/xcomposite-egl/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "qwaylandxcompositeeglclientbufferintegration.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/qwayland-egl/qwaylandeglplatformintegration.h b/src/plugins/platforms/qwayland-egl/qwaylandeglplatformintegration.h index 2dbc15412..5f23f68de 100644 --- a/src/plugins/platforms/qwayland-egl/qwaylandeglplatformintegration.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglplatformintegration.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDEGLPLATFORMINTEGRATION_H #define QWAYLANDEGLPLATFORMINTEGRATION_H -#include +#include #include "qwaylandeglclientbufferintegration.h" diff --git a/src/plugins/platforms/qwayland-generic/main.cpp b/src/plugins/platforms/qwayland-generic/main.cpp index 1b4028cd0..0575d0dc2 100644 --- a/src/plugins/platforms/qwayland-generic/main.cpp +++ b/src/plugins/platforms/qwayland-generic/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h index 3d225a34a..340ab03c3 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDXCOMPOSITEEGLPLATFROMINTEGRATION_H #define QWAYLANDXCOMPOSITEEGLPLATFROMINTEGRATION_H -#include +#include #include "qwaylandxcompositeeglclientbufferintegration.h" -- cgit v1.2.3