Debian Codegraph @

wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylandsubsurface_p.h

raw symbols SCIP
1 // Copyright (C) 2018 The Qt Company Ltd.
2 //
3 // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5 #ifndef QWAYLANDSUBSURFACE_H
6 #define QWAYLANDSUBSURFACE_H
7
8 //
9 // W A R N I N G
10 // -------------
11 //
12 // This file is not part of the Qt API. It exists purely as an
13 // implementation detail. This header file may change from version to
14 // version without notice, or even be removed.
15 //
16 // We mean it.
17 //
18
19 #include <wayland-client.h>
20
21 #include <QtCore/qglobal.h>
22 #include <QtCore/qmutex.h>
23
24 #include <QtWaylandClient/qtwaylandclientglobal.h>
25 #include <QtWaylandClient/private/qwayland-wayland.h>
26
27 QT_BEGIN_NAMESPACE
28
29 namespace QtWaylandClient {
30
31 class QWaylandDisplay;
32 class QWaylandWindow;
33
34 class Q_WAYLAND_CLIENT_EXPORT QWaylandSubSurface : public QtWayland::wl_subsurface
35 {
36 public:
37 QWaylandSubSurface(QWaylandWindow *window, QWaylandWindow *parent, ::wl_subsurface *subsurface);
38 ~QWaylandSubSurface() override;
39
40 QWaylandWindow *window() const { return m_window; }
41 QWaylandWindow *parent() const { return m_parent; }
42
43 void setSync();
44 void setDeSync();
45 bool isSync() const { return m_synchronized; }
46 QMutex *syncMutex() { return &m_syncLock; }
47
48 private:
49
50 // Intentionally hide public methods from ::wl_subsurface
51 // to keep track of the sync state
52 void set_sync();
53 void set_desync();
54 QWaylandWindow *m_window = nullptr;
55 QWaylandWindow *m_parent = nullptr;
56 bool m_synchronized = false;
57 QMutex m_syncLock;
58
59 };
60
61 QT_END_NAMESPACE
62
63 }
64
65 #endif // QWAYLANDSUBSURFACE_H