summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <[email protected]>2020-07-17 20:24:58 +0200
committerTor Arne Vestbø <[email protected]>2020-07-20 17:47:35 +0200
commit6034494070041baab95b835a2605c795f0d7166c (patch)
treec9d9714f8292e119473fa3179841986801e38915
parent3a475d48ee03d1953292a8fe4ef8ab7e3b1e6c37 (diff)
Move private platform interfaces to private QPA headers
They should not clutter the "public" QPA headers that clients use to implement new platforms, and having them in the private headers allows us to check for private configure features. Change-Id: Ib4b4db96c086d81bb5810392c7c8922fc5b4950d Reviewed-by: Friedemann Kleint <[email protected]>
-rw-r--r--src/gui/.prev_CMakeLists.txt2
-rw-r--r--src/gui/CMakeLists.txt2
-rw-r--r--src/gui/kernel/kernel.pri1
-rw-r--r--src/gui/kernel/qplatformmenu.h25
-rw-r--r--src/gui/kernel/qplatformmenu_p.h85
-rw-r--r--src/gui/kernel/qplatformwindow.h15
-rw-r--r--src/gui/kernel/qplatformwindow_p.h15
-rw-r--r--src/gui/platform/macos/qcocoaplatforminterface.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h1
-rw-r--r--src/widgets/widgets/qmainwindow.cpp1
-rw-r--r--src/widgets/widgets/qmenu_mac.mm1
12 files changed, 109 insertions, 44 deletions
diff --git a/src/gui/.prev_CMakeLists.txt b/src/gui/.prev_CMakeLists.txt
index ba71e2d6f27..0b61f853990 100644
--- a/src/gui/.prev_CMakeLists.txt
+++ b/src/gui/.prev_CMakeLists.txt
@@ -62,7 +62,7 @@ qt_add_module(Gui
kernel/qplatformintegration.cpp kernel/qplatformintegration.h
kernel/qplatformintegrationfactory.cpp kernel/qplatformintegrationfactory_p.h
kernel/qplatformintegrationplugin.cpp kernel/qplatformintegrationplugin.h
- kernel/qplatformmenu.cpp kernel/qplatformmenu.h
+ kernel/qplatformmenu.cpp kernel/qplatformmenu.h kernel/qplatformmenu_p.h
kernel/qplatformnativeinterface.cpp kernel/qplatformnativeinterface.h
kernel/qplatformoffscreensurface.cpp kernel/qplatformoffscreensurface.h
kernel/qplatformscreen.cpp kernel/qplatformscreen.h kernel/qplatformscreen_p.h
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 62cc030ea25..228d44a6c17 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -113,7 +113,7 @@ qt_add_module(Gui
kernel/qplatformintegration.cpp kernel/qplatformintegration.h
kernel/qplatformintegrationfactory.cpp kernel/qplatformintegrationfactory_p.h
kernel/qplatformintegrationplugin.cpp kernel/qplatformintegrationplugin.h
- kernel/qplatformmenu.cpp kernel/qplatformmenu.h
+ kernel/qplatformmenu.cpp kernel/qplatformmenu.h kernel/qplatformmenu_p.h
kernel/qplatformnativeinterface.cpp kernel/qplatformnativeinterface.h
kernel/qplatformoffscreensurface.cpp kernel/qplatformoffscreensurface.h
kernel/qplatformscreen.cpp kernel/qplatformscreen.h kernel/qplatformscreen_p.h
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index e653adab9c8..c86489e9faf 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -32,6 +32,7 @@ HEADERS += \
kernel/qplatformclipboard.h \
kernel/qplatformnativeinterface.h \
kernel/qplatformmenu.h \
+ kernel/qplatformmenu_p.h \
kernel/qsurfaceformat.h \
kernel/qguiapplication.h \
kernel/qguiapplication_p.h \
diff --git a/src/gui/kernel/qplatformmenu.h b/src/gui/kernel/qplatformmenu.h
index 6c2abfde5f7..8e470aefd35 100644
--- a/src/gui/kernel/qplatformmenu.h
+++ b/src/gui/kernel/qplatformmenu.h
@@ -166,31 +166,6 @@ public:
virtual QPlatformMenu *createMenu() const;
};
-// ----------------- QPlatformInterface -----------------
-
-QT_END_NAMESPACE
-Q_FORWARD_DECLARE_OBJC_CLASS(NSMenu);
-QT_BEGIN_NAMESPACE
-
-namespace QPlatformInterface::Private {
-
-#if defined(Q_OS_MACOS)
-struct Q_GUI_EXPORT QCocoaMenu
-{
- QT_DECLARE_PLATFORM_INTERFACE(QCocoaMenu)
- virtual NSMenu *nsMenu() const = 0;
- virtual void setAsDockMenu() const = 0;
-};
-
-struct Q_GUI_EXPORT QCocoaMenuBar
-{
- QT_DECLARE_PLATFORM_INTERFACE(QCocoaMenuBar)
- virtual NSMenu *nsMenu() const = 0;
-};
-#endif
-
-} // QPlatformInterface::Private
-
QT_END_NAMESPACE
#endif
diff --git a/src/gui/kernel/qplatformmenu_p.h b/src/gui/kernel/qplatformmenu_p.h
new file mode 100644
index 00000000000..05e17051ba8
--- /dev/null
+++ b/src/gui/kernel/qplatformmenu_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** 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 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 QPLATFORMMENU_P_H
+#define QPLATFORMMENU_P_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 <QtGui/private/qtguiglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+// ----------------- QPlatformInterface -----------------
+
+QT_END_NAMESPACE
+Q_FORWARD_DECLARE_OBJC_CLASS(NSMenu);
+QT_BEGIN_NAMESPACE
+
+namespace QPlatformInterface::Private {
+
+#if defined(Q_OS_MACOS)
+struct Q_GUI_EXPORT QCocoaMenu
+{
+ QT_DECLARE_PLATFORM_INTERFACE(QCocoaMenu)
+ virtual NSMenu *nsMenu() const = 0;
+ virtual void setAsDockMenu() const = 0;
+};
+
+struct Q_GUI_EXPORT QCocoaMenuBar
+{
+ QT_DECLARE_PLATFORM_INTERFACE(QCocoaMenuBar)
+ virtual NSMenu *nsMenu() const = 0;
+};
+#endif
+
+} // QPlatformInterface::Private
+
+QT_END_NAMESPACE
+
+#endif // QPLATFORMMENU_P_H
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index 8d2f4b3fbde..cd621b76364 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -172,21 +172,6 @@ protected:
QScopedPointer<QPlatformWindowPrivate> d_ptr;
};
-// ----------------- QPlatformInterface -----------------
-
-namespace QPlatformInterface::Private {
-
-#if defined(Q_OS_MACOS)
-struct Q_GUI_EXPORT QCocoaWindow
-{
- QT_DECLARE_PLATFORM_INTERFACE(QCocoaWindow)
- virtual void setContentBorderEnabled(bool enable) = 0;
- virtual QPoint bottomLeftClippedByNSWindowOffset() const = 0;
-};
-#endif
-
-} // QPlatformInterface::Private
-
QT_END_NAMESPACE
#endif //QPLATFORMWINDOW_H
diff --git a/src/gui/kernel/qplatformwindow_p.h b/src/gui/kernel/qplatformwindow_p.h
index 00dae9334c8..03ef210f817 100644
--- a/src/gui/kernel/qplatformwindow_p.h
+++ b/src/gui/kernel/qplatformwindow_p.h
@@ -64,6 +64,21 @@ public:
QBasicTimer updateTimer;
};
+// ----------------- QPlatformInterface -----------------
+
+namespace QPlatformInterface::Private {
+
+#if defined(Q_OS_MACOS)
+struct Q_GUI_EXPORT QCocoaWindow
+{
+ QT_DECLARE_PLATFORM_INTERFACE(QCocoaWindow)
+ virtual void setContentBorderEnabled(bool enable) = 0;
+ virtual QPoint bottomLeftClippedByNSWindowOffset() const = 0;
+};
+#endif
+
+} // QPlatformInterface::Private
+
QT_END_NAMESPACE
#endif // QPLATFORMWINDOW_P_H
diff --git a/src/gui/platform/macos/qcocoaplatforminterface.mm b/src/gui/platform/macos/qcocoaplatforminterface.mm
index daa821a794c..be9e8d18bf1 100644
--- a/src/gui/platform/macos/qcocoaplatforminterface.mm
+++ b/src/gui/platform/macos/qcocoaplatforminterface.mm
@@ -41,8 +41,8 @@
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformopenglcontext.h>
#include <qpa/qplatformintegration.h>
-#include <qpa/qplatformwindow.h>
-#include <qpa/qplatformmenu.h>
+#include <qpa/qplatformwindow_p.h>
+#include <qpa/qplatformmenu_p.h>
#include <AppKit/AppKit.h>
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h
index bacc1f75cd0..6bd033bfeb6 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.h
+++ b/src/plugins/platforms/cocoa/qcocoamenu.h
@@ -43,6 +43,7 @@
#include <QtCore/QList>
#include <qpa/qplatformmenu.h>
+#include <qpa/qplatformmenu_p.h>
#include "qcocoamenuitem.h"
#include "qcocoansmenu.h"
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index a46f8913f93..927c3bd751d 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -41,6 +41,7 @@
#define QCOCOAWINDOW_H
#include <qpa/qplatformwindow.h>
+#include <qpa/qplatformwindow_p.h>
#include <QRect>
#include <QPointer>
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index 9ba7260072a..aa6706f0bb5 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -68,6 +68,7 @@
#endif
#include "qwidgetanimator_p.h"
#include <QtGui/qpa/qplatformwindow.h>
+#include <QtGui/qpa/qplatformwindow_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qmenu_mac.mm b/src/widgets/widgets/qmenu_mac.mm
index 67919de9aeb..1be74bf27c8 100644
--- a/src/widgets/widgets/qmenu_mac.mm
+++ b/src/widgets/widgets/qmenu_mac.mm
@@ -55,6 +55,7 @@ QT_USE_NAMESPACE
#include <QtGui/QGuiApplication>
#include <QtGui/QWindow>
#include <qpa/qplatformnativeinterface.h>
+#include <qpa/qplatformmenu_p.h>
using namespace QPlatformInterface::Private;