| 1 | // Copyright (C) 2021 The Qt Company Ltd. | 
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only | 
| 3 |  | 
| 4 | #ifndef QWAYLANDQTSHELLCHROME_P_H | 
| 5 | #define QWAYLANDQTSHELLCHROME_P_H | 
| 6 |  | 
| 7 | #include "qwaylandqtshell.h" | 
| 8 |  | 
| 9 | #include <QtCore/qpointer.h> | 
| 10 | #include <QtQuick/private/qquickitem_p.h> | 
| 11 | #include <QtQuick/private/qquickdraghandler_p.h> | 
| 12 |  | 
| 13 | #include <QtWaylandCompositor/qwaylandquickshellsurfaceitem.h> | 
| 14 |  | 
| 15 | // | 
| 16 | //  W A R N I N G | 
| 17 | //  ------------- | 
| 18 | // | 
| 19 | // This file is not part of the Qt API.  It exists purely as an | 
| 20 | // implementation detail.  This header file may change from version to | 
| 21 | // version without notice, or even be removed. | 
| 22 | // | 
| 23 | // We mean it. | 
| 24 | // | 
| 25 |  | 
| 26 | QT_BEGIN_NAMESPACE | 
| 27 |  | 
| 28 | class QWaylandQtShellChromePrivate : public QQuickItemPrivate | 
| 29 | { | 
| 30 | public: | 
| 31 |     void updateDecorationInteraction(quint8 flags, const QQuickHandlerPoint ¢roid); | 
| 32 |     QPointF constrainPoint(const QPointF &point) const; | 
| 33 |  | 
| 34 |     bool positionSet = false; | 
| 35 |     bool automaticFrameMargins = true; | 
| 36 |     QMargins explicitFrameMargins; | 
| 37 |  | 
| 38 |     uint currentState = Qt::WindowNoState; | 
| 39 |     uint defaultFlags = Qt::Window | 
| 40 |             | Qt::WindowMaximizeButtonHint | 
| 41 |             | Qt::WindowMinimizeButtonHint | 
| 42 |             | Qt::WindowCloseButtonHint; | 
| 43 |     uint currentFlags = defaultFlags; | 
| 44 |     QRect restoreGeometry = QRect(0, 0, 100, 100); | 
| 45 |     QRect maximizedRect; | 
| 46 |     QPointer<QWaylandQuickShellSurfaceItem> shellSurfaceItem; | 
| 47 |     QPointer<QWaylandQtShellSurface> shellSurface; | 
| 48 |     QPointer<QWaylandSurface> surface; | 
| 49 |     QPointer<QWaylandQtShell> shell; | 
| 50 |  | 
| 51 |     enum class DecorationInteraction : quint8 { | 
| 52 |         None = 0, | 
| 53 |         WestBound = 1, | 
| 54 |         EastBound = 2, | 
| 55 |         NorthBound = 4, | 
| 56 |         SouthBound = 8, | 
| 57 |         TitleBar = 16 | 
| 58 |     }; | 
| 59 |  | 
| 60 |     quint8 decorationInteraction = quint8(DecorationInteraction::None); | 
| 61 |     QPointF decorationInteractionPosition; | 
| 62 |     QRect decorationInteractionGeometry; | 
| 63 |  | 
| 64 |     QQuickItem *leftResizeHandle = nullptr; | 
| 65 |     QQuickDragHandler *leftResizeHandleHandler = nullptr; | 
| 66 |     QQuickDragHandler *rightResizeHandleHandler = nullptr; | 
| 67 |     QQuickDragHandler *topResizeHandleHandler = nullptr; | 
| 68 |     QQuickDragHandler *bottomResizeHandleHandler = nullptr; | 
| 69 |     QQuickDragHandler *topLeftResizeHandleHandler = nullptr; | 
| 70 |     QQuickDragHandler *topRightResizeHandleHandler = nullptr; | 
| 71 |     QQuickDragHandler *bottomLeftResizeHandleHandler = nullptr; | 
| 72 |     QQuickDragHandler *bottomRightResizeHandleHandler = nullptr; | 
| 73 |     QQuickDragHandler *titleBarHandler = nullptr; | 
| 74 |  | 
| 75 |     QQuickItem *rightResizeHandle = nullptr; | 
| 76 |     QQuickItem *topResizeHandle = nullptr; | 
| 77 |     QQuickItem *bottomResizeHandle = nullptr; | 
| 78 |     QQuickItem *topLeftResizeHandle = nullptr; | 
| 79 |     QQuickItem *bottomLeftResizeHandle = nullptr; | 
| 80 |     QQuickItem *topRightResizeHandle = nullptr; | 
| 81 |     QQuickItem *bottomRightResizeHandle = nullptr; | 
| 82 |     QQuickItem *titleBar = nullptr; | 
| 83 | }; | 
| 84 |  | 
| 85 | QT_END_NAMESPACE | 
| 86 |  | 
| 87 | #endif // QWAYLANDQTSHELLCHROME_P_H | 
| 88 |  |