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
qwaylandsurface_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWAYLANDSURFACE_P_H
6#define QWAYLANDSURFACE_P_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 <QtGui/QScreen>
20
21#include <QtWaylandClient/private/qwayland-wayland.h>
22#include <QtCore/private/qglobal_p.h>
23
24#include <variant>
25
26QT_BEGIN_NAMESPACE
27
28namespace QtWaylandClient {
29
30class QWaylandScreen;
31class QWaylandSurfaceInputHandler;
32class QWaylandDisplay;
33class QWaylandWindow;
34class QWaylandDecorationSurface;
35
37{
39public:
42 QWaylandScreen *oldestEnteredScreen();
43 QWaylandDecorationSurface *decoration() const
44 {
45 if (auto decoration = std::get_if<QWaylandDecorationSurface *>(&m_container))
46 return *decoration;
47 return nullptr;
48 }
49 QWaylandWindow *waylandWindow() const
50 {
51 if (auto window = std::get_if<QWaylandWindow *>(&m_container))
52 return *window;
53 return nullptr;
54 }
55 std::optional<int32_t> preferredBufferScale() const { return m_preferredBufferScale; }
56 std::optional<wl_output_transform> preferredBufferTransform() const { return m_preferredBufferTransform; }
57
58 static QWaylandSurface *fromWlSurface(::wl_surface *surface);
59
64
65private Q_SLOTS:
67
68protected:
69 void surface_enter(struct ::wl_output *output) override;
70 void surface_leave(struct ::wl_output *output) override;
71 void surface_preferred_buffer_scale(int32_t scale) override;
72 void surface_preferred_buffer_transform(uint32_t transform) override;
73
74 QList<QWaylandScreen *> m_screens; //As seen by wl_surface.enter/leave events. Chronological order.
75
76 std::variant<QWaylandWindow *, QWaylandDecorationSurface *> m_container = static_cast<QWaylandWindow *>(nullptr); // what this surface is for
79
80 friend class QWaylandWindow;
81 friend class QWaylandDecorationSurface;
82};
83
84} // namespace QtWaylandClient
85
86QT_END_NAMESPACE
87
88#endif // QWAYLANDSURFACE_P_H
QList< QWaylandScreen * > m_screens
QWaylandDecorationSurface * decoration() const
std::optional< wl_output_transform > m_preferredBufferTransform
std::variant< QWaylandWindow *, QWaylandDecorationSurface * > m_container
void surface_preferred_buffer_transform(uint32_t transform) override
std::optional< int32_t > preferredBufferScale() const
static QWaylandSurface * fromWlSurface(::wl_surface *surface)
QWaylandWindow * waylandWindow() const
std::optional< int32_t > m_preferredBufferScale
std::optional< wl_output_transform > preferredBufferTransform() const
void surface_preferred_buffer_scale(int32_t scale) override
Combined button and popup list for selecting options.
static QtWayland::wp_cursor_shape_device_v1::shape qtCursorShapeToWaylandShape(Qt::CursorShape cursorShape)