Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylandquickshellsurfaceitem_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWAYLANDQUICKSHELLSURFACEITEM_P_H
6#define QWAYLANDQUICKSHELLSURFACEITEM_P_H
7
8#include <QtWaylandCompositor/QWaylandQuickShellSurfaceItem>
9#include <QtWaylandCompositor/QWaylandQuickShellIntegration>
10#include <QtWaylandCompositor/private/qwaylandquickitem_p.h>
11
12#include <QtCore/QBasicTimer>
13#include <QtCore/qpointer.h>
14
15#include <functional>
16
17QT_BEGIN_NAMESPACE
18
19//
20// W A R N I N G
21// -------------
22//
23// This file is not part of the Qt API. It exists purely as an
24// implementation detail. This header file may change from version to
25// version without notice, or even be removed.
26//
27// We mean it.
28//
29
30class QWaylandShellSurface;
31class QWaylandQuickShellSurfaceItem;
32
33class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandQuickShellSurfaceItemPrivate : public QWaylandQuickItemPrivate
34{
35 Q_DECLARE_PUBLIC(QWaylandQuickShellSurfaceItem)
36public:
37 QWaylandQuickShellSurfaceItemPrivate() {}
38
39 void setShellSurface(QWaylandShellSurface *shellSurface);
40 QWaylandQuickShellSurfaceItem *maybeCreateAutoPopup(QWaylandShellSurface* shellSurface);
41 static QWaylandQuickShellSurfaceItemPrivate *get(QWaylandQuickShellSurfaceItem *item) { return item->d_func(); }
42
43 void raise() override;
44 void lower() override;
45
46 QWaylandQuickShellIntegration *m_shellIntegration = nullptr;
47 QPointer<QWaylandShellSurface> m_shellSurface;
48 QQuickItem *m_moveItem = nullptr;
49 bool m_autoCreatePopupItems = true;
50 bool staysOnTop = false;
51 bool staysOnBottom = false;
52};
53
54class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandQuickShellEventFilter : public QObject
55{
56 Q_OBJECT
57public:
58 typedef std::function<void()> CallbackFunction;
59 static void startFilter(QWaylandClient *client, CallbackFunction closePopupCallback);
60 static void cancelFilter();
61
62protected:
63 void timerEvent(QTimerEvent *event) override;
64
65private:
66 void stopFilter();
67
68 QWaylandQuickShellEventFilter(QObject *parent = nullptr);
69 bool eventFilter(QObject *, QEvent *) override;
70 bool eventFilterInstalled = false;
71 bool waitForRelease = false;
72 QPointer<QWaylandClient> client;
73 CallbackFunction closePopups = nullptr;
74 QBasicTimer mousePressTimeout;
75 static QWaylandQuickShellEventFilter *self;
76};
77
78QT_END_NAMESPACE
79
80#endif // QWAYLANDQUICKSHELLSURFACEITEM_P_H
QWaylandQuickShellEventFilter implements a Wayland popup grab.
\qmltype ShellSurfaceItem \nativetype QWaylandQuickShellSurfaceItem \inherits WaylandQuickItem \inqml...
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(wayland_compositor_quick)
static bool onBottom(QWaylandQuickShellSurfaceItem *surf)
static QWaylandQuickShellSurfaceItem * findSurfaceItemFromMoveItem(QQuickItem *moveItem)
static bool onTop(QWaylandQuickShellSurfaceItem *surf)