Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwaylandoutput_p.h
Go to the documentation of this file.
1// Copyright (C) 2017-2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2// Copyright (C) 2017 Klarälvdalens Datakonsult AB (KDAB).
3// Copyright (C) 2017 The Qt Company Ltd.
4// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
5
6#ifndef QWAYLANDOUTPUT_P_H
7#define QWAYLANDOUTPUT_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
21#include <QtWaylandCompositor/QWaylandOutput>
22#include <QtWaylandCompositor/QWaylandClient>
23#include <QtWaylandCompositor/QWaylandSurface>
24#include <QtWaylandCompositor/QWaylandXdgOutputV1>
25
26#include <QtWaylandCompositor/private/qwayland-server-wayland.h>
27
28#include <QtCore/QList>
29#include <QtCore/QRect>
30
31#include <QtCore/private/qobject_p.h>
32
34
36{
38 {}
39
41 : surface(s)
42 , views(1, v)
43 {}
44
46 {
47 for (int i = 0; i < views.size(); i++) {
48 if (surface && surface->primaryView() == views.at(i))
49 return views.at(i);
50 }
51 return nullptr;
52 }
53
56 bool has_entered = false;
57};
58
59class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandOutputPrivate : public QObjectPrivate, public QtWaylandServer::wl_output
60{
61public:
62 Q_DECLARE_PUBLIC(QWaylandOutput)
63
65
66 ~QWaylandOutputPrivate() override;
67 static QWaylandOutputPrivate *get(QWaylandOutput *output) { return output->d_func(); }
68
69 void addView(QWaylandView *view, QWaylandSurface *surface);
70 void removeView(QWaylandView *view, QWaylandSurface *surface);
71
72 void sendGeometry(const Resource *resource);
73 void sendGeometryInfo();
74
75 void sendMode(const Resource *resource, const QWaylandOutputMode &mode);
76 void sendModesInfo();
77
78 void handleWindowPixelSizeChanged();
79
81
82protected:
83 void output_bind_resource(Resource *resource) override;
84
85private:
86 void _q_handleMaybeWindowPixelSizeChanged();
87 void _q_handleWindowDestroyed();
88
90 QWindow *window = nullptr;
91 QString manufacturer;
95 int currentMode = -1;
96 int preferredMode = -1;
97 QRect availableGeometry;
99 QSize physicalSize;
102 int scaleFactor = 1;
103 bool sizeFollowsWindow = false;
104 bool initialized = false;
105 QSize windowPixelSize;
106
107 Q_DISABLE_COPY(QWaylandOutputPrivate)
108
110};
111
112
114
115#endif /*QWAYLANDOUTPUT_P_H*/
Definition qlist.h:74
qsizetype size() const noexcept
Definition qlist.h:386
const_reference at(qsizetype i) const noexcept
Definition qlist.h:429
\inmodule QtCore\reentrant
Definition qpoint.h:23
\inmodule QtCore
Definition qpointer.h:18
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
\inmodule QtWaylandCompositor
QPointer< QWaylandXdgOutputV1 > xdgOutput
static QWaylandOutputPrivate * get(QWaylandOutput *output)
\qmltype WaylandOutput \instantiates QWaylandOutput \inqmlmodule QtWayland.Compositor
Subpixel
This enum type is used to specify the subpixel arrangement of a QWaylandOutput.
Transform
This enum type is used to specify the orientation of a QWaylandOutput.
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
QWaylandView * primaryView() const
Updates the surface with the compositor's retained clipboard selection.
\qmltype WaylandView \instantiates QWaylandView \inqmlmodule QtWayland.Compositor
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
static QOpenGLCompositor * compositor
GLsizei const GLfloat * v
[13]
GLenum mode
GLuint GLenum GLenum transform
GLdouble s
[6]
Definition qopenglext.h:235
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
QT_BEGIN_NAMESPACE typedef uchar * output
QSqlQueryModel * model
[16]
aWidget window() -> setWindowTitle("New Window Title")
[2]
QQuickView * view
[0]
QWaylandView * maybePrimaryView() const
QList< QWaylandView * > views
QWaylandSurfaceViewMapper(QWaylandSurface *s, QWaylandView *v)