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
4#ifndef QWAYLANDQUICKSHELLSURFACEITEM_P_H
5#define QWAYLANDQUICKSHELLSURFACEITEM_P_H
6
7#include <QtWaylandCompositor/QWaylandQuickShellSurfaceItem>
8#include <QtWaylandCompositor/QWaylandQuickShellIntegration>
9#include <QtWaylandCompositor/private/qwaylandquickitem_p.h>
10
11#include <QtCore/QBasicTimer>
12#include <QtCore/qpointer.h>
13
14#include <functional>
15
16QT_BEGIN_NAMESPACE
17
18//
19// W A R N I N G
20// -------------
21//
22// This file is not part of the Qt API. It exists purely as an
23// implementation detail. This header file may change from version to
24// version without notice, or even be removed.
25//
26// We mean it.
27//
28
29class QWaylandShellSurface;
30class QWaylandQuickShellSurfaceItem;
31
32class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandQuickShellSurfaceItemPrivate : public QWaylandQuickItemPrivate
33{
34 Q_DECLARE_PUBLIC(QWaylandQuickShellSurfaceItem)
35public:
36 QWaylandQuickShellSurfaceItemPrivate() {}
37
38 void setShellSurface(QWaylandShellSurface *shellSurface);
39 QWaylandQuickShellSurfaceItem *maybeCreateAutoPopup(QWaylandShellSurface* shellSurface);
40 static QWaylandQuickShellSurfaceItemPrivate *get(QWaylandQuickShellSurfaceItem *item) { return item->d_func(); }
41
42 void raise() override;
43 void lower() override;
44
45 QWaylandQuickShellIntegration *m_shellIntegration = nullptr;
46 QWaylandShellSurface *m_shellSurface = nullptr;
47 QQuickItem *m_moveItem = nullptr;
48 bool m_autoCreatePopupItems = true;
49 bool staysOnTop = false;
50 bool staysOnBottom = false;
51};
52
53class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandQuickShellEventFilter : public QObject
54{
55 Q_OBJECT
56public:
57 typedef std::function<void()> CallbackFunction;
58 static void startFilter(QWaylandClient *client, CallbackFunction closePopupCallback);
59 static void cancelFilter();
60
61protected:
62 void timerEvent(QTimerEvent *event) override;
63
64private:
65 void stopFilter();
66
67 QWaylandQuickShellEventFilter(QObject *parent = nullptr);
68 bool eventFilter(QObject *, QEvent *) override;
69 bool eventFilterInstalled = false;
70 bool waitForRelease = false;
71 QPointer<QWaylandClient> client;
72 CallbackFunction closePopups = nullptr;
73 QBasicTimer mousePressTimeout;
74 static QWaylandQuickShellEventFilter *self;
75};
76
77QT_END_NAMESPACE
78
79#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)