From 8dd6957cd7a1d86714b32b97dffe603a8636848a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 3 Jul 2020 15:40:47 +0200 Subject: Make QtPlatformHeaders a private module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The APIs will be reintroduced as part of the new platform interface API where appropriate. Clients that still depend on the platform headers can include it via QT += platformheaders-private. Change-Id: Ifbd836d833d19f3cf48cd4f933d7fe754c06d2d9 Reviewed-by: Tor Arne Vestbø --- src/platformheaders/.prev_CMakeLists.txt | 23 ++++ src/platformheaders/CMakeLists.txt | 26 +++- .../cocoafunctions/cocoafunctions.pri | 2 +- .../cocoafunctions/qcocoawindowfunctions.h | 63 --------- .../cocoafunctions/qcocoawindowfunctions_p.h | 74 +++++++++++ .../doc/snippets/qwindowswindowfunctions/main.cpp | 2 +- .../doc/snippets/qxcbwindowfunctions/main.cpp | 2 +- .../eglfsfunctions/eglfsfunctions.pri | 2 +- .../eglfsfunctions/qeglfsfunctions.h | 133 ------------------- .../eglfsfunctions/qeglfsfunctions_p.h | 144 +++++++++++++++++++++ src/platformheaders/helper/helper.pri | 2 +- src/platformheaders/helper/qplatformheaderhelper.h | 93 ------------- .../helper/qplatformheaderhelper_p.h | 104 +++++++++++++++ .../linuxfbfunctions/linuxfbfunctions.pri | 2 +- .../linuxfbfunctions/qlinuxfbfunctions.h | 74 ----------- .../linuxfbfunctions/qlinuxfbfunctions_p.h | 85 ++++++++++++ src/platformheaders/platformheaders.pro | 10 +- .../waylandfunctions/qwaylandwindowfunctions.h | 86 ------------ .../waylandfunctions/qwaylandwindowfunctions_p.h | 97 ++++++++++++++ .../waylandfunctions/waylandfunctions.pri | 2 +- .../windowsfunctions/qwindowswindowfunctions.h | 125 ------------------ .../windowsfunctions/qwindowswindowfunctions_p.h | 136 +++++++++++++++++++ .../windowsfunctions/windowsfunctions.pri | 2 +- .../xcbfunctions/qxcbscreenfunctions.h | 62 --------- .../xcbfunctions/qxcbscreenfunctions_p.h | 73 +++++++++++ .../xcbfunctions/qxcbwindowfunctions.h | 108 ---------------- .../xcbfunctions/qxcbwindowfunctions_p.h | 119 +++++++++++++++++ src/platformheaders/xcbfunctions/xcbfunctions.pri | 4 +- 28 files changed, 888 insertions(+), 767 deletions(-) delete mode 100644 src/platformheaders/cocoafunctions/qcocoawindowfunctions.h create mode 100644 src/platformheaders/cocoafunctions/qcocoawindowfunctions_p.h delete mode 100644 src/platformheaders/eglfsfunctions/qeglfsfunctions.h create mode 100644 src/platformheaders/eglfsfunctions/qeglfsfunctions_p.h delete mode 100644 src/platformheaders/helper/qplatformheaderhelper.h create mode 100644 src/platformheaders/helper/qplatformheaderhelper_p.h delete mode 100644 src/platformheaders/linuxfbfunctions/qlinuxfbfunctions.h create mode 100644 src/platformheaders/linuxfbfunctions/qlinuxfbfunctions_p.h delete mode 100644 src/platformheaders/waylandfunctions/qwaylandwindowfunctions.h create mode 100644 src/platformheaders/waylandfunctions/qwaylandwindowfunctions_p.h delete mode 100644 src/platformheaders/windowsfunctions/qwindowswindowfunctions.h create mode 100644 src/platformheaders/windowsfunctions/qwindowswindowfunctions_p.h delete mode 100644 src/platformheaders/xcbfunctions/qxcbscreenfunctions.h create mode 100644 src/platformheaders/xcbfunctions/qxcbscreenfunctions_p.h delete mode 100644 src/platformheaders/xcbfunctions/qxcbwindowfunctions.h create mode 100644 src/platformheaders/xcbfunctions/qxcbwindowfunctions_p.h (limited to 'src/platformheaders') diff --git a/src/platformheaders/.prev_CMakeLists.txt b/src/platformheaders/.prev_CMakeLists.txt index 5456de5c80..d752381fb7 100644 --- a/src/platformheaders/.prev_CMakeLists.txt +++ b/src/platformheaders/.prev_CMakeLists.txt @@ -1,2 +1,25 @@ # Generated from platformheaders.pro. +##################################################################### +## PlatformHeaders Module: +##################################################################### + +qt_add_module(PlatformHeaders + HEADER_MODULE + SOURCES + cocoafunctions/qcocoawindowfunctions_p.h + eglfsfunctions/qeglfsfunctions_p.h + helper/qplatformheaderhelper_p.h + linuxfbfunctions/qlinuxfbfunctions_p.h + waylandfunctions/qwaylandwindowfunctions_p.h + windowsfunctions/qwindowswindowfunctions_p.h + xcbfunctions/qxcbscreenfunctions_p.h + xcbfunctions/qxcbwindowfunctions_p.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui +) +qt_add_docs(PlatformHeaders + doc/qtplatformheaders.qdocconf +) + diff --git a/src/platformheaders/CMakeLists.txt b/src/platformheaders/CMakeLists.txt index 820bbb71a5..63bb60576f 100644 --- a/src/platformheaders/CMakeLists.txt +++ b/src/platformheaders/CMakeLists.txt @@ -1,13 +1,27 @@ # Generated from platformheaders.pro. -# special case begin - -# FIXME Add the rest of the stuff? I don't think any other stuff is needed? - -qt_add_module(PlatformHeaders HEADER_MODULE) +##################################################################### +## PlatformHeaders Module: +##################################################################### +qt_add_module(PlatformHeaders + HEADER_MODULE + # special case begin + # SOURCES + # cocoafunctions/qcocoawindowfunctions_p.h + # eglfsfunctions/qeglfsfunctions_p.h + # helper/qplatformheaderhelper_p.h + # linuxfbfunctions/qlinuxfbfunctions_p.h + # waylandfunctions/qwaylandwindowfunctions_p.h + # windowsfunctions/qwindowswindowfunctions_p.h + # xcbfunctions/qxcbscreenfunctions_p.h + # xcbfunctions/qxcbwindowfunctions_p.h + # special case end + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui +) qt_add_docs(PlatformHeaders doc/qtplatformheaders.qdocconf ) -# special case end diff --git a/src/platformheaders/cocoafunctions/cocoafunctions.pri b/src/platformheaders/cocoafunctions/cocoafunctions.pri index 3987523f9a..640d29c8ce 100644 --- a/src/platformheaders/cocoafunctions/cocoafunctions.pri +++ b/src/platformheaders/cocoafunctions/cocoafunctions.pri @@ -1 +1 @@ -HEADERS += $$PWD/qcocoawindowfunctions.h +HEADERS += $$PWD/qcocoawindowfunctions_p.h diff --git a/src/platformheaders/cocoafunctions/qcocoawindowfunctions.h b/src/platformheaders/cocoafunctions/qcocoawindowfunctions.h deleted file mode 100644 index 248900ad2a..0000000000 --- a/src/platformheaders/cocoafunctions/qcocoawindowfunctions.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QCOCOAWINDOWFUNCTIONS_H -#define QCOCOAWINDOWFUNCTIONS_H - -#include - -QT_BEGIN_NAMESPACE - -class QWindow; - -class QCocoaWindowFunctions { -public: - typedef QPoint (*BottomLeftClippedByNSWindowOffset)(QWindow *window); - static const QByteArray bottomLeftClippedByNSWindowOffsetIdentifier() { return QByteArrayLiteral("CocoaBottomLeftClippedByNSWindowOffset"); } - - static QPoint bottomLeftClippedByNSWindowOffset(QWindow *window) - { - return QPlatformHeaderHelper::callPlatformFunction(bottomLeftClippedByNSWindowOffsetIdentifier(),window); - } -}; - - -QT_END_NAMESPACE - -#endif // QCOCOAWINDOWFUNCTIONS_H diff --git a/src/platformheaders/cocoafunctions/qcocoawindowfunctions_p.h b/src/platformheaders/cocoafunctions/qcocoawindowfunctions_p.h new file mode 100644 index 0000000000..7701509a66 --- /dev/null +++ b/src/platformheaders/cocoafunctions/qcocoawindowfunctions_p.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOCOAWINDOWFUNCTIONS_H +#define QCOCOAWINDOWFUNCTIONS_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QWindow; + +class QCocoaWindowFunctions { +public: + typedef QPoint (*BottomLeftClippedByNSWindowOffset)(QWindow *window); + static const QByteArray bottomLeftClippedByNSWindowOffsetIdentifier() { return QByteArrayLiteral("CocoaBottomLeftClippedByNSWindowOffset"); } + + static QPoint bottomLeftClippedByNSWindowOffset(QWindow *window) + { + return QPlatformHeaderHelper::callPlatformFunction(bottomLeftClippedByNSWindowOffsetIdentifier(),window); + } +}; + + +QT_END_NAMESPACE + +#endif // QCOCOAWINDOWFUNCTIONS_H diff --git a/src/platformheaders/doc/snippets/qwindowswindowfunctions/main.cpp b/src/platformheaders/doc/snippets/qwindowswindowfunctions/main.cpp index f8f4f28ed3..53b9a58867 100644 --- a/src/platformheaders/doc/snippets/qwindowswindowfunctions/main.cpp +++ b/src/platformheaders/doc/snippets/qwindowswindowfunctions/main.cpp @@ -49,7 +49,7 @@ ****************************************************************************/ #include -#include +#include //! [0] int main(int argc, char **argv) diff --git a/src/platformheaders/doc/snippets/qxcbwindowfunctions/main.cpp b/src/platformheaders/doc/snippets/qxcbwindowfunctions/main.cpp index c2b66e6aa2..3299292993 100644 --- a/src/platformheaders/doc/snippets/qxcbwindowfunctions/main.cpp +++ b/src/platformheaders/doc/snippets/qxcbwindowfunctions/main.cpp @@ -49,7 +49,7 @@ ****************************************************************************/ #include -#include +#include //! [0] int main(int argc, char **argv) diff --git a/src/platformheaders/eglfsfunctions/eglfsfunctions.pri b/src/platformheaders/eglfsfunctions/eglfsfunctions.pri index e4e645f5a5..76c6383ddb 100644 --- a/src/platformheaders/eglfsfunctions/eglfsfunctions.pri +++ b/src/platformheaders/eglfsfunctions/eglfsfunctions.pri @@ -1 +1 @@ -HEADERS += $$PWD/qeglfsfunctions.h +HEADERS += $$PWD/qeglfsfunctions_p.h diff --git a/src/platformheaders/eglfsfunctions/qeglfsfunctions.h b/src/platformheaders/eglfsfunctions/qeglfsfunctions.h deleted file mode 100644 index 869fe7ce3f..0000000000 --- a/src/platformheaders/eglfsfunctions/qeglfsfunctions.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QEGLFSFUNCTIONS_H -#define QEGLFSFUNCTIONS_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QEglFSFunctions -{ -public: - typedef void (*LoadKeymapType)(const QString &filename); - typedef void (*SwitchLangType)(); - static QByteArray loadKeymapTypeIdentifier() { return QByteArrayLiteral("EglFSLoadKeymap"); } - static QByteArray switchLangTypeIdentifier() { return QByteArrayLiteral("EglFSSwitchLang"); } - - static void loadKeymap(const QString &filename) - { - LoadKeymapType func = reinterpret_cast(QGuiApplication::platformFunction(loadKeymapTypeIdentifier())); - if (func) - func(filename); - } - - static void switchLang() - { - SwitchLangType func = reinterpret_cast(QGuiApplication::platformFunction(switchLangTypeIdentifier())); - if (func) - func(); - } - - typedef int (*Vsp2AddLayerType)(const QScreen *screen, int dmabufFd, const QSize &size, const QPoint &position, uint drmPixelFormat, uint bytesPerLine); - static QByteArray vsp2AddLayerTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2AddLayer"); } - - //vsp2 functions are currently internal and preliminary (see qdoc file) - static int vsp2AddLayer(const QScreen *screen, int dmabufFd, const QSize &size, const QPoint &position, uint drmPixelFormat, uint bytesPerLine) - { - auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2AddLayerTypeIdentifier())); - if (func) - return func(screen, dmabufFd, size, position, drmPixelFormat, bytesPerLine); - return 0; - } - - typedef bool (*Vsp2RemoveLayerType)(const QScreen *screen, int id); - static QByteArray vsp2RemoveLayerTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2RemoveLayer"); } - - static bool vsp2RemoveLayer(const QScreen *screen, int id) - { - auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2RemoveLayerTypeIdentifier())); - return func && func(screen, id); - } - - typedef void (*Vsp2SetLayerBufferType)(const QScreen *screen, int id, int dmabufFd); - static QByteArray vsp2SetLayerBufferTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2SetLayerBuffer"); } - - static void vsp2SetLayerBuffer(const QScreen *screen, int id, int dmabufFd) - { - auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2SetLayerBufferTypeIdentifier())); - if (func) - func(screen, id, dmabufFd); - } - - typedef bool (*Vsp2SetLayerPositionType)(const QScreen *screen, int id, const QPoint &position); - static QByteArray vsp2SetLayerPositionTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2SetLayerPosition"); } - - static bool vsp2SetLayerPosition(const QScreen *screen, int id, const QPoint &position) - { - auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2SetLayerPositionTypeIdentifier())); - return func && func(screen, id, position); - } - - typedef bool (*Vsp2SetLayerAlphaType)(const QScreen *screen, int id, qreal alpha); - static QByteArray vsp2SetLayerAlphaTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2SetLayerAlpha"); } - - static bool vsp2SetLayerAlpha(const QScreen *screen, int id, qreal alpha) - { - auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2SetLayerAlphaTypeIdentifier())); - return func && func(screen, id, alpha); - } - - typedef void (*Vsp2AddBlendListenerType)(const QScreen *screen, void(*callback)()); - static QByteArray vsp2AddBlendListenerTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2AddBlendListener"); } - - static void vsp2AddBlendListener(const QScreen *screen, void(*callback)()) - { - auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2AddBlendListenerTypeIdentifier())); - if (func) - func(screen, callback); - } -}; - - -QT_END_NAMESPACE - -#endif // QEGLFSFUNCTIONS_H diff --git a/src/platformheaders/eglfsfunctions/qeglfsfunctions_p.h b/src/platformheaders/eglfsfunctions/qeglfsfunctions_p.h new file mode 100644 index 0000000000..1eb177f694 --- /dev/null +++ b/src/platformheaders/eglfsfunctions/qeglfsfunctions_p.h @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QEGLFSFUNCTIONS_H +#define QEGLFSFUNCTIONS_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QEglFSFunctions +{ +public: + typedef void (*LoadKeymapType)(const QString &filename); + typedef void (*SwitchLangType)(); + static QByteArray loadKeymapTypeIdentifier() { return QByteArrayLiteral("EglFSLoadKeymap"); } + static QByteArray switchLangTypeIdentifier() { return QByteArrayLiteral("EglFSSwitchLang"); } + + static void loadKeymap(const QString &filename) + { + LoadKeymapType func = reinterpret_cast(QGuiApplication::platformFunction(loadKeymapTypeIdentifier())); + if (func) + func(filename); + } + + static void switchLang() + { + SwitchLangType func = reinterpret_cast(QGuiApplication::platformFunction(switchLangTypeIdentifier())); + if (func) + func(); + } + + typedef int (*Vsp2AddLayerType)(const QScreen *screen, int dmabufFd, const QSize &size, const QPoint &position, uint drmPixelFormat, uint bytesPerLine); + static QByteArray vsp2AddLayerTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2AddLayer"); } + + //vsp2 functions are currently internal and preliminary (see qdoc file) + static int vsp2AddLayer(const QScreen *screen, int dmabufFd, const QSize &size, const QPoint &position, uint drmPixelFormat, uint bytesPerLine) + { + auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2AddLayerTypeIdentifier())); + if (func) + return func(screen, dmabufFd, size, position, drmPixelFormat, bytesPerLine); + return 0; + } + + typedef bool (*Vsp2RemoveLayerType)(const QScreen *screen, int id); + static QByteArray vsp2RemoveLayerTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2RemoveLayer"); } + + static bool vsp2RemoveLayer(const QScreen *screen, int id) + { + auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2RemoveLayerTypeIdentifier())); + return func && func(screen, id); + } + + typedef void (*Vsp2SetLayerBufferType)(const QScreen *screen, int id, int dmabufFd); + static QByteArray vsp2SetLayerBufferTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2SetLayerBuffer"); } + + static void vsp2SetLayerBuffer(const QScreen *screen, int id, int dmabufFd) + { + auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2SetLayerBufferTypeIdentifier())); + if (func) + func(screen, id, dmabufFd); + } + + typedef bool (*Vsp2SetLayerPositionType)(const QScreen *screen, int id, const QPoint &position); + static QByteArray vsp2SetLayerPositionTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2SetLayerPosition"); } + + static bool vsp2SetLayerPosition(const QScreen *screen, int id, const QPoint &position) + { + auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2SetLayerPositionTypeIdentifier())); + return func && func(screen, id, position); + } + + typedef bool (*Vsp2SetLayerAlphaType)(const QScreen *screen, int id, qreal alpha); + static QByteArray vsp2SetLayerAlphaTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2SetLayerAlpha"); } + + static bool vsp2SetLayerAlpha(const QScreen *screen, int id, qreal alpha) + { + auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2SetLayerAlphaTypeIdentifier())); + return func && func(screen, id, alpha); + } + + typedef void (*Vsp2AddBlendListenerType)(const QScreen *screen, void(*callback)()); + static QByteArray vsp2AddBlendListenerTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2AddBlendListener"); } + + static void vsp2AddBlendListener(const QScreen *screen, void(*callback)()) + { + auto func = reinterpret_cast(QGuiApplication::platformFunction(vsp2AddBlendListenerTypeIdentifier())); + if (func) + func(screen, callback); + } +}; + + +QT_END_NAMESPACE + +#endif // QEGLFSFUNCTIONS_H diff --git a/src/platformheaders/helper/helper.pri b/src/platformheaders/helper/helper.pri index 2f6e766214..10914f9e5e 100644 --- a/src/platformheaders/helper/helper.pri +++ b/src/platformheaders/helper/helper.pri @@ -1,2 +1,2 @@ HEADERS += \ - $$PWD/qplatformheaderhelper.h + $$PWD/qplatformheaderhelper_p.h diff --git a/src/platformheaders/helper/qplatformheaderhelper.h b/src/platformheaders/helper/qplatformheaderhelper.h deleted file mode 100644 index 6959d889ae..0000000000 --- a/src/platformheaders/helper/qplatformheaderhelper.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMHEADERHELPER_H -#define QPLATFORMHEADERHELPER_H - -#include -#include - -#if 0 -#pragma qt_class(QPlatformHeaderHelper) -#endif - -QT_BEGIN_NAMESPACE - -namespace QPlatformHeaderHelper { - -template -ReturnT callPlatformFunction(const QByteArray &functionName) -{ - FunctionT func = reinterpret_cast(QGuiApplication::platformFunction(functionName)); - return func ? func() : ReturnT(); -} - -template -ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1) -{ - FunctionT func = reinterpret_cast(QGuiApplication::platformFunction(functionName)); - return func ? func(a1) : ReturnT(); -} - -template -ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1, Arg2 a2) -{ - FunctionT func = reinterpret_cast(QGuiApplication::platformFunction(functionName)); - return func ? func(a1, a2) : ReturnT(); -} - -template -ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1, Arg2 a2, Arg3 a3) -{ - FunctionT func = reinterpret_cast(QGuiApplication::platformFunction(functionName)); - return func ? func(a1, a2, a3) : ReturnT(); -} - -template -ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4) -{ - FunctionT func = reinterpret_cast(QGuiApplication::platformFunction(functionName)); - return func ? func(a1, a2, a3, a4) : ReturnT(); -} - -} - -QT_END_NAMESPACE - -#endif /*QPLATFORMHEADERHELPER_H*/ diff --git a/src/platformheaders/helper/qplatformheaderhelper_p.h b/src/platformheaders/helper/qplatformheaderhelper_p.h new file mode 100644 index 0000000000..54567667f6 --- /dev/null +++ b/src/platformheaders/helper/qplatformheaderhelper_p.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMHEADERHELPER_H +#define QPLATFORMHEADERHELPER_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +#if 0 +#pragma qt_class(QPlatformHeaderHelper) +#endif + +QT_BEGIN_NAMESPACE + +namespace QPlatformHeaderHelper { + +template +ReturnT callPlatformFunction(const QByteArray &functionName) +{ + FunctionT func = reinterpret_cast(QGuiApplication::platformFunction(functionName)); + return func ? func() : ReturnT(); +} + +template +ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1) +{ + FunctionT func = reinterpret_cast(QGuiApplication::platformFunction(functionName)); + return func ? func(a1) : ReturnT(); +} + +template +ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1, Arg2 a2) +{ + FunctionT func = reinterpret_cast(QGuiApplication::platformFunction(functionName)); + return func ? func(a1, a2) : ReturnT(); +} + +template +ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1, Arg2 a2, Arg3 a3) +{ + FunctionT func = reinterpret_cast(QGuiApplication::platformFunction(functionName)); + return func ? func(a1, a2, a3) : ReturnT(); +} + +template +ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4) +{ + FunctionT func = reinterpret_cast(QGuiApplication::platformFunction(functionName)); + return func ? func(a1, a2, a3, a4) : ReturnT(); +} + +} + +QT_END_NAMESPACE + +#endif /*QPLATFORMHEADERHELPER_H*/ diff --git a/src/platformheaders/linuxfbfunctions/linuxfbfunctions.pri b/src/platformheaders/linuxfbfunctions/linuxfbfunctions.pri index 8a092c3049..dd18d6c0bb 100644 --- a/src/platformheaders/linuxfbfunctions/linuxfbfunctions.pri +++ b/src/platformheaders/linuxfbfunctions/linuxfbfunctions.pri @@ -1 +1 @@ -HEADERS += $$PWD/qlinuxfbfunctions.h +HEADERS += $$PWD/qlinuxfbfunctions_p.h diff --git a/src/platformheaders/linuxfbfunctions/qlinuxfbfunctions.h b/src/platformheaders/linuxfbfunctions/qlinuxfbfunctions.h deleted file mode 100644 index 94c4c24270..0000000000 --- a/src/platformheaders/linuxfbfunctions/qlinuxfbfunctions.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QLINUXFBFUNCTIONS_H -#define QLINUXFBFUNCTIONS_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QLinuxFbFunctions -{ -public: - typedef void (*LoadKeymapType)(const QString &filename); - typedef void (*SwitchLangType)(); - static QByteArray loadKeymapTypeIdentifier() { return QByteArrayLiteral("LinuxFbLoadKeymap"); } - static QByteArray switchLangTypeIdentifier() { return QByteArrayLiteral("LinuxFbSwitchLang"); } - - static void loadKeymap(const QString &filename) - { - LoadKeymapType func = reinterpret_cast(QGuiApplication::platformFunction(loadKeymapTypeIdentifier())); - if (func) - func(filename); - } - - static void switchLang() - { - SwitchLangType func = reinterpret_cast(QGuiApplication::platformFunction(switchLangTypeIdentifier())); - if (func) - func(); - } -}; - - -QT_END_NAMESPACE - -#endif // QLINUXFBFUNCTIONS_H diff --git a/src/platformheaders/linuxfbfunctions/qlinuxfbfunctions_p.h b/src/platformheaders/linuxfbfunctions/qlinuxfbfunctions_p.h new file mode 100644 index 0000000000..74e5187282 --- /dev/null +++ b/src/platformheaders/linuxfbfunctions/qlinuxfbfunctions_p.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QLINUXFBFUNCTIONS_H +#define QLINUXFBFUNCTIONS_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QLinuxFbFunctions +{ +public: + typedef void (*LoadKeymapType)(const QString &filename); + typedef void (*SwitchLangType)(); + static QByteArray loadKeymapTypeIdentifier() { return QByteArrayLiteral("LinuxFbLoadKeymap"); } + static QByteArray switchLangTypeIdentifier() { return QByteArrayLiteral("LinuxFbSwitchLang"); } + + static void loadKeymap(const QString &filename) + { + LoadKeymapType func = reinterpret_cast(QGuiApplication::platformFunction(loadKeymapTypeIdentifier())); + if (func) + func(filename); + } + + static void switchLang() + { + SwitchLangType func = reinterpret_cast(QGuiApplication::platformFunction(switchLangTypeIdentifier())); + if (func) + func(); + } +}; + + +QT_END_NAMESPACE + +#endif // QLINUXFBFUNCTIONS_H diff --git a/src/platformheaders/platformheaders.pro b/src/platformheaders/platformheaders.pro index 22d1655c77..867f71a4bb 100644 --- a/src/platformheaders/platformheaders.pro +++ b/src/platformheaders/platformheaders.pro @@ -1,7 +1,5 @@ -# Only headers here, no library is wanted. -TEMPLATE = subdirs -VERSION = $$MODULE_VERSION -MODULE_INCNAME = QtPlatformHeaders +TARGET = QtPlatformHeaders +CONFIG += header_module include(xcbfunctions/xcbfunctions.pri) include(eglfsfunctions/eglfsfunctions.pri) @@ -13,6 +11,4 @@ include(linuxfbfunctions/linuxfbfunctions.pri) QMAKE_DOCS = $$PWD/doc/qtplatformheaders.qdocconf -load(qt_module_headers) -load(qt_docs) -load(qt_installs) +load(qt_module) diff --git a/src/platformheaders/waylandfunctions/qwaylandwindowfunctions.h b/src/platformheaders/waylandfunctions/qwaylandwindowfunctions.h deleted file mode 100644 index 9c2e5f2a14..0000000000 --- a/src/platformheaders/waylandfunctions/qwaylandwindowfunctions.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 LG Electronics Ltd, author: mikko.levonmaa@lge.com -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDWINDOWFUNCTIONS_H -#define QWAYLANDWINDOWFUNCTIONS_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWindow; - -class QWaylandWindowFunctions { -public: - - typedef void (*SetWindowSync)(QWindow *window); - typedef void (*SetWindowDeSync)(QWindow *window); - typedef bool (*IsWindowSync)(QWindow *window); - static const QByteArray setSyncIdentifier() { return QByteArrayLiteral("WaylandSubSurfaceSetSync"); } - static const QByteArray setDeSyncIdentifier() { return QByteArrayLiteral("WaylandSubSurfaceSetDeSync"); } - static const QByteArray isSyncIdentifier() { return QByteArrayLiteral("WaylandSubSurfaceIsSync"); } - - static void setSync(QWindow *window) - { - static SetWindowSync func = reinterpret_cast(QGuiApplication::platformFunction(setSyncIdentifier())); - Q_ASSERT(func); - func(window); - } - - static void setDeSync(QWindow *window) - { - static SetWindowDeSync func = reinterpret_cast(QGuiApplication::platformFunction(setDeSyncIdentifier())); - Q_ASSERT(func); - func(window); - } - - static bool isSync(QWindow *window) - { - static IsWindowSync func = reinterpret_cast(QGuiApplication::platformFunction(isSyncIdentifier())); - Q_ASSERT(func); - return func(window); - } - -}; - -QT_END_NAMESPACE - -#endif // QWAYLANDWINDOWFUNCTIONS_H - diff --git a/src/platformheaders/waylandfunctions/qwaylandwindowfunctions_p.h b/src/platformheaders/waylandfunctions/qwaylandwindowfunctions_p.h new file mode 100644 index 0000000000..6d4060daa1 --- /dev/null +++ b/src/platformheaders/waylandfunctions/qwaylandwindowfunctions_p.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2016 LG Electronics Ltd, author: mikko.levonmaa@lge.com +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDWINDOWFUNCTIONS_H +#define QWAYLANDWINDOWFUNCTIONS_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWindow; + +class QWaylandWindowFunctions { +public: + + typedef void (*SetWindowSync)(QWindow *window); + typedef void (*SetWindowDeSync)(QWindow *window); + typedef bool (*IsWindowSync)(QWindow *window); + static const QByteArray setSyncIdentifier() { return QByteArrayLiteral("WaylandSubSurfaceSetSync"); } + static const QByteArray setDeSyncIdentifier() { return QByteArrayLiteral("WaylandSubSurfaceSetDeSync"); } + static const QByteArray isSyncIdentifier() { return QByteArrayLiteral("WaylandSubSurfaceIsSync"); } + + static void setSync(QWindow *window) + { + static SetWindowSync func = reinterpret_cast(QGuiApplication::platformFunction(setSyncIdentifier())); + Q_ASSERT(func); + func(window); + } + + static void setDeSync(QWindow *window) + { + static SetWindowDeSync func = reinterpret_cast(QGuiApplication::platformFunction(setDeSyncIdentifier())); + Q_ASSERT(func); + func(window); + } + + static bool isSync(QWindow *window) + { + static IsWindowSync func = reinterpret_cast(QGuiApplication::platformFunction(isSyncIdentifier())); + Q_ASSERT(func); + return func(window); + } + +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDWINDOWFUNCTIONS_H + diff --git a/src/platformheaders/waylandfunctions/waylandfunctions.pri b/src/platformheaders/waylandfunctions/waylandfunctions.pri index 202df907e5..ec612d6418 100644 --- a/src/platformheaders/waylandfunctions/waylandfunctions.pri +++ b/src/platformheaders/waylandfunctions/waylandfunctions.pri @@ -1 +1 @@ -HEADERS += $$PWD/qwaylandwindowfunctions.h +HEADERS += $$PWD/qwaylandwindowfunctions_p.h diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h deleted file mode 100644 index 722f640a13..0000000000 --- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWINDOWSWINDOWFUNCTIONS_H -#define QWINDOWSWINDOWFUNCTIONS_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWindow; - -class QWindowsWindowFunctions { -public: - enum TouchWindowTouchType { - NormalTouch = 0x00000000, - FineTouch = 0x00000001, - WantPalmTouch = 0x00000002 - }; - - Q_DECLARE_FLAGS(TouchWindowTouchTypes, TouchWindowTouchType) - - enum WindowActivationBehavior { - DefaultActivateWindow, - AlwaysActivateWindow - }; - - typedef void (*SetTouchWindowTouchType)(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes touchType); - static const QByteArray setTouchWindowTouchTypeIdentifier() { return QByteArrayLiteral("WindowsSetTouchWindowTouchType"); } - - static void setTouchWindowTouchType(QWindow *window, TouchWindowTouchTypes type) - { - SetTouchWindowTouchType func = reinterpret_cast(QGuiApplication::platformFunction(setTouchWindowTouchTypeIdentifier())); - if (func) - func(window, type); - } - - typedef void (*SetHasBorderInFullScreen)(QWindow *window, bool border); - static const QByteArray setHasBorderInFullScreenIdentifier() { return QByteArrayLiteral("WindowsSetHasBorderInFullScreen"); } - static void setHasBorderInFullScreen(QWindow *window, bool border) - { - SetHasBorderInFullScreen func = reinterpret_cast(QGuiApplication::platformFunction(setHasBorderInFullScreenIdentifier())); - if (func) - func(window, border); - } - - typedef void (*SetHasBorderInFullScreenDefault)(bool border); - static const QByteArray setHasBorderInFullScreenDefaultIdentifier() { return QByteArrayLiteral("WindowsSetHasBorderInFullScreenDefault"); } - static void setHasBorderInFullScreenDefault(bool border) - { - auto func = reinterpret_cast(QGuiApplication::platformFunction(setHasBorderInFullScreenDefaultIdentifier())); - if (func) - func(border); - } - - typedef void (*SetWindowActivationBehaviorType)(WindowActivationBehavior); - static const QByteArray setWindowActivationBehaviorIdentifier() { return QByteArrayLiteral("WindowsSetWindowActivationBehavior"); } - - static void setWindowActivationBehavior(WindowActivationBehavior behavior) - { - SetWindowActivationBehaviorType func = reinterpret_cast(QGuiApplication::platformFunction(setWindowActivationBehaviorIdentifier())); - if (func) - func(behavior); - } - - typedef bool (*IsTabletModeType)(); - static const QByteArray isTabletModeIdentifier() { return QByteArrayLiteral("WindowsIsTabletMode"); } - - static bool isTabletMode() - { - IsTabletModeType func = reinterpret_cast(QGuiApplication::platformFunction(isTabletModeIdentifier())); - return func && func(); - } - - typedef bool (*SetWinTabEnabled)(bool enabled); - static const QByteArray setWinTabEnabledIdentifier() { return QByteArrayLiteral("WindowsSetWinTabEnabled"); } - static bool setWinTabEnabled(bool enabled) - { - SetWinTabEnabled func = reinterpret_cast(QGuiApplication::platformFunction(setWinTabEnabledIdentifier())); - return func && func(enabled); - } -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS(QWindowsWindowFunctions::TouchWindowTouchTypes) - -QT_END_NAMESPACE - -#endif // QWINDOWSWINDOWFUNCTIONS_H diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions_p.h b/src/platformheaders/windowsfunctions/qwindowswindowfunctions_p.h new file mode 100644 index 0000000000..5e8881fc87 --- /dev/null +++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions_p.h @@ -0,0 +1,136 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWINDOWSWINDOWFUNCTIONS_H +#define QWINDOWSWINDOWFUNCTIONS_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QWindow; + +class QWindowsWindowFunctions { +public: + enum TouchWindowTouchType { + NormalTouch = 0x00000000, + FineTouch = 0x00000001, + WantPalmTouch = 0x00000002 + }; + + Q_DECLARE_FLAGS(TouchWindowTouchTypes, TouchWindowTouchType) + + enum WindowActivationBehavior { + DefaultActivateWindow, + AlwaysActivateWindow + }; + + typedef void (*SetTouchWindowTouchType)(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes touchType); + static const QByteArray setTouchWindowTouchTypeIdentifier() { return QByteArrayLiteral("WindowsSetTouchWindowTouchType"); } + + static void setTouchWindowTouchType(QWindow *window, TouchWindowTouchTypes type) + { + SetTouchWindowTouchType func = reinterpret_cast(QGuiApplication::platformFunction(setTouchWindowTouchTypeIdentifier())); + if (func) + func(window, type); + } + + typedef void (*SetHasBorderInFullScreen)(QWindow *window, bool border); + static const QByteArray setHasBorderInFullScreenIdentifier() { return QByteArrayLiteral("WindowsSetHasBorderInFullScreen"); } + static void setHasBorderInFullScreen(QWindow *window, bool border) + { + SetHasBorderInFullScreen func = reinterpret_cast(QGuiApplication::platformFunction(setHasBorderInFullScreenIdentifier())); + if (func) + func(window, border); + } + + typedef void (*SetHasBorderInFullScreenDefault)(bool border); + static const QByteArray setHasBorderInFullScreenDefaultIdentifier() { return QByteArrayLiteral("WindowsSetHasBorderInFullScreenDefault"); } + static void setHasBorderInFullScreenDefault(bool border) + { + auto func = reinterpret_cast(QGuiApplication::platformFunction(setHasBorderInFullScreenDefaultIdentifier())); + if (func) + func(border); + } + + typedef void (*SetWindowActivationBehaviorType)(WindowActivationBehavior); + static const QByteArray setWindowActivationBehaviorIdentifier() { return QByteArrayLiteral("WindowsSetWindowActivationBehavior"); } + + static void setWindowActivationBehavior(WindowActivationBehavior behavior) + { + SetWindowActivationBehaviorType func = reinterpret_cast(QGuiApplication::platformFunction(setWindowActivationBehaviorIdentifier())); + if (func) + func(behavior); + } + + typedef bool (*IsTabletModeType)(); + static const QByteArray isTabletModeIdentifier() { return QByteArrayLiteral("WindowsIsTabletMode"); } + + static bool isTabletMode() + { + IsTabletModeType func = reinterpret_cast(QGuiApplication::platformFunction(isTabletModeIdentifier())); + return func && func(); + } + + typedef bool (*SetWinTabEnabled)(bool enabled); + static const QByteArray setWinTabEnabledIdentifier() { return QByteArrayLiteral("WindowsSetWinTabEnabled"); } + static bool setWinTabEnabled(bool enabled) + { + SetWinTabEnabled func = reinterpret_cast(QGuiApplication::platformFunction(setWinTabEnabledIdentifier())); + return func && func(enabled); + } +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QWindowsWindowFunctions::TouchWindowTouchTypes) + +QT_END_NAMESPACE + +#endif // QWINDOWSWINDOWFUNCTIONS_H diff --git a/src/platformheaders/windowsfunctions/windowsfunctions.pri b/src/platformheaders/windowsfunctions/windowsfunctions.pri index 479245db80..ee11b9c2b0 100644 --- a/src/platformheaders/windowsfunctions/windowsfunctions.pri +++ b/src/platformheaders/windowsfunctions/windowsfunctions.pri @@ -1 +1 @@ -HEADERS += $$PWD/qwindowswindowfunctions.h +HEADERS += $$PWD/qwindowswindowfunctions_p.h diff --git a/src/platformheaders/xcbfunctions/qxcbscreenfunctions.h b/src/platformheaders/xcbfunctions/qxcbscreenfunctions.h deleted file mode 100644 index 99624bd5d6..0000000000 --- a/src/platformheaders/xcbfunctions/qxcbscreenfunctions.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QXCBSCREENFUNCTIONS_H -#define QXCBSCREENFUNCTIONS_H - -#include - -QT_BEGIN_NAMESPACE - -class QScreen; - -class QXcbScreenFunctions -{ -public: - typedef bool (*VirtualDesktopNumber)(const QScreen *screen); - static const QByteArray virtualDesktopNumberIdentifier() { return QByteArrayLiteral("XcbVirtualDesktopNumber"); } - static int virtualDesktopNumber(const QScreen *screen) - { - return QPlatformHeaderHelper::callPlatformFunction(virtualDesktopNumberIdentifier(), screen); - } -}; - -QT_END_NAMESPACE - -#endif /*QXCBSCREENFUNCTIONS_H*/ diff --git a/src/platformheaders/xcbfunctions/qxcbscreenfunctions_p.h b/src/platformheaders/xcbfunctions/qxcbscreenfunctions_p.h new file mode 100644 index 0000000000..f040701941 --- /dev/null +++ b/src/platformheaders/xcbfunctions/qxcbscreenfunctions_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QXCBSCREENFUNCTIONS_H +#define QXCBSCREENFUNCTIONS_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QScreen; + +class QXcbScreenFunctions +{ +public: + typedef bool (*VirtualDesktopNumber)(const QScreen *screen); + static const QByteArray virtualDesktopNumberIdentifier() { return QByteArrayLiteral("XcbVirtualDesktopNumber"); } + static int virtualDesktopNumber(const QScreen *screen) + { + return QPlatformHeaderHelper::callPlatformFunction(virtualDesktopNumberIdentifier(), screen); + } +}; + +QT_END_NAMESPACE + +#endif /*QXCBSCREENFUNCTIONS_H*/ diff --git a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h deleted file mode 100644 index b0e6cb6a1d..0000000000 --- a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QXCBWINDOWFUNCTIONS_H -#define QXCBWINDOWFUNCTIONS_H - -#include - -QT_BEGIN_NAMESPACE - -class QWindow; - -class QXcbWindowFunctions { -public: - enum WmWindowType { - Normal = 0x000001, - Desktop = 0x000002, - Dock = 0x000004, - Toolbar = 0x000008, - Menu = 0x000010, - Utility = 0x000020, - Splash = 0x000040, - Dialog = 0x000080, - DropDownMenu = 0x000100, - PopupMenu = 0x000200, - Tooltip = 0x000400, - Notification = 0x000800, - Combo = 0x001000, - Dnd = 0x002000, - KdeOverride = 0x004000 - }; - - Q_DECLARE_FLAGS(WmWindowTypes, WmWindowType) - - typedef void (*SetWmWindowType)(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowType); - static const QByteArray setWmWindowTypeIdentifier() { return QByteArrayLiteral("XcbSetWmWindowType"); } - static void setWmWindowType(QWindow *window, WmWindowType type) - { - return QPlatformHeaderHelper::callPlatformFunction(setWmWindowTypeIdentifier(), window, type); - } - - typedef void (*SetWmWindowRole)(QWindow *window, const QByteArray &role); - static const QByteArray setWmWindowRoleIdentifier() { return QByteArrayLiteral("XcbSetWmWindowRole"); } - - static void setWmWindowRole(QWindow *window, const QByteArray &role) - { - return QPlatformHeaderHelper::callPlatformFunction(setWmWindowRoleIdentifier(), window, role); - } - - typedef void (*SetWmWindowIconText)(QWindow *window, const QString &text); - static const QByteArray setWmWindowIconTextIdentifier() { return QByteArrayLiteral("XcbSetWmWindowIconText"); } - static void setWmWindowIconText(QWindow *window, const QString &text) - { - return QPlatformHeaderHelper::callPlatformFunction(setWmWindowIconTextIdentifier(), window, text); - } - - typedef uint (*VisualId)(QWindow *window); - static const QByteArray visualIdIdentifier() { return QByteArrayLiteral("XcbVisualId"); } - - static uint visualId(QWindow *window) - { - QXcbWindowFunctions::VisualId func = reinterpret_cast(QGuiApplication::platformFunction(visualIdIdentifier())); - if (func) - return func(window); - return UINT_MAX; - } -}; - - -QT_END_NAMESPACE - -#endif // QXCBWINDOWFUNCTIONS_H diff --git a/src/platformheaders/xcbfunctions/qxcbwindowfunctions_p.h b/src/platformheaders/xcbfunctions/qxcbwindowfunctions_p.h new file mode 100644 index 0000000000..26b0798fc8 --- /dev/null +++ b/src/platformheaders/xcbfunctions/qxcbwindowfunctions_p.h @@ -0,0 +1,119 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QXCBWINDOWFUNCTIONS_H +#define QXCBWINDOWFUNCTIONS_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QWindow; + +class QXcbWindowFunctions { +public: + enum WmWindowType { + Normal = 0x000001, + Desktop = 0x000002, + Dock = 0x000004, + Toolbar = 0x000008, + Menu = 0x000010, + Utility = 0x000020, + Splash = 0x000040, + Dialog = 0x000080, + DropDownMenu = 0x000100, + PopupMenu = 0x000200, + Tooltip = 0x000400, + Notification = 0x000800, + Combo = 0x001000, + Dnd = 0x002000, + KdeOverride = 0x004000 + }; + + Q_DECLARE_FLAGS(WmWindowTypes, WmWindowType) + + typedef void (*SetWmWindowType)(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowType); + static const QByteArray setWmWindowTypeIdentifier() { return QByteArrayLiteral("XcbSetWmWindowType"); } + static void setWmWindowType(QWindow *window, WmWindowType type) + { + return QPlatformHeaderHelper::callPlatformFunction(setWmWindowTypeIdentifier(), window, type); + } + + typedef void (*SetWmWindowRole)(QWindow *window, const QByteArray &role); + static const QByteArray setWmWindowRoleIdentifier() { return QByteArrayLiteral("XcbSetWmWindowRole"); } + + static void setWmWindowRole(QWindow *window, const QByteArray &role) + { + return QPlatformHeaderHelper::callPlatformFunction(setWmWindowRoleIdentifier(), window, role); + } + + typedef void (*SetWmWindowIconText)(QWindow *window, const QString &text); + static const QByteArray setWmWindowIconTextIdentifier() { return QByteArrayLiteral("XcbSetWmWindowIconText"); } + static void setWmWindowIconText(QWindow *window, const QString &text) + { + return QPlatformHeaderHelper::callPlatformFunction(setWmWindowIconTextIdentifier(), window, text); + } + + typedef uint (*VisualId)(QWindow *window); + static const QByteArray visualIdIdentifier() { return QByteArrayLiteral("XcbVisualId"); } + + static uint visualId(QWindow *window) + { + QXcbWindowFunctions::VisualId func = reinterpret_cast(QGuiApplication::platformFunction(visualIdIdentifier())); + if (func) + return func(window); + return UINT_MAX; + } +}; + + +QT_END_NAMESPACE + +#endif // QXCBWINDOWFUNCTIONS_H diff --git a/src/platformheaders/xcbfunctions/xcbfunctions.pri b/src/platformheaders/xcbfunctions/xcbfunctions.pri index 3fbee53854..5ca2721506 100644 --- a/src/platformheaders/xcbfunctions/xcbfunctions.pri +++ b/src/platformheaders/xcbfunctions/xcbfunctions.pri @@ -1,3 +1,3 @@ HEADERS += \ - $$PWD/qxcbwindowfunctions.h \ - $$PWD/qxcbscreenfunctions.h + $$PWD/qxcbwindowfunctions_p.h \ + $$PWD/qxcbscreenfunctions_p.h -- cgit v1.2.3