Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QWAYLANDSURFACE_P_H
5#define QWAYLANDSURFACE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/QScreen>
19
20#include <QtWaylandClient/private/qwayland-wayland.h>
21#include <QtCore/private/qglobal_p.h>
22
24
25namespace QtWaylandClient {
26
27class QWaylandScreen;
28class QWaylandWindow;
29class QWaylandDisplay;
30
31class QWaylandSurface : public QObject, public QtWayland::wl_surface
32{
34public:
36 ~QWaylandSurface() override;
39 std::optional<int32_t> preferredBufferScale() const { return m_preferredBufferScale; }
40 std::optional<wl_output_transform> preferredBufferTransform() const { return m_preferredBufferTransform; }
41
42 static QWaylandSurface *fromWlSurface(::wl_surface *surface);
43
48
49private Q_SLOTS:
50 void handleScreenRemoved(QScreen *qScreen);
51
52protected:
53 void surface_enter(struct ::wl_output *output) override;
54 void surface_leave(struct ::wl_output *output) override;
55 void surface_preferred_buffer_scale(int32_t scale) override;
56 void surface_preferred_buffer_transform(uint32_t transform) override;
57
58 QList<QWaylandScreen *> m_screens; //As seen by wl_surface.enter/leave events. Chronological order.
60 std::optional<int32_t> m_preferredBufferScale;
61 std::optional<wl_output_transform> m_preferredBufferTransform;
62
63 friend class QWaylandWindow; // TODO: shouldn't need to be friends
64};
65
66} // namespace QtWaylandClient
67
69
70#endif // QWAYLANDSURFACE_P_H
\inmodule QtCore
Definition qobject.h:103
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition qscreen.h:32
QList< QWaylandScreen * > m_screens
void surface_enter(struct ::wl_output *output) override
std::optional< wl_output_transform > m_preferredBufferTransform
void surface_preferred_buffer_transform(uint32_t transform) override
QWaylandSurface(QWaylandDisplay *display)
void surface_leave(struct ::wl_output *output) 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
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
GLuint GLenum GLenum transform
GLenum GLenum GLenum GLenum GLenum scale
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
QT_BEGIN_NAMESPACE typedef uchar * output