1// Copyright (C) 2016 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 QOFFSCREENWINDOW_H
5#define QOFFSCREENWINDOW_H
6
7#include <qpa/qplatformbackingstore.h>
8#include <qpa/qplatformwindow.h>
9
10#include <qhash.h>
11
12QT_BEGIN_NAMESPACE
13
14class QOffscreenWindow : public QPlatformWindow
15{
16public:
17 QOffscreenWindow(QWindow *window, bool frameMarginsEnabled);
18 ~QOffscreenWindow();
19
20 void setGeometry(const QRect &rect) override;
21 void setWindowState(Qt::WindowStates states) override;
22
23 QMargins frameMargins() const override;
24
25 void setVisible(bool visible) override;
26 void requestActivateWindow() override;
27
28 WId winId() const override;
29 QSurfaceFormat format() const override;
30
31 static QOffscreenWindow *windowForWinId(WId id);
32
33private:
34 void setFrameMarginsEnabled(bool enabled);
35 void setGeometryImpl(const QRect &rect);
36
37 QRect m_normalGeometry;
38 QMargins m_margins;
39 bool m_positionIncludesFrame;
40 bool m_visible;
41 bool m_pendingGeometryChangeOnShow;
42 bool m_frameMarginsRequested;
43 WId m_winId;
44
45 Q_CONSTINIT static QHash<WId, QOffscreenWindow *> m_windowForWinIdHash;
46};
47
48QT_END_NAMESPACE
49
50#endif
51

source code of qtbase/src/plugins/platforms/offscreen/qoffscreenwindow.h