From 0efe79f80d6f249040f47162ebbfc82289ca073d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 7 Oct 2020 12:11:46 +0200 Subject: [PATCH] Rename the new platform APIs from QPlatformInterface to QNativeInterface We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- examples/opengl/contextinfo/widget.cpp | 2 +- src/corelib/global/qglobal.h | 21 +++-- src/gui/doc/src/nativeinterfaces.qdoc | 94 +++++++++---------- src/gui/kernel/qguiapplication_p.h | 12 +-- src/gui/kernel/qkeymapper_p.h | 11 +-- src/gui/kernel/qoffscreensurface.cpp | 6 +- src/gui/kernel/qoffscreensurface.h | 3 +- src/gui/kernel/qoffscreensurface_platform.h | 6 +- src/gui/kernel/qopenglcontext.cpp | 6 +- src/gui/kernel/qopenglcontext.h | 3 +- src/gui/kernel/qopenglcontext_platform.h | 12 +-- src/gui/kernel/qplatformintegration.h | 6 +- src/gui/kernel/qplatformmenu_p.h | 10 +- src/gui/kernel/qplatformoffscreensurface.h | 12 +-- src/gui/kernel/qplatformopenglcontext.h | 18 ++-- src/gui/kernel/qplatformscreen_p.h | 10 +- src/gui/kernel/qplatformwindow_p.h | 12 +-- .../platform/egl/qeglplatformcontext_p.h | 2 +- .../android/qandroidplatforminterface.cpp | 8 +- .../platform/macos/qcocoaplatforminterface.mm | 14 +-- .../platform/unix/qunixplatforminterface.cpp | 26 ++--- src/gui/platform/windows/qwindowsmime_p.h | 4 +- .../windows/qwindowsplatforminterface.cpp | 14 +-- .../android/qandroidplatformintegration.h | 4 +- .../qandroidplatformoffscreensurface.h | 2 +- src/plugins/platforms/cocoa/qcocoaglcontext.h | 2 +- .../platforms/cocoa/qcocoaintegration.h | 2 +- src/plugins/platforms/cocoa/qcocoamenu.h | 2 +- src/plugins/platforms/cocoa/qcocoamenubar.h | 2 +- src/plugins/platforms/cocoa/qcocoawindow.h | 2 +- .../platforms/eglfs/api/qeglfsintegration_p.h | 4 +- .../eglfs_kms_vsp2/qeglfskmsvsp2screen.h | 2 +- .../platforms/linuxfb/qlinuxfbintegration.h | 2 +- .../offscreen/qoffscreenintegration_x11.h | 2 +- .../platforms/windows/qwindowsapplication.cpp | 4 +- .../platforms/windows/qwindowsapplication.h | 6 +- .../platforms/windows/qwindowsglcontext.h | 2 +- .../platforms/windows/qwindowsintegration.cpp | 4 +- .../platforms/windows/qwindowsintegration.h | 2 +- .../platforms/windows/qwindowsmime.cpp | 12 +-- src/plugins/platforms/windows/qwindowsmime.h | 2 +- .../platforms/windows/qwindowswindow.h | 6 +- .../xcb_egl/qxcbeglintegration.h | 2 +- .../gl_integrations/xcb_glx/qglxintegration.h | 2 +- .../xcb_glx/qxcbglxintegration.h | 2 +- src/plugins/platforms/xcb/qxcbintegration.cpp | 4 +- src/plugins/platforms/xcb/qxcbintegration.h | 4 +- src/plugins/platforms/xcb/qxcbscreen.h | 2 +- src/plugins/platforms/xcb/qxcbwindow.h | 2 +- .../styles/windowsvista/qwindowsxpstyle.cpp | 2 +- src/widgets/dialogs/qwizard_win.cpp | 2 +- src/widgets/kernel/qwidget.cpp | 2 +- src/widgets/styles/qwindowsstyle.cpp | 2 +- src/widgets/widgets/qmainwindow.cpp | 2 +- src/widgets/widgets/qmenu_mac.mm | 2 +- .../gui/kernel/qclipboard/tst_qclipboard.cpp | 4 +- tests/auto/gui/qopengl/tst_qopengl.cpp | 6 +- .../qopenglcontext/qopenglcontextwindow.cpp | 6 +- .../qtabletevent/regular_widgets/main.cpp | 2 +- tests/manual/touch/main.cpp | 2 +- .../widgets/widgets/defaultUpMenuBar/main.cpp | 2 +- 61 files changed, 215 insertions(+), 213 deletions(-) diff --git a/examples/opengl/contextinfo/widget.cpp b/examples/opengl/contextinfo/widget.cpp index ee3161eae7b..df1e6a6f7b9 100644 --- a/examples/opengl/contextinfo/widget.cpp +++ b/examples/opengl/contextinfo/widget.cpp @@ -382,7 +382,7 @@ void Widget::renderWindowReady() m_output->append(tr("Qt OpenGL configuration: %1") .arg(QString::fromLatin1(gltype[QOpenGLContext::openGLModuleType()]))); #if defined(Q_OS_WIN) - using namespace QPlatformInterface; + using namespace QNativeInterface; m_output->append(tr("Qt OpenGL library handle: %1") .arg(QString::number(qintptr(QWGLContext::openGLModuleHandle()), 16))); #endif diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index fa8193853f0..25c31e40672 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1284,21 +1284,26 @@ inline int qIntCast(float f) { return int(f); } // Ensures that the interface's typeinfo is exported so that // dynamic casts work reliably, and protects the destructor // so that pointers to the interface can't be deleted. -#define QT_DECLARE_PLATFORM_INTERFACE(InterfaceClass) \ +#define QT_DECLARE_NATIVE_INTERFACE(InterfaceClass) \ protected: virtual ~InterfaceClass(); public: +// Declares an accessor for the native interface +#define QT_DECLARE_NATIVE_INTERFACE_ACCESSOR \ + template \ + NativeInterface *nativeInterface() const; + // Provides a definition for the interface destructor -#define QT_DEFINE_PLATFORM_INTERFACE2(Namespace, InterfaceClass) \ +#define QT_DEFINE_NATIVE_INTERFACE2(Namespace, InterfaceClass) \ QT_PREPEND_NAMESPACE(Namespace)::InterfaceClass::~InterfaceClass() = default // Provides a definition for the destructor, and an explicit -// template instantiation of the platform interface accessor. -#define QT_DEFINE_PLATFORM_INTERFACE3(Namespace, InterfaceClass, PublicClass) \ - QT_DEFINE_PLATFORM_INTERFACE2(Namespace, InterfaceClass); \ - template Q_DECL_EXPORT QT_PREPEND_NAMESPACE(Namespace)::InterfaceClass *PublicClass::platformInterface() const +// template instantiation of the native interface accessor. +#define QT_DEFINE_NATIVE_INTERFACE3(Namespace, InterfaceClass, PublicClass) \ + QT_DEFINE_NATIVE_INTERFACE2(Namespace, InterfaceClass); \ + template Q_DECL_EXPORT QT_PREPEND_NAMESPACE(Namespace)::InterfaceClass *PublicClass::nativeInterface() const -#define QT_DEFINE_PLATFORM_INTERFACE(...) QT_OVERLOADED_MACRO(QT_DEFINE_PLATFORM_INTERFACE, QPlatformInterface, __VA_ARGS__) -#define QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(...) QT_OVERLOADED_MACRO(QT_DEFINE_PLATFORM_INTERFACE, QPlatformInterface::Private, __VA_ARGS__) +#define QT_DEFINE_NATIVE_INTERFACE(...) QT_OVERLOADED_MACRO(QT_DEFINE_NATIVE_INTERFACE, QNativeInterface, __VA_ARGS__) +#define QT_DEFINE_PRIVATE_NATIVE_INTERFACE(...) QT_OVERLOADED_MACRO(QT_DEFINE_NATIVE_INTERFACE, QNativeInterface::Private, __VA_ARGS__) // This macro can be used to calculate member offsets for types with a non standard layout. // It uses the fact that offsetof() is allowed to support those types since C++17 as an optional diff --git a/src/gui/doc/src/nativeinterfaces.qdoc b/src/gui/doc/src/nativeinterfaces.qdoc index 9c0ab78ef49..f7137a76a94 100644 --- a/src/gui/doc/src/nativeinterfaces.qdoc +++ b/src/gui/doc/src/nativeinterfaces.qdoc @@ -34,7 +34,7 @@ */ /*! - \namespace QPlatformInterface::Private + \namespace QNativeInterface::Private \inmodule QtGui \since 6.0 \brief Contains the classes providing native interfaces. @@ -42,7 +42,7 @@ */ /*! - \class QPlatformInterface::QCocoaGLContext + \class QNativeInterface::QCocoaGLContext \since 6.0 \brief Native interface to QPlatformOpenGLContext. \inmodule QtGui @@ -50,7 +50,7 @@ */ /*! - \class QPlatformInterface::Private::QCocoaMenu + \class QNativeInterface::Private::QCocoaMenu \since 6.0 \brief Native interface to QPlatformMenu. \inmodule QtGui @@ -58,7 +58,7 @@ */ /*! - \class QPlatformInterface::Private::QCocoaWindow + \class QNativeInterface::Private::QCocoaWindow \since 6.0 \brief Native interface to QPlatformWindow. \inmodule QtGui @@ -66,7 +66,7 @@ */ /*! - \class QPlatformInterface::QEGLContext + \class QNativeInterface::QEGLContext \since 6.0 \brief Native interface to QPlatformOpenGLContext. \inmodule QtGui @@ -74,7 +74,7 @@ */ /*! - \class QPlatformInterface::Private::QEvdevKeyMapper + \class QNativeInterface::Private::QEvdevKeyMapper \since 6.0 \brief Native interface to QKeyMapper. \inmodule QtGui @@ -82,7 +82,7 @@ */ /*! - \class QPlatformInterface::QGLXContext + \class QNativeInterface::QGLXContext \since 6.0 \brief Native interface to QPlatformOpenGLContext. \inmodule QtGui @@ -90,7 +90,7 @@ */ /*! - \class QPlatformInterface::QWGLContext + \class QNativeInterface::QWGLContext \since 6.0 \brief Native interface to QPlatformOpenGLContext. \inmodule QtGui @@ -98,7 +98,7 @@ */ /*! - \class QPlatformInterface::Private::QWindowsApplication + \class QNativeInterface::Private::QWindowsApplication \since 6.0 \brief Native interface to QGuiApplication, to be retrieved from QPlatformIntegration. \inmodule QtGui @@ -106,7 +106,7 @@ */ /*! - \enum QPlatformInterface::Private::QWindowsApplication::TouchWindowTouchType + \enum QNativeInterface::Private::QWindowsApplication::TouchWindowTouchType This enum represents the supported TouchWindow touch flags for registerTouchWindow(). @@ -116,19 +116,19 @@ */ /*! - \fn void QPlatformInterface::Private::QWindowsApplication::setTouchWindowTouchType(QPlatformInterface::Private::QWindowsApplication::TouchWindowTouchTypes type) + \fn void QNativeInterface::Private::QWindowsApplication::setTouchWindowTouchType(QNativeInterface::Private::QWindowsApplication::TouchWindowTouchTypes type) Sets the touch window type for all windows to \a type. */ /*! - \fn QPlatformInterface::Private::QWindowsApplication::TouchWindowTouchTypes QPlatformInterface::Private::QWindowsApplication::touchWindowTouchType() const + \fn QNativeInterface::Private::QWindowsApplication::TouchWindowTouchTypes QNativeInterface::Private::QWindowsApplication::touchWindowTouchType() const Returns the currently set the touch window type. */ /*! - \enum QPlatformInterface::Private::QWindowsApplication::WindowActivationBehavior + \enum QNativeInterface::Private::QWindowsApplication::WindowActivationBehavior This enum specifies the behavior of QWidget::activateWindow() and QWindow::requestActivate(). @@ -144,7 +144,7 @@ */ /*! - \fn void QPlatformInterface::Private::QWindowsApplication::setWindowActivationBehavior(QPlatformInterface::Private::QWindowsApplication::WindowActivationBehavior behavior) + \fn void QNativeInterface::Private::QWindowsApplication::setWindowActivationBehavior(QNativeInterface::Private::QWindowsApplication::WindowActivationBehavior behavior) Sets the window activation behavior to \a behavior. @@ -152,13 +152,13 @@ */ /*! - \fn QPlatformInterface::Private::QWindowsApplication::WindowActivationBehavior QPlatformInterface::Private::QWindowsApplication::windowActivationBehavior() const + \fn QNativeInterface::Private::QWindowsApplication::WindowActivationBehavior QNativeInterface::Private::QWindowsApplication::windowActivationBehavior() const Returns the currently set the window activation behavior. */ /*! - \fn bool QPlatformInterface::Private::QWindowsApplication::isTabletMode() const + \fn bool QNativeInterface::Private::QWindowsApplication::isTabletMode() const Returns \c true if Windows 10 operates in \e{Tablet Mode}. In this mode, Windows forces all application main windows to open in maximized @@ -169,7 +169,7 @@ */ /*! - \enum QPlatformInterface::Private::QWindowsApplication::DarkModeHandlingFlag + \enum QNativeInterface::Private::QWindowsApplication::DarkModeHandlingFlag This enum specifies the behavior of the application when Windows is configured to use dark mode for applications. @@ -182,32 +182,32 @@ */ /*! - \fn bool QPlatformInterface::Private::QWindowsApplication::isDarkMode() const + \fn bool QNativeInterface::Private::QWindowsApplication::isDarkMode() const Returns \c true if Windows 10 is configured to use dark mode for applications. */ /*! - \fn void QPlatformInterface::Private::QWindowsApplication::setDarkModeHandling(DarkModeHandling handling) + \fn void QNativeInterface::Private::QWindowsApplication::setDarkModeHandling(DarkModeHandling handling) Sets the dark mode handling to \a handling. */ /*! - \fn QPlatformInterface::Private::QWindowsApplication::DarkModeHandling QPlatformInterface::Private::QWindowsApplication::darkModeHandling() const + \fn QNativeInterface::Private::QWindowsApplication::DarkModeHandling QNativeInterface::Private::QWindowsApplication::darkModeHandling() const Returns the currently set dark mode handling. */ /*! - \fn bool QPlatformInterface::Private::QWindowsApplication::isWinTabEnabled() const + \fn bool QNativeInterface::Private::QWindowsApplication::isWinTabEnabled() const Returns whether the \e{Tablet WinTab Driver} (\c Wintab32.dll) is used. */ /*! - \fn bool QPlatformInterface::Private::QWindowsApplication::setWinTabEnabled(bool enabled) + \fn bool QNativeInterface::Private::QWindowsApplication::setWinTabEnabled(bool enabled) Sets whether the \e{Tablet WinTab Driver} (\c Wintab32.dll) should be used to \a enabled. @@ -215,55 +215,55 @@ */ /*! - \fn bool QPlatformInterface::Private::QWindowsApplication::registerMime(QWindowsMime *mime) + \fn bool QNativeInterface::Private::QWindowsApplication::registerMime(QWindowsMime *mime) Registers the converter \a mime to the system. - \sa QPlatformInterface::Private::QWindowsMime, unregisterMime() + \sa QNativeInterface::Private::QWindowsMime, unregisterMime() */ /*! - \fn void QPlatformInterface::Private::QWindowsApplication::unregisterMime(QWindowsMime *mime) + \fn void QNativeInterface::Private::QWindowsApplication::unregisterMime(QWindowsMime *mime) Unregisters the converter \a mime from the system. - \sa QPlatformInterface::Private::QWindowsMime, registerMime() + \sa QNativeInterface::Private::QWindowsMime, registerMime() */ /*! - \fn int QPlatformInterface::Private::QWindowsApplication::registerMimeType(const QString &mime) + \fn int QNativeInterface::Private::QWindowsApplication::registerMimeType(const QString &mime) Registers the MIME type \a mime, and returns an ID number identifying the format on Windows. */ /*! - \fn HWND QPlatformInterface::Private::QWindowsApplication::createMessageWindow(const QString &, const QString &, QFunctionPointer) const + \fn HWND QNativeInterface::Private::QWindowsApplication::createMessageWindow(const QString &, const QString &, QFunctionPointer) const \internal */ /*! - \fn bool QPlatformInterface::Private::QWindowsApplication::asyncExpose() const + \fn bool QNativeInterface::Private::QWindowsApplication::asyncExpose() const \internal */ /*! - \fn void QPlatformInterface::Private::QWindowsApplication::setAsyncExpose(bool) + \fn void QNativeInterface::Private::QWindowsApplication::setAsyncExpose(bool) \internal */ /*! - \fn QVariant QPlatformInterface::Private::QWindowsApplication::gpu() + \fn QVariant QNativeInterface::Private::QWindowsApplication::gpu() \internal */ /*! - \fn QVariant QPlatformInterface::Private::QWindowsApplication::gpuList() + \fn QVariant QNativeInterface::Private::QWindowsApplication::gpuList() \internal */ /*! - \class QPlatformInterface::Private::QWindowsMime + \class QNativeInterface::Private::QWindowsMime \since 6.0 \brief The QWindowsMime class maps open-standard MIME to Window Clipboard formats. \inmodule QtGui @@ -305,13 +305,13 @@ */ /*! - \fn QPlatformInterface::Private::QWindowsMime::~QWindowsMime() + \fn QNativeInterface::Private::QWindowsMime::~QWindowsMime() Destroys the conversion object. */ /*! - \fn bool QPlatformInterface::Private::QWindowsMime::canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const + \fn bool QNativeInterface::Private::QWindowsMime::canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const Returns \c true if the converter can convert from the \a mimeData to the format specified in \a formatetc. @@ -320,7 +320,7 @@ */ /*! - \fn bool QPlatformInterface::Private::QWindowsMime::canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const + \fn bool QNativeInterface::Private::QWindowsMime::canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const Returns \c true if the converter can convert to the \a mimeType from the available formats in \a pDataObj. @@ -329,7 +329,7 @@ */ /*! - \fn QString QPlatformInterface::Private::QWindowsMime::mimeForFormat(const FORMATETC &formatetc) const + \fn QString QNativeInterface::Private::QWindowsMime::mimeForFormat(const FORMATETC &formatetc) const Returns the mime type that will be created form the format specified in \a formatetc, or an empty string if this converter does not support @@ -339,7 +339,7 @@ */ /*! - \fn QList QPlatformInterface::Private::QWindowsMime::formatsForMime(const QString &mimeType, const QMimeData *mimeData) const + \fn QList QNativeInterface::Private::QWindowsMime::formatsForMime(const QString &mimeType, const QMimeData *mimeData) const Returns a QList of FORMATETC structures representing the different windows clipboard formats that can be provided for the \a mimeType from the \a mimeData. @@ -348,7 +348,7 @@ */ /*! - \fn QVariant QPlatformInterface::Private::QWindowsMime::convertToMime(const QString &mimeType, IDataObject *pDataObj, + \fn QVariant QNativeInterface::Private::QWindowsMime::convertToMime(const QString &mimeType, IDataObject *pDataObj, QVariant::Type preferredType) const Returns a QVariant containing the converted data for \a mimeType from \a pDataObj. @@ -358,7 +358,7 @@ */ /*! - \fn bool QPlatformInterface::Private::QWindowsMime::convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const + \fn bool QNativeInterface::Private::QWindowsMime::convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const Convert the \a mimeData to the format specified in \a formatetc. The converted data should then be placed in \a pmedium structure. @@ -369,7 +369,7 @@ */ /*! - \class QPlatformInterface::Private::QWindowsWindow + \class QNativeInterface::Private::QWindowsWindow \since 6.0 \brief Native interface to QPlatformWindow. \inmodule QtGui @@ -377,7 +377,7 @@ */ /*! - \fn void QPlatformInterface::Private::QWindowsWindow::setHasBorderInFullScreen(bool border) + \fn void QNativeInterface::Private::QWindowsWindow::setHasBorderInFullScreen(bool border) Sets whether the WS_BORDER flag will be set for the window in full screen mode to \a border. @@ -386,27 +386,27 @@ */ /*! - \fn bool QPlatformInterface::Private::QWindowsWindow::hasBorderInFullScreen() const + \fn bool QNativeInterface::Private::QWindowsWindow::hasBorderInFullScreen() const Returns whether the WS_BORDER flag will be set for the window in full screen mode. */ /*! - \fn QMargins QPlatformInterface::Private::QWindowsWindow::customMargins() const + \fn QMargins QNativeInterface::Private::QWindowsWindow::customMargins() const Returns the margin to be used when handling the \c WM_NCCALCSIZE message. */ /*! - \fn void QPlatformInterface::Private::QWindowsWindow::setCustomMargins(const QMargins &margins) + \fn void QNativeInterface::Private::QWindowsWindow::setCustomMargins(const QMargins &margins) Sets the\a margins to be used when handling the \c WM_NCCALCSIZE message. It is possible to remove a frame border by specifying a negative value. */ /*! - \class QPlatformInterface::Private::QXcbScreen + \class QNativeInterface::Private::QXcbScreen \since 6.0 \brief Native interface to QPlatformScreen. \inmodule QtGui @@ -414,7 +414,7 @@ */ /*! - \class QPlatformInterface::Private::QXcbWindow + \class QNativeInterface::Private::QXcbWindow \since 6.0 \brief Native interface to QPlatformWindow. \inmodule QtGui diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index ea791326cdb..2471bb9e56b 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -350,9 +350,9 @@ private: static qreal m_maxDevicePixelRatio; }; -// ----------------- QPlatformInterface ----------------- +// ----------------- QNativeInterface ----------------- -namespace QPlatformInterface::Private { +namespace QNativeInterface::Private { #if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC) @@ -360,7 +360,7 @@ class QWindowsMime; struct Q_GUI_EXPORT QWindowsApplication { - QT_DECLARE_PLATFORM_INTERFACE(QWindowsApplication) + QT_DECLARE_NATIVE_INTERFACE(QWindowsApplication) enum WindowActivationBehavior { DefaultActivateWindow, @@ -415,11 +415,11 @@ struct Q_GUI_EXPORT QWindowsApplication }; #endif // Q_OS_WIN -} // QPlatformInterface::Private +} // QNativeInterface::Private #if defined(Q_OS_WIN) -Q_DECLARE_OPERATORS_FOR_FLAGS(QPlatformInterface::Private::QWindowsApplication::TouchWindowTouchTypes) -Q_DECLARE_OPERATORS_FOR_FLAGS(QPlatformInterface::Private::QWindowsApplication::DarkModeHandling) +Q_DECLARE_OPERATORS_FOR_FLAGS(QNativeInterface::Private::QWindowsApplication::TouchWindowTouchTypes) +Q_DECLARE_OPERATORS_FOR_FLAGS(QNativeInterface::Private::QWindowsApplication::DarkModeHandling) #endif QT_END_NAMESPACE diff --git a/src/gui/kernel/qkeymapper_p.h b/src/gui/kernel/qkeymapper_p.h index fea671cf401..65d1c229cac 100644 --- a/src/gui/kernel/qkeymapper_p.h +++ b/src/gui/kernel/qkeymapper_p.h @@ -72,8 +72,7 @@ public: static void changeKeyboard(); static QList possibleKeys(QKeyEvent *e); - template - T *platformInterface() const; + QT_DECLARE_NATIVE_INTERFACE_ACCESSOR private: friend QKeyMapperPrivate *qt_keymapper_private(); @@ -99,20 +98,20 @@ public: QKeyMapperPrivate *qt_keymapper_private(); // from qkeymapper.cpp -// ----------------- QPlatformInterface ----------------- +// ----------------- QNativeInterface ----------------- -namespace QPlatformInterface::Private { +namespace QNativeInterface::Private { #if QT_CONFIG(evdev) || defined(Q_CLANG_QDOC) struct Q_GUI_EXPORT QEvdevKeyMapper { - QT_DECLARE_PLATFORM_INTERFACE(QEvdevKeyMapper) + QT_DECLARE_NATIVE_INTERFACE(QEvdevKeyMapper) virtual void loadKeymap(const QString &filename) = 0; virtual void switchLang() = 0; }; #endif -} // QPlatformInterface::Private +} // QNativeInterface::Private QT_END_NAMESPACE diff --git a/src/gui/kernel/qoffscreensurface.cpp b/src/gui/kernel/qoffscreensurface.cpp index 9875911d30d..3144bc6f8cf 100644 --- a/src/gui/kernel/qoffscreensurface.cpp +++ b/src/gui/kernel/qoffscreensurface.cpp @@ -52,12 +52,12 @@ QT_BEGIN_NAMESPACE /*! - \fn T QOffScreenSurface::platformInterface() + \fn template NativeInterface *QOffScreenSurface::nativeInterface() - Returns a platform interface of type T for the surface. + Returns a native interface of type \c NativeInterface for the surface. This function provides access to platform specific functionality - of QOffScreenSurface, as defined in the QPlatformInterface namespace. + of QOffScreenSurface, as defined in the QNativeInterface namespace. If the requested interface is not available a \nullptr is returned. */ diff --git a/src/gui/kernel/qoffscreensurface.h b/src/gui/kernel/qoffscreensurface.h index fe8db44633e..3fc850a79df 100644 --- a/src/gui/kernel/qoffscreensurface.h +++ b/src/gui/kernel/qoffscreensurface.h @@ -79,8 +79,7 @@ public: QPlatformOffscreenSurface *handle() const; - template - T *platformInterface() const; + QT_DECLARE_NATIVE_INTERFACE_ACCESSOR Q_SIGNALS: void screenChanged(QScreen *screen); diff --git a/src/gui/kernel/qoffscreensurface_platform.h b/src/gui/kernel/qoffscreensurface_platform.h index c991ec01225..a122891ee47 100644 --- a/src/gui/kernel/qoffscreensurface_platform.h +++ b/src/gui/kernel/qoffscreensurface_platform.h @@ -49,18 +49,18 @@ QT_FORWARD_DECLARE_CLASS(ANativeWindow); QT_BEGIN_NAMESPACE -namespace QPlatformInterface { +namespace QNativeInterface { #if defined(Q_OS_ANDROID) struct Q_GUI_EXPORT QAndroidOffscreenSurface { - QT_DECLARE_PLATFORM_INTERFACE(QAndroidOffscreenSurface) + QT_DECLARE_NATIVE_INTERFACE(QAndroidOffscreenSurface) static QOffscreenSurface *fromNative(ANativeWindow *nativeSurface); virtual ANativeWindow *nativeSurface() const = 0; }; #endif -} // QPlatformInterface +} // QNativeInterface QT_END_NAMESPACE diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 81ab994f10a..490d082fd45 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -347,12 +347,12 @@ void QOpenGLContextPrivate::_q_screenDestroyed(QObject *object) } /*! - \fn template T *QOpenGLContext::platformInterface() const + \fn template NativeInterface *QOpenGLContext::nativeInterface() const - Returns a platform interface of type T for the context. + Returns a native interface of type \c NativeInterface for the context. This function provides access to platform specific functionality - of QOpenGLContext, as defined in the QPlatformInterface namespace. + of QOpenGLContext, as defined in the QNativeInterface namespace. If the requested interface is not available a \nullptr is returned. */ diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h index 24adb1910b2..60f3e3d03ad 100644 --- a/src/gui/kernel/qopenglcontext.h +++ b/src/gui/kernel/qopenglcontext.h @@ -152,8 +152,7 @@ public: static bool supportsThreadedOpenGL(); static QOpenGLContext *globalShareContext(); - template - T *platformInterface() const; + QT_DECLARE_NATIVE_INTERFACE_ACCESSOR Q_SIGNALS: void aboutToBeDestroyed(); diff --git a/src/gui/kernel/qopenglcontext_platform.h b/src/gui/kernel/qopenglcontext_platform.h index 1b03325c7f8..c498c19437b 100644 --- a/src/gui/kernel/qopenglcontext_platform.h +++ b/src/gui/kernel/qopenglcontext_platform.h @@ -64,12 +64,12 @@ typedef void *NSOpenGLContext; QT_BEGIN_NAMESPACE -namespace QPlatformInterface { +namespace QNativeInterface { #if defined(Q_OS_MACOS) || defined(Q_CLANG_QDOC) struct Q_GUI_EXPORT QCocoaGLContext { - QT_DECLARE_PLATFORM_INTERFACE(QCocoaGLContext) + QT_DECLARE_NATIVE_INTERFACE(QCocoaGLContext) static QOpenGLContext *fromNative(QT_IGNORE_DEPRECATIONS(NSOpenGLContext) *, QOpenGLContext *shareContext = nullptr); virtual QT_IGNORE_DEPRECATIONS(NSOpenGLContext) *nativeContext() const = 0; }; @@ -78,7 +78,7 @@ struct Q_GUI_EXPORT QCocoaGLContext #if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC) struct Q_GUI_EXPORT QWGLContext { - QT_DECLARE_PLATFORM_INTERFACE(QWGLContext) + QT_DECLARE_NATIVE_INTERFACE(QWGLContext) static HMODULE openGLModuleHandle(); static QOpenGLContext *fromNative(HGLRC context, HWND window, QOpenGLContext *shareContext = nullptr); virtual HGLRC nativeContext() const = 0; @@ -88,7 +88,7 @@ struct Q_GUI_EXPORT QWGLContext #if defined(Q_OS_LINUX) || defined(Q_CLANG_QDOC) struct Q_GUI_EXPORT QGLXContext { - QT_DECLARE_PLATFORM_INTERFACE(QGLXContext) + QT_DECLARE_NATIVE_INTERFACE(QGLXContext) static QOpenGLContext *fromNative(GLXContext configBasedContext, QOpenGLContext *shareContext = nullptr); static QOpenGLContext *fromNative(GLXContext visualBasedContext, void *visualInfo, QOpenGLContext *shareContext = nullptr); virtual GLXContext nativeContext() const = 0; @@ -98,13 +98,13 @@ struct Q_GUI_EXPORT QGLXContext #if QT_CONFIG(egl) struct Q_GUI_EXPORT QEGLContext { - QT_DECLARE_PLATFORM_INTERFACE(QEGLContext) + QT_DECLARE_NATIVE_INTERFACE(QEGLContext) static QOpenGLContext *fromNative(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext = nullptr); virtual EGLContext nativeContext() const = 0; }; #endif -} // QPlatformInterface +} // QNativeInterface QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index 5083542e122..c8438a6c247 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -81,7 +81,7 @@ class QOffscreenSurface; class QPlatformVulkanInstance; class QVulkanInstance; -namespace QPlatformInterface::Private { +namespace QNativeInterface::Private { template struct QInterfaceProxyImp @@ -103,7 +103,7 @@ struct QInterfaceProxy : public QInterfaceProxyImp {} template struct QInterfaceProxy : public QInterfaceProxyImp {}; -} // QPlatformInterface::Private +} // QNativeInterface::Private class Q_GUI_EXPORT QPlatformIntegration { @@ -229,7 +229,7 @@ public: template auto call(Args... args) { - using namespace QPlatformInterface::Private; + using namespace QNativeInterface::Private; return QInterfaceProxy::apply(this, args...); } diff --git a/src/gui/kernel/qplatformmenu_p.h b/src/gui/kernel/qplatformmenu_p.h index 40aef4bfd42..feba5aa9ffc 100644 --- a/src/gui/kernel/qplatformmenu_p.h +++ b/src/gui/kernel/qplatformmenu_p.h @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE -// ----------------- QPlatformInterface ----------------- +// ----------------- QNativeInterface ----------------- #if !defined(Q_OS_MACOS) && defined(Q_CLANG_QDOC) typedef void NSMenu; @@ -65,24 +65,24 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSMenu); QT_BEGIN_NAMESPACE #endif -namespace QPlatformInterface::Private { +namespace QNativeInterface::Private { #if defined(Q_OS_MACOS) || defined(Q_CLANG_QDOC) struct Q_GUI_EXPORT QCocoaMenu { - QT_DECLARE_PLATFORM_INTERFACE(QCocoaMenu) + QT_DECLARE_NATIVE_INTERFACE(QCocoaMenu) virtual NSMenu *nsMenu() const = 0; virtual void setAsDockMenu() const = 0; }; struct Q_GUI_EXPORT QCocoaMenuBar { - QT_DECLARE_PLATFORM_INTERFACE(QCocoaMenuBar) + QT_DECLARE_NATIVE_INTERFACE(QCocoaMenuBar) virtual NSMenu *nsMenu() const = 0; }; #endif -} // QPlatformInterface::Private +} // QNativeInterface::Private QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformoffscreensurface.h b/src/gui/kernel/qplatformoffscreensurface.h index 1d06336956f..06fa80b994e 100644 --- a/src/gui/kernel/qplatformoffscreensurface.h +++ b/src/gui/kernel/qplatformoffscreensurface.h @@ -81,23 +81,23 @@ private: Q_DISABLE_COPY(QPlatformOffscreenSurface) }; -template -T *QOffscreenSurface::platformInterface() const +template +NativeInterface *QOffscreenSurface::nativeInterface() const { - return dynamic_cast(surfaceHandle()); + return dynamic_cast(surfaceHandle()); } -namespace QPlatformInterface::Private { +namespace QNativeInterface::Private { #if defined(Q_OS_ANDROID) struct Q_GUI_EXPORT QAndroidOffScreenIntegration { - QT_DECLARE_PLATFORM_INTERFACE(QAndroidOffScreenIntegration) + QT_DECLARE_NATIVE_INTERFACE(QAndroidOffScreenIntegration) virtual QOffscreenSurface *createOffscreenSurface(ANativeWindow *nativeSurface) const = 0; }; #endif -} // QPlatformInterface::Private +} // QNativeInterface::Private QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformopenglcontext.h b/src/gui/kernel/qplatformopenglcontext.h index 8c38d88b568..f5d74613946 100644 --- a/src/gui/kernel/qplatformopenglcontext.h +++ b/src/gui/kernel/qplatformopenglcontext.h @@ -102,18 +102,18 @@ private: Q_DISABLE_COPY(QPlatformOpenGLContext) }; -template -T *QOpenGLContext::platformInterface() const +template +NativeInterface *QOpenGLContext::nativeInterface() const { - return dynamic_cast(handle()); + return dynamic_cast(handle()); } -namespace QPlatformInterface::Private { +namespace QNativeInterface::Private { #if defined(Q_OS_MACOS) struct Q_GUI_EXPORT QCocoaGLIntegration { - QT_DECLARE_PLATFORM_INTERFACE(QCocoaGLIntegration) + QT_DECLARE_NATIVE_INTERFACE(QCocoaGLIntegration) virtual QOpenGLContext *createOpenGLContext(NSOpenGLContext *, QOpenGLContext *shareContext) const = 0; }; #endif @@ -121,7 +121,7 @@ struct Q_GUI_EXPORT QCocoaGLIntegration #if defined(Q_OS_WIN) struct Q_GUI_EXPORT QWindowsGLIntegration { - QT_DECLARE_PLATFORM_INTERFACE(QWindowsGLIntegration) + QT_DECLARE_NATIVE_INTERFACE(QWindowsGLIntegration) virtual HMODULE openGLModuleHandle() const = 0; virtual QOpenGLContext *createOpenGLContext(HGLRC context, HWND window, QOpenGLContext *shareContext) const = 0; }; @@ -130,7 +130,7 @@ struct Q_GUI_EXPORT QWindowsGLIntegration #if defined(Q_OS_LINUX) struct Q_GUI_EXPORT QGLXIntegration { - QT_DECLARE_PLATFORM_INTERFACE(QGLXIntegration) + QT_DECLARE_NATIVE_INTERFACE(QGLXIntegration) virtual QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const = 0; }; #endif @@ -138,12 +138,12 @@ struct Q_GUI_EXPORT QGLXIntegration #if QT_CONFIG(egl) struct Q_GUI_EXPORT QEGLIntegration { - QT_DECLARE_PLATFORM_INTERFACE(QEGLIntegration) + QT_DECLARE_NATIVE_INTERFACE(QEGLIntegration) virtual QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const = 0; }; #endif -} // QPlatformInterface::Private +} // QNativeInterface::Private QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformscreen_p.h b/src/gui/kernel/qplatformscreen_p.h index 2f09c1de37a..340f637dd96 100644 --- a/src/gui/kernel/qplatformscreen_p.h +++ b/src/gui/kernel/qplatformscreen_p.h @@ -65,14 +65,14 @@ public: QPointer screen; }; -// ----------------- QPlatformInterface ----------------- +// ----------------- QNativeInterface ----------------- -namespace QPlatformInterface::Private { +namespace QNativeInterface::Private { #if QT_CONFIG(xcb) struct Q_GUI_EXPORT QXcbScreen { - QT_DECLARE_PLATFORM_INTERFACE(QXcbScreen) + QT_DECLARE_NATIVE_INTERFACE(QXcbScreen) virtual int virtualDesktopNumber() const = 0; }; #endif @@ -80,7 +80,7 @@ struct Q_GUI_EXPORT QXcbScreen #if QT_CONFIG(vsp2) struct Q_GUI_EXPORT QVsp2Screen { - QT_DECLARE_PLATFORM_INTERFACE(QVsp2Screen) + QT_DECLARE_NATIVE_INTERFACE(QVsp2Screen) virtual int addLayer(int dmabufFd, const QSize &size, const QPoint &position, uint drmPixelFormat, uint bytesPerLine) = 0; virtual void setLayerBuffer(int id, int dmabufFd) = 0; virtual void setLayerPosition(int id, const QPoint &position) = 0; @@ -90,7 +90,7 @@ struct Q_GUI_EXPORT QVsp2Screen }; #endif -} // QPlatformInterface::Private +} // QNativeInterface::Private QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformwindow_p.h b/src/gui/kernel/qplatformwindow_p.h index 7d459556fd9..ffc3879bf18 100644 --- a/src/gui/kernel/qplatformwindow_p.h +++ b/src/gui/kernel/qplatformwindow_p.h @@ -66,14 +66,14 @@ public: QBasicTimer updateTimer; }; -// ----------------- QPlatformInterface ----------------- +// ----------------- QNativeInterface ----------------- -namespace QPlatformInterface::Private { +namespace QNativeInterface::Private { #if defined(Q_OS_MACOS) || defined(Q_CLANG_QDOC) struct Q_GUI_EXPORT QCocoaWindow { - QT_DECLARE_PLATFORM_INTERFACE(QCocoaWindow) + QT_DECLARE_NATIVE_INTERFACE(QCocoaWindow) virtual void setContentBorderEnabled(bool enable) = 0; virtual QPoint bottomLeftClippedByNSWindowOffset() const = 0; }; @@ -82,7 +82,7 @@ struct Q_GUI_EXPORT QCocoaWindow #if QT_CONFIG(xcb) || defined(Q_CLANG_QDOC) struct Q_GUI_EXPORT QXcbWindow { - QT_DECLARE_PLATFORM_INTERFACE(QXcbWindow) + QT_DECLARE_NATIVE_INTERFACE(QXcbWindow) enum WindowType { None = 0x000000, @@ -114,7 +114,7 @@ struct Q_GUI_EXPORT QXcbWindow #if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC) struct Q_GUI_EXPORT QWindowsWindow { - QT_DECLARE_PLATFORM_INTERFACE(QWindowsWindow) + QT_DECLARE_NATIVE_INTERFACE(QWindowsWindow) virtual void setHasBorderInFullScreen(bool border) = 0; virtual bool hasBorderInFullScreen() const = 0; @@ -124,7 +124,7 @@ struct Q_GUI_EXPORT QWindowsWindow }; #endif // Q_OS_WIN -} // QPlatformInterface::Private +} // QNativeInterface::Private QT_END_NAMESPACE diff --git a/src/gui/opengl/platform/egl/qeglplatformcontext_p.h b/src/gui/opengl/platform/egl/qeglplatformcontext_p.h index 899f4b5c9f9..5f399c69946 100644 --- a/src/gui/opengl/platform/egl/qeglplatformcontext_p.h +++ b/src/gui/opengl/platform/egl/qeglplatformcontext_p.h @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE class Q_GUI_EXPORT QEGLPlatformContext : public QPlatformOpenGLContext, - public QPlatformInterface::QEGLContext + public QNativeInterface::QEGLContext { public: enum Flag { diff --git a/src/gui/platform/android/qandroidplatforminterface.cpp b/src/gui/platform/android/qandroidplatforminterface.cpp index 0a2c708d7ae..bdb322add0b 100644 --- a/src/gui/platform/android/qandroidplatforminterface.cpp +++ b/src/gui/platform/android/qandroidplatforminterface.cpp @@ -45,13 +45,13 @@ QT_BEGIN_NAMESPACE -using namespace QPlatformInterface::Private; +using namespace QNativeInterface::Private; #if defined(Q_OS_ANDROID) -QT_DEFINE_PLATFORM_INTERFACE(QAndroidOffscreenSurface, QOffscreenSurface); -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QAndroidOffScreenIntegration); +QT_DEFINE_NATIVE_INTERFACE(QAndroidOffscreenSurface, QOffscreenSurface); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QAndroidOffScreenIntegration); -QOffscreenSurface *QPlatformInterface::QAndroidOffscreenSurface::fromNative(ANativeWindow *nativeSurface) +QOffscreenSurface *QNativeInterface::QAndroidOffscreenSurface::fromNative(ANativeWindow *nativeSurface) { return QGuiApplicationPrivate::platformIntegration()->call< &QAndroidOffScreenIntegration::createOffscreenSurface>(nativeSurface); diff --git a/src/gui/platform/macos/qcocoaplatforminterface.mm b/src/gui/platform/macos/qcocoaplatforminterface.mm index be9e8d18bf1..c075a07e663 100644 --- a/src/gui/platform/macos/qcocoaplatforminterface.mm +++ b/src/gui/platform/macos/qcocoaplatforminterface.mm @@ -48,17 +48,17 @@ QT_BEGIN_NAMESPACE -using namespace QPlatformInterface::Private; +using namespace QNativeInterface::Private; #ifndef QT_NO_OPENGL -QT_DEFINE_PLATFORM_INTERFACE(QCocoaGLContext, QOpenGLContext); -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QCocoaGLIntegration); -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QCocoaWindow); -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QCocoaMenu); -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QCocoaMenuBar); +QT_DEFINE_NATIVE_INTERFACE(QCocoaGLContext, QOpenGLContext); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QCocoaGLIntegration); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QCocoaWindow); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QCocoaMenu); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QCocoaMenuBar); -QOpenGLContext *QPlatformInterface::QCocoaGLContext::fromNative(NSOpenGLContext *nativeContext, QOpenGLContext *shareContext) +QOpenGLContext *QNativeInterface::QCocoaGLContext::fromNative(NSOpenGLContext *nativeContext, QOpenGLContext *shareContext) { return QGuiApplicationPrivate::platformIntegration()->call< &QCocoaGLIntegration::createOpenGLContext>(nativeContext, shareContext); diff --git a/src/gui/platform/unix/qunixplatforminterface.cpp b/src/gui/platform/unix/qunixplatforminterface.cpp index 55650e3efcc..378282936ee 100644 --- a/src/gui/platform/unix/qunixplatforminterface.cpp +++ b/src/gui/platform/unix/qunixplatforminterface.cpp @@ -51,21 +51,21 @@ QT_BEGIN_NAMESPACE -using namespace QPlatformInterface::Private; +using namespace QNativeInterface::Private; #ifndef QT_NO_OPENGL #if defined(Q_OS_LINUX) -QT_DEFINE_PLATFORM_INTERFACE(QGLXContext, QOpenGLContext); -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QGLXIntegration); +QT_DEFINE_NATIVE_INTERFACE(QGLXContext, QOpenGLContext); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QGLXIntegration); -QOpenGLContext *QPlatformInterface::QGLXContext::fromNative(GLXContext configBasedContext, QOpenGLContext *shareContext) +QOpenGLContext *QNativeInterface::QGLXContext::fromNative(GLXContext configBasedContext, QOpenGLContext *shareContext) { return QGuiApplicationPrivate::platformIntegration()->call< &QGLXIntegration::createOpenGLContext>(configBasedContext, nullptr, shareContext); } -QOpenGLContext *QPlatformInterface::QGLXContext::fromNative(GLXContext visualBasedContext, void *visualInfo, QOpenGLContext *shareContext) +QOpenGLContext *QNativeInterface::QGLXContext::fromNative(GLXContext visualBasedContext, void *visualInfo, QOpenGLContext *shareContext) { return QGuiApplicationPrivate::platformIntegration()->call< &QGLXIntegration::createOpenGLContext>(visualBasedContext, visualInfo, shareContext); @@ -73,10 +73,10 @@ QOpenGLContext *QPlatformInterface::QGLXContext::fromNative(GLXContext visualBas #endif #if QT_CONFIG(egl) -QT_DEFINE_PLATFORM_INTERFACE(QEGLContext, QOpenGLContext); -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QEGLIntegration); +QT_DEFINE_NATIVE_INTERFACE(QEGLContext, QOpenGLContext); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QEGLIntegration); -QOpenGLContext *QPlatformInterface::QEGLContext::fromNative(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) +QOpenGLContext *QNativeInterface::QEGLContext::fromNative(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) { return QGuiApplicationPrivate::platformIntegration()->call< &QEGLIntegration::createOpenGLContext>(context, display, shareContext); @@ -86,19 +86,19 @@ QOpenGLContext *QPlatformInterface::QEGLContext::fromNative(EGLContext context, #endif // QT_NO_OPENGL #if QT_CONFIG(xcb) -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QXcbScreen); -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QXcbWindow); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QXcbScreen); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QXcbWindow); #endif #if QT_CONFIG(vsp2) -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QVsp2Screen); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QVsp2Screen); #endif #if QT_CONFIG(evdev) -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QEvdevKeyMapper); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QEvdevKeyMapper); template <> -QEvdevKeyMapper *QKeyMapper::platformInterface() const +QEvdevKeyMapper *QKeyMapper::nativeInterface() const { return dynamic_cast(QGuiApplicationPrivate::platformIntegration()); } diff --git a/src/gui/platform/windows/qwindowsmime_p.h b/src/gui/platform/windows/qwindowsmime_p.h index 5d71b9ee947..71b1c8a87fd 100644 --- a/src/gui/platform/windows/qwindowsmime_p.h +++ b/src/gui/platform/windows/qwindowsmime_p.h @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE class QMimeData; -namespace QPlatformInterface::Private { +namespace QNativeInterface::Private { class Q_GUI_EXPORT QWindowsMime { @@ -78,7 +78,7 @@ public: virtual QString mimeForFormat(const FORMATETC &formatetc) const = 0; }; -} // QPlatformInterface::Private +} // QNativeInterface::Private QT_END_NAMESPACE diff --git a/src/gui/platform/windows/qwindowsplatforminterface.cpp b/src/gui/platform/windows/qwindowsplatforminterface.cpp index e1aa3b69708..950c86d7fb1 100644 --- a/src/gui/platform/windows/qwindowsplatforminterface.cpp +++ b/src/gui/platform/windows/qwindowsplatforminterface.cpp @@ -47,20 +47,20 @@ QT_BEGIN_NAMESPACE -using namespace QPlatformInterface::Private; +using namespace QNativeInterface::Private; #ifndef QT_NO_OPENGL -QT_DEFINE_PLATFORM_INTERFACE(QWGLContext, QOpenGLContext); -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QWindowsGLIntegration); +QT_DEFINE_NATIVE_INTERFACE(QWGLContext, QOpenGLContext); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsGLIntegration); -HMODULE QPlatformInterface::QWGLContext::openGLModuleHandle() +HMODULE QNativeInterface::QWGLContext::openGLModuleHandle() { return QGuiApplicationPrivate::platformIntegration()->call< &QWindowsGLIntegration::openGLModuleHandle>(); } -QOpenGLContext *QPlatformInterface::QWGLContext::fromNative(HGLRC context, HWND window, QOpenGLContext *shareContext) +QOpenGLContext *QNativeInterface::QWGLContext::fromNative(HGLRC context, HWND window, QOpenGLContext *shareContext) { return QGuiApplicationPrivate::platformIntegration()->call< &QWindowsGLIntegration::createOpenGLContext>(context, window, shareContext); @@ -68,7 +68,7 @@ QOpenGLContext *QPlatformInterface::QWGLContext::fromNative(HGLRC context, HWND #endif // QT_NO_OPENGL -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QWindowsApplication); -QT_DEFINE_PRIVATE_PLATFORM_INTERFACE(QWindowsWindow); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsApplication); +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsWindow); QT_END_NAMESPACE diff --git a/src/plugins/platforms/android/qandroidplatformintegration.h b/src/plugins/platforms/android/qandroidplatformintegration.h index 012616839c9..d579bc29aeb 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/qandroidplatformintegration.h @@ -72,8 +72,8 @@ protected: }; class QAndroidPlatformIntegration : public QPlatformIntegration - , QPlatformInterface::Private::QEGLIntegration - , QPlatformInterface::Private::QAndroidOffScreenIntegration + , QNativeInterface::Private::QEGLIntegration + , QNativeInterface::Private::QAndroidOffScreenIntegration { friend class QAndroidPlatformScreen; diff --git a/src/plugins/platforms/android/qandroidplatformoffscreensurface.h b/src/plugins/platforms/android/qandroidplatformoffscreensurface.h index 3eef7275961..e57ab2afad7 100644 --- a/src/plugins/platforms/android/qandroidplatformoffscreensurface.h +++ b/src/plugins/platforms/android/qandroidplatformoffscreensurface.h @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE class QOffscreenSurface; class QAndroidPlatformOffscreenSurface : public QPlatformOffscreenSurface, - public QPlatformInterface::QAndroidOffscreenSurface + public QNativeInterface::QAndroidOffscreenSurface { public: QAndroidPlatformOffscreenSurface(ANativeWindow *nativeSurface, EGLDisplay display, QOffscreenSurface *offscreenSurface); diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.h b/src/plugins/platforms/cocoa/qcocoaglcontext.h index ab8e9d30129..633b9256c8c 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.h +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE class QCocoaWindow; -class QCocoaGLContext : public QPlatformOpenGLContext, public QPlatformInterface::QCocoaGLContext +class QCocoaGLContext : public QPlatformOpenGLContext, public QNativeInterface::QCocoaGLContext { public: QCocoaGLContext(QOpenGLContext *context); diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h index 1e330344afd..4f1969dd982 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.h +++ b/src/plugins/platforms/cocoa/qcocoaintegration.h @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE class QCocoaIntegration : public QObject, public QPlatformIntegration #ifndef QT_NO_OPENGL - , public QPlatformInterface::Private::QCocoaGLIntegration + , public QNativeInterface::Private::QCocoaGLIntegration #endif { Q_OBJECT diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h index 6bd033bfeb6..1bf9cface04 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.h +++ b/src/plugins/platforms/cocoa/qcocoamenu.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE class QCocoaMenuBar; class QCocoaMenu : public QPlatformMenu, public QCocoaMenuObject - , public QPlatformInterface::Private::QCocoaMenu + , public QNativeInterface::Private::QCocoaMenu { public: QCocoaMenu(); diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.h b/src/plugins/platforms/cocoa/qcocoamenubar.h index 94333e3bb14..7186e48829a 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.h +++ b/src/plugins/platforms/cocoa/qcocoamenubar.h @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE class QCocoaWindow; class QCocoaMenuBar : public QPlatformMenuBar - , public QPlatformInterface::Private::QCocoaMenuBar + , public QNativeInterface::Private::QCocoaMenuBar { Q_OBJECT public: diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index d7c4a665144..9a2fa5f0251 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -100,7 +100,7 @@ class QDebug; class QCocoaMenuBar; class QCocoaWindow : public QObject, public QPlatformWindow, - public QPlatformInterface::Private::QCocoaWindow + public QNativeInterface::Private::QCocoaWindow { Q_OBJECT public: diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h b/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h index 9bc24f36f97..5ba24b107a6 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h +++ b/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h @@ -70,10 +70,10 @@ class QEvdevKeyboardManager; class Q_EGLFS_EXPORT QEglFSIntegration : public QPlatformIntegration, public QPlatformNativeInterface #if QT_CONFIG(evdev) - , public QPlatformInterface::Private::QEvdevKeyMapper + , public QNativeInterface::Private::QEvdevKeyMapper #endif #ifndef QT_NO_OPENGL - , public QPlatformInterface::Private::QEGLIntegration + , public QNativeInterface::Private::QEGLIntegration #endif { public: diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.h index 369d175bcf7..b3dfa77e1be 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE class QEglFSKmsVsp2Screen : public QEglFSKmsScreen - , public QPlatformInterface::Private::QVsp2Screen + , public QNativeInterface::Private::QVsp2Screen { public: QEglFSKmsVsp2Screen(QEglFSKmsDevice *device, const QKmsOutput &output); diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.h b/src/plugins/platforms/linuxfb/qlinuxfbintegration.h index 1e671ee7fc4..3481abb47da 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.h +++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.h @@ -53,7 +53,7 @@ class QEvdevKeyboardManager; class QLinuxFbIntegration : public QPlatformIntegration, public QPlatformNativeInterface #if QT_CONFIG(evdev) - , public QPlatformInterface::Private::QEvdevKeyMapper + , public QNativeInterface::Private::QEvdevKeyMapper #endif { public: diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h index 005ac26151c..01a75510fb5 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h +++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h @@ -90,7 +90,7 @@ private: class QOffscreenX11GLXContextData; class QOffscreenX11GLXContext : public QPlatformOpenGLContext - , public QPlatformInterface::QGLXContext + , public QNativeInterface::QGLXContext { public: QOffscreenX11GLXContext(QOffscreenX11Info *x11, QOpenGLContext *context); diff --git a/src/plugins/platforms/windows/qwindowsapplication.cpp b/src/plugins/platforms/windows/qwindowsapplication.cpp index fc495d999f1..9997e0a9036 100644 --- a/src/plugins/platforms/windows/qwindowsapplication.cpp +++ b/src/plugins/platforms/windows/qwindowsapplication.cpp @@ -112,13 +112,13 @@ void QWindowsApplication::setDarkModeHandling(QWindowsApplication::DarkModeHandl m_darkModeHandling = handling; } -void QWindowsApplication::registerMime(QPlatformInterface::Private::QWindowsMime *mime) +void QWindowsApplication::registerMime(QNativeInterface::Private::QWindowsMime *mime) { if (auto ctx = QWindowsContext::instance()) ctx->mimeConverter().registerMime(mime); } -void QWindowsApplication::unregisterMime(QPlatformInterface::Private::QWindowsMime *mime) +void QWindowsApplication::unregisterMime(QNativeInterface::Private::QWindowsMime *mime) { if (auto ctx = QWindowsContext::instance()) ctx->mimeConverter().unregisterMime(mime); diff --git a/src/plugins/platforms/windows/qwindowsapplication.h b/src/plugins/platforms/windows/qwindowsapplication.h index 25a0cc74377..d57ce263c96 100644 --- a/src/plugins/platforms/windows/qwindowsapplication.h +++ b/src/plugins/platforms/windows/qwindowsapplication.h @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE -class QWindowsApplication : public QPlatformInterface::Private::QWindowsApplication +class QWindowsApplication : public QNativeInterface::Private::QWindowsApplication { public: void setTouchWindowTouchType(TouchWindowTouchTypes type) override; @@ -62,8 +62,8 @@ public: DarkModeHandling darkModeHandling() const override; void setDarkModeHandling(DarkModeHandling handling) override; - void registerMime(QPlatformInterface::Private::QWindowsMime *mime) override; - void unregisterMime(QPlatformInterface::Private::QWindowsMime *mime) override; + void registerMime(QNativeInterface::Private::QWindowsMime *mime) override; + void unregisterMime(QNativeInterface::Private::QWindowsMime *mime) override; int registerMimeType(const QString &mime) override; diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h index 2970f3d3330..0e8383e5c04 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.h +++ b/src/plugins/platforms/windows/qwindowsglcontext.h @@ -200,7 +200,7 @@ public: static QWindowsOpengl32DLL opengl32; }; -class QWindowsGLContext : public QWindowsOpenGLContext, public QPlatformInterface::QWGLContext +class QWindowsGLContext : public QWindowsOpenGLContext, public QNativeInterface::QWGLContext { public: explicit QWindowsGLContext(QOpenGLStaticContext *staticContext, QOpenGLContext *context); diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 6ec5f6e37fc..74e6985980f 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -183,8 +183,8 @@ bool parseIntOption(const QString ¶meter,const QLatin1String &option, return true; } -using DarkModeHandlingFlag = QPlatformInterface::Private::QWindowsApplication::DarkModeHandlingFlag; -using DarkModeHandling = QPlatformInterface::Private::QWindowsApplication::DarkModeHandling; +using DarkModeHandlingFlag = QNativeInterface::Private::QWindowsApplication::DarkModeHandlingFlag; +using DarkModeHandling = QNativeInterface::Private::QWindowsApplication::DarkModeHandling; static inline unsigned parseOptions(const QStringList ¶mList, int *tabletAbsoluteRange, diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h index e0af1e65121..b5449b4a458 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.h +++ b/src/plugins/platforms/windows/qwindowsintegration.h @@ -58,7 +58,7 @@ class QWindowsStaticOpenGLContext; class QWindowsIntegration : public QPlatformIntegration #ifndef QT_NO_OPENGL - , public QPlatformInterface::Private::QWindowsGLIntegration + , public QNativeInterface::Private::QWindowsGLIntegration #endif , public QWindowsApplication { diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp index 9c43045d6a8..49bbe88d346 100644 --- a/src/plugins/platforms/windows/qwindowsmime.cpp +++ b/src/plugins/platforms/windows/qwindowsmime.cpp @@ -544,7 +544,7 @@ QDebug operator<<(QDebug d, IDataObject *dataObj) All subclasses must reimplement this pure virtual function. */ -class QWindowsMimeText : public QPlatformInterface::Private::QWindowsMime +class QWindowsMimeText : public QNativeInterface::Private::QWindowsMime { public: bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const override; @@ -700,7 +700,7 @@ QVariant QWindowsMimeText::convertToMime(const QString &mime, LPDATAOBJECT pData return ret; } -class QWindowsMimeURI : public QPlatformInterface::Private::QWindowsMime +class QWindowsMimeURI : public QNativeInterface::Private::QWindowsMime { public: QWindowsMimeURI(); @@ -866,7 +866,7 @@ QVariant QWindowsMimeURI::convertToMime(const QString &mimeType, LPDATAOBJECT pD return QVariant(); } -class QWindowsMimeHtml : public QPlatformInterface::Private::QWindowsMime +class QWindowsMimeHtml : public QNativeInterface::Private::QWindowsMime { public: QWindowsMimeHtml(); @@ -1004,7 +1004,7 @@ bool QWindowsMimeHtml::convertFromMime(const FORMATETC &formatetc, const QMimeDa #ifndef QT_NO_IMAGEFORMAT_BMP -class QWindowsMimeImage : public QPlatformInterface::Private::QWindowsMime +class QWindowsMimeImage : public QNativeInterface::Private::QWindowsMime { public: QWindowsMimeImage(); @@ -1158,7 +1158,7 @@ QVariant QWindowsMimeImage::convertToMime(const QString &mimeType, IDataObject * } #endif -class QBuiltInMimes : public QPlatformInterface::Private::QWindowsMime +class QBuiltInMimes : public QNativeInterface::Private::QWindowsMime { public: QBuiltInMimes(); @@ -1279,7 +1279,7 @@ QString QBuiltInMimes::mimeForFormat(const FORMATETC &formatetc) const } -class QLastResortMimes : public QPlatformInterface::Private::QWindowsMime +class QLastResortMimes : public QNativeInterface::Private::QWindowsMime { public: diff --git a/src/plugins/platforms/windows/qwindowsmime.h b/src/plugins/platforms/windows/qwindowsmime.h index 891ec44ecd0..e131dba8488 100644 --- a/src/plugins/platforms/windows/qwindowsmime.h +++ b/src/plugins/platforms/windows/qwindowsmime.h @@ -56,7 +56,7 @@ class QWindowsMimeConverter { Q_DISABLE_COPY_MOVE(QWindowsMimeConverter) public: - using QWindowsMime = QPlatformInterface::Private::QWindowsMime; + using QWindowsMime = QNativeInterface::Private::QWindowsMime; QWindowsMimeConverter(); ~QWindowsMimeConverter(); diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 827e4cc288e..1f1af82da22 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -125,12 +125,12 @@ struct QWindowsWindowData }; class QWindowsBaseWindow : public QPlatformWindow, - public QPlatformInterface::Private::QWindowsWindow + public QNativeInterface::Private::QWindowsWindow { Q_DISABLE_COPY_MOVE(QWindowsBaseWindow) public: - using TouchWindowTouchType = QPlatformInterface::Private::QWindowsApplication::TouchWindowTouchType; - using TouchWindowTouchTypes = QPlatformInterface::Private::QWindowsApplication::TouchWindowTouchTypes; + using TouchWindowTouchType = QNativeInterface::Private::QWindowsApplication::TouchWindowTouchType; + using TouchWindowTouchTypes = QNativeInterface::Private::QWindowsApplication::TouchWindowTouchTypes; explicit QWindowsBaseWindow(QWindow *window) : QPlatformWindow(window) {} diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h index ddb44881053..be5c75aedc9 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler; class QXcbEglIntegration : public QXcbGlIntegration - , public QPlatformInterface::Private::QEGLIntegration + , public QNativeInterface::Private::QEGLIntegration { public: QXcbEglIntegration(); diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h index a7468c8facb..62a9247fd98 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext, - public QPlatformInterface::QGLXContext + public QNativeInterface::QGLXContext { public: QGLXContext(Display *display, QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share); diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h index 18c1be94895..6b0c6dfee20 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE class QXcbNativeInterfaceHandler; class QXcbGlxIntegration : public QXcbGlIntegration, - public QPlatformInterface::Private::QGLXIntegration + public QNativeInterface::Private::QGLXIntegration { public: QXcbGlxIntegration(); diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 5dd6fbe57a7..89395cb21de 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -276,7 +276,7 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont QOpenGLContext *QXcbIntegration::createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const { - using namespace QPlatformInterface::Private; + using namespace QNativeInterface::Private; if (auto *glxIntegration = dynamic_cast(m_connection->glIntegration())) return glxIntegration->createOpenGLContext(context, visualInfo, shareContext); else @@ -286,7 +286,7 @@ QOpenGLContext *QXcbIntegration::createOpenGLContext(GLXContext context, void *v #if QT_CONFIG(egl) QOpenGLContext *QXcbIntegration::createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const { - using namespace QPlatformInterface::Private; + using namespace QNativeInterface::Private; if (auto *eglIntegration = dynamic_cast(m_connection->glIntegration())) return eglIntegration->createOpenGLContext(context, display, shareContext); else diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h index 043dc13711e..eb584339671 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.h +++ b/src/plugins/platforms/xcb/qxcbintegration.h @@ -57,9 +57,9 @@ class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration #ifndef QT_NO_OPENGL - , public QPlatformInterface::Private::QGLXIntegration + , public QNativeInterface::Private::QGLXIntegration # if QT_CONFIG(egl) - , public QPlatformInterface::Private::QEGLIntegration + , public QNativeInterface::Private::QEGLIntegration # endif #endif { diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index 9be3ce9e7f1..267c8b89110 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -139,7 +139,7 @@ private: }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen - , public QPlatformInterface::Private::QXcbScreen + , public QNativeInterface::Private::QXcbScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index c05e6586525..5e5aa96629d 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -57,7 +57,7 @@ class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow - , public QPlatformInterface::Private::QXcbWindow + , public QNativeInterface::Private::QXcbWindow { public: enum NetWmState { diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp index a324de0fc81..b0aab59d995 100644 --- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp +++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp @@ -279,7 +279,7 @@ void QWindowsXPStylePrivate::cleanup(bool force) static inline HWND createTreeViewHelperWindow() { - using QWindowsApplication = QPlatformInterface::Private::QWindowsApplication; + using QWindowsApplication = QNativeInterface::Private::QWindowsApplication; HWND result = nullptr; if (auto nativeWindowsApp = dynamic_cast(QGuiApplicationPrivate::platformIntegration())) diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index 9575dc7fba9..692583666df 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -168,7 +168,7 @@ QVistaHelper::~QVistaHelper() void QVistaHelper::updateCustomMargins(bool vistaMargins) { - using namespace QPlatformInterface::Private; + using namespace QNativeInterface::Private; if (QWindow *window = wizard->windowHandle()) { // Reduce top frame to zero since we paint it ourselves. Use diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 8040560e7c1..4bcc0f5df04 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -121,7 +121,7 @@ QT_BEGIN_NAMESPACE -using namespace QPlatformInterface::Private; +using namespace QNativeInterface::Private; Q_LOGGING_CATEGORY(lcWidgetPainting, "qt.widgets.painting", QtWarningMsg); diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index e3c2a54051c..28a195bba88 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -133,7 +133,7 @@ bool QWindowsStylePrivate::isDarkMode() { bool result = false; #ifdef Q_OS_WIN - using QWindowsApplication = QPlatformInterface::Private::QWindowsApplication; + using QWindowsApplication = QNativeInterface::Private::QWindowsApplication; // Windows only: Return whether dark mode style support is desired and // dark mode is in effect. if (auto windowsApp = dynamic_cast(QGuiApplicationPrivate::platformIntegration())) { diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index aa6706f0bb5..8aa2c24592d 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1360,7 +1360,7 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool enabled) d->useUnifiedToolBar = enabled; createWinId(); - using namespace QPlatformInterface::Private; + using namespace QNativeInterface::Private; if (auto *platformWindow = dynamic_cast(window()->windowHandle()->handle())) platformWindow->setContentBorderEnabled(enabled); diff --git a/src/widgets/widgets/qmenu_mac.mm b/src/widgets/widgets/qmenu_mac.mm index 7bff4f33417..d6e09d9512e 100644 --- a/src/widgets/widgets/qmenu_mac.mm +++ b/src/widgets/widgets/qmenu_mac.mm @@ -56,7 +56,7 @@ QT_USE_NAMESPACE #include #include -using namespace QPlatformInterface::Private; +using namespace QNativeInterface::Private; QT_BEGIN_NAMESPACE diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp index 0df949acba4..790b53ff9fa 100644 --- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp @@ -446,8 +446,8 @@ void tst_QClipboard::clearBeforeSetText() # ifdef Q_OS_WIN -using QWindowsMime = QPlatformInterface::Private::QWindowsMime; -using QWindowsApplication = QPlatformInterface::Private::QWindowsApplication; +using QWindowsMime = QNativeInterface::Private::QWindowsMime; +using QWindowsApplication = QNativeInterface::Private::QWindowsApplication; class TestMime : public QWindowsMime { diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp index 5e244a4ae9e..903b617ae87 100644 --- a/tests/auto/gui/qopengl/tst_qopengl.cpp +++ b/tests/auto/gui/qopengl/tst_qopengl.cpp @@ -1472,7 +1472,7 @@ void tst_QOpenGL::defaultSurfaceFormat() QCOMPARE(context->format(), fmt); } -using namespace QPlatformInterface; +using namespace QNativeInterface; #ifdef USE_GLX void tst_QOpenGL::glxContextWrap() @@ -1490,7 +1490,7 @@ void tst_QOpenGL::glxContextWrap() QOpenGLContext *ctx0 = new QOpenGLContext; ctx0->setFormat(window->format()); QVERIFY(ctx0->create()); - auto *glxContextIf = ctx0->platformInterface(); + auto *glxContextIf = ctx0->nativeInterface(); QVERIFY(glxContextIf); GLXContext context = glxContextIf->nativeContext(); QVERIFY(context); @@ -1524,7 +1524,7 @@ void tst_QOpenGL::wglContextWrap() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window.data())); - auto *wglContext = ctx->platformInterface(); + auto *wglContext = ctx->nativeInterface(); QVERIFY(wglContext); QVERIFY(wglContext->nativeContext()); diff --git a/tests/manual/qopenglcontext/qopenglcontextwindow.cpp b/tests/manual/qopenglcontext/qopenglcontextwindow.cpp index 4a369f8eda8..07147a4488e 100644 --- a/tests/manual/qopenglcontext/qopenglcontextwindow.cpp +++ b/tests/manual/qopenglcontext/qopenglcontextwindow.cpp @@ -97,8 +97,8 @@ void QOpenGLContextWindow::createForeignContext() // underlying native context. This way the texture, that belongs to the context // created here, will be accessible from m_context too. - using namespace QPlatformInterface; - auto *eglContext = m_context->platformInterface(); + using namespace QNativeInterface; + auto *eglContext = m_context->nativeInterface(); if (!eglContext) qFatal("Not running with EGL backend"); @@ -132,7 +132,7 @@ void QOpenGLContextWindow::createForeignContext() // Wrap ctx into a QOpenGLContext. QOpenGLContext *ctxWrap = QEGLContext::fromNative(ctx, dpy, m_context); - Q_ASSERT(ctxWrap->platformInterface()->nativeContext() == ctx); + Q_ASSERT(ctxWrap->nativeInterface()->nativeContext() == ctx); QOffscreenSurface surface; surface.setFormat(fmt); diff --git a/tests/manual/qtabletevent/regular_widgets/main.cpp b/tests/manual/qtabletevent/regular_widgets/main.cpp index 9f20f5412f8..3b112450b4a 100644 --- a/tests/manual/qtabletevent/regular_widgets/main.cpp +++ b/tests/manual/qtabletevent/regular_widgets/main.cpp @@ -52,7 +52,7 @@ enum TabletPointType { }; #ifdef Q_OS_WIN -using QWindowsApplication = QPlatformInterface::Private::QWindowsApplication; +using QWindowsApplication = QNativeInterface::Private::QWindowsApplication; static void setWinTabEnabled(bool e) { diff --git a/tests/manual/touch/main.cpp b/tests/manual/touch/main.cpp index c09d951ff00..fdba80d7bb0 100644 --- a/tests/manual/touch/main.cpp +++ b/tests/manual/touch/main.cpp @@ -430,7 +430,7 @@ private slots: void touchTypeToggled(); private: - using QWindowsApplication = QPlatformInterface::Private::QWindowsApplication; + using QWindowsApplication = QNativeInterface::Private::QWindowsApplication; using TouchWindowTouchType = QWindowsApplication::TouchWindowTouchType; using TouchWindowTouchTypes = QWindowsApplication::QWindowsApplication::TouchWindowTouchTypes; diff --git a/tests/manual/widgets/widgets/defaultUpMenuBar/main.cpp b/tests/manual/widgets/widgets/defaultUpMenuBar/main.cpp index e9e1d91e371..2a78f9d0f02 100644 --- a/tests/manual/widgets/widgets/defaultUpMenuBar/main.cpp +++ b/tests/manual/widgets/widgets/defaultUpMenuBar/main.cpp @@ -118,7 +118,7 @@ int main(int argc, char **argv) MainWindow *mainWindow = new MainWindow; mainWindow->setGeometry(screen->geometry()); mainWindow->winId(); - using namespace QPlatformInterface::Private; + using namespace QNativeInterface::Private; if (auto *windowsWindow = dynamic_cast(mainWindow->windowHandle()->handle())) windowsWindow->setHasBorderInFullScreen(true); mainWindow->showMaximized();