Warning: That file was not part of the compilation database. It may have many parsing errors.

1/****************************************************************************
2**
3** Copyright (C) 2017-2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
4** Copyright (C) 2017 The Qt Company Ltd.
5** Contact: https://www.qt.io/licensing/
6**
7** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:GPL$
10** Commercial License Usage
11** Licensees holding valid commercial Qt licenses may use this file in
12** accordance with the commercial license agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and The Qt Company. For licensing terms
15** and conditions see https://www.qt.io/terms-conditions. For further
16** information use the contact form at https://www.qt.io/contact-us.
17**
18** GNU General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU
20** General Public License version 3 or (at your option) any later version
21** approved by the KDE Free Qt Foundation. The licenses are as published by
22** the Free Software Foundation and appearing in the file LICENSE.GPL3
23** included in the packaging of this file. Please review the following
24** information to ensure the GNU General Public License requirements will
25** be met: https://www.gnu.org/licenses/gpl-3.0.html.
26**
27** $QT_END_LICENSE$
28**
29****************************************************************************/
30
31#ifndef QWAYLANDSURFACE_H
32#define QWAYLANDSURFACE_H
33
34#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
35#include <QtWaylandCompositor/qwaylandcompositorextension.h>
36#include <QtWaylandCompositor/qwaylandclient.h>
37
38#include <QtCore/QScopedPointer>
39#include <QtGui/QImage>
40#include <QtGui/QWindow>
41#include <QtCore/QVariantMap>
42
43struct wl_client;
44struct wl_resource;
45
46QT_BEGIN_NAMESPACE
47
48class QTouchEvent;
49class QWaylandClient;
50class QWaylandSurfacePrivate;
51class QWaylandCompositor;
52class QWaylandBufferRef;
53class QWaylandView;
54class QWaylandSurfaceOp;
55class QWaylandInputMethodControl;
56class QWaylandDrag;
57
58class QWaylandSurfaceRole
59{
60public:
61 QWaylandSurfaceRole(const QByteArray &n) : m_name(n) {}
62
63 const QByteArray name() { return m_name; }
64
65private:
66 QByteArray m_name;
67};
68
69class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandSurface : public QWaylandObject
70{
71 Q_OBJECT
72 Q_DECLARE_PRIVATE(QWaylandSurface)
73 Q_PROPERTY(QWaylandClient *client READ client CONSTANT)
74 Q_PROPERTY(QRectF sourceGeometry READ sourceGeometry NOTIFY sourceGeometryChanged REVISION 13)
75 Q_PROPERTY(QSize destinationSize READ destinationSize NOTIFY destinationSizeChanged REVISION 13)
76 Q_PROPERTY(QSize bufferSize READ bufferSize NOTIFY bufferSizeChanged REVISION 13)
77#if QT_DEPRECATED_SINCE(5, 13)
78 Q_PROPERTY(QSize size READ size NOTIFY sizeChanged) // Qt 6: Remove
79#endif
80 Q_PROPERTY(int bufferScale READ bufferScale NOTIFY bufferScaleChanged)
81 Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation NOTIFY contentOrientationChanged)
82 Q_PROPERTY(QWaylandSurface::Origin origin READ origin NOTIFY originChanged)
83 Q_PROPERTY(bool hasContent READ hasContent NOTIFY hasContentChanged)
84 Q_PROPERTY(bool cursorSurface READ isCursorSurface WRITE markAsCursorSurface NOTIFY cursorSurfaceChanged)
85 Q_PROPERTY(bool inhibitsIdle READ inhibitsIdle NOTIFY inhibitsIdleChanged REVISION 14)
86
87public:
88 enum Origin {
89 OriginTopLeft,
90 OriginBottomLeft
91 };
92 Q_ENUM(Origin)
93
94 QWaylandSurface();
95 QWaylandSurface(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version);
96 ~QWaylandSurface() override;
97
98 Q_INVOKABLE void initialize(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version);
99 bool isInitialized() const;
100
101 QWaylandClient *client() const;
102 ::wl_client *waylandClient() const;
103
104 bool setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode);
105 QWaylandSurfaceRole *role() const;
106
107 bool hasContent() const;
108
109 QRectF sourceGeometry() const;
110 QSize destinationSize() const;
111#if QT_DEPRECATED_SINCE(5, 13)
112 QT_DEPRECATED QSize size() const;
113#endif
114 QSize bufferSize() const;
115 int bufferScale() const;
116
117 Qt::ScreenOrientation contentOrientation() const;
118
119 Origin origin() const;
120
121 QWaylandCompositor *compositor() const;
122
123 bool inputRegionContains(const QPoint &p) const;
124 bool inputRegionContains(const QPointF &position) const;
125
126 Q_INVOKABLE void destroy();
127 Q_INVOKABLE bool isDestroyed() const;
128
129 Q_INVOKABLE void frameStarted();
130 Q_INVOKABLE void sendFrameCallbacks();
131
132 QWaylandView *primaryView() const;
133 void setPrimaryView(QWaylandView *view);
134
135 QList<QWaylandView *> views() const;
136
137 static QWaylandSurface *fromResource(::wl_resource *resource);
138 struct wl_resource *resource() const;
139
140 void markAsCursorSurface(bool cursorSurface);
141 bool isCursorSurface() const;
142
143 bool inhibitsIdle() const;
144
145#if QT_CONFIG(im)
146 QWaylandInputMethodControl *inputMethodControl() const;
147#endif
148
149public Q_SLOTS:
150#if QT_CONFIG(clipboard)
151 void updateSelection();
152#endif
153
154protected:
155 QWaylandSurface(QWaylandSurfacePrivate &dptr);
156
157Q_SIGNALS:
158 void hasContentChanged();
159 void damaged(const QRegion &rect);
160 void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent);
161 void childAdded(QWaylandSurface *child);
162 Q_REVISION(13) void sourceGeometryChanged();
163 Q_REVISION(13) void destinationSizeChanged();
164#if QT_DEPRECATED_SINCE(5, 13)
165 QT_DEPRECATED void sizeChanged();
166#endif
167 Q_REVISION(13) void bufferSizeChanged();
168 void bufferScaleChanged();
169 void offsetForNextFrame(const QPoint &offset);
170 void contentOrientationChanged();
171 void surfaceDestroyed();
172 void originChanged();
173 void subsurfacePositionChanged(const QPoint &position);
174 void subsurfacePlaceAbove(QWaylandSurface *sibling);
175 void subsurfacePlaceBelow(QWaylandSurface *sibling);
176 void dragStarted(QWaylandDrag *drag);
177 void cursorSurfaceChanged();
178 Q_REVISION(14) void inhibitsIdleChanged();
179
180 void configure(bool hasBuffer);
181 void redraw();
182};
183
184QT_END_NAMESPACE
185
186#endif // QWAYLANDSURFACE_H
187

Warning: That file was not part of the compilation database. It may have many parsing errors.

source code of qtwayland/src/compositor/compositor_api/qwaylandsurface.h