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
qwaylandscreen_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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 QWAYLANDSCREEN_H
5#define QWAYLANDSCREEN_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 <qpa/qplatformscreen.h>
19#include <QtGui/qscreen_platform.h>
20#include <QtWaylandClient/qtwaylandclientglobal.h>
21
22#include <QtWaylandClient/private/qwayland-wayland.h>
23#include <QtWaylandClient/private/qwayland-xdg-output-unstable-v1.h>
24#include <QtCore/private/qglobal_p.h>
25
27
28namespace QtWaylandClient {
29
30class QWaylandDisplay;
31class QWaylandCursor;
32
33class Q_WAYLANDCLIENT_EXPORT QWaylandXdgOutputManagerV1 : public QtWayland::zxdg_output_manager_v1 {
34public:
37};
38
39class Q_WAYLANDCLIENT_EXPORT QWaylandScreen : public QPlatformScreen,
40 QtWayland::wl_output,
41 QtWayland::zxdg_output_v1,
42 public QNativeInterface::QWaylandScreen
43{
44public:
45 QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id);
46 ~QWaylandScreen() override;
47
48 void maybeInitialize();
49
50 void initXdgOutput(QWaylandXdgOutputManagerV1 *xdgOutputManager);
51
52 QWaylandDisplay *display() const;
53
54 QString manufacturer() const override;
55 QString model() const override;
56
57 QRect geometry() const override;
58 int depth() const override;
59 QImage::Format format() const override;
60
61 QSizeF physicalSize() const override;
62
63 QDpi logicalDpi() const override;
64 QList<QPlatformScreen *> virtualSiblings() const override;
65
66 QWindow *topLevelAt(const QPoint &point) const override;
67
68 Qt::ScreenOrientation orientation() const override;
69 int scale() const;
70 qreal devicePixelRatio() const override;
71 qreal refreshRate() const override;
72
73 QString name() const override { return mOutputName; }
74
75#if QT_CONFIG(cursor)
76 QPlatformCursor *cursor() const override;
77#endif
78
79 SubpixelAntialiasingType subpixelAntialiasingTypeHint() const override;
80
81 uint32_t outputId() const { return m_outputId; }
82 ::wl_output *output() const override
83 {
84 return const_cast<::wl_output *>(QtWayland::wl_output::object());
85 }
86
87 static QWaylandScreen *waylandScreenFromWindow(QWindow *window);
88 static QWaylandScreen *fromWlOutput(::wl_output *output);
89
90 Qt::ScreenOrientation toScreenOrientation(int wlTransform,
91 Qt::ScreenOrientation fallback) const;
92
93protected:
94 enum Event : uint {
95 XdgOutputDoneEvent = 0x1,
96 OutputDoneEvent = 0x2,
97 XdgOutputNameEvent = 0x4,
98 };
99 uint requiredEvents() const;
100
101 void output_mode(uint32_t flags, int width, int height, int refresh) override;
102 void output_geometry(int32_t x, int32_t y,
103 int32_t width, int32_t height,
104 int subpixel,
105 const QString &make,
106 const QString &model,
107 int32_t transform) override;
108 void output_scale(int32_t factor) override;
109 void output_done() override;
110 void updateOutputProperties();
111
112 // XdgOutput
113 void zxdg_output_v1_logical_position(int32_t x, int32_t y) override;
114 void zxdg_output_v1_logical_size(int32_t width, int32_t height) override;
115 void zxdg_output_v1_done() override;
116 void zxdg_output_v1_name(const QString &name) override;
117 void updateXdgOutputProperties();
118
120 QWaylandDisplay *mWaylandDisplay = nullptr;
125 int mScale = 1;
126 int mDepth = 32;
127 int mRefreshRate = 60000;
128 int mSubpixel = -1;
129 int mTransform = -1;
134 uint mProcessedEvents = 0;
135 bool mInitialized = false;
136};
137
138}
139
141
142#endif // QWAYLANDSCREEN_H
Format
The following image formats are available in Qt.
Definition qimage.h:41
@ Format_ARGB32_Premultiplied
Definition qimage.h:48
The QPlatformCursor class provides information about pointer device events (movement,...
The QPlatformScreen class provides an abstraction for visual displays.
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:208
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtGui
Definition qwindow.h:63
QString name() const override
::wl_output * output() const override
QCursor cursor
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
ScreenOrientation
Definition qnamespace.h:271
@ PrimaryOrientation
Definition qnamespace.h:272
static QFontEngine::SubpixelAntialiasingType subpixelAntialiasingTypeHint()
QPair< qreal, qreal > QDpi
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLint GLsizei GLsizei height
GLint GLsizei width
GLbitfield flags
GLuint name
GLint GLsizei GLsizei GLenum format
GLint y
GLuint GLenum GLenum transform
GLenum GLenum GLenum GLenum GLenum scale
static QT_BEGIN_NAMESPACE QWindow * topLevelAt(const QPoint &pos)
unsigned int uint
Definition qtypes.h:34
double qreal
Definition qtypes.h:187
QT_BEGIN_NAMESPACE typedef uchar * output
QSqlQueryModel * model
[16]
aWidget window() -> setWindowTitle("New Window Title")
[2]