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
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#include <QtCore/qpointer.h>
33
35
37{
40
45
47 {
48 for (int i = 0; i < views.size(); i++) {
49 if (surface && surface->primaryView() == views.at(i))
50 return views.at(i);
51 }
52 return nullptr;
53 }
54
56 QList<QWaylandView *> views;
57 bool has_entered = false;
58};
59
60class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandOutputPrivate : public QObjectPrivate, public QtWaylandServer::wl_output
61{
62public:
63 Q_DECLARE_PUBLIC(QWaylandOutput)
64
66
67 ~QWaylandOutputPrivate() override;
68 static QWaylandOutputPrivate *get(QWaylandOutput *output) { return output->d_func(); }
69
70 void addView(QWaylandView *view, QWaylandSurface *surface);
71 void removeView(QWaylandView *view, QWaylandSurface *surface);
72
73 void sendGeometry(const Resource *resource);
74 void sendGeometryInfo();
75
76 void sendMode(const Resource *resource, const QWaylandOutputMode &mode);
77 void sendModesInfo();
78
79 void handleWindowPixelSizeChanged();
80
81 QPointer<QWaylandXdgOutputV1> xdgOutput;
82
83protected:
84 void output_bind_resource(Resource *resource) override;
85
86private:
87 void _q_handleMaybeWindowPixelSizeChanged();
88 void _q_handleWindowDestroyed();
89
91 QWindow *window = nullptr;
92 QString manufacturer;
95 QList<QWaylandOutputMode> modes;
96 int currentMode = -1;
97 int preferredMode = -1;
98 QRect availableGeometry;
99 QList<QWaylandSurfaceViewMapper> surfaceViews;
100 QSize physicalSize;
103 int scaleFactor = 1;
104 bool sizeFollowsWindow = false;
105 bool initialized = false;
106 QSize windowPixelSize;
107
108 Q_DISABLE_COPY(QWaylandOutputPrivate)
109
111};
112
113
115
116#endif /*QWAYLANDOUTPUT_P_H*/
qsizetype size() const noexcept
Definition qlist.h:397
const_reference at(qsizetype i) const noexcept
Definition qlist.h:446
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\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)