From 36547f4eff44361f7a6acd0cff107c0e47561f93 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 27 Apr 2012 01:33:35 +0200 Subject: Expose QPA API under qpa/* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The main reasons for doing this are: 1. _qpa.h end up in the master QtGui include file. QtGui is meant for userland applications. qpa code is neither binary nor source compatible. Inadvertant use of QPA api makes the user code binary-incompatible. 2. syncqt creates forwarding headers for non-private header files. This gives people the impression that this is public API. As discussed on the mailing list, even though QPA api is internal and subject to change, it needs to treated differently from private headers since they will be used by in-qtbase and out-of-qtbase plugins. This commit does the following: 1. The _qpa in QPA header files is dropped. 2. syncqt now treats any file with qplatform prefix as a special file and moves it to qpa/ directory. The recommended way of using QPA API in plugins is: #include . This allows the user include QPA API from multiple modules (for example, qplatformfoo might be in QtPrintSupport) 3. The user needs to explicitly add QT += -private to get access to the qpa api. 4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo includes. This commit does not change the cpp filenames. This requires a more careful merging of existing non qpa cpp files and existing cpp files on a case by case basis. This can be done at anytime. The following files are not renamed as part of this changed but will be fixed as part of a future change: src/gui/kernel/qgenericpluginfactory_qpa.h src/gui/kernel/qgenericplugin_qpa.h src/gui/kernel/qwindowsysteminterface_qpa.h files were renamed using for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done includes were renamed using script for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include ,g' \ -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include ,g' \ -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include ,g' \ -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include ,g' \ -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include ,g' \ -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include ,g' \ $file done Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67 Reviewed-by: Morten Johan Sørvig Reviewed-by: Samuel Rødal Reviewed-by: Friedemann Kleint Reviewed-by: Sean Harmer Reviewed-by: Lars Knoll Reviewed-by: Gunnar Sletta --- src/gui/kernel/kernel.pri | 42 +-- src/gui/kernel/qclipboard_qpa.cpp | 4 +- src/gui/kernel/qcursor_qpa.cpp | 2 +- src/gui/kernel/qdnd.cpp | 4 +- src/gui/kernel/qguiapplication.cpp | 26 +- src/gui/kernel/qguiapplication_p.h | 2 +- src/gui/kernel/qinputmethod.cpp | 2 +- src/gui/kernel/qinputmethod_p.h | 4 +- src/gui/kernel/qkeysequence.cpp | 2 +- src/gui/kernel/qopenglcontext.cpp | 4 +- src/gui/kernel/qplatformclipboard.h | 85 ++++++ src/gui/kernel/qplatformclipboard_qpa.cpp | 2 +- src/gui/kernel/qplatformclipboard_qpa.h | 85 ------ src/gui/kernel/qplatformcursor.h | 111 +++++++ src/gui/kernel/qplatformcursor_qpa.cpp | 4 +- src/gui/kernel/qplatformcursor_qpa.h | 111 ------- src/gui/kernel/qplatformdialoghelper.h | 320 +++++++++++++++++++++ src/gui/kernel/qplatformdialoghelper_qpa.cpp | 2 +- src/gui/kernel/qplatformdialoghelper_qpa.h | 320 --------------------- src/gui/kernel/qplatformdrag.h | 122 ++++++++ src/gui/kernel/qplatformdrag_qpa.cpp | 2 +- src/gui/kernel/qplatformdrag_qpa.h | 122 -------- src/gui/kernel/qplatforminputcontext.h | 109 +++++++ src/gui/kernel/qplatforminputcontext_p.h | 67 +++++ src/gui/kernel/qplatforminputcontext_qpa.cpp | 4 +- src/gui/kernel/qplatforminputcontext_qpa.h | 109 ------- src/gui/kernel/qplatforminputcontext_qpa_p.h | 67 ----- src/gui/kernel/qplatformintegration.h | 155 ++++++++++ src/gui/kernel/qplatformintegration_qpa.cpp | 12 +- src/gui/kernel/qplatformintegration_qpa.h | 155 ---------- src/gui/kernel/qplatformintegrationfactory_p.h | 77 +++++ src/gui/kernel/qplatformintegrationfactory_qpa.cpp | 4 +- src/gui/kernel/qplatformintegrationfactory_qpa_p.h | 77 ----- src/gui/kernel/qplatformintegrationplugin.h | 91 ++++++ src/gui/kernel/qplatformintegrationplugin_qpa.cpp | 2 +- src/gui/kernel/qplatformintegrationplugin_qpa.h | 91 ------ src/gui/kernel/qplatformnativeinterface.h | 104 +++++++ src/gui/kernel/qplatformnativeinterface_qpa.cpp | 2 +- src/gui/kernel/qplatformnativeinterface_qpa.h | 104 ------- src/gui/kernel/qplatformopenglcontext.h | 109 +++++++ src/gui/kernel/qplatformopenglcontext_qpa.cpp | 2 +- src/gui/kernel/qplatformopenglcontext_qpa.h | 109 ------- src/gui/kernel/qplatformscreen.h | 133 +++++++++ src/gui/kernel/qplatformscreen_p.h | 74 +++++ src/gui/kernel/qplatformscreen_qpa.cpp | 8 +- src/gui/kernel/qplatformscreen_qpa.h | 133 --------- src/gui/kernel/qplatformscreen_qpa_p.h | 74 ----- src/gui/kernel/qplatformscreenpageflipper.h | 98 +++++++ src/gui/kernel/qplatformscreenpageflipper_qpa.cpp | 2 +- src/gui/kernel/qplatformscreenpageflipper_qpa.h | 98 ------- src/gui/kernel/qplatformservices.h | 76 +++++ src/gui/kernel/qplatformservices_qpa.cpp | 2 +- src/gui/kernel/qplatformservices_qpa.h | 76 ----- src/gui/kernel/qplatformsharedgraphicscache.h | 109 +++++++ .../kernel/qplatformsharedgraphicscache_qpa.cpp | 2 +- src/gui/kernel/qplatformsharedgraphicscache_qpa.h | 109 ------- src/gui/kernel/qplatformsurface.h | 85 ++++++ src/gui/kernel/qplatformsurface_qpa.cpp | 2 +- src/gui/kernel/qplatformsurface_qpa.h | 85 ------ src/gui/kernel/qplatformtheme.h | 171 +++++++++++ src/gui/kernel/qplatformtheme_qpa.cpp | 2 +- src/gui/kernel/qplatformtheme_qpa.h | 171 ----------- src/gui/kernel/qplatformthemefactory_p.h | 76 +++++ src/gui/kernel/qplatformthemefactory_qpa.cpp | 4 +- src/gui/kernel/qplatformthemefactory_qpa_p.h | 76 ----- src/gui/kernel/qplatformthemeplugin.h | 91 ++++++ src/gui/kernel/qplatformthemeplugin_qpa.cpp | 2 +- src/gui/kernel/qplatformthemeplugin_qpa.h | 91 ------ src/gui/kernel/qplatformwindow.h | 129 +++++++++ src/gui/kernel/qplatformwindow_qpa.cpp | 2 +- src/gui/kernel/qplatformwindow_qpa.h | 129 --------- src/gui/kernel/qscreen.cpp | 2 +- src/gui/kernel/qscreen_p.h | 2 +- src/gui/kernel/qstylehints.cpp | 2 +- src/gui/kernel/qwindow.cpp | 6 +- src/gui/kernel/qwindow_p.h | 2 +- src/gui/kernel/qwindowsysteminterface_qpa.cpp | 4 +- 77 files changed, 2478 insertions(+), 2478 deletions(-) create mode 100644 src/gui/kernel/qplatformclipboard.h delete mode 100644 src/gui/kernel/qplatformclipboard_qpa.h create mode 100644 src/gui/kernel/qplatformcursor.h delete mode 100644 src/gui/kernel/qplatformcursor_qpa.h create mode 100644 src/gui/kernel/qplatformdialoghelper.h delete mode 100644 src/gui/kernel/qplatformdialoghelper_qpa.h create mode 100644 src/gui/kernel/qplatformdrag.h delete mode 100644 src/gui/kernel/qplatformdrag_qpa.h create mode 100644 src/gui/kernel/qplatforminputcontext.h create mode 100644 src/gui/kernel/qplatforminputcontext_p.h delete mode 100644 src/gui/kernel/qplatforminputcontext_qpa.h delete mode 100644 src/gui/kernel/qplatforminputcontext_qpa_p.h create mode 100644 src/gui/kernel/qplatformintegration.h delete mode 100644 src/gui/kernel/qplatformintegration_qpa.h create mode 100644 src/gui/kernel/qplatformintegrationfactory_p.h delete mode 100644 src/gui/kernel/qplatformintegrationfactory_qpa_p.h create mode 100644 src/gui/kernel/qplatformintegrationplugin.h delete mode 100644 src/gui/kernel/qplatformintegrationplugin_qpa.h create mode 100644 src/gui/kernel/qplatformnativeinterface.h delete mode 100644 src/gui/kernel/qplatformnativeinterface_qpa.h create mode 100644 src/gui/kernel/qplatformopenglcontext.h delete mode 100644 src/gui/kernel/qplatformopenglcontext_qpa.h create mode 100644 src/gui/kernel/qplatformscreen.h create mode 100644 src/gui/kernel/qplatformscreen_p.h delete mode 100644 src/gui/kernel/qplatformscreen_qpa.h delete mode 100644 src/gui/kernel/qplatformscreen_qpa_p.h create mode 100644 src/gui/kernel/qplatformscreenpageflipper.h delete mode 100644 src/gui/kernel/qplatformscreenpageflipper_qpa.h create mode 100644 src/gui/kernel/qplatformservices.h delete mode 100644 src/gui/kernel/qplatformservices_qpa.h create mode 100644 src/gui/kernel/qplatformsharedgraphicscache.h delete mode 100644 src/gui/kernel/qplatformsharedgraphicscache_qpa.h create mode 100644 src/gui/kernel/qplatformsurface.h delete mode 100644 src/gui/kernel/qplatformsurface_qpa.h create mode 100644 src/gui/kernel/qplatformtheme.h delete mode 100644 src/gui/kernel/qplatformtheme_qpa.h create mode 100644 src/gui/kernel/qplatformthemefactory_p.h delete mode 100644 src/gui/kernel/qplatformthemefactory_qpa_p.h create mode 100644 src/gui/kernel/qplatformthemeplugin.h delete mode 100644 src/gui/kernel/qplatformthemeplugin_qpa.h create mode 100644 src/gui/kernel/qplatformwindow.h delete mode 100644 src/gui/kernel/qplatformwindow_qpa.h (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index 3c1b6b4e48..525871c89b 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -10,27 +10,27 @@ HEADERS += \ kernel/qgenericplugin_qpa.h \ kernel/qwindowsysteminterface_qpa.h \ kernel/qwindowsysteminterface_qpa_p.h \ - kernel/qplatformintegration_qpa.h \ - kernel/qplatformdrag_qpa.h \ - kernel/qplatformscreen_qpa.h \ - kernel/qplatformscreen_qpa_p.h \ - kernel/qplatforminputcontext_qpa.h \ - kernel/qplatforminputcontext_qpa_p.h \ - kernel/qplatformintegrationfactory_qpa_p.h \ - kernel/qplatformintegrationplugin_qpa.h \ - kernel/qplatformtheme_qpa.h\ - kernel/qplatformthemefactory_qpa_p.h \ - kernel/qplatformthemeplugin_qpa.h \ - kernel/qplatformwindow_qpa.h \ - kernel/qplatformcursor_qpa.h \ - kernel/qplatformclipboard_qpa.h \ - kernel/qplatformnativeinterface_qpa.h \ + kernel/qplatformintegration.h \ + kernel/qplatformdrag.h \ + kernel/qplatformscreen.h \ + kernel/qplatformscreen_p.h \ + kernel/qplatforminputcontext.h \ + kernel/qplatforminputcontext_p.h \ + kernel/qplatformintegrationfactory_p.h \ + kernel/qplatformintegrationplugin.h \ + kernel/qplatformtheme.h\ + kernel/qplatformthemefactory_p.h \ + kernel/qplatformthemeplugin.h \ + kernel/qplatformwindow.h \ + kernel/qplatformcursor.h \ + kernel/qplatformclipboard.h \ + kernel/qplatformnativeinterface.h \ kernel/qsurfaceformat.h \ kernel/qguiapplication.h \ kernel/qguiapplication_p.h \ kernel/qwindow_p.h \ kernel/qwindow.h \ - kernel/qplatformsurface_qpa.h \ + kernel/qplatformsurface.h \ kernel/qsurface.h \ kernel/qclipboard.h \ kernel/qcursor.h \ @@ -55,10 +55,10 @@ HEADERS += \ kernel/qstylehints.h \ kernel/qtouchdevice.h \ kernel/qtouchdevice_p.h \ - kernel/qplatformsharedgraphicscache_qpa.h \ - kernel/qplatformdialoghelper_qpa.h \ - kernel/qplatformservices_qpa.h \ - kernel/qplatformscreenpageflipper_qpa.h + kernel/qplatformsharedgraphicscache.h \ + kernel/qplatformdialoghelper.h \ + kernel/qplatformservices.h \ + kernel/qplatformscreenpageflipper.h SOURCES += \ kernel/qclipboard_qpa.cpp \ @@ -107,7 +107,7 @@ SOURCES += \ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) { HEADERS += \ - kernel/qplatformopenglcontext_qpa.h \ + kernel/qplatformopenglcontext.h \ kernel/qopenglcontext.h \ kernel/qopenglcontext_p.h diff --git a/src/gui/kernel/qclipboard_qpa.cpp b/src/gui/kernel/qclipboard_qpa.cpp index 187e09253e..284775c4e2 100644 --- a/src/gui/kernel/qclipboard_qpa.cpp +++ b/src/gui/kernel/qclipboard_qpa.cpp @@ -45,8 +45,8 @@ #include "qmimedata.h" #include "private/qguiapplication_p.h" -#include "qplatformclipboard_qpa.h" -#include "qplatformintegration_qpa.h" +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qcursor_qpa.cpp b/src/gui/kernel/qcursor_qpa.cpp index 1c719c839e..cc9163fbc0 100644 --- a/src/gui/kernel/qcursor_qpa.cpp +++ b/src/gui/kernel/qcursor_qpa.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp index 1ed4a96192..8182719830 100644 --- a/src/gui/kernel/qdnd.cpp +++ b/src/gui/kernel/qdnd.cpp @@ -59,8 +59,8 @@ #include "qimagewriter.h" #include "qdebug.h" #include -#include -#include +#include +#include #include diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 27e84b71a9..631592aace 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -42,14 +42,14 @@ #include "qguiapplication.h" #include "private/qguiapplication_p.h" -#include "private/qplatformintegrationfactory_qpa_p.h" +#include #include "private/qevent_p.h" #include "qfont.h" -#include "qplatformfontdatabase_qpa.h" -#include "qplatformwindow_qpa.h" -#include "qplatformnativeinterface_qpa.h" -#include "qplatformtheme_qpa.h" -#include "qplatformintegration_qpa.h" +#include +#include +#include +#include +#include #include #include @@ -64,14 +64,14 @@ #include #include -#include +#include #include #include #include #include -#include -#include -#include +#include +#include +#include #include #include "private/qwindowsysteminterface_qpa_p.h" @@ -79,11 +79,11 @@ #include "private/qcursor_p.h" #include "private/qdnd_p.h" -#include -#include "qplatformdrag_qpa.h" +#include +#include #ifndef QT_NO_CURSOR -#include "qplatformcursor_qpa.h" +#include #endif #include diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 78641de55b..cb3587ba63 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -53,7 +53,7 @@ #include "private/qwindowsysteminterface_qpa_p.h" #include "private/qshortcutmap_p.h" -#include "qplatformdrag_qpa.h" +#include QT_BEGIN_HEADER diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp index 0e0bc7237a..a699938dc6 100644 --- a/src/gui/kernel/qinputmethod.cpp +++ b/src/gui/kernel/qinputmethod.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qinputmethod_p.h b/src/gui/kernel/qinputmethod_p.h index 1e55b00318..ad3d2141c1 100644 --- a/src/gui/kernel/qinputmethod_p.h +++ b/src/gui/kernel/qinputmethod_p.h @@ -46,8 +46,8 @@ #include #include #include -#include -#include +#include +#include #include QT_BEGIN_HEADER diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 4946a1dc18..e88d901a2b 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -41,7 +41,7 @@ #include "qkeysequence.h" #include "qkeysequence_p.h" -#include "qplatformtheme_qpa.h" +#include #include "private/qguiapplication_p.h" #ifndef QT_NO_SHORTCUT diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 4668f9e750..b99a4dbd04 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qplatformopenglcontext_qpa.h" -#include "qplatformintegration_qpa.h" +#include +#include #include "qopenglcontext.h" #include "qopenglcontext_p.h" #include "qwindow.h" diff --git a/src/gui/kernel/qplatformclipboard.h b/src/gui/kernel/qplatformclipboard.h new file mode 100644 index 0000000000..95c8103b7e --- /dev/null +++ b/src/gui/kernel/qplatformclipboard.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMCLIPBOARD_QPA_H +#define QPLATFORMCLIPBOARD_QPA_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 + +#ifndef QT_NO_CLIPBOARD + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class Q_GUI_EXPORT QPlatformClipboard +{ +public: + virtual ~QPlatformClipboard(); + + virtual QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard); + virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard); + virtual bool supportsMode(QClipboard::Mode mode) const; + virtual bool ownsMode(QClipboard::Mode mode) const; + void emitChanged(QClipboard::Mode mode); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QT_NO_CLIPBOARD + +#endif //QPLATFORMCLIPBOARD_QPA_H diff --git a/src/gui/kernel/qplatformclipboard_qpa.cpp b/src/gui/kernel/qplatformclipboard_qpa.cpp index 7273450077..5a29606391 100644 --- a/src/gui/kernel/qplatformclipboard_qpa.cpp +++ b/src/gui/kernel/qplatformclipboard_qpa.cpp @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "qplatformclipboard_qpa.h" +#include "qplatformclipboard.h" #ifndef QT_NO_CLIPBOARD diff --git a/src/gui/kernel/qplatformclipboard_qpa.h b/src/gui/kernel/qplatformclipboard_qpa.h deleted file mode 100644 index 95c8103b7e..0000000000 --- a/src/gui/kernel/qplatformclipboard_qpa.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMCLIPBOARD_QPA_H -#define QPLATFORMCLIPBOARD_QPA_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 - -#ifndef QT_NO_CLIPBOARD - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class Q_GUI_EXPORT QPlatformClipboard -{ -public: - virtual ~QPlatformClipboard(); - - virtual QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard); - virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard); - virtual bool supportsMode(QClipboard::Mode mode) const; - virtual bool ownsMode(QClipboard::Mode mode) const; - void emitChanged(QClipboard::Mode mode); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QT_NO_CLIPBOARD - -#endif //QPLATFORMCLIPBOARD_QPA_H diff --git a/src/gui/kernel/qplatformcursor.h b/src/gui/kernel/qplatformcursor.h new file mode 100644 index 0000000000..1f339c86b7 --- /dev/null +++ b/src/gui/kernel/qplatformcursor.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtOpenVG module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QPLATFORMCURSOR_QPA_H +#define QPLATFORMCURSOR_QPA_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 +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +// Cursor graphics management +class Q_GUI_EXPORT QPlatformCursorImage { +public: + QPlatformCursorImage(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY) + { set(data, mask, width, height, hotX, hotY); } + QImage * image() { return &cursorImage; } + QPoint hotspot() const { return hot; } + void set(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY); + void set(const QImage &image, int hx, int hy); + void set(Qt::CursorShape); +private: + static void createSystemCursor(int id); + QImage cursorImage; + QPoint hot; +}; + +class QPlatformCursor; + +class Q_GUI_EXPORT QPlatformCursorPrivate { +public: + static QList getInstances(); +}; + +class Q_GUI_EXPORT QPlatformCursor : public QObject { +public: + QPlatformCursor(); + + // input methods + virtual void pointerEvent(const QMouseEvent & event) { Q_UNUSED(event); } + virtual void changeCursor(QCursor * windowCursor, QWindow * window) = 0; + virtual QPoint pos() const; + virtual void setPos(const QPoint &pos); + +private: + Q_DECLARE_PRIVATE(QPlatformCursor) + friend void qt_qpa_set_cursor(QWidget * w, bool force); + friend class QApplicationPrivate; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMCURSOR_QPA_H diff --git a/src/gui/kernel/qplatformcursor_qpa.cpp b/src/gui/kernel/qplatformcursor_qpa.cpp index 5ea080c40a..40b7967af7 100644 --- a/src/gui/kernel/qplatformcursor_qpa.cpp +++ b/src/gui/kernel/qplatformcursor_qpa.cpp @@ -38,13 +38,13 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "qplatformcursor_qpa.h" +#include "qplatformcursor.h" #include #include #include #include -#include +#include #include #include diff --git a/src/gui/kernel/qplatformcursor_qpa.h b/src/gui/kernel/qplatformcursor_qpa.h deleted file mode 100644 index fb3e4604d2..0000000000 --- a/src/gui/kernel/qplatformcursor_qpa.h +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtOpenVG module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QPLATFORMCURSOR_QPA_H -#define QPLATFORMCURSOR_QPA_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 -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -// Cursor graphics management -class Q_GUI_EXPORT QPlatformCursorImage { -public: - QPlatformCursorImage(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY) - { set(data, mask, width, height, hotX, hotY); } - QImage * image() { return &cursorImage; } - QPoint hotspot() const { return hot; } - void set(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY); - void set(const QImage &image, int hx, int hy); - void set(Qt::CursorShape); -private: - static void createSystemCursor(int id); - QImage cursorImage; - QPoint hot; -}; - -class QPlatformCursor; - -class Q_GUI_EXPORT QPlatformCursorPrivate { -public: - static QList getInstances(); -}; - -class Q_GUI_EXPORT QPlatformCursor : public QObject { -public: - QPlatformCursor(); - - // input methods - virtual void pointerEvent(const QMouseEvent & event) { Q_UNUSED(event); } - virtual void changeCursor(QCursor * windowCursor, QWindow * window) = 0; - virtual QPoint pos() const; - virtual void setPos(const QPoint &pos); - -private: - Q_DECLARE_PRIVATE(QPlatformCursor) - friend void qt_qpa_set_cursor(QWidget * w, bool force); - friend class QApplicationPrivate; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMCURSOR_QPA_H diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h new file mode 100644 index 0000000000..5cd3ab055b --- /dev/null +++ b/src/gui/kernel/qplatformdialoghelper.h @@ -0,0 +1,320 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMDIALOGHELPER_H +#define QPLATFORMDIALOGHELPER_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 +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QString; +class QColor; +class QFont; +class QWindow; +class QVariant; +class QUrl; +class QColorDialogOptionsPrivate; +class QFontDialogOptionsPrivate; +class QFileDialogOptionsPrivate; + +class Q_GUI_EXPORT QPlatformDialogHelper : public QObject +{ + Q_OBJECT +public: + enum StyleHint { + SnapToDefaultButton + }; + enum DialogCode { Rejected, Accepted }; + + QPlatformDialogHelper(); + virtual ~QPlatformDialogHelper(); + + virtual QVariant styleHint(StyleHint hint) const; + + virtual void platformNativeDialogModalHelp() = 0; + virtual void _q_platformRunNativeAppModalPanel() = 0; + + virtual void deleteNativeDialog_sys() = 0; + virtual bool show_sys(Qt::WindowFlags windowFlags, + Qt::WindowModality windowModality, + QWindow *parent) = 0; + virtual void hide_sys() = 0; + + virtual DialogCode dialogResultCode_sys() = 0; + + static QVariant defaultStyleHint(QPlatformDialogHelper::StyleHint hint); + +Q_SIGNALS: + void launchNativeAppModalPanel(); + void accept(); + void reject(); + +protected Q_SLOTS: + void emitLaunchNativeAppModalPanel(); +}; + +class Q_GUI_EXPORT QColorDialogOptions +{ +public: + enum ColorDialogOption { + ShowAlphaChannel = 0x00000001, + NoButtons = 0x00000002, + DontUseNativeDialog = 0x00000004 + }; + + Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption) + + QColorDialogOptions(); + QColorDialogOptions(const QColorDialogOptions &rhs); + QColorDialogOptions &operator=(const QColorDialogOptions &rhs); + ~QColorDialogOptions(); + + QString windowTitle() const; + void setWindowTitle(const QString &); + + void setOption(ColorDialogOption option, bool on = true); + bool testOption(ColorDialogOption option) const; + void setOptions(ColorDialogOptions options); + ColorDialogOptions options() const; + + static int customColorCount(); + static QRgb customColor(int index); + static QRgb *customColors(); + static void setCustomColor(int index, QRgb color); + + static QRgb *standardColors(); + static QRgb standardColor(int index); + static void setStandardColor(int index, QRgb color); + +private: + QSharedDataPointer d; +}; + +class Q_GUI_EXPORT QPlatformColorDialogHelper : public QPlatformDialogHelper +{ + Q_OBJECT +public: + const QSharedPointer &options() const; + void setOptions(const QSharedPointer &options); + + virtual void setCurrentColor_sys(const QColor &) = 0; + virtual QColor currentColor_sys() const = 0; + +Q_SIGNALS: + void currentColorChanged(const QColor &color); + void colorSelected(const QColor &color); + +private: + QSharedPointer m_options; +}; + +class Q_GUI_EXPORT QFontDialogOptions +{ +public: + enum FontDialogOption { + NoButtons = 0x00000001, + DontUseNativeDialog = 0x00000002 + }; + + Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption) + + QFontDialogOptions(); + QFontDialogOptions(const QFontDialogOptions &rhs); + QFontDialogOptions &operator=(const QFontDialogOptions &rhs); + ~QFontDialogOptions(); + + QString windowTitle() const; + void setWindowTitle(const QString &); + + void setOption(FontDialogOption option, bool on = true); + bool testOption(FontDialogOption option) const; + void setOptions(FontDialogOptions options); + FontDialogOptions options() const; + +private: + QSharedDataPointer d; +}; + +class Q_GUI_EXPORT QPlatformFontDialogHelper : public QPlatformDialogHelper +{ + Q_OBJECT +public: + virtual void setCurrentFont_sys(const QFont &) = 0; + virtual QFont currentFont_sys() const = 0; + + const QSharedPointer &options() const; + void setOptions(const QSharedPointer &options); + +Q_SIGNALS: + void currentFontChanged(const QFont &font); + void fontSelected(const QFont &font); + +private: + QSharedPointer m_options; +}; + +class Q_GUI_EXPORT QFileDialogOptions +{ +public: + enum ViewMode { Detail, List }; + enum FileMode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly }; + enum AcceptMode { AcceptOpen, AcceptSave }; + enum DialogLabel { LookIn, FileName, FileType, Accept, Reject, DialogLabelCount }; + + enum FileDialogOption + { + ShowDirsOnly = 0x00000001, + DontResolveSymlinks = 0x00000002, + DontConfirmOverwrite = 0x00000004, + DontUseSheet = 0x00000008, + DontUseNativeDialog = 0x00000010, + ReadOnly = 0x00000020, + HideNameFilterDetails = 0x00000040 + }; + Q_DECLARE_FLAGS(FileDialogOptions, FileDialogOption) + + QFileDialogOptions(); + QFileDialogOptions(const QFileDialogOptions &rhs); + QFileDialogOptions &operator=(const QFileDialogOptions &rhs); + ~QFileDialogOptions(); + + QString windowTitle() const; + void setWindowTitle(const QString &); + + void setOption(FileDialogOption option, bool on = true); + bool testOption(FileDialogOption option) const; + void setOptions(FileDialogOptions options); + FileDialogOptions options() const; + + QDir::Filters filter() const; + void setFilter(QDir::Filters filters); + + void setViewMode(ViewMode mode); + ViewMode viewMode() const; + + void setFileMode(FileMode mode); + FileMode fileMode() const; + + void setAcceptMode(AcceptMode mode); + AcceptMode acceptMode() const; + + void setSidebarUrls(const QList &urls); + QList sidebarUrls() const; + + void setNameFilters(const QStringList &filters); + QStringList nameFilters() const; + + void setDefaultSuffix(const QString &suffix); + QString defaultSuffix() const; + + void setHistory(const QStringList &paths); + QStringList history() const; + + void setLabelText(DialogLabel label, const QString &text); + QString labelText(DialogLabel label) const; + bool isLabelExplicitlySet(DialogLabel label); + + QString initialDirectory() const; + void setInitialDirectory(const QString &); + + QString initiallySelectedNameFilter() const; + void setInitiallySelectedNameFilter(const QString &); + + QStringList initiallySelectedFiles() const; + void setInitiallySelectedFiles(const QStringList &); + +private: + QSharedDataPointer d; +}; + +class Q_GUI_EXPORT QPlatformFileDialogHelper : public QPlatformDialogHelper +{ + Q_OBJECT +public: + virtual bool defaultNameFilterDisables() const = 0; + virtual void setDirectory_sys(const QString &directory) = 0; + virtual QString directory_sys() const = 0; + virtual void selectFile_sys(const QString &filename) = 0; + virtual QStringList selectedFiles_sys() const = 0; + virtual void setFilter_sys() = 0; + virtual void selectNameFilter_sys(const QString &filter) = 0; + virtual QString selectedNameFilter_sys() const = 0; + + const QSharedPointer &options() const; + void setOptions(const QSharedPointer &options); + +Q_SIGNALS: + void fileSelected(const QString &file); + void filesSelected(const QStringList &files); + void currentChanged(const QString &path); + void directoryEntered(const QString &directory); + void filterSelected(const QString &filter); + +private: + QSharedPointer m_options; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMDIALOGHELPER_H diff --git a/src/gui/kernel/qplatformdialoghelper_qpa.cpp b/src/gui/kernel/qplatformdialoghelper_qpa.cpp index f2114d17e0..ec9906ca0e 100644 --- a/src/gui/kernel/qplatformdialoghelper_qpa.cpp +++ b/src/gui/kernel/qplatformdialoghelper_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformdialoghelper_qpa.h" +#include "qplatformdialoghelper.h" #include #include diff --git a/src/gui/kernel/qplatformdialoghelper_qpa.h b/src/gui/kernel/qplatformdialoghelper_qpa.h deleted file mode 100644 index 5cd3ab055b..0000000000 --- a/src/gui/kernel/qplatformdialoghelper_qpa.h +++ /dev/null @@ -1,320 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMDIALOGHELPER_H -#define QPLATFORMDIALOGHELPER_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 -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QString; -class QColor; -class QFont; -class QWindow; -class QVariant; -class QUrl; -class QColorDialogOptionsPrivate; -class QFontDialogOptionsPrivate; -class QFileDialogOptionsPrivate; - -class Q_GUI_EXPORT QPlatformDialogHelper : public QObject -{ - Q_OBJECT -public: - enum StyleHint { - SnapToDefaultButton - }; - enum DialogCode { Rejected, Accepted }; - - QPlatformDialogHelper(); - virtual ~QPlatformDialogHelper(); - - virtual QVariant styleHint(StyleHint hint) const; - - virtual void platformNativeDialogModalHelp() = 0; - virtual void _q_platformRunNativeAppModalPanel() = 0; - - virtual void deleteNativeDialog_sys() = 0; - virtual bool show_sys(Qt::WindowFlags windowFlags, - Qt::WindowModality windowModality, - QWindow *parent) = 0; - virtual void hide_sys() = 0; - - virtual DialogCode dialogResultCode_sys() = 0; - - static QVariant defaultStyleHint(QPlatformDialogHelper::StyleHint hint); - -Q_SIGNALS: - void launchNativeAppModalPanel(); - void accept(); - void reject(); - -protected Q_SLOTS: - void emitLaunchNativeAppModalPanel(); -}; - -class Q_GUI_EXPORT QColorDialogOptions -{ -public: - enum ColorDialogOption { - ShowAlphaChannel = 0x00000001, - NoButtons = 0x00000002, - DontUseNativeDialog = 0x00000004 - }; - - Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption) - - QColorDialogOptions(); - QColorDialogOptions(const QColorDialogOptions &rhs); - QColorDialogOptions &operator=(const QColorDialogOptions &rhs); - ~QColorDialogOptions(); - - QString windowTitle() const; - void setWindowTitle(const QString &); - - void setOption(ColorDialogOption option, bool on = true); - bool testOption(ColorDialogOption option) const; - void setOptions(ColorDialogOptions options); - ColorDialogOptions options() const; - - static int customColorCount(); - static QRgb customColor(int index); - static QRgb *customColors(); - static void setCustomColor(int index, QRgb color); - - static QRgb *standardColors(); - static QRgb standardColor(int index); - static void setStandardColor(int index, QRgb color); - -private: - QSharedDataPointer d; -}; - -class Q_GUI_EXPORT QPlatformColorDialogHelper : public QPlatformDialogHelper -{ - Q_OBJECT -public: - const QSharedPointer &options() const; - void setOptions(const QSharedPointer &options); - - virtual void setCurrentColor_sys(const QColor &) = 0; - virtual QColor currentColor_sys() const = 0; - -Q_SIGNALS: - void currentColorChanged(const QColor &color); - void colorSelected(const QColor &color); - -private: - QSharedPointer m_options; -}; - -class Q_GUI_EXPORT QFontDialogOptions -{ -public: - enum FontDialogOption { - NoButtons = 0x00000001, - DontUseNativeDialog = 0x00000002 - }; - - Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption) - - QFontDialogOptions(); - QFontDialogOptions(const QFontDialogOptions &rhs); - QFontDialogOptions &operator=(const QFontDialogOptions &rhs); - ~QFontDialogOptions(); - - QString windowTitle() const; - void setWindowTitle(const QString &); - - void setOption(FontDialogOption option, bool on = true); - bool testOption(FontDialogOption option) const; - void setOptions(FontDialogOptions options); - FontDialogOptions options() const; - -private: - QSharedDataPointer d; -}; - -class Q_GUI_EXPORT QPlatformFontDialogHelper : public QPlatformDialogHelper -{ - Q_OBJECT -public: - virtual void setCurrentFont_sys(const QFont &) = 0; - virtual QFont currentFont_sys() const = 0; - - const QSharedPointer &options() const; - void setOptions(const QSharedPointer &options); - -Q_SIGNALS: - void currentFontChanged(const QFont &font); - void fontSelected(const QFont &font); - -private: - QSharedPointer m_options; -}; - -class Q_GUI_EXPORT QFileDialogOptions -{ -public: - enum ViewMode { Detail, List }; - enum FileMode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly }; - enum AcceptMode { AcceptOpen, AcceptSave }; - enum DialogLabel { LookIn, FileName, FileType, Accept, Reject, DialogLabelCount }; - - enum FileDialogOption - { - ShowDirsOnly = 0x00000001, - DontResolveSymlinks = 0x00000002, - DontConfirmOverwrite = 0x00000004, - DontUseSheet = 0x00000008, - DontUseNativeDialog = 0x00000010, - ReadOnly = 0x00000020, - HideNameFilterDetails = 0x00000040 - }; - Q_DECLARE_FLAGS(FileDialogOptions, FileDialogOption) - - QFileDialogOptions(); - QFileDialogOptions(const QFileDialogOptions &rhs); - QFileDialogOptions &operator=(const QFileDialogOptions &rhs); - ~QFileDialogOptions(); - - QString windowTitle() const; - void setWindowTitle(const QString &); - - void setOption(FileDialogOption option, bool on = true); - bool testOption(FileDialogOption option) const; - void setOptions(FileDialogOptions options); - FileDialogOptions options() const; - - QDir::Filters filter() const; - void setFilter(QDir::Filters filters); - - void setViewMode(ViewMode mode); - ViewMode viewMode() const; - - void setFileMode(FileMode mode); - FileMode fileMode() const; - - void setAcceptMode(AcceptMode mode); - AcceptMode acceptMode() const; - - void setSidebarUrls(const QList &urls); - QList sidebarUrls() const; - - void setNameFilters(const QStringList &filters); - QStringList nameFilters() const; - - void setDefaultSuffix(const QString &suffix); - QString defaultSuffix() const; - - void setHistory(const QStringList &paths); - QStringList history() const; - - void setLabelText(DialogLabel label, const QString &text); - QString labelText(DialogLabel label) const; - bool isLabelExplicitlySet(DialogLabel label); - - QString initialDirectory() const; - void setInitialDirectory(const QString &); - - QString initiallySelectedNameFilter() const; - void setInitiallySelectedNameFilter(const QString &); - - QStringList initiallySelectedFiles() const; - void setInitiallySelectedFiles(const QStringList &); - -private: - QSharedDataPointer d; -}; - -class Q_GUI_EXPORT QPlatformFileDialogHelper : public QPlatformDialogHelper -{ - Q_OBJECT -public: - virtual bool defaultNameFilterDisables() const = 0; - virtual void setDirectory_sys(const QString &directory) = 0; - virtual QString directory_sys() const = 0; - virtual void selectFile_sys(const QString &filename) = 0; - virtual QStringList selectedFiles_sys() const = 0; - virtual void setFilter_sys() = 0; - virtual void selectNameFilter_sys(const QString &filter) = 0; - virtual QString selectedNameFilter_sys() const = 0; - - const QSharedPointer &options() const; - void setOptions(const QSharedPointer &options); - -Q_SIGNALS: - void fileSelected(const QString &file); - void filesSelected(const QStringList &files); - void currentChanged(const QString &path); - void directoryEntered(const QString &directory); - void filterSelected(const QString &filter); - -private: - QSharedPointer m_options; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMDIALOGHELPER_H diff --git a/src/gui/kernel/qplatformdrag.h b/src/gui/kernel/qplatformdrag.h new file mode 100644 index 0000000000..14282c5a21 --- /dev/null +++ b/src/gui/kernel/qplatformdrag.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMDRAG_H +#define QPLATFORMDRAG_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_HEADER + +QT_BEGIN_NAMESPACE + + +class QMimeData; +class QMouseEvent; +class QDrag; +class QObject; +class QEvent; +class QPlatformDragPrivate; + +class Q_GUI_EXPORT QPlatformDropQtResponse +{ +public: + QPlatformDropQtResponse(bool accepted, Qt::DropAction acceptedAction); + bool isAccepted() const; + Qt::DropAction acceptedAction() const; + +private: + bool m_accepted; + Qt::DropAction m_accepted_action; + +}; + +class Q_GUI_EXPORT QPlatformDragQtResponse : public QPlatformDropQtResponse +{ +public: + QPlatformDragQtResponse(bool accepted, Qt::DropAction acceptedAction, QRect answerRect); + + QRect answerRect() const; + +private: + QRect m_answer_rect; +}; + +class Q_GUI_EXPORT QPlatformDrag +{ + Q_DECLARE_PRIVATE(QPlatformDrag) +public: + QPlatformDrag(); + virtual ~QPlatformDrag(); + + QDrag *currentDrag() const; + virtual QMimeData *platformDropData() = 0; + + virtual Qt::DropAction drag(QDrag *m_drag) = 0; + void updateAction(Qt::DropAction action); + + Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const; + + static QPixmap defaultPixmap(); + +private: + QPlatformDragPrivate *d_ptr; + + Q_DISABLE_COPY(QPlatformDrag) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/gui/kernel/qplatformdrag_qpa.cpp b/src/gui/kernel/qplatformdrag_qpa.cpp index d9fc3a2ab8..8367ad8e06 100644 --- a/src/gui/kernel/qplatformdrag_qpa.cpp +++ b/src/gui/kernel/qplatformdrag_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformdrag_qpa.h" +#include "qplatformdrag.h" #include #include diff --git a/src/gui/kernel/qplatformdrag_qpa.h b/src/gui/kernel/qplatformdrag_qpa.h deleted file mode 100644 index 14282c5a21..0000000000 --- a/src/gui/kernel/qplatformdrag_qpa.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMDRAG_H -#define QPLATFORMDRAG_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_HEADER - -QT_BEGIN_NAMESPACE - - -class QMimeData; -class QMouseEvent; -class QDrag; -class QObject; -class QEvent; -class QPlatformDragPrivate; - -class Q_GUI_EXPORT QPlatformDropQtResponse -{ -public: - QPlatformDropQtResponse(bool accepted, Qt::DropAction acceptedAction); - bool isAccepted() const; - Qt::DropAction acceptedAction() const; - -private: - bool m_accepted; - Qt::DropAction m_accepted_action; - -}; - -class Q_GUI_EXPORT QPlatformDragQtResponse : public QPlatformDropQtResponse -{ -public: - QPlatformDragQtResponse(bool accepted, Qt::DropAction acceptedAction, QRect answerRect); - - QRect answerRect() const; - -private: - QRect m_answer_rect; -}; - -class Q_GUI_EXPORT QPlatformDrag -{ - Q_DECLARE_PRIVATE(QPlatformDrag) -public: - QPlatformDrag(); - virtual ~QPlatformDrag(); - - QDrag *currentDrag() const; - virtual QMimeData *platformDropData() = 0; - - virtual Qt::DropAction drag(QDrag *m_drag) = 0; - void updateAction(Qt::DropAction action); - - Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const; - - static QPixmap defaultPixmap(); - -private: - QPlatformDragPrivate *d_ptr; - - Q_DISABLE_COPY(QPlatformDrag) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/gui/kernel/qplatforminputcontext.h b/src/gui/kernel/qplatforminputcontext.h new file mode 100644 index 0000000000..696146b859 --- /dev/null +++ b/src/gui/kernel/qplatforminputcontext.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMINPUTCONTEXT_H +#define QPLATFORMINPUTCONTEXT_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_HEADER + +QT_BEGIN_NAMESPACE + +class QPlatformInputContextPrivate; + +class Q_GUI_EXPORT QPlatformInputContext : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QPlatformInputContext) + +public: + QPlatformInputContext(); + virtual ~QPlatformInputContext(); + + virtual bool isValid() const; + + virtual void reset(); + virtual void commit(); + virtual void update(Qt::InputMethodQueries); + virtual void invokeAction(QInputMethod::Action, int cursorPosition); + virtual bool filterEvent(const QEvent *event); + virtual QRectF keyboardRect() const; + void emitKeyboardRectChanged(); + + virtual bool isAnimating() const; + void emitAnimatingChanged(); + + virtual void showInputPanel(); + virtual void hideInputPanel(); + virtual bool isInputPanelVisible() const; + void emitInputPanelVisibleChanged(); + + virtual QLocale locale() const; + void emitLocaleChanged(); + virtual Qt::LayoutDirection inputDirection() const; + void emitInputDirectionChanged(Qt::LayoutDirection newDirection); + + virtual void setFocusObject(QObject *object); + bool inputMethodAccepted() const; + +private: + friend class QGuiApplication; + friend class QGuiApplicationPrivate; + friend class QInputMethod; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMINPUTCONTEXT_H diff --git a/src/gui/kernel/qplatforminputcontext_p.h b/src/gui/kernel/qplatforminputcontext_p.h new file mode 100644 index 0000000000..dc12d26ffc --- /dev/null +++ b/src/gui/kernel/qplatforminputcontext_p.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMINPUTCONTEXT_P_H +#define QPLATFORMINPUTCONTEXT_P_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QPlatformInputContextPrivate: public QObjectPrivate +{ +public: + QPlatformInputContextPrivate() {} + ~QPlatformInputContextPrivate() {} + + static void setInputMethodAccepted(bool accepted); + static bool inputMethodAccepted(); + + static bool s_inputMethodAccepted; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/gui/kernel/qplatforminputcontext_qpa.cpp b/src/gui/kernel/qplatforminputcontext_qpa.cpp index 53839088c5..0a8633b61d 100644 --- a/src/gui/kernel/qplatforminputcontext_qpa.cpp +++ b/src/gui/kernel/qplatforminputcontext_qpa.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include +#include "qplatforminputcontext.h" #include #include #include "private/qkeymapper_p.h" -#include "private/qplatforminputcontext_qpa_p.h" +#include QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qplatforminputcontext_qpa.h b/src/gui/kernel/qplatforminputcontext_qpa.h deleted file mode 100644 index 696146b859..0000000000 --- a/src/gui/kernel/qplatforminputcontext_qpa.h +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMINPUTCONTEXT_H -#define QPLATFORMINPUTCONTEXT_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_HEADER - -QT_BEGIN_NAMESPACE - -class QPlatformInputContextPrivate; - -class Q_GUI_EXPORT QPlatformInputContext : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QPlatformInputContext) - -public: - QPlatformInputContext(); - virtual ~QPlatformInputContext(); - - virtual bool isValid() const; - - virtual void reset(); - virtual void commit(); - virtual void update(Qt::InputMethodQueries); - virtual void invokeAction(QInputMethod::Action, int cursorPosition); - virtual bool filterEvent(const QEvent *event); - virtual QRectF keyboardRect() const; - void emitKeyboardRectChanged(); - - virtual bool isAnimating() const; - void emitAnimatingChanged(); - - virtual void showInputPanel(); - virtual void hideInputPanel(); - virtual bool isInputPanelVisible() const; - void emitInputPanelVisibleChanged(); - - virtual QLocale locale() const; - void emitLocaleChanged(); - virtual Qt::LayoutDirection inputDirection() const; - void emitInputDirectionChanged(Qt::LayoutDirection newDirection); - - virtual void setFocusObject(QObject *object); - bool inputMethodAccepted() const; - -private: - friend class QGuiApplication; - friend class QGuiApplicationPrivate; - friend class QInputMethod; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMINPUTCONTEXT_H diff --git a/src/gui/kernel/qplatforminputcontext_qpa_p.h b/src/gui/kernel/qplatforminputcontext_qpa_p.h deleted file mode 100644 index dc12d26ffc..0000000000 --- a/src/gui/kernel/qplatforminputcontext_qpa_p.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMINPUTCONTEXT_P_H -#define QPLATFORMINPUTCONTEXT_P_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QPlatformInputContextPrivate: public QObjectPrivate -{ -public: - QPlatformInputContextPrivate() {} - ~QPlatformInputContextPrivate() {} - - static void setInputMethodAccepted(bool accepted); - static bool inputMethodAccepted(); - - static bool s_inputMethodAccepted; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h new file mode 100644 index 0000000000..fb62dafc5c --- /dev/null +++ b/src/gui/kernel/qplatformintegration.h @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMINTEGRATION_H +#define QPLATFORMINTEGRATION_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 +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QPlatformWindow; +class QWindow; +class QPlatformBackingStore; +class QPlatformFontDatabase; +class QPlatformClipboard; +class QPlatformNativeInterface; +class QPlatformDrag; +class QPlatformOpenGLContext; +class QGuiGLFormat; +class QAbstractEventDispatcher; +class QPlatformInputContext; +class QPlatformAccessibility; +class QPlatformTheme; +class QPlatformDialogHelper; +class QPlatformSharedGraphicsCache; +class QPlatformServices; + +class Q_GUI_EXPORT QPlatformIntegration +{ +public: + enum Capability { + ThreadedPixmaps = 1, + OpenGL = 2, + ThreadedOpenGL = 3, + SharedGraphicsCache = 4, + BufferQueueingOpenGL = 5 + + }; + + virtual ~QPlatformIntegration() { } + + virtual bool hasCapability(Capability cap) const; + + virtual QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const; + virtual QPlatformWindow *createPlatformWindow(QWindow *window) const = 0; + virtual QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const = 0; +#ifndef QT_NO_OPENGL + virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; +#endif + virtual QPlatformSharedGraphicsCache *createPlatformSharedGraphicsCache(const char *cacheId) const; + virtual QPaintEngine *createImagePaintEngine(QPaintDevice *paintDevice) const; + +// Event dispatcher: + virtual QAbstractEventDispatcher *guiThreadEventDispatcher() const = 0; + +//Deeper window system integrations + virtual QPlatformFontDatabase *fontDatabase() const; +#ifndef QT_NO_CLIPBOARD + virtual QPlatformClipboard *clipboard() const; +#endif +#ifndef QT_NO_DRAGANDDROP + virtual QPlatformDrag *drag() const; +#endif + virtual QPlatformInputContext *inputContext() const; +#ifndef QT_NO_ACCESSIBILITY + virtual QPlatformAccessibility *accessibility() const; +#endif + + // Access native handles. The window handle is already available from Wid; + virtual QPlatformNativeInterface *nativeInterface() const; + + virtual QPlatformServices *services() const; + + enum StyleHint { + CursorFlashTime, + KeyboardInputInterval, + MouseDoubleClickInterval, + StartDragDistance, + StartDragTime, + KeyboardAutoRepeatRate, + ShowIsFullScreen, + PasswordMaskDelay, + FontSmoothingGamma + }; + + virtual QVariant styleHint(StyleHint hint) const; + + virtual Qt::KeyboardModifiers queryKeyboardModifiers() const; + + virtual QStringList themeNames() const; + virtual QPlatformTheme *createPlatformTheme(const QString &name) const; + +protected: + void screenAdded(QPlatformScreen *screen); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMINTEGRATION_H diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp index 5269d8fb24..8e4ed05576 100644 --- a/src/gui/kernel/qplatformintegration_qpa.cpp +++ b/src/gui/kernel/qplatformintegration_qpa.cpp @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qplatformintegration_qpa.h" +#include "qplatformintegration.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h deleted file mode 100644 index a44f4343ef..0000000000 --- a/src/gui/kernel/qplatformintegration_qpa.h +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMINTEGRATION_H -#define QPLATFORMINTEGRATION_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 -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QPlatformWindow; -class QWindow; -class QPlatformBackingStore; -class QPlatformFontDatabase; -class QPlatformClipboard; -class QPlatformNativeInterface; -class QPlatformDrag; -class QPlatformOpenGLContext; -class QGuiGLFormat; -class QAbstractEventDispatcher; -class QPlatformInputContext; -class QPlatformAccessibility; -class QPlatformTheme; -class QPlatformDialogHelper; -class QPlatformSharedGraphicsCache; -class QPlatformServices; - -class Q_GUI_EXPORT QPlatformIntegration -{ -public: - enum Capability { - ThreadedPixmaps = 1, - OpenGL = 2, - ThreadedOpenGL = 3, - SharedGraphicsCache = 4, - BufferQueueingOpenGL = 5 - - }; - - virtual ~QPlatformIntegration() { } - - virtual bool hasCapability(Capability cap) const; - - virtual QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const; - virtual QPlatformWindow *createPlatformWindow(QWindow *window) const = 0; - virtual QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const = 0; -#ifndef QT_NO_OPENGL - virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; -#endif - virtual QPlatformSharedGraphicsCache *createPlatformSharedGraphicsCache(const char *cacheId) const; - virtual QPaintEngine *createImagePaintEngine(QPaintDevice *paintDevice) const; - -// Event dispatcher: - virtual QAbstractEventDispatcher *guiThreadEventDispatcher() const = 0; - -//Deeper window system integrations - virtual QPlatformFontDatabase *fontDatabase() const; -#ifndef QT_NO_CLIPBOARD - virtual QPlatformClipboard *clipboard() const; -#endif -#ifndef QT_NO_DRAGANDDROP - virtual QPlatformDrag *drag() const; -#endif - virtual QPlatformInputContext *inputContext() const; -#ifndef QT_NO_ACCESSIBILITY - virtual QPlatformAccessibility *accessibility() const; -#endif - - // Access native handles. The window handle is already available from Wid; - virtual QPlatformNativeInterface *nativeInterface() const; - - virtual QPlatformServices *services() const; - - enum StyleHint { - CursorFlashTime, - KeyboardInputInterval, - MouseDoubleClickInterval, - StartDragDistance, - StartDragTime, - KeyboardAutoRepeatRate, - ShowIsFullScreen, - PasswordMaskDelay, - FontSmoothingGamma - }; - - virtual QVariant styleHint(StyleHint hint) const; - - virtual Qt::KeyboardModifiers queryKeyboardModifiers() const; - - virtual QStringList themeNames() const; - virtual QPlatformTheme *createPlatformTheme(const QString &name) const; - -protected: - void screenAdded(QPlatformScreen *screen); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMINTEGRATION_H diff --git a/src/gui/kernel/qplatformintegrationfactory_p.h b/src/gui/kernel/qplatformintegrationfactory_p.h new file mode 100644 index 0000000000..4aae7898fa --- /dev/null +++ b/src/gui/kernel/qplatformintegrationfactory_p.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMINTEGRATIONFACTORY_H +#define QPLATFORMINTEGRATIONFACTORY_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_HEADER + +QT_BEGIN_NAMESPACE + + +class QPlatformIntegration; + +class QPlatformIntegrationFactory +{ +public: + static QStringList keys(const QString &platformPluginPath = QString()); + static QPlatformIntegration *create(const QString &key, const QString &platformPluginPath = QString()); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMINTEGRATIONFACTORY_H + diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp index a84c243355..2092f2d0ba 100644 --- a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp +++ b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qplatformintegrationfactory_qpa_p.h" -#include +#include +#include #include "private/qfactoryloader_p.h" #include "qmutex.h" diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa_p.h b/src/gui/kernel/qplatformintegrationfactory_qpa_p.h deleted file mode 100644 index 4aae7898fa..0000000000 --- a/src/gui/kernel/qplatformintegrationfactory_qpa_p.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMINTEGRATIONFACTORY_H -#define QPLATFORMINTEGRATIONFACTORY_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_HEADER - -QT_BEGIN_NAMESPACE - - -class QPlatformIntegration; - -class QPlatformIntegrationFactory -{ -public: - static QStringList keys(const QString &platformPluginPath = QString()); - static QPlatformIntegration *create(const QString &key, const QString &platformPluginPath = QString()); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMINTEGRATIONFACTORY_H - diff --git a/src/gui/kernel/qplatformintegrationplugin.h b/src/gui/kernel/qplatformintegrationplugin.h new file mode 100644 index 0000000000..d70569cbba --- /dev/null +++ b/src/gui/kernel/qplatformintegrationplugin.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMINTEGRATIONPLUGIN_H +#define QPLATFORMINTEGRATIONPLUGIN_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_HEADER + +QT_BEGIN_NAMESPACE + + +class QPlatformIntegration; + +struct QPlatformIntegrationFactoryInterface : public QFactoryInterface +{ + virtual QPlatformIntegration *create(const QString &key, const QStringList ¶mList) = 0; +}; + +#define QPlatformIntegrationFactoryInterface_iid "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" + +Q_DECLARE_INTERFACE(QPlatformIntegrationFactoryInterface, QPlatformIntegrationFactoryInterface_iid) + +class Q_GUI_EXPORT QPlatformIntegrationPlugin : public QObject, public QPlatformIntegrationFactoryInterface +{ + Q_OBJECT + Q_INTERFACES(QPlatformIntegrationFactoryInterface:QFactoryInterface) +public: + explicit QPlatformIntegrationPlugin(QObject *parent = 0); + ~QPlatformIntegrationPlugin(); + + virtual QStringList keys() const = 0; + virtual QPlatformIntegration *create(const QString &key, const QStringList ¶mList) = 0; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMINTEGRATIONPLUGIN_H diff --git a/src/gui/kernel/qplatformintegrationplugin_qpa.cpp b/src/gui/kernel/qplatformintegrationplugin_qpa.cpp index 7bd1caa1d3..d4debd1f3a 100644 --- a/src/gui/kernel/qplatformintegrationplugin_qpa.cpp +++ b/src/gui/kernel/qplatformintegrationplugin_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformintegrationplugin_qpa.h" +#include "qplatformintegrationplugin.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qplatformintegrationplugin_qpa.h b/src/gui/kernel/qplatformintegrationplugin_qpa.h deleted file mode 100644 index d70569cbba..0000000000 --- a/src/gui/kernel/qplatformintegrationplugin_qpa.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMINTEGRATIONPLUGIN_H -#define QPLATFORMINTEGRATIONPLUGIN_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_HEADER - -QT_BEGIN_NAMESPACE - - -class QPlatformIntegration; - -struct QPlatformIntegrationFactoryInterface : public QFactoryInterface -{ - virtual QPlatformIntegration *create(const QString &key, const QStringList ¶mList) = 0; -}; - -#define QPlatformIntegrationFactoryInterface_iid "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" - -Q_DECLARE_INTERFACE(QPlatformIntegrationFactoryInterface, QPlatformIntegrationFactoryInterface_iid) - -class Q_GUI_EXPORT QPlatformIntegrationPlugin : public QObject, public QPlatformIntegrationFactoryInterface -{ - Q_OBJECT - Q_INTERFACES(QPlatformIntegrationFactoryInterface:QFactoryInterface) -public: - explicit QPlatformIntegrationPlugin(QObject *parent = 0); - ~QPlatformIntegrationPlugin(); - - virtual QStringList keys() const = 0; - virtual QPlatformIntegration *create(const QString &key, const QStringList ¶mList) = 0; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMINTEGRATIONPLUGIN_H diff --git a/src/gui/kernel/qplatformnativeinterface.h b/src/gui/kernel/qplatformnativeinterface.h new file mode 100644 index 0000000000..918ba4a9b8 --- /dev/null +++ b/src/gui/kernel/qplatformnativeinterface.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMNATIVEINTERFACE_QPA_H +#define QPLATFORMNATIVEINTERFACE_QPA_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 +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QOpenGLContext; +class QWindow; +class QPlatformWindow; +class QBackingStore; + +class Q_GUI_EXPORT QPlatformNativeInterface : public QObject +{ + Q_OBJECT +public: + virtual void *nativeResourceForIntegration(const QByteArray &resource); + virtual void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context); + virtual void *nativeResourceForWindow(const QByteArray &resource, QWindow *window); + virtual void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore); + + typedef void * (*NativeResourceForIntegrationFunction)(); + typedef void * (*NativeResourceForContextFunction)(QOpenGLContext *context); + typedef void * (*NativeResourceForWindowFunction)(QWindow *window); + typedef void * (*NativeResourceForBackingStoreFunction)(QBackingStore *backingStore); + virtual NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource); + virtual NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource); + virtual NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource); + virtual NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource); + + virtual QVariantMap windowProperties(QPlatformWindow *window) const; + virtual QVariant windowProperty(QPlatformWindow *window, const QString &name) const; + virtual QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const; + virtual void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value); + + typedef bool (*EventFilter)(void *message, long *result); + virtual EventFilter setEventFilter(const QByteArray &eventType, EventFilter filter); + +Q_SIGNALS: + void windowPropertyChanged(QPlatformWindow *window, const QString &propertyName); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMNATIVEINTERFACE_QPA_H diff --git a/src/gui/kernel/qplatformnativeinterface_qpa.cpp b/src/gui/kernel/qplatformnativeinterface_qpa.cpp index c17eee4415..f0bd3f0658 100644 --- a/src/gui/kernel/qplatformnativeinterface_qpa.cpp +++ b/src/gui/kernel/qplatformnativeinterface_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformnativeinterface_qpa.h" +#include "qplatformnativeinterface.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qplatformnativeinterface_qpa.h b/src/gui/kernel/qplatformnativeinterface_qpa.h deleted file mode 100644 index 918ba4a9b8..0000000000 --- a/src/gui/kernel/qplatformnativeinterface_qpa.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMNATIVEINTERFACE_QPA_H -#define QPLATFORMNATIVEINTERFACE_QPA_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 -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QOpenGLContext; -class QWindow; -class QPlatformWindow; -class QBackingStore; - -class Q_GUI_EXPORT QPlatformNativeInterface : public QObject -{ - Q_OBJECT -public: - virtual void *nativeResourceForIntegration(const QByteArray &resource); - virtual void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context); - virtual void *nativeResourceForWindow(const QByteArray &resource, QWindow *window); - virtual void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore); - - typedef void * (*NativeResourceForIntegrationFunction)(); - typedef void * (*NativeResourceForContextFunction)(QOpenGLContext *context); - typedef void * (*NativeResourceForWindowFunction)(QWindow *window); - typedef void * (*NativeResourceForBackingStoreFunction)(QBackingStore *backingStore); - virtual NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource); - virtual NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource); - virtual NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource); - virtual NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource); - - virtual QVariantMap windowProperties(QPlatformWindow *window) const; - virtual QVariant windowProperty(QPlatformWindow *window, const QString &name) const; - virtual QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const; - virtual void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value); - - typedef bool (*EventFilter)(void *message, long *result); - virtual EventFilter setEventFilter(const QByteArray &eventType, EventFilter filter); - -Q_SIGNALS: - void windowPropertyChanged(QPlatformWindow *window, const QString &propertyName); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMNATIVEINTERFACE_QPA_H diff --git a/src/gui/kernel/qplatformopenglcontext.h b/src/gui/kernel/qplatformopenglcontext.h new file mode 100644 index 0000000000..ddcb87ad5a --- /dev/null +++ b/src/gui/kernel/qplatformopenglcontext.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMGLCONTEXT_H +#define QPLATFORMGLCONTEXT_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. +// + +#ifndef QT_NO_OPENGL + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QPlatformOpenGLContextPrivate; + +class Q_GUI_EXPORT QPlatformOpenGLContext +{ + Q_DECLARE_PRIVATE(QPlatformOpenGLContext) +public: + QPlatformOpenGLContext(); + virtual ~QPlatformOpenGLContext(); + + virtual QSurfaceFormat format() const = 0; + + virtual void swapBuffers(QPlatformSurface *surface) = 0; + + virtual GLuint defaultFramebufferObject(QPlatformSurface *surface) const; + + virtual bool makeCurrent(QPlatformSurface *surface) = 0; + virtual void doneCurrent() = 0; + + virtual bool isSharing() const { return false; } + virtual bool isValid() const { return true; } + + virtual QFunctionPointer getProcAddress(const QByteArray &procName) = 0; + + QOpenGLContext *context() const; + +private: + friend class QOpenGLContext; + + QScopedPointer d_ptr; + + void setContext(QOpenGLContext *context); + + Q_DISABLE_COPY(QPlatformOpenGLContext) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QT_NO_OPENGL + +#endif // QPLATFORMGLCONTEXT_H diff --git a/src/gui/kernel/qplatformopenglcontext_qpa.cpp b/src/gui/kernel/qplatformopenglcontext_qpa.cpp index 33adc26482..d38a5864d6 100644 --- a/src/gui/kernel/qplatformopenglcontext_qpa.cpp +++ b/src/gui/kernel/qplatformopenglcontext_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformopenglcontext_qpa.h" +#include "qplatformopenglcontext.h" #include diff --git a/src/gui/kernel/qplatformopenglcontext_qpa.h b/src/gui/kernel/qplatformopenglcontext_qpa.h deleted file mode 100644 index ddcb87ad5a..0000000000 --- a/src/gui/kernel/qplatformopenglcontext_qpa.h +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMGLCONTEXT_H -#define QPLATFORMGLCONTEXT_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. -// - -#ifndef QT_NO_OPENGL - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QPlatformOpenGLContextPrivate; - -class Q_GUI_EXPORT QPlatformOpenGLContext -{ - Q_DECLARE_PRIVATE(QPlatformOpenGLContext) -public: - QPlatformOpenGLContext(); - virtual ~QPlatformOpenGLContext(); - - virtual QSurfaceFormat format() const = 0; - - virtual void swapBuffers(QPlatformSurface *surface) = 0; - - virtual GLuint defaultFramebufferObject(QPlatformSurface *surface) const; - - virtual bool makeCurrent(QPlatformSurface *surface) = 0; - virtual void doneCurrent() = 0; - - virtual bool isSharing() const { return false; } - virtual bool isValid() const { return true; } - - virtual QFunctionPointer getProcAddress(const QByteArray &procName) = 0; - - QOpenGLContext *context() const; - -private: - friend class QOpenGLContext; - - QScopedPointer d_ptr; - - void setContext(QOpenGLContext *context); - - Q_DISABLE_COPY(QPlatformOpenGLContext) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QT_NO_OPENGL - -#endif // QPLATFORMGLCONTEXT_H diff --git a/src/gui/kernel/qplatformscreen.h b/src/gui/kernel/qplatformscreen.h new file mode 100644 index 0000000000..075dfb114b --- /dev/null +++ b/src/gui/kernel/qplatformscreen.h @@ -0,0 +1,133 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMSCREEN_H +#define QPLATFORMSCREEN_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 +#include +#include +#include +#include + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QPlatformBackingStore; +class QPlatformOpenGLContext; +class QPlatformScreenPrivate; +class QPlatformWindow; +class QPlatformCursor; +class QPlatformScreenPageFlipper; +class QScreen; +class QSurfaceFormat; + +typedef QPair QDpi; + + +class Q_GUI_EXPORT QPlatformScreen +{ + Q_DECLARE_PRIVATE(QPlatformScreen) + +public: + QPlatformScreen(); + virtual ~QPlatformScreen(); + + virtual QPixmap grabWindow(WId window, int x, int y, int width, int height) const; + + virtual QRect geometry() const = 0; + virtual QRect availableGeometry() const {return geometry();} + + virtual int depth() const = 0; + virtual QImage::Format format() const = 0; + + virtual QSizeF physicalSize() const; + virtual QDpi logicalDpi() const; + + virtual Qt::ScreenOrientation orientation() const; + + virtual QWindow *topLevelAt(const QPoint &point) const; + virtual QList virtualSiblings() const; + + QScreen *screen() const; + + //jl: should this function be in QPlatformIntegration + //jl: maybe screenForWindow is a better name? + static QPlatformScreen *platformScreenForWindow(const QWindow *window); + + virtual QString name() const { return QString(); } + + virtual QPlatformScreenPageFlipper *pageFlipper() const; + virtual QPlatformCursor *cursor() const; + +protected: + QScopedPointer d_ptr; + +private: + Q_DISABLE_COPY(QPlatformScreen) + + friend class QPlatformIntegration; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMSCREEN_H diff --git a/src/gui/kernel/qplatformscreen_p.h b/src/gui/kernel/qplatformscreen_p.h new file mode 100644 index 0000000000..ced66be8d7 --- /dev/null +++ b/src/gui/kernel/qplatformscreen_p.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMSCREEN_QPA_P_H +#define QPLATFORMSCREEN_QPA_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. +// + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QScreen; + +class QPlatformScreenPrivate +{ +public: + QScreen *screen; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMSCREEN_QPA_P_H diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp index a26bd25408..6c2f98beb4 100644 --- a/src/gui/kernel/qplatformscreen_qpa.cpp +++ b/src/gui/kernel/qplatformscreen_qpa.cpp @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#include "qplatformscreen_qpa.h" +#include "qplatformscreen.h" #include -#include +#include #include -#include -#include +#include +#include #include #include diff --git a/src/gui/kernel/qplatformscreen_qpa.h b/src/gui/kernel/qplatformscreen_qpa.h deleted file mode 100644 index 71d734867e..0000000000 --- a/src/gui/kernel/qplatformscreen_qpa.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMSCREEN_H -#define QPLATFORMSCREEN_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 -#include -#include -#include -#include - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QPlatformBackingStore; -class QPlatformOpenGLContext; -class QPlatformScreenPrivate; -class QPlatformWindow; -class QPlatformCursor; -class QPlatformScreenPageFlipper; -class QScreen; -class QSurfaceFormat; - -typedef QPair QDpi; - - -class Q_GUI_EXPORT QPlatformScreen -{ - Q_DECLARE_PRIVATE(QPlatformScreen) - -public: - QPlatformScreen(); - virtual ~QPlatformScreen(); - - virtual QPixmap grabWindow(WId window, int x, int y, int width, int height) const; - - virtual QRect geometry() const = 0; - virtual QRect availableGeometry() const {return geometry();} - - virtual int depth() const = 0; - virtual QImage::Format format() const = 0; - - virtual QSizeF physicalSize() const; - virtual QDpi logicalDpi() const; - - virtual Qt::ScreenOrientation orientation() const; - - virtual QWindow *topLevelAt(const QPoint &point) const; - virtual QList virtualSiblings() const; - - QScreen *screen() const; - - //jl: should this function be in QPlatformIntegration - //jl: maybe screenForWindow is a better name? - static QPlatformScreen *platformScreenForWindow(const QWindow *window); - - virtual QString name() const { return QString(); } - - virtual QPlatformScreenPageFlipper *pageFlipper() const; - virtual QPlatformCursor *cursor() const; - -protected: - QScopedPointer d_ptr; - -private: - Q_DISABLE_COPY(QPlatformScreen) - - friend class QPlatformIntegration; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMSCREEN_H diff --git a/src/gui/kernel/qplatformscreen_qpa_p.h b/src/gui/kernel/qplatformscreen_qpa_p.h deleted file mode 100644 index ced66be8d7..0000000000 --- a/src/gui/kernel/qplatformscreen_qpa_p.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMSCREEN_QPA_P_H -#define QPLATFORMSCREEN_QPA_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. -// - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -class QScreen; - -class QPlatformScreenPrivate -{ -public: - QScreen *screen; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMSCREEN_QPA_P_H diff --git a/src/gui/kernel/qplatformscreenpageflipper.h b/src/gui/kernel/qplatformscreenpageflipper.h new file mode 100644 index 0000000000..116d2dbf82 --- /dev/null +++ b/src/gui/kernel/qplatformscreenpageflipper.h @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMSCREENPAGEFLIPPER_QPA_H +#define QPLATFORMSCREENPAGEFLIPPER_QPA_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_HEADER + +QT_BEGIN_NAMESPACE + +class Q_GUI_EXPORT QPlatformScreenBuffer { +public: + QPlatformScreenBuffer(); + virtual ~QPlatformScreenBuffer(); + + bool isDestroyed() const; + bool isReady() const; + + virtual void aboutToBeDisplayed(); + virtual void displayed(); + virtual void release() = 0; + + virtual void *handle() const = 0; + +protected: + bool m_destroyed; + bool m_ready; +}; + +class Q_GUI_EXPORT QPlatformScreenPageFlipper : public QObject +{ + Q_OBJECT +public: + explicit QPlatformScreenPageFlipper(QObject *parent = 0); + + virtual bool displayBuffer(QPlatformScreenBuffer *) = 0; + +signals: + void bufferDisplayed(QPlatformScreenBuffer *); + void bufferReleased(QPlatformScreenBuffer *); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMSCREENPAGEFLIPPER_QPA_H diff --git a/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp b/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp index b912c6055e..babecb061f 100644 --- a/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp +++ b/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformscreenpageflipper_qpa.h" +#include "qplatformscreenpageflipper.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qplatformscreenpageflipper_qpa.h b/src/gui/kernel/qplatformscreenpageflipper_qpa.h deleted file mode 100644 index 116d2dbf82..0000000000 --- a/src/gui/kernel/qplatformscreenpageflipper_qpa.h +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMSCREENPAGEFLIPPER_QPA_H -#define QPLATFORMSCREENPAGEFLIPPER_QPA_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_HEADER - -QT_BEGIN_NAMESPACE - -class Q_GUI_EXPORT QPlatformScreenBuffer { -public: - QPlatformScreenBuffer(); - virtual ~QPlatformScreenBuffer(); - - bool isDestroyed() const; - bool isReady() const; - - virtual void aboutToBeDisplayed(); - virtual void displayed(); - virtual void release() = 0; - - virtual void *handle() const = 0; - -protected: - bool m_destroyed; - bool m_ready; -}; - -class Q_GUI_EXPORT QPlatformScreenPageFlipper : public QObject -{ - Q_OBJECT -public: - explicit QPlatformScreenPageFlipper(QObject *parent = 0); - - virtual bool displayBuffer(QPlatformScreenBuffer *) = 0; - -signals: - void bufferDisplayed(QPlatformScreenBuffer *); - void bufferReleased(QPlatformScreenBuffer *); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMSCREENPAGEFLIPPER_QPA_H diff --git a/src/gui/kernel/qplatformservices.h b/src/gui/kernel/qplatformservices.h new file mode 100644 index 0000000000..c9bfe020ab --- /dev/null +++ b/src/gui/kernel/qplatformservices.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMSERVICES_QPA_H +#define QPLATFORMSERVICES_QPA_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_HEADER + +QT_BEGIN_NAMESPACE + +class QUrl; + +class Q_GUI_EXPORT QPlatformServices +{ +public: + virtual ~QPlatformServices() { } + + virtual bool openUrl(const QUrl &url); + virtual bool openDocument(const QUrl &url); +}; + +QT_END_NAMESPACE +QT_END_HEADER + +#endif // QPLATFORMSERVICES_QPA_H diff --git a/src/gui/kernel/qplatformservices_qpa.cpp b/src/gui/kernel/qplatformservices_qpa.cpp index 7993a82f4e..dac9e64e40 100644 --- a/src/gui/kernel/qplatformservices_qpa.cpp +++ b/src/gui/kernel/qplatformservices_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformservices_qpa.h" +#include "qplatformservices.h" #include #include diff --git a/src/gui/kernel/qplatformservices_qpa.h b/src/gui/kernel/qplatformservices_qpa.h deleted file mode 100644 index c9bfe020ab..0000000000 --- a/src/gui/kernel/qplatformservices_qpa.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMSERVICES_QPA_H -#define QPLATFORMSERVICES_QPA_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_HEADER - -QT_BEGIN_NAMESPACE - -class QUrl; - -class Q_GUI_EXPORT QPlatformServices -{ -public: - virtual ~QPlatformServices() { } - - virtual bool openUrl(const QUrl &url); - virtual bool openDocument(const QUrl &url); -}; - -QT_END_NAMESPACE -QT_END_HEADER - -#endif // QPLATFORMSERVICES_QPA_H diff --git a/src/gui/kernel/qplatformsharedgraphicscache.h b/src/gui/kernel/qplatformsharedgraphicscache.h new file mode 100644 index 0000000000..679b8ab7de --- /dev/null +++ b/src/gui/kernel/qplatformsharedgraphicscache.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMSHAREDGRAPHICSCACHE_QPA_H +#define QPLATFORMSHAREDGRAPHICSCACHE_QPA_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_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class Q_GUI_EXPORT QPlatformSharedGraphicsCache: public QObject +{ + Q_OBJECT +public: + enum PixelFormat + { + Alpha8 + }; + + enum BufferType + { + OpenGLTexture + }; + + explicit QPlatformSharedGraphicsCache(QObject *parent = 0) : QObject(parent) {} + + Q_INVOKABLE virtual void ensureCacheInitialized(const QByteArray &cacheId, BufferType bufferType, + PixelFormat pixelFormat) = 0; + + Q_INVOKABLE virtual void requestItems(const QByteArray &cacheId, const QVector &itemIds) = 0; + Q_INVOKABLE virtual void insertItems(const QByteArray &cacheId, + const QVector &itemIds, + const QVector &items) = 0; + Q_INVOKABLE virtual void releaseItems(const QByteArray &cacheId, const QVector &itemIds) = 0; + + virtual uint textureIdForBuffer(void *bufferId) = 0; + virtual void referenceBuffer(void *bufferId) = 0; + virtual bool dereferenceBuffer(void *bufferId) = 0; + virtual QSize sizeOfBuffer(void *bufferId) = 0; + virtual void *eglImageForBuffer(void *bufferId) = 0; + +Q_SIGNALS: + void itemsMissing(const QByteArray &cacheId, const QVector &itemIds); + void itemsAvailable(const QByteArray &cacheId, void *bufferId, + const QVector &itemIds, const QVector &positionsInBuffer); + void itemsInvalidated(const QByteArray &cacheId, const QVector &itemIds); + void itemsUpdated(const QByteArray &cacheId, void *bufferId, + const QVector &itemIds, const QVector &positionsInBuffer); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMSHAREDGRAPHICSCACHE_QPA_H diff --git a/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp b/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp index 539bb1458f..a3bb8da358 100644 --- a/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp +++ b/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformsharedgraphicscache_qpa.h" +#include "qplatformsharedgraphicscache.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qplatformsharedgraphicscache_qpa.h b/src/gui/kernel/qplatformsharedgraphicscache_qpa.h deleted file mode 100644 index 679b8ab7de..0000000000 --- a/src/gui/kernel/qplatformsharedgraphicscache_qpa.h +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMSHAREDGRAPHICSCACHE_QPA_H -#define QPLATFORMSHAREDGRAPHICSCACHE_QPA_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_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -class Q_GUI_EXPORT QPlatformSharedGraphicsCache: public QObject -{ - Q_OBJECT -public: - enum PixelFormat - { - Alpha8 - }; - - enum BufferType - { - OpenGLTexture - }; - - explicit QPlatformSharedGraphicsCache(QObject *parent = 0) : QObject(parent) {} - - Q_INVOKABLE virtual void ensureCacheInitialized(const QByteArray &cacheId, BufferType bufferType, - PixelFormat pixelFormat) = 0; - - Q_INVOKABLE virtual void requestItems(const QByteArray &cacheId, const QVector &itemIds) = 0; - Q_INVOKABLE virtual void insertItems(const QByteArray &cacheId, - const QVector &itemIds, - const QVector &items) = 0; - Q_INVOKABLE virtual void releaseItems(const QByteArray &cacheId, const QVector &itemIds) = 0; - - virtual uint textureIdForBuffer(void *bufferId) = 0; - virtual void referenceBuffer(void *bufferId) = 0; - virtual bool dereferenceBuffer(void *bufferId) = 0; - virtual QSize sizeOfBuffer(void *bufferId) = 0; - virtual void *eglImageForBuffer(void *bufferId) = 0; - -Q_SIGNALS: - void itemsMissing(const QByteArray &cacheId, const QVector &itemIds); - void itemsAvailable(const QByteArray &cacheId, void *bufferId, - const QVector &itemIds, const QVector &positionsInBuffer); - void itemsInvalidated(const QByteArray &cacheId, const QVector &itemIds); - void itemsUpdated(const QByteArray &cacheId, void *bufferId, - const QVector &itemIds, const QVector &positionsInBuffer); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMSHAREDGRAPHICSCACHE_QPA_H diff --git a/src/gui/kernel/qplatformsurface.h b/src/gui/kernel/qplatformsurface.h new file mode 100644 index 0000000000..f64a697fc5 --- /dev/null +++ b/src/gui/kernel/qplatformsurface.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMSURFACE_H +#define QPLATFORMSURFACE_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 +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class Q_GUI_EXPORT QPlatformSurface +{ +public: + virtual ~QPlatformSurface(); + virtual QSurfaceFormat format() const = 0; + + QSurface::SurfaceClass surfaceClass() const; + +private: + explicit QPlatformSurface(QSurface::SurfaceClass type); + + QSurface::SurfaceClass m_type; + + friend class QPlatformWindow; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif //QPLATFORMSURFACE_H diff --git a/src/gui/kernel/qplatformsurface_qpa.cpp b/src/gui/kernel/qplatformsurface_qpa.cpp index 1f752fe3e2..50cdd68ab6 100644 --- a/src/gui/kernel/qplatformsurface_qpa.cpp +++ b/src/gui/kernel/qplatformsurface_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformsurface_qpa.h" +#include "qplatformsurface.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qplatformsurface_qpa.h b/src/gui/kernel/qplatformsurface_qpa.h deleted file mode 100644 index f64a697fc5..0000000000 --- a/src/gui/kernel/qplatformsurface_qpa.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMSURFACE_H -#define QPLATFORMSURFACE_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 -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class Q_GUI_EXPORT QPlatformSurface -{ -public: - virtual ~QPlatformSurface(); - virtual QSurfaceFormat format() const = 0; - - QSurface::SurfaceClass surfaceClass() const; - -private: - explicit QPlatformSurface(QSurface::SurfaceClass type); - - QSurface::SurfaceClass m_type; - - friend class QPlatformWindow; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif //QPLATFORMSURFACE_H diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h new file mode 100644 index 0000000000..8d936e8267 --- /dev/null +++ b/src/gui/kernel/qplatformtheme.h @@ -0,0 +1,171 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMTHEME_H +#define QPLATFORMTHEME_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_HEADER + +QT_BEGIN_NAMESPACE + +class QMenu; +class QMenuBar; +class QPlatformMenu; +class QPlatformMenuBar; +class QPlatformDialogHelper; +class QVariant; +class QPalette; +class QFont; + +class Q_GUI_EXPORT QPlatformTheme +{ +public: + enum ThemeHint { + TextCursorWidth, + DropShadow, + MaximumScrollBarDragDistance, + ToolButtonStyle, + ToolBarIconSize, + ItemViewActivateItemOnSingleClick, + SystemIconThemeName, + SystemIconFallbackThemeName, + IconThemeSearchPaths, + StyleNames, + WindowAutoPlacement, + DialogButtonBoxLayout, + DialogButtonBoxButtonsHaveIcons, + UseFullScreenForPopupMenu, + KeyboardScheme + }; + + enum DialogType { + FileDialog, + ColorDialog, + FontDialog + }; + + enum Palette { + SystemPalette, + ToolTipPalette, + ToolButtonPalette, + ButtonPalette, + HeaderPalette, + ComboBoxPalette, + ItemViewPalette, + MessageBoxLabelPelette, + TabBarPalette, + LabelPalette, + GroupBoxPalette, + MenuPalette, + MenuBarPalette, + TextEditPalette, + TextLineEditPalette, + NPalettes + }; + + enum Font { + SystemFont, + MenuFont, + MenuBarFont, + MenuItemFont, + MessageBoxFont, + LabelFont, + TipLabelFont, + StatusBarFont, + TitleBarFont, + MdiSubWindowTitleFont, + DockWidgetTitleFont, + PushButtonFont, + ToolButtonFont, + ItemViewFont, + ListViewFont, + HeaderViewFont, + ListBoxFont, + ComboMenuItemFont, + ComboLineEditFont, + SmallFont, + MiniFont, + NFonts + }; + + enum KeyboardSchemes + { + WindowsKeyboardScheme, + MacKeyboardScheme, + X11KeyboardScheme, + KdeKeyboardScheme, + GnomeKeyboardScheme, + CdeKeyboardScheme + }; + + virtual ~QPlatformTheme(); + + virtual QPlatformMenu *createPlatformMenu(QMenu *menu = 0) const; + virtual QPlatformMenuBar *createPlatformMenuBar(QMenuBar *menuBar = 0) const; + + virtual bool usePlatformNativeDialog(DialogType type) const; + virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const; + + virtual const QPalette *palette(Palette type = SystemPalette) const; + + virtual const QFont *font(Font type = SystemFont) const; + + virtual QVariant themeHint(ThemeHint hint) const; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMTHEME_H diff --git a/src/gui/kernel/qplatformtheme_qpa.cpp b/src/gui/kernel/qplatformtheme_qpa.cpp index c6314825d7..07a1d7f365 100644 --- a/src/gui/kernel/qplatformtheme_qpa.cpp +++ b/src/gui/kernel/qplatformtheme_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformtheme_qpa.h" +#include "qplatformtheme.h" #include #include diff --git a/src/gui/kernel/qplatformtheme_qpa.h b/src/gui/kernel/qplatformtheme_qpa.h deleted file mode 100644 index 8d936e8267..0000000000 --- a/src/gui/kernel/qplatformtheme_qpa.h +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMTHEME_H -#define QPLATFORMTHEME_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_HEADER - -QT_BEGIN_NAMESPACE - -class QMenu; -class QMenuBar; -class QPlatformMenu; -class QPlatformMenuBar; -class QPlatformDialogHelper; -class QVariant; -class QPalette; -class QFont; - -class Q_GUI_EXPORT QPlatformTheme -{ -public: - enum ThemeHint { - TextCursorWidth, - DropShadow, - MaximumScrollBarDragDistance, - ToolButtonStyle, - ToolBarIconSize, - ItemViewActivateItemOnSingleClick, - SystemIconThemeName, - SystemIconFallbackThemeName, - IconThemeSearchPaths, - StyleNames, - WindowAutoPlacement, - DialogButtonBoxLayout, - DialogButtonBoxButtonsHaveIcons, - UseFullScreenForPopupMenu, - KeyboardScheme - }; - - enum DialogType { - FileDialog, - ColorDialog, - FontDialog - }; - - enum Palette { - SystemPalette, - ToolTipPalette, - ToolButtonPalette, - ButtonPalette, - HeaderPalette, - ComboBoxPalette, - ItemViewPalette, - MessageBoxLabelPelette, - TabBarPalette, - LabelPalette, - GroupBoxPalette, - MenuPalette, - MenuBarPalette, - TextEditPalette, - TextLineEditPalette, - NPalettes - }; - - enum Font { - SystemFont, - MenuFont, - MenuBarFont, - MenuItemFont, - MessageBoxFont, - LabelFont, - TipLabelFont, - StatusBarFont, - TitleBarFont, - MdiSubWindowTitleFont, - DockWidgetTitleFont, - PushButtonFont, - ToolButtonFont, - ItemViewFont, - ListViewFont, - HeaderViewFont, - ListBoxFont, - ComboMenuItemFont, - ComboLineEditFont, - SmallFont, - MiniFont, - NFonts - }; - - enum KeyboardSchemes - { - WindowsKeyboardScheme, - MacKeyboardScheme, - X11KeyboardScheme, - KdeKeyboardScheme, - GnomeKeyboardScheme, - CdeKeyboardScheme - }; - - virtual ~QPlatformTheme(); - - virtual QPlatformMenu *createPlatformMenu(QMenu *menu = 0) const; - virtual QPlatformMenuBar *createPlatformMenuBar(QMenuBar *menuBar = 0) const; - - virtual bool usePlatformNativeDialog(DialogType type) const; - virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const; - - virtual const QPalette *palette(Palette type = SystemPalette) const; - - virtual const QFont *font(Font type = SystemFont) const; - - virtual QVariant themeHint(ThemeHint hint) const; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMTHEME_H diff --git a/src/gui/kernel/qplatformthemefactory_p.h b/src/gui/kernel/qplatformthemefactory_p.h new file mode 100644 index 0000000000..4d659812dc --- /dev/null +++ b/src/gui/kernel/qplatformthemefactory_p.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMTHEMEFACTORY_H +#define QPLATFORMTHEMEFACTORY_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_HEADER + +QT_BEGIN_NAMESPACE + + +class QPlatformTheme; + +class QPlatformThemeFactory +{ +public: + static QStringList keys(const QString &platformPluginPath = QString()); + static QPlatformTheme *create(const QString &key, const QString &platformPluginPath = QString()); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMTHEMEFACTORY_H diff --git a/src/gui/kernel/qplatformthemefactory_qpa.cpp b/src/gui/kernel/qplatformthemefactory_qpa.cpp index c023a73e7e..8294591c4b 100644 --- a/src/gui/kernel/qplatformthemefactory_qpa.cpp +++ b/src/gui/kernel/qplatformthemefactory_qpa.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qplatformthemefactory_qpa_p.h" -#include +#include +#include #include "private/qfactoryloader_p.h" #include "qmutex.h" diff --git a/src/gui/kernel/qplatformthemefactory_qpa_p.h b/src/gui/kernel/qplatformthemefactory_qpa_p.h deleted file mode 100644 index 4d659812dc..0000000000 --- a/src/gui/kernel/qplatformthemefactory_qpa_p.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMTHEMEFACTORY_H -#define QPLATFORMTHEMEFACTORY_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_HEADER - -QT_BEGIN_NAMESPACE - - -class QPlatformTheme; - -class QPlatformThemeFactory -{ -public: - static QStringList keys(const QString &platformPluginPath = QString()); - static QPlatformTheme *create(const QString &key, const QString &platformPluginPath = QString()); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMTHEMEFACTORY_H diff --git a/src/gui/kernel/qplatformthemeplugin.h b/src/gui/kernel/qplatformthemeplugin.h new file mode 100644 index 0000000000..3ce7cc5b02 --- /dev/null +++ b/src/gui/kernel/qplatformthemeplugin.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMTHEMEPLUGIN_H +#define QPLATFORMTHEMEPLUGIN_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_HEADER + +QT_BEGIN_NAMESPACE + + +class QPlatformTheme; + +struct QPlatformThemeFactoryInterface : public QFactoryInterface +{ + virtual QPlatformTheme *create(const QString &key, const QStringList ¶mList) = 0; +}; + +#define QPlatformThemeFactoryInterface_iid "org.qt-project.Qt.QPlatformThemeFactoryInterface" + +Q_DECLARE_INTERFACE(QPlatformThemeFactoryInterface, QPlatformThemeFactoryInterface_iid) + +class Q_GUI_EXPORT QPlatformThemePlugin : public QObject, public QPlatformThemeFactoryInterface +{ + Q_OBJECT + Q_INTERFACES(QPlatformThemeFactoryInterface:QFactoryInterface) +public: + explicit QPlatformThemePlugin(QObject *parent = 0); + ~QPlatformThemePlugin(); + + virtual QStringList keys() const = 0; + virtual QPlatformTheme *create(const QString &key, const QStringList ¶mList) = 0; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPLATFORMTHEMEPLUGIN_H diff --git a/src/gui/kernel/qplatformthemeplugin_qpa.cpp b/src/gui/kernel/qplatformthemeplugin_qpa.cpp index da2743d6e3..be18716b28 100644 --- a/src/gui/kernel/qplatformthemeplugin_qpa.cpp +++ b/src/gui/kernel/qplatformthemeplugin_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformthemeplugin_qpa.h" +#include "qplatformthemeplugin.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qplatformthemeplugin_qpa.h b/src/gui/kernel/qplatformthemeplugin_qpa.h deleted file mode 100644 index 3ce7cc5b02..0000000000 --- a/src/gui/kernel/qplatformthemeplugin_qpa.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLATFORMTHEMEPLUGIN_H -#define QPLATFORMTHEMEPLUGIN_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_HEADER - -QT_BEGIN_NAMESPACE - - -class QPlatformTheme; - -struct QPlatformThemeFactoryInterface : public QFactoryInterface -{ - virtual QPlatformTheme *create(const QString &key, const QStringList ¶mList) = 0; -}; - -#define QPlatformThemeFactoryInterface_iid "org.qt-project.Qt.QPlatformThemeFactoryInterface" - -Q_DECLARE_INTERFACE(QPlatformThemeFactoryInterface, QPlatformThemeFactoryInterface_iid) - -class Q_GUI_EXPORT QPlatformThemePlugin : public QObject, public QPlatformThemeFactoryInterface -{ - Q_OBJECT - Q_INTERFACES(QPlatformThemeFactoryInterface:QFactoryInterface) -public: - explicit QPlatformThemePlugin(QObject *parent = 0); - ~QPlatformThemePlugin(); - - virtual QStringList keys() const = 0; - virtual QPlatformTheme *create(const QString &key, const QStringList ¶mList) = 0; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QPLATFORMTHEMEPLUGIN_H diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h new file mode 100644 index 0000000000..0b4c675e56 --- /dev/null +++ b/src/gui/kernel/qplatformwindow.h @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QPLATFORMWINDOW_H +#define QPLATFORMWINDOW_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 +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QPlatformScreen; +class QPlatformWindowPrivate; +class QWindow; + +class Q_GUI_EXPORT QPlatformWindow : public QPlatformSurface +{ + Q_DECLARE_PRIVATE(QPlatformWindow) +public: + explicit QPlatformWindow(QWindow *window); + virtual ~QPlatformWindow(); + + QWindow *window() const; + QPlatformWindow *parent() const; + + QPlatformScreen *screen() const; + + virtual QSurfaceFormat format() const; + + virtual void setGeometry(const QRect &rect); + virtual QRect geometry() const; + + virtual QMargins frameMargins() const; + + virtual void setVisible(bool visible); + virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags); + virtual Qt::WindowState setWindowState(Qt::WindowState state); + + virtual WId winId() const; + virtual void setParent(const QPlatformWindow *window); + + virtual void setWindowTitle(const QString &title); + virtual void raise(); + virtual void lower(); + + virtual bool isExposed() const; + + virtual void propagateSizeHints(); + + virtual void setOpacity(qreal level); + virtual void requestActivateWindow(); + + virtual void handleContentOrientationChange(Qt::ScreenOrientation orientation); + virtual Qt::ScreenOrientation requestWindowOrientation(Qt::ScreenOrientation orientation); + + virtual bool setKeyboardGrabEnabled(bool grab); + virtual bool setMouseGrabEnabled(bool grab); + + virtual bool setWindowModified(bool modified); + + virtual void windowEvent(QEvent *event); + +protected: + QScopedPointer d_ptr; +private: + Q_DISABLE_COPY(QPlatformWindow) +}; + +QT_END_NAMESPACE + +QT_END_HEADER +#endif //QPLATFORMWINDOW_H diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index b507eb4fdd..20817361f8 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qplatformwindow_qpa.h" +#include "qplatformwindow.h" #include #include diff --git a/src/gui/kernel/qplatformwindow_qpa.h b/src/gui/kernel/qplatformwindow_qpa.h deleted file mode 100644 index 729f35e025..0000000000 --- a/src/gui/kernel/qplatformwindow_qpa.h +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QPLATFORMWINDOW_H -#define QPLATFORMWINDOW_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 -#include -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QPlatformScreen; -class QPlatformWindowPrivate; -class QWindow; - -class Q_GUI_EXPORT QPlatformWindow : public QPlatformSurface -{ - Q_DECLARE_PRIVATE(QPlatformWindow) -public: - explicit QPlatformWindow(QWindow *window); - virtual ~QPlatformWindow(); - - QWindow *window() const; - QPlatformWindow *parent() const; - - QPlatformScreen *screen() const; - - virtual QSurfaceFormat format() const; - - virtual void setGeometry(const QRect &rect); - virtual QRect geometry() const; - - virtual QMargins frameMargins() const; - - virtual void setVisible(bool visible); - virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags); - virtual Qt::WindowState setWindowState(Qt::WindowState state); - - virtual WId winId() const; - virtual void setParent(const QPlatformWindow *window); - - virtual void setWindowTitle(const QString &title); - virtual void raise(); - virtual void lower(); - - virtual bool isExposed() const; - - virtual void propagateSizeHints(); - - virtual void setOpacity(qreal level); - virtual void requestActivateWindow(); - - virtual void handleContentOrientationChange(Qt::ScreenOrientation orientation); - virtual Qt::ScreenOrientation requestWindowOrientation(Qt::ScreenOrientation orientation); - - virtual bool setKeyboardGrabEnabled(bool grab); - virtual bool setMouseGrabEnabled(bool grab); - - virtual bool setWindowModified(bool modified); - - virtual void windowEvent(QEvent *event); - -protected: - QScopedPointer d_ptr; -private: - Q_DISABLE_COPY(QPlatformWindow) -}; - -QT_END_NAMESPACE - -QT_END_HEADER -#endif //QPLATFORMWINDOW_H diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index 3546ce01dd..716caacb40 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -42,7 +42,7 @@ #include "qscreen.h" #include "qscreen_p.h" #include "qpixmap.h" -#include "qplatformscreen_qpa.h" +#include #include diff --git a/src/gui/kernel/qscreen_p.h b/src/gui/kernel/qscreen_p.h index c6bf37e87a..0167384b01 100644 --- a/src/gui/kernel/qscreen_p.h +++ b/src/gui/kernel/qscreen_p.h @@ -43,7 +43,7 @@ #define QSCREEN_P_H #include -#include +#include #include diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index 9384d34097..a98e5fbd76 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 8b37fce50c..6183b3f6ac 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -41,11 +41,11 @@ #include "qwindow.h" -#include "qplatformwindow_qpa.h" -#include "qplatformintegration_qpa.h" +#include +#include #include "qsurfaceformat.h" #ifndef QT_NO_OPENGL -#include "qplatformopenglcontext_qpa.h" +#include #include "qopenglcontext.h" #endif #include "qscreen.h" diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index 0afd903ead..92eaf90188 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -43,7 +43,7 @@ #define QWINDOW_P_H #include -#include +#include #include diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index a0b77b8208..83cf8c338c 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -39,13 +39,13 @@ ** ****************************************************************************/ #include "qwindowsysteminterface_qpa.h" -#include "qplatformwindow_qpa.h" +#include #include "qwindowsysteminterface_qpa_p.h" #include "private/qguiapplication_p.h" #include "private/qevent_p.h" #include "private/qtouchdevice_p.h" #include -#include +#include #include QT_BEGIN_NAMESPACE -- cgit v1.2.3