diff options
Diffstat (limited to 'src/imports')
28 files changed, 0 insertions, 3389 deletions
diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt deleted file mode 100644 index fdad931..0000000 --- a/src/imports/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Generated from imports.pro. - -add_subdirectory(winextras) diff --git a/src/imports/imports.pro b/src/imports/imports.pro deleted file mode 100644 index b8e59ad..0000000 --- a/src/imports/imports.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += winextras diff --git a/src/imports/winextras/CMakeLists.txt b/src/imports/winextras/CMakeLists.txt deleted file mode 100644 index f31a6f6..0000000 --- a/src/imports/winextras/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -# Generated from winextras.pro. - -##################################################################### -## qml_winextras Plugin: -##################################################################### - -qt_add_qml_module(qml_winextras - URI "QtWinExtras" - VERSION "1.${CMAKE_PROJECT_VERSION_MINOR}" - CLASSNAME QWinExtrasQmlPlugin - SOURCES - plugin.cpp - qquickdwmfeatures.cpp qquickdwmfeatures_p.h - qquickdwmfeatures_p_p.h - qquickiconloader.cpp qquickiconloader_p.h - qquickjumplist.cpp qquickjumplist_p.h - qquickjumplistcategory.cpp qquickjumplistcategory_p.h - qquickjumplistitem.cpp qquickjumplistitem_p.h - qquicktaskbarbutton.cpp qquicktaskbarbutton_p.h - qquickthumbnailtoolbar.cpp qquickthumbnailtoolbar_p.h - qquickthumbnailtoolbutton.cpp qquickthumbnailtoolbutton_p.h - qquickwin_p.h - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::Qml - Qt::Quick - Qt::WinExtras - Qt::WinExtrasPrivate -) - -#### Keys ignored in scope 1:.:.:winextras.pro:<TRUE>: -# CXX_MODULE = "qml" -# IMPORT_VERSION = "1.$$QT_MINOR_VERSION" -# OTHER_FILES = "qmldir" "JumpListLink.qml" "JumpListDestination.qml" "JumpListSeparator.qml" -# QML_FILES = "JumpListLink.qml" "JumpListDestination.qml" "JumpListSeparator.qml" -# TARGETPATH = "QtWinExtras" - -## Scopes: -##################################################################### - -qt_extend_target(qml_winextras CONDITION QT_FEATURE_dynamicgl OR NOT TARGET Qt::OpenGL - LIBRARIES - user32 -) - -set(qml_files - "JumpListLink.qml" - "JumpListDestination.qml" - "JumpListSeparator.qml" -) -set_source_files_properties(JumpListLink.qml PROPERTIES - QT_QML_SOURCE_VERSION "1.0" -) -set_source_files_properties(JumpListDestination.qml PROPERTIES - QT_QML_SOURCE_VERSION "1.0" -) -set_source_files_properties(JumpListSeparator.qml PROPERTIES - QT_QML_SOURCE_VERSION "1.0" -) - -qt6_target_qml_files(qml_winextras - FILES - ${qml_files} -) diff --git a/src/imports/winextras/JumpListDestination.qml b/src/imports/winextras/JumpListDestination.qml deleted file mode 100644 index 2a26719..0000000 --- a/src/imports/winextras/JumpListDestination.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -import QtWinExtras 1.0 - -/*! - \qmltype JumpListDestination - \inherits JumpListItem - \inqmlmodule QtWinExtras - - \brief Represents a file that can be edited or viewed by an application. - - \since QtWinExtras 1.0 - - The JumpListDestination type contains a path to a file that users can select - from a Jump List to view or edit it with an application. - - */ - -JumpListItem { - __jumpListItemType: JumpListItem.ItemTypeDestination - - /*! - \qmlproperty string JumpListDestination::filePath - - The path to the file. - */ - property string filePath -} diff --git a/src/imports/winextras/JumpListLink.qml b/src/imports/winextras/JumpListLink.qml deleted file mode 100644 index fd27ad0..0000000 --- a/src/imports/winextras/JumpListLink.qml +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -import QtWinExtras 1.0 - -/*! - \qmltype JumpListLink - \inherits JumpListItem - \inqmlmodule QtWinExtras - - \brief Represents a command to execute an application. - - \since QtWinExtras 1.0 - - The JumpListLink type represents a command to execute an application. - - */ - -JumpListItem { - __jumpListItemType: JumpListItem.ItemTypeLink - - /*! - \qmlproperty string JumpListLink::iconPath - - The path to a link icon. - */ - property string iconPath - - /*! - \qmlproperty string JumpListLink::executablePath - - The path to an executable file. - */ - property string executablePath - - /*! - \qmlproperty string JumpListLink::arguments - - Command-line arguments. - */ - property string arguments - - /*! - \qmlproperty string JumpListLink::description - - The description of the link. - */ - property string description - - /*! - \qmlproperty string JumpListLink::title - - The title of the link. - */ - property string title -} diff --git a/src/imports/winextras/JumpListSeparator.qml b/src/imports/winextras/JumpListSeparator.qml deleted file mode 100644 index 3484afc..0000000 --- a/src/imports/winextras/JumpListSeparator.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -import QtWinExtras 1.0 - -/*! - \qmltype JumpListSeparator - \inherits JumpListItem - \inqmlmodule QtWinExtras - - \brief Represents a task list separator. - - \since QtWinExtras 1.0 - - The JumpListSeparator type represents a separator in a Jump List. This value - is used only for task lists. - */ - -JumpListItem { - __jumpListItemType: JumpListItem.ItemTypeSeparator -} diff --git a/src/imports/winextras/plugin.cpp b/src/imports/winextras/plugin.cpp deleted file mode 100644 index eadf357..0000000 --- a/src/imports/winextras/plugin.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickdwmfeatures_p.h" -#include "qquicktaskbarbutton_p.h" -#include "qquickjumplist_p.h" -#include "qquickjumplistitem_p.h" -#include "qquickjumplistcategory_p.h" -#include "qquickthumbnailtoolbar_p.h" -#include "qquickthumbnailtoolbutton_p.h" -#include "qquickwin_p.h" - -#include <QtQml/qqmlextensionplugin.h> - -QT_BEGIN_NAMESPACE - -class QWinExtrasQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) - -public: - QWinExtrasQmlPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { } - void registerTypes(const char *uri) Q_DECL_OVERRIDE - { - Q_ASSERT(uri == QLatin1String("QtWinExtras")); - // The minor version used to be the current Qt 5 minor. For compatibility it is the last - // Qt 5 release. - qmlRegisterModule(uri, 1, 15); - qmlRegisterUncreatableType<QQuickWin>(uri, 1, 0, "QtWin", "Cannot create an instance of the QtWin namespace."); - qmlRegisterType<QQuickDwmFeatures>(uri, 1, 0, "DwmFeatures"); - qmlRegisterType<QQuickTaskbarButton>(uri, 1, 0, "TaskbarButton"); - qmlRegisterUncreatableType<QWinTaskbarProgress>(uri, 1, 0, "TaskbarProgress", "Cannot create TaskbarProgress - use TaskbarButton.progress instead."); - qmlRegisterUncreatableType<QQuickTaskbarOverlay>(uri, 1, 0, "TaskbarOverlay", "Cannot create TaskbarOverlay - use TaskbarButton.overlay instead."); - qmlRegisterType<QQuickJumpList>(uri, 1, 0, "JumpList"); - qmlRegisterType<QQuickJumpListItem>(uri, 1, 0, "JumpListItem"); - qmlRegisterType<QQuickJumpListCategory>(uri, 1, 0, "JumpListCategory"); - qmlRegisterType<QQuickThumbnailToolBar>(uri, 1, 0, "ThumbnailToolBar"); - qmlRegisterType<QQuickThumbnailToolButton>(uri, 1, 0, "ThumbnailToolButton"); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/imports/winextras/plugins.qmltypes b/src/imports/winextras/plugins.qmltypes deleted file mode 100644 index fff1181..0000000 --- a/src/imports/winextras/plugins.qmltypes +++ /dev/null @@ -1,225 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtWinExtras 1.13' - -Module { - dependencies: ["QtQuick 2.0"] - Component { - name: "QQuickDwmFeatures" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtWinExtras/DwmFeatures 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "compositionEnabled"; type: "bool" } - Property { name: "colorizationColor"; type: "QColor"; isReadonly: true } - Property { name: "realColorizationColor"; type: "QColor"; isReadonly: true } - Property { name: "colorizationOpaqueBlend"; type: "bool"; isReadonly: true } - Property { name: "topGlassMargin"; type: "int" } - Property { name: "rightGlassMargin"; type: "int" } - Property { name: "bottomGlassMargin"; type: "int" } - Property { name: "leftGlassMargin"; type: "int" } - Property { name: "blurBehindEnabled"; type: "bool" } - Property { name: "excludedFromPeek"; type: "bool" } - Property { name: "peekDisallowed"; type: "bool" } - Property { name: "flip3DPolicy"; type: "QQuickWin::WindowFlip3DPolicy" } - Property { name: "nonClientAreaRenderingPolicy"; type: "QQuickWin::WindowNonClientRenderingPolicy" } - } - Component { - name: "QQuickJumpList" - defaultProperty: "data" - prototype: "QObject" - exports: ["QtWinExtras/JumpList 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "recent"; type: "QQuickJumpListCategory"; isReadonly: true; isPointer: true } - Property { name: "frequent"; type: "QQuickJumpListCategory"; isReadonly: true; isPointer: true } - Property { name: "tasks"; type: "QQuickJumpListCategory"; isPointer: true } - Property { name: "categories"; type: "QQuickJumpListCategory"; isList: true; isReadonly: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - } - Component { - name: "QQuickJumpListCategory" - defaultProperty: "data" - prototype: "QObject" - exports: ["QtWinExtras/JumpListCategory 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "items"; type: "QQuickJumpListItem"; isList: true; isReadonly: true } - Property { name: "title"; type: "string" } - Property { name: "visible"; type: "bool" } - Signal { name: "visibilityChanged" } - } - Component { - name: "QQuickJumpListItem" - prototype: "QObject" - exports: ["QtWinExtras/JumpListItem 1.0"] - exportMetaObjectRevisions: [0] - Enum { - name: "JumpListItemType" - values: { - "ItemTypeLink": 1, - "ItemTypeDestination": 2, - "ItemTypeSeparator": 3 - } - } - Property { name: "__jumpListItemType"; type: "int" } - } - Component { - name: "QQuickTaskbarButton" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtWinExtras/TaskbarButton 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "overlay"; type: "QQuickTaskbarOverlay"; isReadonly: true; isPointer: true } - Property { name: "progress"; type: "QWinTaskbarProgress"; isReadonly: true; isPointer: true } - } - Component { - name: "QQuickTaskbarOverlay" - prototype: "QObject" - exports: ["QtWinExtras/TaskbarOverlay 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "iconSource"; type: "QUrl" } - Property { name: "accessibleDescription"; type: "string" } - } - Component { - name: "QQuickThumbnailToolBar" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtWinExtras/ThumbnailToolBar 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "count"; type: "int"; isReadonly: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "buttons"; type: "QQuickThumbnailToolButton"; isList: true; isReadonly: true } - Property { name: "iconicNotificationsEnabled"; type: "bool" } - Property { name: "iconicThumbnailSource"; type: "QUrl" } - Property { name: "iconicLivePreviewSource"; type: "QUrl" } - Signal { name: "iconicThumbnailRequested" } - Signal { name: "iconicLivePreviewRequested" } - Method { name: "clear" } - Method { - name: "addButton" - Parameter { name: "button"; type: "QQuickThumbnailToolButton"; isPointer: true } - } - Method { - name: "removeButton" - Parameter { name: "button"; type: "QQuickThumbnailToolButton"; isPointer: true } - } - } - Component { - name: "QQuickThumbnailToolButton" - prototype: "QObject" - exports: ["QtWinExtras/ThumbnailToolButton 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "iconSource"; type: "QUrl" } - Property { name: "tooltip"; type: "string" } - Property { name: "enabled"; type: "bool" } - Property { name: "interactive"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "dismissOnClick"; type: "bool" } - Property { name: "flat"; type: "bool" } - Signal { name: "clicked" } - } - Component { - name: "QQuickWin" - prototype: "QObject" - exports: ["QtWinExtras/QtWin 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "HBitmapFormat" - values: { - "HBitmapNoAlpha": 0, - "HBitmapPremultipliedAlpha": 1, - "HBitmapAlpha": 2 - } - } - Enum { - name: "WindowFlip3DPolicy" - values: { - "FlipDefault": 0, - "FlipExcludeBelow": 1, - "FlipExcludeAbove": 2 - } - } - Enum { - name: "WindowNonClientRenderingPolicy" - values: { - "NonClientRenderingUseWindowStyle": 0, - "NonClientRenderingDisabled": 1, - "NonClientRenderingEnabled": 2 - } - } - } - Component { - name: "QWinTaskbarProgress" - prototype: "QObject" - exports: ["QtWinExtras/TaskbarProgress 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "value"; type: "int" } - Property { name: "minimum"; type: "int" } - Property { name: "maximum"; type: "int" } - Property { name: "visible"; type: "bool" } - Property { name: "paused"; type: "bool" } - Property { name: "stopped"; type: "bool"; isReadonly: true } - Signal { - name: "valueChanged" - Parameter { name: "value"; type: "int" } - } - Signal { - name: "minimumChanged" - Parameter { name: "minimum"; type: "int" } - } - Signal { - name: "maximumChanged" - Parameter { name: "maximum"; type: "int" } - } - Signal { - name: "visibilityChanged" - Parameter { name: "visible"; type: "bool" } - } - Signal { - name: "pausedChanged" - Parameter { name: "paused"; type: "bool" } - } - Signal { - name: "stoppedChanged" - Parameter { name: "stopped"; type: "bool" } - } - Method { - name: "setValue" - Parameter { name: "value"; type: "int" } - } - Method { - name: "setMinimum" - Parameter { name: "minimum"; type: "int" } - } - Method { - name: "setMaximum" - Parameter { name: "maximum"; type: "int" } - } - Method { - name: "setRange" - Parameter { name: "minimum"; type: "int" } - Parameter { name: "maximum"; type: "int" } - } - Method { name: "reset" } - Method { name: "show" } - Method { name: "hide" } - Method { - name: "setVisible" - Parameter { name: "visible"; type: "bool" } - } - Method { name: "pause" } - Method { name: "resume" } - Method { - name: "setPaused" - Parameter { name: "paused"; type: "bool" } - } - Method { name: "stop" } - } -} diff --git a/src/imports/winextras/qmldir b/src/imports/winextras/qmldir deleted file mode 100644 index f3c244c..0000000 --- a/src/imports/winextras/qmldir +++ /dev/null @@ -1,6 +0,0 @@ -module QtWinExtras -plugin qml_winextras -JumpListLink 1.0 JumpListLink.qml -JumpListDestination 1.0 JumpListDestination.qml -JumpListSeparator 1.0 JumpListSeparator.qml -classname QWinExtrasQmlPlugin diff --git a/src/imports/winextras/qquickdwmfeatures.cpp b/src/imports/winextras/qquickdwmfeatures.cpp deleted file mode 100644 index 124d957..0000000 --- a/src/imports/winextras/qquickdwmfeatures.cpp +++ /dev/null @@ -1,399 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickdwmfeatures_p.h" -#include "qquickdwmfeatures_p_p.h" - -#include <QtWinExtras/private/qwineventfilter_p.h> -#include <QWinEvent> -#include <QQuickWindow> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype DwmFeatures - \instantiates QQuickDwmFeatures - \inqmlmodule QtWinExtras - - \brief Enables you to manage the Windows DWM features. - - \since QtWinExtras 1.0 - - The DwmFeatures type enables you to extend a glass frame into the client - area, as well as to control the behavior of Aero Peek and Flip3D. - */ - -/*! - \class QQuickDwmFeatures - \internal - */ - -QQuickDwmFeatures::QQuickDwmFeatures(QQuickItem *parent) : - QQuickItem(parent), d_ptr(new QQuickDwmFeaturesPrivate(this)) -{ - QWinEventFilter::setup(); -} - -QQuickDwmFeatures::~QQuickDwmFeatures() = default; - -void QQuickDwmFeatures::setCompositionEnabled(bool enabled) -{ - QtWin::setCompositionEnabled(enabled); -} - -bool QQuickDwmFeatures::isCompositionEnabled() const -{ - return QtWin::isCompositionEnabled(); -} - -QColor QQuickDwmFeatures::colorizationColor() const -{ - return QtWin::colorizationColor(); -} - -QColor QQuickDwmFeatures::realColorizationColor() const -{ - return QtWin::realColorizationColor(); -} - -bool QQuickDwmFeatures::colorizationOpaqueBlend() const -{ - bool opaque; - QtWin::colorizationColor(&opaque); - return opaque; -} - -/*! - \qmlproperty int DwmFeatures::topGlassMargin - - The top glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setTopGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->topMargin == margin) - return; - - d->topMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit topGlassMarginChanged(); -} - -/*! - \qmlproperty int DwmFeatures::rightGlassMargin - - The right glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setRightGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->rightMargin == margin) - return; - - d->rightMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit rightGlassMarginChanged(); -} - -/*! - \qmlproperty int DwmFeatures::bottomGlassMargin - - The bottom glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setBottomGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->bottomMargin == margin) - return; - - d->bottomMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit bottomGlassMarginChanged(); -} - -/*! - \qmlproperty int DwmFeatures::leftGlassMargin - - The left glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setLeftGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->leftMargin == margin) - return; - - d->leftMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit leftGlassMarginChanged(); -} - -int QQuickDwmFeatures::topGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->topMargin; -} - -int QQuickDwmFeatures::rightGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->rightMargin; -} - -int QQuickDwmFeatures::bottomGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->bottomMargin; -} - -int QQuickDwmFeatures::leftGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->leftMargin; -} - -/*! - \qmlproperty bool DwmFeatures::blurBehindEnabled - - Specifies whether the blur behind the window client area is enabled. - */ -bool QQuickDwmFeatures::isBlurBehindEnabled() const -{ - Q_D(const QQuickDwmFeatures); - return d->blurBehindEnabled; -} - -void QQuickDwmFeatures::setBlurBehindEnabled(bool enabled) -{ - Q_D(QQuickDwmFeatures); - if (d->blurBehindEnabled == enabled) - return; - - d->blurBehindEnabled = enabled; - if (window()) { - if (d->blurBehindEnabled) - QtWin::enableBlurBehindWindow(window()); - else - QtWin::disableBlurBehindWindow(window()); - } - emit blurBehindEnabledChanged(); -} - -/*! - \qmlproperty bool DwmFeatures::excludedFromPeek - - Specifies whether the window is excluded from Aero Peek. - The default value is false. - */ -bool QQuickDwmFeatures::isExcludedFromPeek() const -{ - Q_D(const QQuickDwmFeatures); - return window() ? QtWin::isWindowExcludedFromPeek(window()) : d->peekExcluded; -} - -void QQuickDwmFeatures::setExcludedFromPeek(bool exclude) -{ - Q_D(QQuickDwmFeatures); - if (d->peekExcluded == exclude) - return; - - d->peekExcluded = exclude; - if (window()) - QtWin::setWindowExcludedFromPeek(window(), d->peekExcluded); - emit excludedFromPeekChanged(); -} - -/*! - \qmlproperty bool DwmFeatures::peekDisallowed - - Set this value to true if you want to forbid Aero Peek when the user hovers - the mouse over the window thumbnail. The default value is false. -*/ -bool QQuickDwmFeatures::isPeekDisallowed() const -{ - Q_D(const QQuickDwmFeatures); - return window() ? QtWin::isWindowPeekDisallowed(window()) : d->peekDisallowed; -} - -void QQuickDwmFeatures::setPeekDisallowed(bool disallow) -{ - Q_D(QQuickDwmFeatures); - if (d->peekDisallowed == disallow) - return; - - d->peekDisallowed = disallow; - if (window()) - QtWin::setWindowDisallowPeek(window(), d->peekDisallowed); - emit peekDisallowedChanged(); -} - -/*! - \qmlproperty QtWin::WindowFlip3DPolicy DwmFeatures::flip3DPolicy - - The current Flip3D policy for the window. - */ -QQuickWin::WindowFlip3DPolicy QQuickDwmFeatures::flip3DPolicy() const -{ - Q_D(const QQuickDwmFeatures); - if (window()) - return static_cast<QQuickWin::WindowFlip3DPolicy>(QtWin::windowFlip3DPolicy(window())); - else - return d->flipPolicy; -} - -void QQuickDwmFeatures::setFlip3DPolicy(QQuickWin::WindowFlip3DPolicy policy) -{ - Q_D(QQuickDwmFeatures); - if (d->flipPolicy == policy) - return; - - d->flipPolicy = policy; - if (window()) - QtWin::setWindowFlip3DPolicy(window(), static_cast<QtWin::WindowFlip3DPolicy>(d->flipPolicy)); - emit flip3DPolicyChanged(); -} - -/*! - \qmlproperty QtWin::WindowNonClientRenderingPolicy DwmFeatures::nonClientAreaRenderingPolicy - - The current non-client area rendering policy for the window. - */ -QQuickWin::WindowNonClientRenderingPolicy QQuickDwmFeatures::nonClientAreaRenderingPolicy() const -{ - Q_D(const QQuickDwmFeatures); - if (window()) - return static_cast<QQuickWin::WindowNonClientRenderingPolicy>(QtWin::windowNonClientAreaRenderingPolicy(window())); - else - return d->nonClientRenderingPolicy; -} - -void QQuickDwmFeatures::setNonClientAreaRenderingPolicy(QQuickWin::WindowNonClientRenderingPolicy policy) -{ - Q_D(QQuickDwmFeatures); - if (d->nonClientRenderingPolicy == policy) - return; - - d->nonClientRenderingPolicy = policy; - if (window()) - QtWin::setWindowNonClientAreaRenderingPolicy(window(), static_cast<QtWin::WindowNonClientRenderingPolicy>(d->nonClientRenderingPolicy)); - emit nonClientAreaRenderingPolicyChanged(); -} - -bool QQuickDwmFeatures::eventFilter(QObject *object, QEvent *event) -{ - Q_D(QQuickDwmFeatures); - if (object == window()) { - if (event->type() == QWinEvent::CompositionChange) { - d->updateSurfaceFormat(); - if (static_cast<QWinCompositionChangeEvent *>(event)->isCompositionEnabled()) - d->updateAll(); - emit compositionEnabledChanged(); - } else if (event->type() == QWinEvent::ColorizationChange) { - emit colorizationColorChanged(); - emit realColorizationColorChanged(); - emit colorizationOpaqueBlendChanged(); - } - } - return QQuickItem::eventFilter(object, event); -} - -QQuickDwmFeatures *QQuickDwmFeatures::qmlAttachedProperties(QObject *parentObject) -{ - auto *featuresObj = new QQuickDwmFeatures(); - auto *parentItem = qobject_cast<QQuickItem *>(parentObject); - if (parentItem) - featuresObj->setParentItem(parentItem); - else - featuresObj->setParent(parentObject); - return featuresObj; -} - -void QQuickDwmFeatures::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - Q_D(QQuickDwmFeatures); - if (change == ItemSceneChange && data.window) { - d->updateAll(); - data.window->installEventFilter(this); - d->originalSurfaceColor = data.window->color(); - } - QQuickItem::itemChange(change, data); -} - - - -QQuickDwmFeaturesPrivate::QQuickDwmFeaturesPrivate(QQuickDwmFeatures *parent) : - q_ptr(parent) -{ -} - -void QQuickDwmFeaturesPrivate::updateAll() -{ - Q_Q(QQuickDwmFeatures); - QWindow *w = q->window(); - if (w) { - updateSurfaceFormat(); - QtWin::setWindowExcludedFromPeek(w, peekExcluded); - QtWin::setWindowDisallowPeek(w, peekDisallowed); - QtWin::setWindowFlip3DPolicy(w, static_cast<QtWin::WindowFlip3DPolicy>(flipPolicy)); - QtWin::setWindowNonClientAreaRenderingPolicy(w, static_cast<QtWin::WindowNonClientRenderingPolicy>(nonClientRenderingPolicy)); - if (blurBehindEnabled) - QtWin::enableBlurBehindWindow(w); - else - QtWin::disableBlurBehindWindow(w); - QtWin::extendFrameIntoClientArea(w, leftMargin, topMargin, rightMargin, bottomMargin); - } -} - -void QQuickDwmFeaturesPrivate::updateSurfaceFormat() -{ - Q_Q(QQuickDwmFeatures); - if (q->window()) { - const bool compositionEnabled = q->isCompositionEnabled(); - QSurfaceFormat format = q->window()->format(); - format.setAlphaBufferSize(compositionEnabled ? 8 : 0); - q->window()->setFormat(format); - q->window()->setColor(compositionEnabled ? QColor(Qt::transparent) : originalSurfaceColor); - } -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickdwmfeatures_p.h b/src/imports/winextras/qquickdwmfeatures_p.h deleted file mode 100644 index 3887d24..0000000 --- a/src/imports/winextras/qquickdwmfeatures_p.h +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKDWMFEATURES_P_H -#define QQUICKDWMFEATURES_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QtWin> -#include <QColor> - -#include "qquickwin_p.h" - -QT_BEGIN_NAMESPACE - -class QQuickDwmFeaturesPrivate; - -class QQuickDwmFeatures : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(bool compositionEnabled READ isCompositionEnabled WRITE setCompositionEnabled NOTIFY compositionEnabledChanged) - Q_PROPERTY(QColor colorizationColor READ colorizationColor NOTIFY colorizationColorChanged) - Q_PROPERTY(QColor realColorizationColor READ realColorizationColor NOTIFY realColorizationColorChanged) - Q_PROPERTY(bool colorizationOpaqueBlend READ colorizationOpaqueBlend NOTIFY colorizationOpaqueBlendChanged) - Q_PROPERTY(int topGlassMargin READ topGlassMargin WRITE setTopGlassMargin NOTIFY topGlassMarginChanged) - Q_PROPERTY(int rightGlassMargin READ rightGlassMargin WRITE setRightGlassMargin NOTIFY rightGlassMarginChanged) - Q_PROPERTY(int bottomGlassMargin READ bottomGlassMargin WRITE setBottomGlassMargin NOTIFY bottomGlassMarginChanged) - Q_PROPERTY(int leftGlassMargin READ leftGlassMargin WRITE setLeftGlassMargin NOTIFY leftGlassMarginChanged) - Q_PROPERTY(bool blurBehindEnabled READ isBlurBehindEnabled WRITE setBlurBehindEnabled NOTIFY blurBehindEnabledChanged) - Q_PROPERTY(bool excludedFromPeek READ isExcludedFromPeek WRITE setExcludedFromPeek NOTIFY excludedFromPeekChanged) - Q_PROPERTY(bool peekDisallowed READ isPeekDisallowed WRITE setPeekDisallowed NOTIFY peekDisallowedChanged) - Q_PROPERTY(QQuickWin::WindowFlip3DPolicy flip3DPolicy READ flip3DPolicy WRITE setFlip3DPolicy NOTIFY flip3DPolicyChanged) - Q_PROPERTY(QQuickWin::WindowNonClientRenderingPolicy nonClientAreaRenderingPolicy READ nonClientAreaRenderingPolicy WRITE setNonClientAreaRenderingPolicy NOTIFY nonClientAreaRenderingPolicyChanged) - -public: - explicit QQuickDwmFeatures(QQuickItem *parent = nullptr); - ~QQuickDwmFeatures(); - - void setCompositionEnabled(bool enabled); - bool isCompositionEnabled() const; - QColor colorizationColor() const; - QColor realColorizationColor() const; - bool colorizationOpaqueBlend() const; - - void setTopGlassMargin(int margin); - void setRightGlassMargin(int margin); - void setBottomGlassMargin(int margin); - void setLeftGlassMargin(int margin); - int topGlassMargin() const; - int rightGlassMargin() const; - int bottomGlassMargin() const; - int leftGlassMargin() const; - bool isBlurBehindEnabled() const; - void setBlurBehindEnabled(bool enabled); - - bool isExcludedFromPeek() const; - void setExcludedFromPeek(bool exclude); - bool isPeekDisallowed() const; - void setPeekDisallowed(bool disallow); - QQuickWin::WindowFlip3DPolicy flip3DPolicy() const; - void setFlip3DPolicy(QQuickWin::WindowFlip3DPolicy policy); - QQuickWin::WindowNonClientRenderingPolicy nonClientAreaRenderingPolicy() const; - void setNonClientAreaRenderingPolicy(QQuickWin::WindowNonClientRenderingPolicy policy); - - bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; - - static QQuickDwmFeatures *qmlAttachedProperties(QObject *object); - -Q_SIGNALS: - void colorizationColorChanged(); - void realColorizationColorChanged(); - void compositionEnabledChanged(); - void colorizationOpaqueBlendChanged(); - void topGlassMarginChanged(); - void rightGlassMarginChanged(); - void bottomGlassMarginChanged(); - void leftGlassMarginChanged(); - void blurBehindEnabledChanged(); - void excludedFromPeekChanged(); - void peekDisallowedChanged(); - void flip3DPolicyChanged(); - void nonClientAreaRenderingPolicyChanged(); - -protected: - void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; - -private: - QScopedPointer<QQuickDwmFeaturesPrivate> d_ptr; - - Q_DECLARE_PRIVATE(QQuickDwmFeatures) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPEINFO(QQuickDwmFeatures, QML_HAS_ATTACHED_PROPERTIES) - -#endif // QQUICKDWMFEATURES_P_H diff --git a/src/imports/winextras/qquickdwmfeatures_p_p.h b/src/imports/winextras/qquickdwmfeatures_p_p.h deleted file mode 100644 index acf9dd6..0000000 --- a/src/imports/winextras/qquickdwmfeatures_p_p.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKDWMFEATURES_P_P_H -#define QQUICKDWMFEATURES_P_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qquickdwmfeatures_p.h" - -QT_BEGIN_NAMESPACE - -class QQuickDwmFeaturesPrivate -{ -public: - QQuickDwmFeaturesPrivate(QQuickDwmFeatures *parent); - - int topMargin = 0; - int rightMargin = 0; - int bottomMargin = 0; - int leftMargin = 0; - bool blurBehindEnabled = false; - - bool peekDisallowed = false; - bool peekExcluded = false; - QQuickWin::WindowFlip3DPolicy flipPolicy = QQuickWin::FlipDefault; - QQuickWin::WindowNonClientRenderingPolicy nonClientRenderingPolicy = QQuickWin::NonClientRenderingUseWindowStyle; - QColor originalSurfaceColor; - - void updateAll(); - void updateSurfaceFormat(); - -private: - QQuickDwmFeatures *q_ptr; - - Q_DECLARE_PUBLIC(QQuickDwmFeatures) -}; - -QT_END_NAMESPACE - -#endif // QQUICKDWMFEATURES_P_P_H diff --git a/src/imports/winextras/qquickiconloader.cpp b/src/imports/winextras/qquickiconloader.cpp deleted file mode 100644 index b5b7e5b..0000000 --- a/src/imports/winextras/qquickiconloader.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickiconloader_p.h" - -#include <QQmlEngine> -#include <QNetworkAccessManager> -#include <QFileInfo> -#include <QNetworkRequest> -#include <QNetworkReply> -#include <QQuickImageProvider> -#include <QQmlFile> -#include <qt_windows.h> - -QT_BEGIN_NAMESPACE - -QVariant QQuickIconLoader::loadFromFile(const QUrl &url, QVariant::Type type) -{ - const QString path = QQmlFile::urlToLocalFileOrQrc(url); - if (QFileInfo::exists(path)) { - switch (type) { - case QMetaType::QIcon: - return QVariant(QIcon(path)); - case QMetaType::QPixmap: - return QVariant(QPixmap(path)); - default: - qWarning("%s: Unsupported type: %d", Q_FUNC_INFO, int(type)); - break; - } - } - return QVariant(); -} - -QNetworkReply *QQuickIconLoader::loadFromNetwork(const QUrl &url, const QQmlEngine *engine) -{ - return engine->networkAccessManager()->get(QNetworkRequest(url)); -} - -QVariant QQuickIconLoader::loadFromImageProvider(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, QSize requestedSize) -{ - const QString providerId = url.host(); - const QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1); - QQuickImageProvider::ImageType imageType = QQuickImageProvider::Invalid; - auto *provider = static_cast<QQuickImageProvider *>(engine->imageProvider(providerId)); - QSize size; - if (!requestedSize.isValid()) - requestedSize = QSize(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON)); - if (provider) - imageType = provider->imageType(); - QPixmap pixmap; - switch (imageType) { - case QQuickImageProvider::Image: { - QImage image = provider->requestImage(imageId, &size, requestedSize); - if (!image.isNull()) - pixmap = QPixmap::fromImage(image); - } - break; - case QQuickImageProvider::Pixmap: - pixmap = provider->requestPixmap(imageId, &size, requestedSize); - break; - default: - break; - } - if (!pixmap.isNull()) { - switch (type) { - case QMetaType::QIcon: - return QVariant(QIcon(pixmap)); - case QMetaType::QPixmap: - return QVariant(pixmap); - default: - qWarning("%s: Unsupported type: %d", Q_FUNC_INFO, int(type)); - break; - } - } - return QVariant(); -} - -QQuickIconLoaderNetworkReplyHandler::QQuickIconLoaderNetworkReplyHandler(QNetworkReply *reply, QVariant::Type type) - : QObject(reply) - , m_type(type) -{ - connect(reply, &QNetworkReply::finished, this, &QQuickIconLoaderNetworkReplyHandler::onRequestFinished); -} - -void QQuickIconLoaderNetworkReplyHandler::onRequestFinished() -{ - auto *reply = qobject_cast<QNetworkReply *>(sender()); - Q_ASSERT(reply); - if (reply->error() != QNetworkReply::NoError) { - qWarning() << Q_FUNC_INFO << reply->url() << "failed:" << reply->errorString(); - return; - } - const QByteArray data = reply->readAll(); - QPixmap pixmap; - if (pixmap.loadFromData(data)) { - switch (m_type) { - case QMetaType::QIcon: - emit finished(QVariant(QIcon(pixmap))); - break; - case QMetaType::QPixmap: - emit finished(QVariant(pixmap)); - break; - default: - qWarning("%s: Unsupported type: %d", Q_FUNC_INFO, int(m_type)); - break; - } - } - reply->deleteLater(); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickiconloader_p.h b/src/imports/winextras/qquickiconloader_p.h deleted file mode 100644 index 22aaae6..0000000 --- a/src/imports/winextras/qquickiconloader_p.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKICONLOADER_P_H -#define QQUICKICONLOADER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QObject> -#include <QVariant> -#include <QUrl> -#include <QIcon> -#include <QPixmap> -#include <QDebug> - -QT_BEGIN_NAMESPACE - -class QIcon; -class QQmlEngine; -class QNetworkReply; - -class QQuickIconLoader -{ -public: - enum LoadResult { - LoadOk, - LoadError, - LoadNetworkRequestStarted, - }; - - // Load a QIcon (pass type = QMetaType::QIcon) or a QPixmap (pass type = - // QMetaType::QPixmap) from url. The function takes an object and member - // function pointer to a slot accepting a QVariant. For resources that can - // loaded synchronously ("file", "qrc" or "image"), the member function pointer - // will be invoked immediately with the result. For network resources, it will be - // connected to an object handling the network reply and invoked once it finishes. - template <typename Object> - static LoadResult load(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, const QSize &requestedSize, - Object *receiver, void (Object::*function)(const QVariant &)); - -private: - QQuickIconLoader() = default; - static QVariant loadFromFile(const QUrl &url, QVariant::Type type); - static QVariant loadFromImageProvider(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, QSize requestedSize); - static QNetworkReply *loadFromNetwork(const QUrl &url, const QQmlEngine *engine); -}; - -// Internal handler which loads the resource once QNetworkReply finishes -class QQuickIconLoaderNetworkReplyHandler : public QObject -{ - Q_OBJECT - -public: - explicit QQuickIconLoaderNetworkReplyHandler(QNetworkReply *reply, QVariant::Type); - -Q_SIGNALS: - void finished(const QVariant &); - -private Q_SLOTS: - void onRequestFinished(); - -private: - const QVariant::Type m_type; -}; - -template <typename Object> -QQuickIconLoader::LoadResult - QQuickIconLoader::load(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, const QSize &requestedSize, - Object *receiver, void (Object::*function)(const QVariant &)) -{ - const QString scheme = url.scheme(); - if (scheme.startsWith(u"http")) { - if (QNetworkReply *reply = QQuickIconLoader::loadFromNetwork(url, engine)) { - auto *handler = new QQuickIconLoaderNetworkReplyHandler(reply, type); - QObject::connect(handler, &QQuickIconLoaderNetworkReplyHandler::finished, receiver, function); - return LoadNetworkRequestStarted; - } - return LoadError; - } - const QVariant resource = scheme == u"image" - ? QQuickIconLoader::loadFromImageProvider(url, engine, type, requestedSize) - : QQuickIconLoader::loadFromFile(url, type); // qrc, file - if (resource.isValid()) { - (receiver->*function)(resource); - return LoadOk; - } - return LoadError; -} - -QT_END_NAMESPACE - -#endif // QQUICKICONLOADER_P_H diff --git a/src/imports/winextras/qquickjumplist.cpp b/src/imports/winextras/qquickjumplist.cpp deleted file mode 100644 index 615af08..0000000 --- a/src/imports/winextras/qquickjumplist.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickjumplist_p.h" -#include "qquickjumplistcategory_p.h" -#include <QWinJumpList> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype JumpList - \instantiates QQuickJumpList - \inqmlmodule QtWinExtras - - \brief Enables you to modify the application Jump List. - - \since QtWinExtras 1.0 - - The JumpList type enables you to modify Windows Jump Lists. - - An application can use Jump Lists to provide users with faster access to - files or to display shortcuts to tasks or commands. - */ - -/*! - \class QQuickJumpList - \internal - */ - -QQuickJumpList::QQuickJumpList(QObject *parent) : - QObject(parent) -{ -} - -QQuickJumpList::~QQuickJumpList() = default; - -/*! - \qmlproperty JumpListCategory JumpList::recent - \readonly - - The recent items category. - */ -QQuickJumpListCategory *QQuickJumpList::recent() const -{ - if (!m_recent) { - auto *that = const_cast<QQuickJumpList *>(this); - that->m_recent = new QQuickJumpListCategory(that); - connect(m_recent, &QQuickJumpListCategory::visibilityChanged, that, &QQuickJumpList::rebuild); - m_recent->setVisible(false); - } - return m_recent; -} - -/*! - \qmlproperty JumpListCategory JumpList::frequent - \readonly - - The frequent items category. - */ -QQuickJumpListCategory *QQuickJumpList::frequent() const -{ - if (!m_frequent) { - auto *that = const_cast<QQuickJumpList *>(this); - that->m_frequent = new QQuickJumpListCategory(that); - connect(m_frequent, &QQuickJumpListCategory::visibilityChanged, that, &QQuickJumpList::rebuild); - m_frequent->setVisible(false); - } - return m_frequent; -} - -/*! - \qmlproperty JumpListCategory JumpList::tasks - - The tasks category. - */ -QQuickJumpListCategory *QQuickJumpList::tasks() const -{ - if (!m_tasks) { - auto *that = const_cast<QQuickJumpList *>(this); - that->m_tasks = new QQuickJumpListCategory(that); - connect(m_tasks, &QQuickJumpListCategory::visibilityChanged, that, &QQuickJumpList::rebuild); - } - return m_tasks; -} - -void QQuickJumpList::setTasks(QQuickJumpListCategory *tasks) -{ - if (m_tasks != tasks) { - if (m_tasks) - disconnect(m_tasks, &QQuickJumpListCategory::visibilityChanged, this, &QQuickJumpList::rebuild); - delete m_tasks; - m_tasks = tasks; - if (m_tasks) - connect(m_tasks, &QQuickJumpListCategory::visibilityChanged, this, &QQuickJumpList::rebuild); - emit tasksChanged(); - } -} - -/*! - \qmlproperty list<QtObject> JumpList::data - \internal - */ -QQmlListProperty<QObject> QQuickJumpList::data() -{ - return QQmlListProperty<QObject>(this, this, &QQuickJumpList::data_append, nullptr, nullptr, nullptr); -} - -/*! - \qmlproperty list<JumpListCategory> JumpList::categories - - A list of custom categories. - */ -QQmlListProperty<QQuickJumpListCategory> QQuickJumpList::categories() -{ - return QQmlListProperty<QQuickJumpListCategory>(this, this, &QQuickJumpList::categories_count, &QQuickJumpList::categories_at); -} - -void QQuickJumpList::classBegin() -{ -} - -void QQuickJumpList::componentComplete() -{ - rebuild(); -} - -void QQuickJumpList::rebuild() -{ - QWinJumpList jumpList; - jumpList.recent()->setVisible(m_recent && m_recent->isVisible()); - jumpList.frequent()->setVisible(m_frequent && m_frequent->isVisible()); - if (m_tasks && m_tasks->isVisible()) { - jumpList.tasks()->setVisible(true); - const auto items = m_tasks->toItemList(); - for (QWinJumpListItem *item : items) - jumpList.tasks()->addItem(item); - } - for (QQuickJumpListCategory *category : qAsConst(m_categories)) { - if (category->isVisible()) - jumpList.addCategory(category->title(), category->toItemList())->setVisible(true); - } -} - -void QQuickJumpList::data_append(QQmlListProperty<QObject> *property, QObject *object) -{ - if (auto *category = qobject_cast<QQuickJumpListCategory *>(object)) { - auto *jumpList = static_cast<QQuickJumpList *>(property->object); - connect(category, &QQuickJumpListCategory::visibilityChanged, jumpList, &QQuickJumpList::rebuild); - jumpList->m_categories.append(category); - emit jumpList->categoriesChanged(); - } -} - -int QQuickJumpList::categories_count(QQmlListProperty<QQuickJumpListCategory> *property) -{ - return static_cast<QQuickJumpList *>(property->object)->m_categories.count(); -} - -QQuickJumpListCategory *QQuickJumpList::categories_at(QQmlListProperty<QQuickJumpListCategory> *property, int index) -{ - return static_cast<QQuickJumpList *>(property->object)->m_categories.value(index); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickjumplist_p.h b/src/imports/winextras/qquickjumplist_p.h deleted file mode 100644 index 25bf2e2..0000000 --- a/src/imports/winextras/qquickjumplist_p.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKJUMPLIST_P_H -#define QQUICKJUMPLIST_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qquickjumplistcategory_p.h" - -#include <QObject> -#include <QQmlParserStatus> -#include <QQmlListProperty> -#include <QList> - -QT_BEGIN_NAMESPACE - -class QQuickJumpListCategory; - -class QQuickJumpList : public QObject, public QQmlParserStatus -{ - Q_OBJECT - Q_PROPERTY(QQuickJumpListCategory *recent READ recent CONSTANT) - Q_PROPERTY(QQuickJumpListCategory *frequent READ frequent CONSTANT) - Q_PROPERTY(QQuickJumpListCategory *tasks READ tasks WRITE setTasks NOTIFY tasksChanged) - Q_PROPERTY(QQmlListProperty<QQuickJumpListCategory> categories READ categories NOTIFY categoriesChanged) - Q_PROPERTY(QQmlListProperty<QObject> data READ data) - Q_CLASSINFO("DefaultProperty", "data") - Q_INTERFACES(QQmlParserStatus) - -public: - explicit QQuickJumpList(QObject *parent = nullptr); - ~QQuickJumpList(); - - QQuickJumpListCategory *recent() const; - QQuickJumpListCategory *frequent() const; - - QQuickJumpListCategory *tasks() const; - void setTasks(QQuickJumpListCategory *tasks); - - QQmlListProperty<QObject> data(); - QQmlListProperty<QQuickJumpListCategory> categories(); - - void classBegin() override; - void componentComplete() override; - -Q_SIGNALS: - void tasksChanged(); - void categoriesChanged(); - -private Q_SLOTS: - void rebuild(); - -private: - static void data_append(QQmlListProperty<QObject> *property, QObject *object); - static int categories_count(QQmlListProperty<QQuickJumpListCategory> *property); - static QQuickJumpListCategory *categories_at(QQmlListProperty<QQuickJumpListCategory> *property, int index); - - QQuickJumpListCategory *m_recent = nullptr; - QQuickJumpListCategory *m_frequent = nullptr; - QQuickJumpListCategory *m_tasks = nullptr; - QList<QQuickJumpListCategory *> m_categories; -}; - -QT_END_NAMESPACE - -#endif // QQUICKJUMPLIST_P_H diff --git a/src/imports/winextras/qquickjumplistcategory.cpp b/src/imports/winextras/qquickjumplistcategory.cpp deleted file mode 100644 index 30183f4..0000000 --- a/src/imports/winextras/qquickjumplistcategory.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickjumplistcategory_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \qmltype JumpListCategory - \instantiates QQuickJumpListCategory - \inqmlmodule QtWinExtras - - \brief Represents a jump list category. - - \since QtWinExtras 1.0 - - The JumpListCategory type represents a category that consists of several - Jump List destinations and has a title. - */ - -/*! - \class QQuickJumpListCategory - \internal - */ - -QQuickJumpListCategory::QQuickJumpListCategory(QObject *parent) : - QObject(parent) -{ -} - -QQuickJumpListCategory::~QQuickJumpListCategory() = default; - -/*! - \qmlproperty list<QtObject> JumpListCategory::data - \internal - */ -QQmlListProperty<QObject> QQuickJumpListCategory::data() -{ - return QQmlListProperty<QObject>(this, this, &QQuickJumpListCategory::data_append, nullptr, nullptr, nullptr); -} - -/*! - \qmlproperty list<JumpListItem> JumpListCategory::items - - A list of items. - */ -QQmlListProperty<QQuickJumpListItem> QQuickJumpListCategory::items() -{ - return QQmlListProperty<QQuickJumpListItem>(this, this, &QQuickJumpListCategory::items_count, &QQuickJumpListCategory::items_at); -} - -/*! - \qmlproperty string JumpListCategory::title - - The title of the category. - */ -QString QQuickJumpListCategory::title() const -{ - return m_title; -} - -void QQuickJumpListCategory::setTitle(const QString &title) -{ - if (m_title != title) { - m_title = title; - emit titleChanged(); - } -} - -/*! - \qmlproperty bool JumpListCategory::visible - - The visibility of the category. - */ -bool QQuickJumpListCategory::isVisible() const -{ - return m_visible; -} - -void QQuickJumpListCategory::setVisible(bool visible) -{ - if (m_visible != visible) { - m_visible = visible; - emit visibilityChanged(); - } -} - -QList<QWinJumpListItem *> QQuickJumpListCategory::toItemList() const -{ - QList<QWinJumpListItem *> items; - for (QQuickJumpListItem *item : m_items) - items.append(item->toJumpListItem()); - return items; -} - -void QQuickJumpListCategory::data_append(QQmlListProperty<QObject> *property, QObject *object) -{ - if (auto *item = qobject_cast<QQuickJumpListItem *>(object)) { - auto *category = static_cast<QQuickJumpListCategory *>(property->object); - category->m_items.append(item); - emit category->itemsChanged(); - } -} - -int QQuickJumpListCategory::items_count(QQmlListProperty<QQuickJumpListItem> *property) -{ - return static_cast<QQuickJumpListCategory *>(property->object)->m_items.count(); -} - -QQuickJumpListItem *QQuickJumpListCategory::items_at(QQmlListProperty<QQuickJumpListItem> *property, int index) -{ - return static_cast<QQuickJumpListCategory *>(property->object)->m_items.value(index); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickjumplistcategory_p.h b/src/imports/winextras/qquickjumplistcategory_p.h deleted file mode 100644 index 9e1fda7..0000000 --- a/src/imports/winextras/qquickjumplistcategory_p.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKJUMPLISTCATEGORY_P_H -#define QQUICKJUMPLISTCATEGORY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qquickjumplistitem_p.h" - -#include <QObject> -#include <QList> -#include <QQmlListProperty> -#include <QWinJumpListCategory> -#include <QWinJumpListItem> - -QT_BEGIN_NAMESPACE - -class QQuickJumpListCategory : public QObject -{ - Q_OBJECT - Q_PROPERTY(QQmlListProperty<QObject> data READ data) - Q_PROPERTY(QQmlListProperty<QQuickJumpListItem> items READ items) - Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged) - Q_CLASSINFO("DefaultProperty", "data") - -public: - explicit QQuickJumpListCategory(QObject *parent = nullptr); - ~QQuickJumpListCategory(); - - QString title() const; - void setTitle(const QString &title); - - bool isVisible() const; - void setVisible(bool visible); - - QQmlListProperty<QObject> data(); - QQmlListProperty<QQuickJumpListItem> items(); - - QList<QWinJumpListItem *> toItemList() const; - -Q_SIGNALS: - void itemsChanged(); - void titleChanged(); - void visibilityChanged(); - -private: - static void data_append(QQmlListProperty<QObject> *property, QObject *object); - static int items_count(QQmlListProperty<QQuickJumpListItem> *property); - static QQuickJumpListItem *items_at(QQmlListProperty<QQuickJumpListItem> *property, int index); - - bool m_visible = true; - QString m_title; - QList<QQuickJumpListItem *> m_items; -}; - -QT_END_NAMESPACE - -#endif // QQUICKJUMPLISTCATEGORY_P_H diff --git a/src/imports/winextras/qquickjumplistitem.cpp b/src/imports/winextras/qquickjumplistitem.cpp deleted file mode 100644 index bfc9543..0000000 --- a/src/imports/winextras/qquickjumplistitem.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickjumplistitem_p.h" -#include <QVariant> - -QT_BEGIN_NAMESPACE - -QQuickJumpListItem::QQuickJumpListItem(QObject *parent) : - QObject(parent) -{ -} - -QQuickJumpListItem::~QQuickJumpListItem() = default; - -int QQuickJumpListItem::type() const -{ - return m_type; -} - -void QQuickJumpListItem::setType(int type) -{ - m_type = type; -} - -QWinJumpListItem *QQuickJumpListItem::toJumpListItem() const -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Separator); - switch (m_type) { - case ItemTypeDestination: - item->setType(QWinJumpListItem::Destination); - item->setFilePath(property("filePath").toString()); - break; - case ItemTypeLink: - item->setType(QWinJumpListItem::Link); - item->setFilePath(property("executablePath").toString()); - item->setArguments(QStringList(property("arguments").toStringList())); - item->setDescription(property("description").toString()); - item->setTitle(property("title").toString()); - item->setIcon(QIcon(property("iconPath").toString())); - break; - } - - return item; -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickjumplistitem_p.h b/src/imports/winextras/qquickjumplistitem_p.h deleted file mode 100644 index 47d92d7..0000000 --- a/src/imports/winextras/qquickjumplistitem_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKJUMPLISTITEM_P_H -#define QQUICKJUMPLISTITEM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QObject> -#include <QWinJumpListItem> - -QT_BEGIN_NAMESPACE - -class QQuickJumpListItem : public QObject -{ - Q_OBJECT - Q_PROPERTY(int __jumpListItemType READ type WRITE setType) -public: - enum JumpListItemType { - ItemTypeLink = 1, - ItemTypeDestination = 2, - ItemTypeSeparator = 3 - }; - Q_ENUM(JumpListItemType) - - explicit QQuickJumpListItem(QObject *p = nullptr); - ~QQuickJumpListItem(); - - int type() const; - void setType(int type); - - QWinJumpListItem *toJumpListItem() const; - -private: - int m_type; // 1 - link, 2 - destination -}; - -QT_END_NAMESPACE - -#endif // QQUICKJUMPLISTITEM_P_H diff --git a/src/imports/winextras/qquicktaskbarbutton.cpp b/src/imports/winextras/qquicktaskbarbutton.cpp deleted file mode 100644 index 688ef35..0000000 --- a/src/imports/winextras/qquicktaskbarbutton.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquicktaskbarbutton_p.h" -#include "qquickiconloader_p.h" - -#include <QQuickWindow> -#include <QVariant> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype TaskbarButton - \instantiates QQuickTaskbarButton - \inqmlmodule QtWinExtras - - \brief Manages Windows taskbar buttons. - - \since QtWinExtras 1.0 - - The TaskbarButton type enables you to set an overlay icon and to display - a progress indicator on a taskbar button. An overlay icon indicates change - in the state of the application. A progress indicator shows how time-consuming - tasks are progressing. - - \section3 Example - - The following example illustrates how to use TaskbarButton in QML: - - \snippet code/taskbar.qml taskbar_qml - - \image taskbar-button.png Taskbar Button - - \sa QWinTaskbarButton, QWinTaskbarProgress - */ - -QQuickTaskbarOverlay::QQuickTaskbarOverlay(QWinTaskbarButton *button, QObject *parent) : - QObject(parent), m_button(button) -{ -} - -QUrl QQuickTaskbarOverlay::iconSource() const -{ - return m_iconSource; -} - -void QQuickTaskbarOverlay::setIconSource(const QUrl &iconSource) -{ - if (m_iconSource == iconSource) - return; - - if (iconSource.isEmpty()) { - m_button->clearOverlayIcon(); - m_iconSource = iconSource; - emit iconSourceChanged(); - return; - } - - if (QQuickIconLoader::load(iconSource, qmlEngine(parent()), QVariant::Icon, QSize(), - this, &QQuickTaskbarOverlay::iconLoaded) != QQuickIconLoader::LoadError) { - m_iconSource = iconSource; - emit iconSourceChanged(); - } -} - -QString QQuickTaskbarOverlay::accessibleDescription() const -{ - return m_button->overlayAccessibleDescription(); -} - -void QQuickTaskbarOverlay::setAccessibleDescription(const QString &description) -{ - if (accessibleDescription() != description) { - m_button->setOverlayAccessibleDescription(description); - emit accessibleDescriptionChanged(); - } -} - -void QQuickTaskbarOverlay::iconLoaded(const QVariant &value) -{ - m_button->setOverlayIcon(value.value<QIcon>()); -} - -QQuickTaskbarButton::QQuickTaskbarButton(QQuickItem *parent) : QQuickItem(parent), - m_button(new QWinTaskbarButton(this)), m_overlay(new QQuickTaskbarOverlay(m_button, this)) -{ -} - -QQuickTaskbarButton::~QQuickTaskbarButton() = default; - -/*! - \qmlpropertygroup ::TaskbarButton::progress - \qmlproperty int TaskbarButton::progress.value - \qmlproperty int TaskbarButton::progress.minimum - \qmlproperty int TaskbarButton::progress.maximum - \qmlproperty bool TaskbarButton::progress.visible - \qmlproperty bool TaskbarButton::progress.paused - \qmlproperty bool TaskbarButton::progress.stopped - - The taskbar progress indicator. - - \sa QWinTaskbarProgress - */ -QWinTaskbarProgress *QQuickTaskbarButton::progress() const -{ - return m_button->progress(); -} - -/*! - \qmlpropertygroup ::TaskbarButton::overlay - \qmlproperty url TaskbarButton::overlay.iconSource - \qmlproperty string TaskbarButton::overlay.accessibleDescription - - The overlay icon and a description of the overlay for accessibility purposes. - */ -QQuickTaskbarOverlay *QQuickTaskbarButton::overlay() const -{ - return m_overlay; -} - -void QQuickTaskbarButton::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - if (change == ItemSceneChange) { - m_button->setWindow(data.window); - } - QQuickItem::itemChange(change, data); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquicktaskbarbutton_p.h b/src/imports/winextras/qquicktaskbarbutton_p.h deleted file mode 100644 index a26fa67..0000000 --- a/src/imports/winextras/qquicktaskbarbutton_p.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKTASKBARBUTTON_P_H -#define QQUICKTASKBARBUTTON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QWinTaskbarButton> -#include <QWinTaskbarProgress> - -QT_BEGIN_NAMESPACE - -class QVariant; -class QQuickTaskbarButtonPrivate; - -class QQuickTaskbarOverlay : public QObject -{ - Q_OBJECT - Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged) - Q_PROPERTY(QString accessibleDescription READ accessibleDescription WRITE setAccessibleDescription NOTIFY accessibleDescriptionChanged) - -public: - explicit QQuickTaskbarOverlay(QWinTaskbarButton *button, QObject *parent = nullptr); - - QUrl iconSource() const; - void setIconSource(const QUrl &iconSource); - - QString accessibleDescription() const; - void setAccessibleDescription(const QString &description); - -Q_SIGNALS: - void iconSourceChanged(); - void accessibleDescriptionChanged(); - -private Q_SLOTS: - void iconLoaded(const QVariant &); - -private: - QUrl m_iconSource; - QWinTaskbarButton *m_button; -}; - -class QQuickTaskbarButton : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QQuickTaskbarOverlay *overlay READ overlay CONSTANT) - Q_PROPERTY(QWinTaskbarProgress *progress READ progress CONSTANT) - -public: - explicit QQuickTaskbarButton(QQuickItem *parent = nullptr); - ~QQuickTaskbarButton(); - - QQuickTaskbarOverlay *overlay() const; - QWinTaskbarProgress *progress() const; - -protected: - void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; - -private: - QWinTaskbarButton *m_button; - QQuickTaskbarOverlay *m_overlay; -}; - -QT_END_NAMESPACE - -#endif // QQUICKTASKBARBUTTON_P_H diff --git a/src/imports/winextras/qquickthumbnailtoolbar.cpp b/src/imports/winextras/qquickthumbnailtoolbar.cpp deleted file mode 100644 index 7bdf112..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbar.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickthumbnailtoolbar_p.h" -#include "qquickthumbnailtoolbutton_p.h" -#include "qquickiconloader_p.h" - -#include <QQuickWindow> -#include <QQmlEngine> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype ThumbnailToolBar - \instantiates QQuickThumbnailToolBar - \inqmlmodule QtWinExtras - - \brief Allows manipulating the window's thumbnail toolbar. - - This class allows an application to embed a toolbar in the thumbnail of a window, - which is shown when hovering over its taskbar icon. It provides quick access to - the window's commands without requiring the user to restore or activate the window. - - \image thumbbar.png Media player thumbnail toolbar - - \section3 Example - \snippet code/thumbbar.qml thumbbar_qml - \since QtWinExtras 1.0 - */ - -QQuickThumbnailToolBar::QQuickThumbnailToolBar(QQuickItem *parent) : - QQuickItem(parent) -{ - connect(&m_toolbar, &QWinThumbnailToolBar::iconicThumbnailPixmapRequested, - this, &QQuickThumbnailToolBar::iconicThumbnailRequested); - connect(&m_toolbar, &QWinThumbnailToolBar::iconicLivePreviewPixmapRequested, - this, &QQuickThumbnailToolBar::iconicLivePreviewRequested); -} - -QQuickThumbnailToolBar::~QQuickThumbnailToolBar() = default; - -int QQuickThumbnailToolBar::count() const -{ - return m_toolbar.count(); -} - -QQmlListProperty<QObject> QQuickThumbnailToolBar::data() -{ - return QQmlListProperty<QObject>(this, nullptr, &QQuickThumbnailToolBar::addData, nullptr, nullptr, nullptr); -} - -QQmlListProperty<QQuickThumbnailToolButton> QQuickThumbnailToolBar::buttons() -{ - return QQmlListProperty<QQuickThumbnailToolButton>(this, nullptr, &QQuickThumbnailToolBar::buttonCount, &QQuickThumbnailToolBar::buttonAt); -} - -void QQuickThumbnailToolBar::addButton(QQuickThumbnailToolButton *button) -{ - if (!m_buttons.contains(button)) { - m_toolbar.addButton(button->m_button); - m_buttons.append(button); - emit countChanged(); - emit buttonsChanged(); - } -} - -void QQuickThumbnailToolBar::removeButton(QQuickThumbnailToolButton *button) -{ - if (m_buttons.removeOne(button)) { - m_toolbar.removeButton(button->m_button); - emit countChanged(); - emit buttonsChanged(); - } -} - -void QQuickThumbnailToolBar::clear() -{ - m_toolbar.clear(); - for (QQuickThumbnailToolButton *button : qAsConst(m_buttons)) - button->deleteLater(); - m_buttons.clear(); - emit countChanged(); - emit buttonsChanged(); -} - -/*! - \qmlsignal ThumbnailToolBar::iconicThumbnailRequested() - - This signal is emitted when the operating system requests a new iconic thumbnail pixmap, - typically when the thumbnail is shown. - - \since 5.4 -*/ - -/*! - \qmlsignal ThumbnailToolBar::iconicLivePreviewRequested() - - This signal is emitted when the operating system requests a new iconic live preview pixmap, - typically when the user ALT-tabs to the application. - \since 5.4 -*/ - -/*! - \qmlproperty bool ThumbnailToolBar::iconicNotificationsEnabled - - This property holds whether the signals iconicThumbnailRequested() - or iconicLivePreviewRequested() will be emitted. - \since 5.4 - */ -bool QQuickThumbnailToolBar::iconicNotificationsEnabled() const -{ - return m_toolbar.iconicPixmapNotificationsEnabled(); -} - -void QQuickThumbnailToolBar::setIconicNotificationsEnabled(bool enabled) -{ - if (enabled != m_toolbar.iconicPixmapNotificationsEnabled()) { - m_toolbar.setIconicPixmapNotificationsEnabled(enabled); - emit iconicNotificationsEnabledChanged(); - } -} - -void QQuickThumbnailToolBar::iconicThumbnailLoaded(const QVariant &value) -{ - m_toolbar.setIconicThumbnailPixmap(value.value<QPixmap>()); -} - -/*! - \qmlproperty url ThumbnailToolBar::iconicThumbnailSource - - The pixmap for use as a thumbnail representation - \since 5.4 - */ -void QQuickThumbnailToolBar::setIconicThumbnailSource(const QUrl &source) -{ - if (source == m_iconicThumbnailSource) - return; - - if (source.isEmpty()) { - m_toolbar.setIconicThumbnailPixmap(QPixmap()); - m_iconicThumbnailSource = source; - emit iconicThumbnailSourceChanged(); - } - - if (QQuickIconLoader::load(source, qmlEngine(this), QVariant::Pixmap, QSize(), - this, &QQuickThumbnailToolBar::iconicThumbnailLoaded) != QQuickIconLoader::LoadError) { - m_iconicThumbnailSource = source; - emit iconicThumbnailSourceChanged(); - } -} - -void QQuickThumbnailToolBar::iconicLivePreviewLoaded(const QVariant &value) -{ - m_toolbar.setIconicLivePreviewPixmap(value.value<QPixmap>()); -} - -/*! - \qmlproperty url ThumbnailToolBar::iconicLivePreviewSource - - The pixmap for use as a live (peek) preview when tabbing into the application. - \since 5.4 - */ -void QQuickThumbnailToolBar::setIconicLivePreviewSource(const QUrl &source) -{ - if (source == m_iconicLivePreviewSource) - return; - - if (source.isEmpty()) { - m_toolbar.setIconicLivePreviewPixmap(QPixmap()); - m_iconicLivePreviewSource = source; - emit iconicLivePreviewSourceChanged(); - } - - if (QQuickIconLoader::load(source, qmlEngine(this), QVariant::Pixmap, QSize(), - this, &QQuickThumbnailToolBar::iconicLivePreviewLoaded) != QQuickIconLoader::LoadError) { - m_iconicLivePreviewSource = source; - emit iconicLivePreviewSourceChanged(); - } -} - -void QQuickThumbnailToolBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - if (change == ItemSceneChange) - m_toolbar.setWindow(data.window); - QQuickItem::itemChange(change, data); -} - -void QQuickThumbnailToolBar::addData(QQmlListProperty<QObject> *property, QObject *object) -{ - if (auto *button = qobject_cast<QQuickThumbnailToolButton *>(object)) { - auto *quickThumbbar = static_cast<QQuickThumbnailToolBar *>(property->object); - quickThumbbar->m_toolbar.addButton(button->m_button); - quickThumbbar->m_buttons.append(button); - emit quickThumbbar->countChanged(); - emit quickThumbbar->buttonsChanged(); - } -} - -int QQuickThumbnailToolBar::buttonCount(QQmlListProperty<QQuickThumbnailToolButton> *property) -{ - return static_cast<QQuickThumbnailToolBar *>(property->object)->count(); -} - -QQuickThumbnailToolButton *QQuickThumbnailToolBar::buttonAt(QQmlListProperty<QQuickThumbnailToolButton> *property, int index) -{ - return static_cast<QQuickThumbnailToolBar *>(property->object)->m_buttons.value(index); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickthumbnailtoolbar_p.h b/src/imports/winextras/qquickthumbnailtoolbar_p.h deleted file mode 100644 index fc1e67a..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbar_p.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKTHUMBNAILTOOLBAR_P_H -#define QQUICKTHUMBNAILTOOLBAR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QWinThumbnailToolBar> -#include <QUrl> -#include <QList> - -QT_BEGIN_NAMESPACE - -class QVariant; - -class QQuickThumbnailToolButton; - -class QQuickThumbnailToolBar : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_PROPERTY(QQmlListProperty<QObject> data READ data) - Q_PROPERTY(QQmlListProperty<QQuickThumbnailToolButton> buttons READ buttons NOTIFY buttonsChanged) - Q_PROPERTY(bool iconicNotificationsEnabled READ iconicNotificationsEnabled WRITE setIconicNotificationsEnabled NOTIFY iconicNotificationsEnabledChanged) - Q_PROPERTY(QUrl iconicThumbnailSource READ iconicThumbnailSource WRITE setIconicThumbnailSource NOTIFY iconicThumbnailSourceChanged) - Q_PROPERTY(QUrl iconicLivePreviewSource READ iconicLivePreviewSource WRITE setIconicLivePreviewSource NOTIFY iconicLivePreviewSourceChanged) - Q_CLASSINFO("DefaultProperty", "data") - -public: - explicit QQuickThumbnailToolBar(QQuickItem *parent = nullptr); - ~QQuickThumbnailToolBar(); - - int count() const; - - QQmlListProperty<QObject> data(); - QQmlListProperty<QQuickThumbnailToolButton> buttons(); - - Q_INVOKABLE void addButton(QQuickThumbnailToolButton *button); - Q_INVOKABLE void removeButton(QQuickThumbnailToolButton *button); - - bool iconicNotificationsEnabled() const; - void setIconicNotificationsEnabled(bool); - QUrl iconicThumbnailSource() const { return m_iconicThumbnailSource; } - void setIconicThumbnailSource(const QUrl &); - QUrl iconicLivePreviewSource() const { return m_iconicLivePreviewSource; } - void setIconicLivePreviewSource(const QUrl &); - -public Q_SLOTS: - void clear(); - -Q_SIGNALS: - void countChanged(); - void buttonsChanged(); - void iconicNotificationsEnabledChanged(); - void iconicThumbnailSourceChanged(); - void iconicThumbnailRequested(); - void iconicLivePreviewSourceChanged(); - void iconicLivePreviewRequested(); - -private Q_SLOTS: - void iconicThumbnailLoaded(const QVariant &); - void iconicLivePreviewLoaded(const QVariant &); - -protected: - void itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) override; - -private: - static void addData(QQmlListProperty<QObject> *property, QObject *button); - static int buttonCount(QQmlListProperty<QQuickThumbnailToolButton> *property); - static QQuickThumbnailToolButton *buttonAt(QQmlListProperty<QQuickThumbnailToolButton> *property, int index); - - QWinThumbnailToolBar m_toolbar; - QList<QQuickThumbnailToolButton *> m_buttons; - QUrl m_iconicThumbnailSource; - QUrl m_iconicLivePreviewSource; -}; - -QT_END_NAMESPACE - -#endif // QQUICKTHUMBNAILTOOLBAR_P_H diff --git a/src/imports/winextras/qquickthumbnailtoolbutton.cpp b/src/imports/winextras/qquickthumbnailtoolbutton.cpp deleted file mode 100644 index e4a1f81..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbutton.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickthumbnailtoolbutton_p.h" -#include "qquickiconloader_p.h" - -#include <QWinThumbnailToolButton> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype ThumbnailToolButton - \instantiates QQuickThumbnailToolButton - \inqmlmodule QtWinExtras - - \brief Represents a button in a thumbnail toolbar. - - The ThumbnailToolButton represents a button in a thumbnail toolbar. - \since QtWinExtras 1.0 - */ - -/*! - \qmlsignal ThumbnailToolButton::clicked() - This signal is emitted when the user clicks the button. The corresponding handler is \c onClicked. -*/ - -QQuickThumbnailToolButton::QQuickThumbnailToolButton(QObject *parent) : - QObject(parent), m_button(new QWinThumbnailToolButton(this)) -{ - connect(m_button, &QWinThumbnailToolButton::clicked, this, &QQuickThumbnailToolButton::clicked); -} - -QQuickThumbnailToolButton::~QQuickThumbnailToolButton() = default; - -/*! - \qmlproperty url ThumbnailToolButton::iconSource - - The button icon path. - */ -void QQuickThumbnailToolButton::setIconSource(const QUrl &iconSource) -{ - if (m_iconSource == iconSource) - return; - - if (iconSource.isEmpty()) { - m_button->setIcon(QIcon()); - m_iconSource = iconSource; - emit iconSourceChanged(); - } - - if (QQuickIconLoader::load(iconSource, qmlEngine(this), QVariant::Icon, QSize(), - this, &QQuickThumbnailToolButton::iconLoaded) != QQuickIconLoader::LoadError) { - m_iconSource = iconSource; - emit iconSourceChanged(); - } -} - -QUrl QQuickThumbnailToolButton::iconSource() -{ - return m_iconSource; -} - -/*! - \qmlproperty string ThumbnailToolButton::tooltip - - The tooltip of the button. - */ -void QQuickThumbnailToolButton::setTooltip(const QString &tooltip) -{ - if (m_button->toolTip() != tooltip) { - m_button->setToolTip(tooltip); - emit tooltipChanged(); - } -} - -QString QQuickThumbnailToolButton::tooltip() const -{ - return m_button->toolTip(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::enabled - - This property holds whether the button is enabled. - - By default, this property is set to true. - */ -void QQuickThumbnailToolButton::setEnabled(bool enabled) -{ - if (m_button->isEnabled() != enabled) { - m_button->setEnabled(enabled); - emit enabledChanged(); - } -} - -bool QQuickThumbnailToolButton::isEnabled() const -{ - return m_button->isEnabled(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::interactive - - This property holds whether the button is interactive. - If not interactive, the button remains enabled, but no pressed or mouse-over - states are drawn. Set this property to false to use this button as a - notification icon. - - By default, this property is set to true. - */ -void QQuickThumbnailToolButton::setInteractive(bool interactive) -{ - if (m_button->isInteractive() != interactive) { - m_button->setInteractive(interactive); - emit interactiveChanged(); - } -} - -bool QQuickThumbnailToolButton::isInteractive() const -{ - return m_button->isInteractive(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::visible - - This property holds whether the button is visible. - - By default, this property is set to true. - */ -void QQuickThumbnailToolButton::setVisible(bool visible) -{ - if (m_button->isVisible() != visible) { - m_button->setVisible(visible); - emit visibleChanged(); - } -} - -bool QQuickThumbnailToolButton::isVisible() const -{ - return m_button->isVisible(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::dismissOnClick - - This property holds whether the window thumbnail is dismissed after a button click. - - By default, this property is set to false. - */ -void QQuickThumbnailToolButton::setDismissOnClick(bool dismiss) -{ - if (m_button->dismissOnClick() != dismiss) { - m_button->setDismissOnClick(dismiss); - emit dismissOnClickChanged(); - } -} - -bool QQuickThumbnailToolButton::dismissOnClick() const -{ - return m_button->dismissOnClick(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::flat - - This property holds whether the button background and frame are not drawn. - - By default, this property is set to false. - */ -void QQuickThumbnailToolButton::setFlat(bool flat) -{ - if (m_button->isFlat() != flat) { - m_button->setFlat(flat); - emit flatChanged(); - } -} - -bool QQuickThumbnailToolButton::isFlat() const -{ - return m_button->isFlat(); -} - -void QQuickThumbnailToolButton::iconLoaded(const QVariant &value) -{ - if (value.isValid()) - m_button->setIcon(value.value<QIcon>()); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickthumbnailtoolbutton_p.h b/src/imports/winextras/qquickthumbnailtoolbutton_p.h deleted file mode 100644 index aca0e74..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbutton_p.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKTHUMBNAILTOOLBUTTON_P_H -#define QQUICKTHUMBNAILTOOLBUTTON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QWinThumbnailToolBar> -#include <QUrl> - -QT_BEGIN_NAMESPACE - -class QQuickThumbnailToolButton : public QObject -{ - Q_OBJECT - Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged) - Q_PROPERTY(QString tooltip READ tooltip WRITE setTooltip NOTIFY tooltipChanged) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) - Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) - Q_PROPERTY(bool dismissOnClick READ dismissOnClick WRITE setDismissOnClick NOTIFY dismissOnClickChanged) - Q_PROPERTY(bool flat READ isFlat WRITE setFlat NOTIFY flatChanged) - -public: - explicit QQuickThumbnailToolButton(QObject *parent = nullptr); - ~QQuickThumbnailToolButton(); - - void setIconSource(const QUrl &iconSource); - QUrl iconSource(); - void setTooltip(const QString &tooltip); - QString tooltip() const; - void setEnabled(bool isEnabled); - bool isEnabled() const; - void setInteractive(bool isInteractive); - bool isInteractive() const; - void setVisible(bool isVisible); - bool isVisible() const; - void setDismissOnClick(bool dismiss); - bool dismissOnClick() const; - void setFlat(bool flat); - bool isFlat() const; - -Q_SIGNALS: - void clicked(); - void iconSourceChanged(); - void tooltipChanged(); - void enabledChanged(); - void interactiveChanged(); - void visibleChanged(); - void dismissOnClickChanged(); - void flatChanged(); - -private Q_SLOTS: - void iconLoaded(const QVariant &); - -private: - QUrl m_iconSource; - QWinThumbnailToolButton *m_button; - - friend class QQuickThumbnailToolBar; -}; - -QT_END_NAMESPACE - -#endif // QQUICKTHUMBNAILTOOLBUTTON_P_H diff --git a/src/imports/winextras/qquickwin_p.h b/src/imports/winextras/qquickwin_p.h deleted file mode 100644 index 4ed9015..0000000 --- a/src/imports/winextras/qquickwin_p.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKWIN_P_H -#define QQUICKWIN_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QObject> -#include <QtWin> - -QT_BEGIN_NAMESPACE - -class QQuickWin : public QObject -{ - Q_OBJECT - -public: - enum HBitmapFormat - { - HBitmapNoAlpha = QtWin::HBitmapNoAlpha, - HBitmapPremultipliedAlpha = QtWin::HBitmapPremultipliedAlpha, - HBitmapAlpha = QtWin::HBitmapAlpha - }; - Q_ENUM(HBitmapFormat) - - enum WindowFlip3DPolicy - { - FlipDefault = QtWin::FlipDefault, - FlipExcludeBelow = QtWin::FlipExcludeBelow, - FlipExcludeAbove = QtWin::FlipExcludeAbove - }; - Q_ENUM(WindowFlip3DPolicy) - - enum WindowNonClientRenderingPolicy - { - NonClientRenderingUseWindowStyle = QtWin::NonClientRenderingUseWindowStyle, - NonClientRenderingDisabled = QtWin::NonClientRenderingDisabled, - NonClientRenderingEnabled = QtWin::NonClientRenderingEnabled - }; - Q_ENUM(WindowNonClientRenderingPolicy) -}; - -QT_END_NAMESPACE - -#endif // QQUICKWIN_P_H diff --git a/src/imports/winextras/winextras.pro b/src/imports/winextras/winextras.pro deleted file mode 100644 index dc778e6..0000000 --- a/src/imports/winextras/winextras.pro +++ /dev/null @@ -1,44 +0,0 @@ -CXX_MODULE = qml -TARGET = qml_winextras -TARGETPATH = QtWinExtras -IMPORT_VERSION = 1.$$QT_MINOR_VERSION - -QT += qml quick winextras winextras-private - -QML_FILES += \ - JumpListLink.qml \ - JumpListDestination.qml \ - JumpListSeparator.qml - -HEADERS += \ - qquickdwmfeatures_p.h \ - qquickdwmfeatures_p_p.h \ - qquicktaskbarbutton_p.h \ - qquickjumplist_p.h \ - qquickjumplistitem_p.h \ - qquickjumplistcategory_p.h \ - qquickthumbnailtoolbar_p.h \ - qquickthumbnailtoolbutton_p.h \ - qquickiconloader_p.h \ - qquickwin_p.h - -SOURCES += \ - plugin.cpp \ - qquickdwmfeatures.cpp \ - qquicktaskbarbutton.cpp \ - qquickjumplist.cpp \ - qquickjumplistitem.cpp \ - qquickjumplistcategory.cpp \ - qquickthumbnailtoolbar.cpp \ - qquickthumbnailtoolbutton.cpp \ - qquickiconloader.cpp - -OTHER_FILES += \ - qmldir \ - JumpListLink.qml \ - JumpListDestination.qml \ - JumpListSeparator.qml - -!qtHaveModule(opengl)|qtConfig(dynamicgl):LIBS_PRIVATE += -luser32 - -load(qml_plugin) |