diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-11-08 18:19:41 +0100 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-11-08 18:19:41 +0100 |
commit | d075d35cb583c0d23ec0a0b4651fb24c6f900af1 (patch) | |
tree | 6ce47989602855fcd955d5a9b4510cc2c5ed96ca | |
parent | c6cb3ca7a672c65a5e0dff7880b8d733b18e9ad1 (diff) | |
parent | 7317f4440a9af01feac7758afff8f98e9150dd62 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I920b79bf5c48e8d72b35ec909ed6ea9d8da1da66
39 files changed, 563 insertions, 96 deletions
diff --git a/examples/winextras/iconextractor/main.cpp b/examples/winextras/iconextractor/main.cpp index 9277ac3..5c25a4b 100644 --- a/examples/winextras/iconextractor/main.cpp +++ b/examples/winextras/iconextractor/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include <QWinFunctions> +#include <QtWin> #include <QGuiApplication> #include <QScopedArrayPointer> diff --git a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-composited.png b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-composited.png Binary files differnew file mode 100644 index 0000000..76c8734 --- /dev/null +++ b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-composited.png diff --git a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-non-composited.png b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-non-composited.png Binary files differnew file mode 100644 index 0000000..23fdc56 --- /dev/null +++ b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-non-composited.png diff --git a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-taskbar.png b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-taskbar.png Binary files differnew file mode 100644 index 0000000..17d62b8 --- /dev/null +++ b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-taskbar.png diff --git a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-thumbnail.png b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-thumbnail.png Binary files differnew file mode 100644 index 0000000..0312ee2 --- /dev/null +++ b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-thumbnail.png diff --git a/examples/winextras/quickplayer/doc/src/qtwinextras-quickplayer.qdoc b/examples/winextras/quickplayer/doc/src/qtwinextras-quickplayer.qdoc new file mode 100644 index 0000000..68a08e8 --- /dev/null +++ b/examples/winextras/quickplayer/doc/src/qtwinextras-quickplayer.qdoc @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example quickplayer + \title Quick Player + \ingroup examples-qtwinextras + \brief Demonstrates using QtWinExtras in Qt Quick. + + \image qtwinextras-quickplayer-composited.png Screenshot of the Quick Player example + + The Quick Player example demonstrates how to use the various features + provided by the QtWinExtras module in Qt Quick. + + \note This example is a simplified Qt Quick-based version of the \l {Music Player} example. + + \section1 DWM Features + + The example uses Windows DWM (Desktop Window Manager) features to visually + integrate the window content to the window frame and to make the window + translucent and blurred. + + The example applies a different look based on whether composition is enabled + or not. When composition is enabled, the window is made translucent and + the window frame is extended to the client area to make the window content + integrate seamlessly to the window frame as shown above. + + \snippet quickplayer/qml/main.qml dwm + + When composition is disabled, the colorization color is used as a background + color for the window. + + \snippet quickplayer/qml/main.qml color + + The following screenshot illustrates how the Quick Player example looks when + composition is disabled. + + \image qtwinextras-quickplayer-non-composited.png Screenshot of the Quick Player example + + \section1 Taskbar Overlay and Progress + + The example uses Windows Taskbar for two things; it sets an overlay icon + that represents the current music playback state, and it indicates the + playback progress in the taskbar button. + + \image qtwinextras-quickplayer-taskbar.png Screenshot of the Quick Player taskbar + + The following snippet shows how the taskbar button is prepared. The taskbar progress + indicator and the overlay icon are bound to the music playback, and will automatically + change whenever the state or attributes of the music playback change. + + \snippet quickplayer/qml/main.qml taskbar + + \section1 Thumbnail Toolbar + + \image qtwinextras-quickplayer-thumbnail.png Screenshot of the Quick Player thumbnail + + The Windows Thumbnail Toolbar is used for providing basic music playback + controls. These controls can be used to control the application without + having to activate the application. The thumbnail toolbar buttons are bound + to the music playback, and will automatically change whenever the state or + attributes of the music playback changes. + + \snippet quickplayer/qml/main.qml thumbbar +*/ diff --git a/examples/winextras/quickplayer/images/media-pause-16.png b/examples/winextras/quickplayer/images/media-pause-16.png Binary files differnew file mode 100644 index 0000000..6cb1fd7 --- /dev/null +++ b/examples/winextras/quickplayer/images/media-pause-16.png diff --git a/examples/winextras/quickplayer/images/media-pause-32.png b/examples/winextras/quickplayer/images/media-pause-32.png Binary files differnew file mode 100644 index 0000000..3f172a0 --- /dev/null +++ b/examples/winextras/quickplayer/images/media-pause-32.png diff --git a/examples/winextras/quickplayer/images/media-play-16.png b/examples/winextras/quickplayer/images/media-play-16.png Binary files differnew file mode 100644 index 0000000..d7ee3cc --- /dev/null +++ b/examples/winextras/quickplayer/images/media-play-16.png diff --git a/examples/winextras/quickplayer/images/media-play-32.png b/examples/winextras/quickplayer/images/media-play-32.png Binary files differnew file mode 100644 index 0000000..af8d2f7 --- /dev/null +++ b/examples/winextras/quickplayer/images/media-play-32.png diff --git a/examples/winextras/quickplayer/images/media-seek-backward-32.png b/examples/winextras/quickplayer/images/media-seek-backward-32.png Binary files differnew file mode 100644 index 0000000..a21d137 --- /dev/null +++ b/examples/winextras/quickplayer/images/media-seek-backward-32.png diff --git a/examples/winextras/quickplayer/images/media-seek-forward-32.png b/examples/winextras/quickplayer/images/media-seek-forward-32.png Binary files differnew file mode 100644 index 0000000..4f8d370 --- /dev/null +++ b/examples/winextras/quickplayer/images/media-seek-forward-32.png diff --git a/examples/winextras/quickplayer/images/media-stop-32.png b/examples/winextras/quickplayer/images/media-stop-32.png Binary files differnew file mode 100644 index 0000000..aae24ba --- /dev/null +++ b/examples/winextras/quickplayer/images/media-stop-32.png diff --git a/examples/winextras/quickplayer/images/quickplayer.ico b/examples/winextras/quickplayer/images/quickplayer.ico Binary files differnew file mode 100644 index 0000000..fef1dee --- /dev/null +++ b/examples/winextras/quickplayer/images/quickplayer.ico diff --git a/examples/winextras/quickplayer/images/quickplayer.png b/examples/winextras/quickplayer/images/quickplayer.png Binary files differnew file mode 100644 index 0000000..7d3e97e --- /dev/null +++ b/examples/winextras/quickplayer/images/quickplayer.png diff --git a/examples/winextras/quickplayer/main.cpp b/examples/winextras/quickplayer/main.cpp new file mode 100644 index 0000000..39656a7 --- /dev/null +++ b/examples/winextras/quickplayer/main.cpp @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QQmlApplicationEngine> +#include <QGuiApplication> +#include <QWindow> + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + app.setApplicationName("QuickPlayer"); + app.setOrganizationName("QtWinExtras"); + app.setOrganizationDomain("qt-project.org"); + app.setApplicationDisplayName("QtWinExtras Quick Player"); + + QQmlApplicationEngine engine(QUrl("qrc:/main.qml")); + QObject* root = engine.rootObjects().value(0); + if (QWindow *window = qobject_cast<QWindow *>(root)) + window->show(); + return app.exec(); +} diff --git a/examples/winextras/quickplayer/qml/main.qml b/examples/winextras/quickplayer/qml/main.qml new file mode 100644 index 0000000..b58b49a --- /dev/null +++ b/examples/winextras/quickplayer/qml/main.qml @@ -0,0 +1,204 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Window 2.1 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.0 +import QtQuick.Dialogs 1.0 +import QtMultimedia 5.0 +import QtWinExtras 1.0 as Win + +Window { + id: window + + title: qsTr("QtWinExtras Quick Player") + + width: 300 + height: 60 + minimumWidth: row.implicitWidth + 18 + minimumHeight: column.implicitHeight + 18 + + //! [color] + color: dwm.compositionEnabled ? "transparent" : dwm.realColorizationColor + //! [color] + + //! [dwm] + Win.DwmFeatures { + id: dwm + + topGlassMargin: -1 + leftGlassMargin: -1 + rightGlassMargin: -1 + bottomGlassMargin: -1 + } + //! [dwm] + + //! [taskbar] + Win.TaskbarButton { + id: taskbar + + progress.value: mediaPlayer.position + progress.maximum: mediaPlayer.duration + progress.visible: mediaPlayer.hasAudio + progress.paused: mediaPlayer.playbackState === MediaPlayer.PausedState + + overlay.iconSource: mediaPlayer.playbackState === MediaPlayer.PlayingState ? "qrc:/play-32.png" : + mediaPlayer.playbackState === MediaPlayer.PausedState ? "qrc:/pause-32.png" : "qrc:/stop-32.png" + } + //! [taskbar] + + //! [thumbbar] + Win.ThumbnailToolBar { + id: thumbbar + + Win.ThumbnailToolButton { + tooltip: qsTr("Rewind") + iconSource: "qrc:/backward-32.png" + + enabled: mediaPlayer.position > 0 + onClicked: mediaPlayer.seek(mediaPlayer.position - mediaPlayer.duration / 10) + } + + Win.ThumbnailToolButton { + tooltip: mediaPlayer.playbackState === MediaPlayer.PlayingState ? qsTr("Pause") : qsTr("Play") + iconSource: mediaPlayer.playbackState === MediaPlayer.PlayingState ? "qrc:/pause-32.png" : "qrc:/play-32.png" + + enabled: mediaPlayer.hasAudio + onClicked: mediaPlayer.playbackState === MediaPlayer.PlayingState ? mediaPlayer.pause() : mediaPlayer.play() + } + + Win.ThumbnailToolButton { + tooltip: qsTr("Fast forward") + iconSource: "qrc:/forward-32.png" + + enabled: mediaPlayer.position < mediaPlayer.duration + onClicked: mediaPlayer.seek(mediaPlayer.position + mediaPlayer.duration / 10) + } + } + //! [thumbbar] + + MediaPlayer { + id: mediaPlayer + autoPlay: true + readonly property string title: !!metaData.author && !!metaData.title + ? qsTr("%1 - %2").arg(metaData.author).arg(metaData.title) + : metaData.author || metaData.title || source + } + + ColumnLayout { + id: column + + anchors.margins: 9 + anchors.fill: parent + + Label { + id: infoLabel + + elide: Qt.ElideLeft + verticalAlignment: Qt.AlignVCenter + text: mediaPlayer.errorString || mediaPlayer.title + Layout.minimumHeight: infoLabel.implicitHeight + Layout.fillWidth: true + Layout.fillHeight: true + } + + RowLayout { + id: row + + Button { + id: openButton + + text: qsTr("...") + Layout.preferredWidth: openButton.implicitHeight + onClicked: fileDialog.open() + + FileDialog { + id: fileDialog + + title: qsTr("Open file") + nameFilters: [qsTr("MP3 files (*.mp3)"), qsTr("All files (*.*)")] + onAccepted: mediaPlayer.source = fileDialog.fileUrl + } + } + + Button { + id: playButton + + enabled: mediaPlayer.hasAudio + Layout.preferredWidth: playButton.implicitHeight + iconSource: mediaPlayer.playbackState === MediaPlayer.PlayingState ? "qrc:/pause-16.png" : "qrc:/play-16.png" + onClicked: mediaPlayer.playbackState === MediaPlayer.PlayingState ? mediaPlayer.pause() : mediaPlayer.play() + } + + Slider { + id: positionSlider + + Layout.fillWidth: true + maximumValue: mediaPlayer.duration + + property bool sync: false + + onValueChanged: { + if (!sync) + mediaPlayer.seek(value) + } + + Connections { + target: mediaPlayer + onPositionChanged: { + positionSlider.sync = true + positionSlider.value = mediaPlayer.position + positionSlider.sync = false + } + } + } + + Label { + id: positionLabel + + readonly property int minutes: Math.floor(mediaPlayer.position / 60000) + readonly property int seconds: Math.round((mediaPlayer.position % 60000) / 1000) + + text: Qt.formatTime(new Date(0, 0, 0, 0, minutes, seconds), qsTr("mm:ss")) + } + } + } +} diff --git a/examples/winextras/quickplayer/quickplayer.pro b/examples/winextras/quickplayer/quickplayer.pro new file mode 100644 index 0000000..f7474f7 --- /dev/null +++ b/examples/winextras/quickplayer/quickplayer.pro @@ -0,0 +1,18 @@ +TEMPLATE = app +TARGET = quickplayer + +QT += quick + +SOURCES = \ + main.cpp + +OTHER_FILES += \ + qml/main.qml + +RESOURCES += \ + quickplayer.qrc + +RC_ICONS = images/quickplayer.ico + +target.path = $$[QT_INSTALL_EXAMPLES]/winextras/quickplayer +INSTALLS += target diff --git a/examples/winextras/quickplayer/quickplayer.qrc b/examples/winextras/quickplayer/quickplayer.qrc new file mode 100644 index 0000000..7515bd2 --- /dev/null +++ b/examples/winextras/quickplayer/quickplayer.qrc @@ -0,0 +1,13 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file alias="main.qml">qml/main.qml</file> + <file alias="pause-16.png">images/media-pause-16.png</file> + <file alias="pause-32.png">images/media-pause-32.png</file> + <file alias="play-16.png">images/media-play-16.png</file> + <file alias="play-32.png">images/media-play-32.png</file> + <file alias="backward-32.png">images/media-seek-backward-32.png</file> + <file alias="forward-32.png">images/media-seek-forward-32.png</file> + <file alias="stop-32.png">images/media-stop-32.png</file> + <file alias="quickplayer.png">images/quickplayer.png</file> +</qresource> +</RCC> diff --git a/examples/winextras/quickplayer/quickplayer.rc b/examples/winextras/quickplayer/quickplayer.rc new file mode 100644 index 0000000..00a51ee --- /dev/null +++ b/examples/winextras/quickplayer/quickplayer.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "images\\musicplayer.ico" diff --git a/examples/winextras/winextras.pro b/examples/winextras/winextras.pro index 8cb2148..467d53b 100644 --- a/examples/winextras/winextras.pro +++ b/examples/winextras/winextras.pro @@ -3,4 +3,5 @@ win32 { SUBDIRS += \ iconextractor qtHaveModule(widgets):qtHaveModule(multimedia): SUBDIRS += musicplayer + qtHaveModule(quick):qtHaveModule(multimedia): SUBDIRS += quickplayer } diff --git a/src/imports/winextras/qquickdwmfeatures_p.h b/src/imports/winextras/qquickdwmfeatures_p.h index 0d61f64..231424a 100644 --- a/src/imports/winextras/qquickdwmfeatures_p.h +++ b/src/imports/winextras/qquickdwmfeatures_p.h @@ -44,7 +44,7 @@ #define QQUICKDWMFEATURES_P_H #include <QQuickItem> -#include <QWinFunctions> +#include <QtWin> #include "qquickwin_p.h" diff --git a/src/imports/winextras/qquickwin_p.h b/src/imports/winextras/qquickwin_p.h index ecc908d..8735aa2 100644 --- a/src/imports/winextras/qquickwin_p.h +++ b/src/imports/winextras/qquickwin_p.h @@ -44,7 +44,7 @@ #define QQUICKWIN_P_H #include <QObject> -#include <QWinFunctions> +#include <QtWin> QT_BEGIN_NAMESPACE diff --git a/src/winextras/doc/qtwinextras.qdocconf b/src/winextras/doc/qtwinextras.qdocconf index c63c68c..138fea0 100644 --- a/src/winextras/doc/qtwinextras.qdocconf +++ b/src/winextras/doc/qtwinextras.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtWinExtras description = Qt Windows Extras Reference Documentation -url = http://qt-project.org/doc/qt-$QT_VER/qtwinextras +url = http://qt-project.org/doc/qt-$QT_VER version = $QT_VERSION exampledirs += ../../../examples/winextras \ diff --git a/src/winextras/qwinextrasglobal.h b/src/winextras/qwinextrasglobal.h index a5b4b10..25503d2 100644 --- a/src/winextras/qwinextrasglobal.h +++ b/src/winextras/qwinextrasglobal.h @@ -46,10 +46,14 @@ QT_BEGIN_NAMESPACE -#if defined(QT_BUILD_WINEXTRAS_LIB) -# define Q_WINEXTRAS_EXPORT Q_DECL_EXPORT +#ifndef QT_STATIC +# if defined(QT_BUILD_WINEXTRAS_LIB) +# define Q_WINEXTRAS_EXPORT Q_DECL_EXPORT +# else +# define Q_WINEXTRAS_EXPORT Q_DECL_IMPORT +# endif #else -# define Q_WINEXTRAS_EXPORT Q_DECL_IMPORT +# define Q_WINEXTRAS_EXPORT #endif QT_END_NAMESPACE diff --git a/src/winextras/qwinfunctions.cpp b/src/winextras/qwinfunctions.cpp index bbed42a..3e62aff 100644 --- a/src/winextras/qwinfunctions.cpp +++ b/src/winextras/qwinfunctions.cpp @@ -43,6 +43,7 @@ #include "qwinfunctions.h" #include "qwinfunctions_p.h" #include "qwineventfilter_p.h" +#include "windowsguidsdefs_p.h" #include <QGuiApplication> #include <QWindow> @@ -70,7 +71,7 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon); \namespace QtWin \inmodule QtWinExtras \brief The QtWin namespace contains miscellaneous Windows-specific functions. - \inheaderfile QWinFunctions + \inheaderfile QtWin */ @@ -1833,7 +1834,7 @@ void QtWin::setCurrentProcessExplicitAppUserModelID(const QString &id) ITaskbarList3 *qt_createITaskbarList3() { ITaskbarList3 *pTbList = 0; - HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, reinterpret_cast<void **>(&pTbList)); + HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, qIID_ITaskbarList3, reinterpret_cast<void **>(&pTbList)); if (SUCCEEDED(result)) { if (FAILED(pTbList->HrInit())) { pTbList->Release(); @@ -1849,7 +1850,7 @@ ITaskbarList3 *qt_createITaskbarList3() ITaskbarList2 *qt_createITaskbarList2() { ITaskbarList3 *pTbList = 0; - HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList2, reinterpret_cast<void **>(&pTbList)); + HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, qIID_ITaskbarList2, reinterpret_cast<void **>(&pTbList)); if (SUCCEEDED(result)) { if (FAILED(pTbList->HrInit())) { pTbList->Release(); diff --git a/src/winextras/qwinfunctions.h b/src/winextras/qwinfunctions.h index b03a426..f7db203 100644 --- a/src/winextras/qwinfunctions.h +++ b/src/winextras/qwinfunctions.h @@ -43,7 +43,7 @@ #define QWINFUNCTIONS_H #if 0 -#pragma qt_class(QWinFunctions) +#pragma qt_class(QtWin) #endif #include <QtCore/qobject.h> diff --git a/src/winextras/qwinfunctions_p.cpp b/src/winextras/qwinfunctions_p.cpp index 00dd349..6e259c5 100644 --- a/src/winextras/qwinfunctions_p.cpp +++ b/src/winextras/qwinfunctions_p.cpp @@ -88,7 +88,7 @@ HRESULT qt_DwmGetColorizationColor(DWORD *colorization, BOOL *opaqueBlend) HRESULT qt_DwmSetWindowAttribute(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute) { qt_winextras_init(); - if (pDwmGetColorizationColor) + if (pDwmSetWindowAttribute) return pDwmSetWindowAttribute(hwnd, dwAttribute, pvAttribute, cbAttribute); else return E_FAIL; diff --git a/src/winextras/qwinjumplist.cpp b/src/winextras/qwinjumplist.cpp index 5d2020e..fa233a2 100644 --- a/src/winextras/qwinjumplist.cpp +++ b/src/winextras/qwinjumplist.cpp @@ -45,6 +45,8 @@ #include "qwinjumplistitem.h" #include "qwinjumplistcategory.h" #include "qwinjumplistcategory_p.h" +#include "windowsguidsdefs_p.h" +#include "winpropkey_p.h" #include <QDir> #include <QCoreApplication> @@ -180,7 +182,7 @@ bool QWinJumpListPrivate::beginList() if (SUCCEEDED(hresult)) { UINT maxSlots = 0; IUnknown *array = 0; - hresult = pDestList->BeginList(&maxSlots, IID_IUnknown, reinterpret_cast<void **>(&array)); + hresult = pDestList->BeginList(&maxSlots, qIID_IUnknown, reinterpret_cast<void **>(&array)); if (array) array->Release(); } @@ -235,7 +237,7 @@ QList<QWinJumpListItem *> QWinJumpListPrivate::fromComCollection(IObjectArray *a array->GetCount(&count); for (UINT i = 0; i < count; ++i) { IUnknown *collectionItem = 0; - HRESULT hresult = array->GetAt(i, IID_IUnknown, reinterpret_cast<void **>(&collectionItem)); + HRESULT hresult = array->GetAt(i, qIID_IUnknown, reinterpret_cast<void **>(&collectionItem)); if (FAILED(hresult)) { QWinJumpListPrivate::warning("GetAt", hresult); continue; @@ -243,10 +245,10 @@ QList<QWinJumpListItem *> QWinJumpListPrivate::fromComCollection(IObjectArray *a IShellItem2 *shellItem = 0; IShellLinkW *shellLink = 0; QWinJumpListItem *jumplistItem = 0; - if (SUCCEEDED(collectionItem->QueryInterface(IID_IShellItem2, reinterpret_cast<void **>(&shellItem)))) { + if (SUCCEEDED(collectionItem->QueryInterface(qIID_IShellItem2, reinterpret_cast<void **>(&shellItem)))) { jumplistItem = fromIShellItem(shellItem); shellItem->Release(); - } else if (SUCCEEDED(collectionItem->QueryInterface(IID_IShellLinkW, reinterpret_cast<void **>(&shellLink)))) { + } else if (SUCCEEDED(collectionItem->QueryInterface(qIID_IShellLinkW, reinterpret_cast<void **>(&shellLink)))) { jumplistItem = fromIShellLink(shellLink); shellLink->Release(); } else { @@ -264,7 +266,7 @@ IObjectCollection *QWinJumpListPrivate::toComCollection(const QList<QWinJumpList if (list.isEmpty()) return 0; IObjectCollection *collection = 0; - HRESULT hresult = CoCreateInstance(CLSID_EnumerableObjectCollection, 0, CLSCTX_INPROC_SERVER, IID_IObjectCollection, reinterpret_cast<void **>(&collection)); + HRESULT hresult = CoCreateInstance(qCLSID_EnumerableObjectCollection, 0, CLSCTX_INPROC_SERVER, qIID_IObjectCollection, reinterpret_cast<void **>(&collection)); if (FAILED(hresult)) { QWinJumpListPrivate::warning("QWinJumpList: failed to instantiate IObjectCollection", hresult); return 0; @@ -284,9 +286,9 @@ QWinJumpListItem *QWinJumpListPrivate::fromIShellLink(IShellLinkW *link) QWinJumpListItem *item = new QWinJumpListItem(QWinJumpListItem::Link); IPropertyStore *linkProps; - link->QueryInterface(IID_IPropertyStore, reinterpret_cast<void **>(&linkProps)); + link->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&linkProps)); PROPVARIANT var; - linkProps->GetValue(PKEY_Link_Arguments, &var); + linkProps->GetValue(qPKEY_Link_Arguments, &var); item->setArguments(QStringList(QString::fromWCharArray(var.pwszVal))); PropVariantClear(&var); linkProps->Release(); @@ -334,7 +336,7 @@ IUnknown *QWinJumpListPrivate::toICustomDestinationListItem(const QWinJumpListIt IShellLinkW *QWinJumpListPrivate::toIShellLink(const QWinJumpListItem *item) { IShellLinkW *link = 0; - HRESULT hresult = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, IID_IShellLinkW, reinterpret_cast<void **>(&link)); + HRESULT hresult = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, qIID_IShellLinkW, reinterpret_cast<void **>(&link)); if (FAILED(hresult)) { QWinJumpListPrivate::warning("QWinJumpList: failed to instantiate IShellLinkW", hresult); return 0; @@ -372,7 +374,7 @@ IShellLinkW *QWinJumpListPrivate::toIShellLink(const QWinJumpListItem *item) IPropertyStore *properties; PROPVARIANT titlepv; - hresult = link->QueryInterface(IID_IPropertyStore, reinterpret_cast<void **>(&properties)); + hresult = link->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&properties)); if (FAILED(hresult)) { link->Release(); return 0; @@ -380,7 +382,7 @@ IShellLinkW *QWinJumpListPrivate::toIShellLink(const QWinJumpListItem *item) qt_qstringToNullTerminated(item->title(), buffer); InitPropVariantFromString(buffer, &titlepv); - properties->SetValue(PKEY_Title, titlepv); + properties->SetValue(qPKEY_Title, titlepv); properties->Commit(); properties->Release(); PropVariantClear(&titlepv); @@ -393,7 +395,7 @@ IShellItem2 *QWinJumpListPrivate::toIShellItem(const QWinJumpListItem *item) { IShellItem2 *shellitem = 0; wchar_t *buffer = qt_qstringToNullTerminated(item->filePath()); - qt_SHCreateItemFromParsingName(buffer, 0, IID_IShellItem2, reinterpret_cast<void **>(&shellitem)); + qt_SHCreateItemFromParsingName(buffer, 0, qIID_IShellItem2, reinterpret_cast<void **>(&shellitem)); delete[] buffer; return shellitem; } @@ -401,12 +403,12 @@ IShellItem2 *QWinJumpListPrivate::toIShellItem(const QWinJumpListItem *item) IShellLinkW *QWinJumpListPrivate::makeSeparatorShellItem() { IShellLinkW *separator; - HRESULT res = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, IID_IShellLinkW, reinterpret_cast<void **>(&separator)); + HRESULT res = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, qIID_IShellLinkW, reinterpret_cast<void **>(&separator)); if (FAILED(res)) return 0; IPropertyStore *properties; - res = separator->QueryInterface(IID_IPropertyStore, reinterpret_cast<void **>(&properties)); + res = separator->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&properties)); if (FAILED(res)) { separator->Release(); return 0; @@ -414,7 +416,7 @@ IShellLinkW *QWinJumpListPrivate::makeSeparatorShellItem() PROPVARIANT isSeparator; InitPropVariantFromBoolean(TRUE, &isSeparator); - properties->SetValue(PKEY_AppUserModel_IsDestListSeparator, isSeparator); + properties->SetValue(qPKEY_AppUserModel_IsDestListSeparator, isSeparator); properties->Commit(); properties->Release(); PropVariantClear(&isSeparator); @@ -430,7 +432,7 @@ QWinJumpList::QWinJumpList(QObject *parent) : { Q_D(QWinJumpList); d->q_ptr = this; - HRESULT hresult = CoCreateInstance(CLSID_DestinationList, 0, CLSCTX_INPROC_SERVER, IID_ICustomDestinationList, reinterpret_cast<void **>(&d_ptr->pDestList)); + HRESULT hresult = CoCreateInstance(qCLSID_DestinationList, 0, CLSCTX_INPROC_SERVER, qIID_ICustomDestinationList, reinterpret_cast<void **>(&d_ptr->pDestList)); if (FAILED(hresult)) QWinJumpListPrivate::warning("CoCreateInstance", hresult); setIdentifier(defaultIdentifier()); diff --git a/src/winextras/qwinjumplistcategory.cpp b/src/winextras/qwinjumplistcategory.cpp index 25b10a2..4ca815e 100644 --- a/src/winextras/qwinjumplistcategory.cpp +++ b/src/winextras/qwinjumplistcategory.cpp @@ -46,6 +46,7 @@ #include "qwinfunctions_p.h" #include "qwinjumplist_p.h" #include "winshobjidl_p.h" +#include "windowsguidsdefs_p.h" #include <shlobj.h> @@ -98,7 +99,7 @@ void QWinJumpListCategoryPrivate::loadRecents() { Q_ASSERT(jumpList); IApplicationDocumentLists *pDocList = 0; - HRESULT hresult = CoCreateInstance(CLSID_ApplicationDocumentLists, 0, CLSCTX_INPROC_SERVER, IID_IApplicationDocumentLists, reinterpret_cast<void **>(&pDocList)); + HRESULT hresult = CoCreateInstance(qCLSID_ApplicationDocumentLists, 0, CLSCTX_INPROC_SERVER, qIID_IApplicationDocumentLists, reinterpret_cast<void **>(&pDocList)); if (SUCCEEDED(hresult)) { if (!jumpList->identifier().isEmpty()) { wchar_t *id = qt_qstringToNullTerminated(jumpList->identifier()); @@ -108,7 +109,7 @@ void QWinJumpListCategoryPrivate::loadRecents() if (SUCCEEDED(hresult)) { IObjectArray *array = 0; hresult = pDocList->GetList(type == QWinJumpListCategory::Recent ? ADLT_RECENT : ADLT_FREQUENT, - 0, IID_IObjectArray, reinterpret_cast<void **>(&array)); + 0, qIID_IObjectArray, reinterpret_cast<void **>(&array)); if (SUCCEEDED(hresult)) { items = QWinJumpListPrivate::fromComCollection(array); array->Release(); @@ -139,7 +140,7 @@ void QWinJumpListCategoryPrivate::addRecent(QWinJumpListItem *item) void QWinJumpListCategoryPrivate::clearRecents() { IApplicationDestinations *pDest = 0; - HRESULT hresult = CoCreateInstance(CLSID_ApplicationDestinations, 0, CLSCTX_INPROC_SERVER, IID_IApplicationDestinations, reinterpret_cast<void **>(&pDest)); + HRESULT hresult = CoCreateInstance(qCLSID_ApplicationDestinations, 0, CLSCTX_INPROC_SERVER, qIID_IApplicationDestinations, reinterpret_cast<void **>(&pDest)); if (SUCCEEDED(hresult)) { const QString identifier = jumpList ? jumpList->identifier() : QString(); if (!identifier.isEmpty()) { diff --git a/src/winextras/qwintaskbarbutton.cpp b/src/winextras/qwintaskbarbutton.cpp index 48a6bbc..27cbd43 100644 --- a/src/winextras/qwintaskbarbutton.cpp +++ b/src/winextras/qwintaskbarbutton.cpp @@ -48,6 +48,7 @@ #include "qwineventfilter_p.h" #include "qwinevent.h" #include "winshobjidl_p.h" +#include "windowsguidsdefs_p.h" #include <QWindow> #include <QIcon> @@ -96,16 +97,16 @@ static TBPFLAG nativeProgressState(QWinTaskbarProgress *progress) QWinTaskbarButtonPrivate::QWinTaskbarButtonPrivate() : progressBar(0), pTbList(0), window(0) { - HRESULT hresult = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList4, reinterpret_cast<void **>(&pTbList)); + HRESULT hresult = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, qIID_ITaskbarList4, reinterpret_cast<void **>(&pTbList)); if (FAILED(hresult)) { pTbList = 0; const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinTaskbarButton: IID_ITaskbarList4 was not created: %#010x, %s.", (unsigned)hresult, qPrintable(err)); + qWarning("QWinTaskbarButton: qIID_ITaskbarList4 was not created: %#010x, %s.", (unsigned)hresult, qPrintable(err)); } else if (FAILED(pTbList->HrInit())) { pTbList->Release(); pTbList = 0; const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinTaskbarButton: IID_ITaskbarList4 was not initialized: %#010x, %s.", (unsigned)hresult, qPrintable(err)); + qWarning("QWinTaskbarButton: qIID_ITaskbarList4 was not initialized: %#010x, %s.", (unsigned)hresult, qPrintable(err)); } } diff --git a/src/winextras/qwinthumbnailtoolbar.cpp b/src/winextras/qwinthumbnailtoolbar.cpp index cc85b9c..c1f0f2c 100644 --- a/src/winextras/qwinthumbnailtoolbar.cpp +++ b/src/winextras/qwinthumbnailtoolbar.cpp @@ -44,6 +44,7 @@ #include "qwinthumbnailtoolbar_p.h" #include "qwinthumbnailtoolbutton.h" #include "qwinthumbnailtoolbutton_p.h" +#include "windowsguidsdefs_p.h" #include <QWindow> #include <QCoreApplication> @@ -215,10 +216,10 @@ void QWinThumbnailToolBar::clear() static inline ITaskbarList4 *createTaskbarList() { ITaskbarList4 *result = 0; - HRESULT hresult = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList4, reinterpret_cast<void **>(&result)); + HRESULT hresult = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, qIID_ITaskbarList4, reinterpret_cast<void **>(&result)); if (FAILED(hresult)) { const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinThumbnailToolBar: IID_ITaskbarList4 was not created: %#010x, %s.", + qWarning("QWinThumbnailToolBar: qIID_ITaskbarList4 was not created: %#010x, %s.", (unsigned)hresult, qPrintable(err)); return 0; } @@ -226,7 +227,7 @@ static inline ITaskbarList4 *createTaskbarList() if (FAILED(hresult)) { result->Release(); const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinThumbnailToolBar: IID_ITaskbarList4 was not initialized: %#010x, %s.", + qWarning("QWinThumbnailToolBar: qIID_ITaskbarList4 was not initialized: %#010x, %s.", (unsigned)hresult, qPrintable(err)); return 0; } diff --git a/src/winextras/windowsguidsdefs.cpp b/src/winextras/windowsguidsdefs.cpp index 740cb84..73d9ec0 100644 --- a/src/winextras/windowsguidsdefs.cpp +++ b/src/winextras/windowsguidsdefs.cpp @@ -39,36 +39,36 @@ ** ****************************************************************************/ -#include <QtGlobal> - -#include <qt_windows.h> +#include "windowsguidsdefs_p.h" #include "winpropkey_p.h" #include "winshobjidl_p.h" -// shobjidl.h from MinGW 4.7, shipped with Qt 5.0, does provide many of those, but is unable to link with them -#if defined(Q_CC_MINGW) || _MSC_VER < 1600 -const GUID CLSID_DestinationList = {0x77f10cf0, 0x3db5, 0x4966, {0xb5,0x20,0xb7,0xc5,0x4f,0xd3,0x5e,0xd6}}; -const GUID CLSID_EnumerableObjectCollection = {0x2d3468c1, 0x36a7, 0x43b6, {0xac,0x24,0xd3,0xf0,0x2f,0xd9,0x60,0x7a}}; -const GUID IID_ICustomDestinationList = {0x6332debf, 0x87b5, 0x4670, {0x90,0xc0,0x5e,0x57,0xb4,0x08,0xa4,0x9e}}; -const GUID IID_IApplicationDestinations = {0x12337d35, 0x94c6, 0x48a0, {0xbc,0xe7,0x6a,0x9c,0x69,0xd4,0xd6,0x00}}; -const GUID CLSID_ApplicationDestinations = {0x86c14003, 0x4d6b, 0x4ef3, {0xa7,0xb4,0x05,0x06,0x66,0x3b,0x2e,0x68}}; -const GUID IID_IApplicationDocumentLists = {0x3c594f9f, 0x9f30, 0x47a1, {0x97,0x9a,0xc9,0xe8,0x3d,0x3d,0x0a,0x06}}; -const GUID CLSID_ApplicationDocumentLists = {0x86bec222, 0x30f2, 0x47e0, {0x9f,0x25,0x60,0xd1,0x1c,0xd7,0x5c,0x28}}; -const GUID IID_IObjectArray = {0x92ca9dcd, 0x5622, 0x4bba, {0xa8,0x05,0x5e,0x9f,0x54,0x1b,0xd8,0xc9}}; -const GUID IID_IObjectCollection = {0x5632b1a4, 0xe38a, 0x400a, {0x92,0x8a,0xd4,0xcd,0x63,0x23,0x02,0x95}}; -const GUID IID_IPropertyStore = {0x886d8eeb, 0x8cf2, 0x4446, {0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99}}; -const GUID IID_ITaskbarList3 = {0xea1afb91, 0x9e28, 0x4b86, {0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}}; -const GUID IID_ITaskbarList4 = {0xc43dc798, 0x95d1, 0x4bea, {0x90,0x30, 0xbb,0x99,0xe2,0x98,0x3a,0x1a}}; -const PROPERTYKEY PKEY_Title = {{0xf29f85e0, 0x4ff9, 0x1068, {0xab,0x91,0x08,0x00,0x2b,0x27,0xb3,0xd9}}, 2}; -const PROPERTYKEY PKEY_Link_Arguments = {{0x436f2667, 0x14e2, 0x4feb, {0xb3,0x0a,0x14,0x6c,0x53,0xb5,0xb6,0x74}}, 100}; -const PROPERTYKEY PKEY_AppUserModel_IsDestListSeparator = {{0x9f4c2855, 0x9f79, 0x4b39, {0xa8,0xd0,0xe1,0xd4,0x2d,0xe1,0xd5,0xf3}}, 6}; -#endif +QT_BEGIN_NAMESPACE + +// Some of these symbols are defined to varying extents in the various +// MinGW versions. To avoid potential conflicts, we provide them prefixed with +// 'q' in Qt's namespace. + +const GUID qCLSID_DestinationList = {0x77f10cf0, 0x3db5, 0x4966, {0xb5,0x20,0xb7,0xc5,0x4f,0xd3,0x5e,0xd6}}; +const GUID qCLSID_EnumerableObjectCollection = {0x2d3468c1, 0x36a7, 0x43b6, {0xac,0x24,0xd3,0xf0,0x2f,0xd9,0x60,0x7a}}; +const GUID qIID_ICustomDestinationList = {0x6332debf, 0x87b5, 0x4670, {0x90,0xc0,0x5e,0x57,0xb4,0x08,0xa4,0x9e}}; +const GUID qIID_IApplicationDestinations = {0x12337d35, 0x94c6, 0x48a0, {0xbc,0xe7,0x6a,0x9c,0x69,0xd4,0xd6,0x00}}; +const GUID qCLSID_ApplicationDestinations = {0x86c14003, 0x4d6b, 0x4ef3, {0xa7,0xb4,0x05,0x06,0x66,0x3b,0x2e,0x68}}; +const GUID qIID_IApplicationDocumentLists = {0x3c594f9f, 0x9f30, 0x47a1, {0x97,0x9a,0xc9,0xe8,0x3d,0x3d,0x0a,0x06}}; +const GUID qCLSID_ApplicationDocumentLists = {0x86bec222, 0x30f2, 0x47e0, {0x9f,0x25,0x60,0xd1,0x1c,0xd7,0x5c,0x28}}; +const GUID qIID_IObjectArray = {0x92ca9dcd, 0x5622, 0x4bba, {0xa8,0x05,0x5e,0x9f,0x54,0x1b,0xd8,0xc9}}; +const GUID qIID_IObjectCollection = {0x5632b1a4, 0xe38a, 0x400a, {0x92,0x8a,0xd4,0xcd,0x63,0x23,0x02,0x95}}; +const GUID qIID_IPropertyStore = {0x886d8eeb, 0x8cf2, 0x4446, {0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99}}; +const GUID qIID_ITaskbarList3 = {0xea1afb91, 0x9e28, 0x4b86, {0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}}; +const GUID qIID_ITaskbarList4 = {0xc43dc798, 0x95d1, 0x4bea, {0x90,0x30, 0xbb,0x99,0xe2,0x98,0x3a,0x1a}}; +const PROPERTYKEY qPKEY_Title = {{0xf29f85e0, 0x4ff9, 0x1068, {0xab,0x91,0x08,0x00,0x2b,0x27,0xb3,0xd9}}, 2}; +const PROPERTYKEY qPKEY_Link_Arguments = {{0x436f2667, 0x14e2, 0x4feb, {0xb3,0x0a,0x14,0x6c,0x53,0xb5,0xb6,0x74}}, 100}; +const PROPERTYKEY qPKEY_AppUserModel_IsDestListSeparator = {{0x9f4c2855, 0x9f79, 0x4b39, {0xa8,0xd0,0xe1,0xd4,0x2d,0xe1,0xd5,0xf3}}, 6}; +const GUID qIID_IShellItem2 = {0x7e9fb0d3, 0x919f, 0x4307, {0xab,0x2e,0x9b,0x18,0x60,0x31,0x0c,0x93}}; +const GUID qIID_IShellLinkW = {0x000214f9, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}; +const GUID qIID_ITaskbarList = {0xea1afb91, 0x9e28, 0x4b86, {0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}}; +const GUID qIID_ITaskbarList2 = {0x602d4995, 0xb13a, 0x429b, {0xa6,0x6e,0x19,0x35,0xe4,0x4f,0x43,0x17}}; +const GUID qIID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}; +const GUID qGUID_NULL = {0x00000000, 0x0000, 0x0000, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; -#if defined(Q_CC_MINGW) -const GUID IID_IShellItem2 = {0x7e9fb0d3, 0x919f, 0x4307, {0xab,0x2e,0x9b,0x18,0x60,0x31,0x0c,0x93}}; -const GUID IID_IShellLinkW = {0x000214f9, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}; -const GUID IID_ITaskbarList = {0xea1afb91, 0x9e28, 0x4b86, {0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}}; -const GUID IID_ITaskbarList2 = {0x602d4995, 0xb13a, 0x429b, {0xa6,0x6e,0x19,0x35,0xe4,0x4f,0x43,0x17}}; -const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}; -const GUID GUID_NULL = {0x00000000, 0x0000, 0x0000, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; -#endif +QT_END_NAMESPACE diff --git a/src/winextras/windowsguidsdefs_p.h b/src/winextras/windowsguidsdefs_p.h new file mode 100644 index 0000000..e66df96 --- /dev/null +++ b/src/winextras/windowsguidsdefs_p.h @@ -0,0 +1,82 @@ +/**************************************************************************** + ** + ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> + ** Contact: http://www.qt-project.org/legal + ** + ** This file is part of the QtWinExtras module of the Qt Toolkit. + ** + ** $QT_BEGIN_LICENSE:LGPL$ + ** Commercial License Usage + ** Licensees holding valid commercial Qt licenses may use this file in + ** accordance with the commercial license agreement provided with the + ** Software or, alternatively, in accordance with the terms contained in + ** a written agreement between you and Digia. For licensing terms and + ** conditions see http://qt.digia.com/licensing. For further information + ** use the contact form at http://qt.digia.com/contact-us. + ** + ** GNU Lesser General Public License Usage + ** Alternatively, this file may be used under the terms of the GNU Lesser + ** General Public License version 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, Digia gives you certain additional + ** rights. These rights are described in the Digia 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. + ** + ** + ** $QT_END_LICENSE$ + ** + ****************************************************************************/ + +#ifndef WINDOWSGUIDSDEFS_P_H +#define WINDOWSGUIDSDEFS_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of QtWinExtras. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtGlobal> +#include <qt_windows.h> + +QT_BEGIN_NAMESPACE + +extern const GUID qCLSID_DestinationList; +extern const GUID qCLSID_EnumerableObjectCollection; +extern const GUID qIID_ICustomDestinationList; +extern const GUID qIID_IApplicationDestinations; +extern const GUID qCLSID_ApplicationDestinations; +extern const GUID qIID_IApplicationDocumentLists; +extern const GUID qCLSID_ApplicationDocumentLists; +extern const GUID qIID_IObjectArray; +extern const GUID qIID_IObjectCollection; +extern const GUID qIID_IPropertyStore; +extern const GUID qIID_ITaskbarList3; +extern const GUID qIID_ITaskbarList4; +extern const GUID qIID_IShellItem2; +extern const GUID qIID_IShellLinkW; +extern const GUID qIID_ITaskbarList; +extern const GUID qIID_ITaskbarList2; +extern const GUID qIID_IUnknown; +extern const GUID qGUID_NULL; + +QT_END_NAMESPACE + +#endif // WINDOWSGUIDSDEFS_P_H diff --git a/src/winextras/winextras.pro b/src/winextras/winextras.pro index 6642a3e..5b9bbe7 100644 --- a/src/winextras/winextras.pro +++ b/src/winextras/winextras.pro @@ -36,13 +36,13 @@ HEADERS += \ qwinthumbnailtoolbar_p.h \ qwinthumbnailtoolbutton.h \ qwinthumbnailtoolbutton_p.h \ - qwinevent.h + qwinevent.h \ + windowsguidsdefs_p.h QMAKE_DOCS = $$PWD/doc/qtwinextras.qdocconf DEFINES += NTDDI_VERSION=0x06010000 _WIN32_WINNT=0x0601 -LIBS += -lole32 -lshlwapi -lshell32 -LIBS -= -luuid +LIBS_PRIVATE += -lole32 -lshlwapi -lshell32 OTHER_FILES += \ doc/qtwinextras.qdocconf \ diff --git a/src/winextras/winpropkey_p.h b/src/winextras/winpropkey_p.h index 12e40a1..b58960d 100644 --- a/src/winextras/winpropkey_p.h +++ b/src/winextras/winpropkey_p.h @@ -42,13 +42,26 @@ #ifndef WINPROPKEY_P_H #define WINPROPKEY_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of QtWinExtras. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtGlobal> #include <propkey.h> -#if _MSC_VER < 1600 || defined(Q_CC_MINGW) +QT_BEGIN_NAMESPACE -extern const PROPERTYKEY PKEY_AppUserModel_IsDestListSeparator; -extern const PROPERTYKEY PKEY_Link_Arguments; +extern const PROPERTYKEY qPKEY_Title; +extern const PROPERTYKEY qPKEY_AppUserModel_IsDestListSeparator; +extern const PROPERTYKEY qPKEY_Link_Arguments; -#endif +QT_END_NAMESPACE #endif // WINPROPKEY_P_H diff --git a/src/winextras/winshobjidl_p.h b/src/winextras/winshobjidl_p.h index 7d1085d..91faed5 100644 --- a/src/winextras/winshobjidl_p.h +++ b/src/winextras/winshobjidl_p.h @@ -47,8 +47,6 @@ #ifndef __ITaskbarList_INTERFACE_DEFINED__ #define __ITaskbarList_INTERFACE_DEFINED__ -extern const GUID IID_ITaskbarList; - struct ITaskbarList : IUnknown { virtual HRESULT STDMETHODCALLTYPE HrInit() = 0; @@ -63,8 +61,6 @@ struct ITaskbarList : IUnknown #ifndef __ITaskbarList2_INTERFACE_DEFINED__ #define __ITaskbarList2_INTERFACE_DEFINED__ -extern const GUID IID_ITaskbarList2; - struct ITaskbarList2 : ITaskbarList { virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fullscreen) = 0; @@ -75,8 +71,6 @@ struct ITaskbarList2 : ITaskbarList #ifndef __ITaskbarList3_INTERFACE_DEFINED__ #define __ITaskbarList3_INTERFACE_DEFINED__ -extern const GUID IID_ITaskbarList3; - enum THUMBBUTTONMASK { THB_BITMAP = 0x00000001, THB_ICON = 0x00000002, @@ -140,8 +134,6 @@ struct ITaskbarList3 : ITaskbarList2 #ifndef __ITaskbarList4_INTERFACE_DEFINED__ #define __ITaskbarList4_INTERFACE_DEFINED__ -extern const GUID IID_ITaskbarList4; - struct ITaskbarList4 : ITaskbarList3 { virtual HRESULT STDMETHODCALLTYPE SetTabProperties(HWND tab, STPFLAG flags) = 0; @@ -152,9 +144,6 @@ struct ITaskbarList4 : ITaskbarList3 #ifndef __IObjectArray_INTERFACE_DEFINED__ #define __IObjectArray_INTERFACE_DEFINED__ -extern const GUID CLSID_EnumerableObjectCollection; -extern const GUID IID_IObjectArray; - struct IObjectArray : IUnknown { public: @@ -167,8 +156,6 @@ public: #ifndef __IObjectCollection_INTERFACE_DEFINED__ #define __IObjectCollection_INTERFACE_DEFINED__ -extern const GUID IID_IObjectCollection; - struct IObjectCollection : IObjectArray { public: @@ -188,9 +175,6 @@ enum KNOWNDESTCATEGORY { KDC_RECENT }; -extern const GUID IID_ICustomDestinationList; -extern const GUID CLSID_DestinationList; - struct ICustomDestinationList : IUnknown { public: @@ -215,9 +199,6 @@ enum APPDOCLISTTYPE { ADLT_FREQUENT }; -extern const GUID IID_IApplicationDocumentLists; -extern const GUID CLSID_ApplicationDocumentLists; - struct IApplicationDocumentLists : public IUnknown { public: @@ -229,9 +210,6 @@ public: #ifndef __IApplicationDestinations_INTERFACE_DEFINED__ #define __IApplicationDestinations_INTERFACE_DEFINED__ -extern const GUID IID_IApplicationDestinations; -extern const GUID CLSID_ApplicationDestinations; - struct IApplicationDestinations : public IUnknown { public: diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 62de7bf..81be39a 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -44,7 +44,7 @@ #include <QtCore/QFileInfo> #include <QtGui/QPixmap> #include <QtGui/QImage> -#include <QtWinExtras/QWinFunctions> +#include <QtWinExtras/QtWin> class tst_QPixmap : public QObject { diff --git a/tests/manual/dwmfeatures/testwidget.cpp b/tests/manual/dwmfeatures/testwidget.cpp index 2d02d14..03c6a9d 100644 --- a/tests/manual/dwmfeatures/testwidget.cpp +++ b/tests/manual/dwmfeatures/testwidget.cpp @@ -42,7 +42,7 @@ #include "testwidget.h" #include "ui_testwidget.h" -#include <QWinFunctions> +#include <QtWin> #include <QWinEvent> #include <QDebug> #include <qt_windows.h> |