From 037238022f3a91a5619709b2c7cf4b38cd4d294b Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 19 Jun 2012 13:21:35 -0700 Subject: [PATCH] Make QWindowSystemInterface part of QPA API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As discussed on mailing list and QtCS 2012. Any file starting with qwindowsystem is now marked as QPA API. This change drops _qpa from the filenames and adds gui-private where required for the code to compile. This change is backward compatible otherwise and compat headers are created for the old inclusion headers. Change-Id: I72ea0f394dee74f46e614fcf11ab5500ac9fef2a Reviewed-by: Samuel Rødal --- bin/syncqt | 14 ++++++++++++-- src/gui/kernel/kernel.pri | 4 ++-- src/gui/kernel/qguiapplication_p.h | 4 ++-- ...teminterface_qpa.h => qwindowsysteminterface.h} | 9 +++++++++ ...nterface_qpa_p.h => qwindowsysteminterface_p.h} | 8 ++++---- src/gui/kernel/qwindowsysteminterface_qpa.cpp | 4 ++-- src/testlib/qtestkeyboard.h | 2 +- src/testlib/qtestmouse.h | 2 +- src/testlib/qtesttouch.h | 2 +- sync.profile | 6 +++++- 10 files changed, 39 insertions(+), 16 deletions(-) rename src/gui/kernel/{qwindowsysteminterface_qpa.h => qwindowsysteminterface.h} (97%) rename src/gui/kernel/{qwindowsysteminterface_qpa_p.h => qwindowsysteminterface_p.h} (98%) diff --git a/bin/syncqt b/bin/syncqt index 5f8bbe248a..23230c2c4b 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -88,6 +88,7 @@ normalizePath(\$qtbasedir) if (defined $qtbasedir); # will be defined based on the modules sync.profile our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %modulepris, %explicitheaders, %deprecatedheaders); +our @qpa_headers = (); # global variables (modified by options) my $isunix = 0; @@ -584,6 +585,15 @@ sub locateSyncProfile } } +sub isQpaHeader +{ + my ($header) = @_; + foreach my $qpa_header (@qpa_headers) { + return 1 if ($header =~ $qpa_header); + } + return 0; +} + # check if this is an in-source build, and if so use that as the basedir too $basedir = locateSyncProfile($out_basedir); if ($basedir) { @@ -910,7 +920,7 @@ foreach my $lib (@modules_to_sync) { #figure out if it is a public header my $public_header = $header; my $qpa_header = 0; - if($public_header =~ /^qplatform/) { + if(isQpaHeader($public_header)) { $public_header = 0; $qpa_header = 1; } elsif($allheadersprivate || $public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) { @@ -1200,7 +1210,7 @@ if($check_includes) { my $public_header = $header; if($public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) { $public_header = 0; - } elsif ($public_header =~ /^qplatform/) { + } elsif (isQpaHeader($public_header)) { $public_header = 0; } else { foreach (@ignore_for_master_contents) { diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index 9825633358..efa79b5cc0 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -8,8 +8,8 @@ KERNEL_P= kernel HEADERS += \ kernel/qgenericpluginfactory_qpa.h \ kernel/qgenericplugin_qpa.h \ - kernel/qwindowsysteminterface_qpa.h \ - kernel/qwindowsysteminterface_qpa_p.h \ + kernel/qwindowsysteminterface.h \ + kernel/qwindowsysteminterface_p.h \ kernel/qplatformintegration.h \ kernel/qplatformdrag.h \ kernel/qplatformscreen.h \ diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index a9fe118f2b..857dc5390e 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -49,8 +49,8 @@ #include -#include -#include "private/qwindowsysteminterface_qpa_p.h" +#include +#include #include "private/qshortcutmap_p.h" #include diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.h b/src/gui/kernel/qwindowsysteminterface.h similarity index 97% rename from src/gui/kernel/qwindowsysteminterface_qpa.h rename to src/gui/kernel/qwindowsysteminterface.h index b55f3e3f33..0382ac6dbf 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -41,6 +41,15 @@ #ifndef QWINDOWSYSTEMINTERFACE_H #define QWINDOWSYSTEMINTERFACE_H +// +// W A R N I N G +// ------------- +// +// This file is part of the QPA API and is not meant to be used +// in applications. Usage of this API may make your code +// source and binary incompatible with future versions of Qt. +// + #include #include #include diff --git a/src/gui/kernel/qwindowsysteminterface_qpa_p.h b/src/gui/kernel/qwindowsysteminterface_p.h similarity index 98% rename from src/gui/kernel/qwindowsysteminterface_qpa_p.h rename to src/gui/kernel/qwindowsysteminterface_p.h index 8fb0652eb6..26f4cd68bb 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QWINDOWSYSTEMINTERFACE_QPA_P_H -#define QWINDOWSYSTEMINTERFACE_QPA_P_H +#ifndef QWINDOWSYSTEMINTERFACE_P_H +#define QWINDOWSYSTEMINTERFACE_P_H -#include "qwindowsysteminterface_qpa.h" +#include "qwindowsysteminterface.h" #include #include @@ -338,4 +338,4 @@ public: QT_END_HEADER QT_END_NAMESPACE -#endif // QWINDOWSYSTEMINTERFACE_QPA_P_H +#endif // QWINDOWSYSTEMINTERFACE_P_H diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index 139df98daf..e884d7caf9 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -38,9 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "qwindowsysteminterface_qpa.h" +#include "qwindowsysteminterface.h" #include -#include "qwindowsysteminterface_qpa_p.h" +#include "qwindowsysteminterface_p.h" #include "private/qguiapplication_p.h" #include "private/qevent_p.h" #include "private/qtouchdevice_p.h" diff --git a/src/testlib/qtestkeyboard.h b/src/testlib/qtestkeyboard.h index 2e43e864d5..7c37d07a0b 100644 --- a/src/testlib/qtestkeyboard.h +++ b/src/testlib/qtestkeyboard.h @@ -56,7 +56,7 @@ #include #include #include -#include +#include #ifdef QT_WIDGETS_LIB #include diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h index 4ee31ff47f..910914bdbc 100644 --- a/src/testlib/qtestmouse.h +++ b/src/testlib/qtestmouse.h @@ -54,7 +54,7 @@ #include #include #include -#include +#include #ifdef QT_WIDGETS_LIB #include diff --git a/src/testlib/qtesttouch.h b/src/testlib/qtesttouch.h index 6e456f375c..e19c60f812 100644 --- a/src/testlib/qtesttouch.h +++ b/src/testlib/qtesttouch.h @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include #ifdef QT_WIDGETS_LIB diff --git a/sync.profile b/sync.profile index 460e7083bd..d5c897ac72 100644 --- a/sync.profile +++ b/sync.profile @@ -87,7 +87,10 @@ "qplatformthemeplugin_qpa.h" => "qpa/qplatformthemeplugin.h", "QPlatformThemePlugin" => "qpa/qplatformthemeplugin.h", "qplatformwindow_qpa.h" => "qpa/qplatformwindow.h", - "QPlatformWindow" => "qpa/qplatformwindow.h" + "QPlatformWindow" => "qpa/qplatformwindow.h", + "qwindowsysteminterface_qpa.h" => "qpa/qwindowsysteminterface.h", + "QWindowSystemInterface" => "qpa/qwindowsysteminterface.h", + "qwindowsysteminterface_qpa_p.h" => "qpa/qwindowsysteminterface_p.h" }, "QtWidgets" => { "qplatformmenu_qpa.h" => "qpa/qplatformmenu.h", @@ -120,6 +123,7 @@ } ); +@qpa_headers = ( qr/^qplatform/, qr/^qwindowsystem/ ); @ignore_for_include_check = ( "qsystemdetection.h", "qcompilerdetection.h", "qprocessordetection.h" ); @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qt_windows.h" ); @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" );