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 QPLATFORMSCREEN_P_H
5#define QPLATFORMSCREEN_P_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 <QtGui/private/qtguiglobal_p.h>
19
20#include <QtCore/qpointer.h>
21#include <QtCore/qnativeinterface.h>
22
23#if defined(Q_OS_WIN32)
24#include <qwindowdefs_win.h>
25#endif
26
27#if defined(Q_OS_UNIX)
28struct wl_output;
29#endif
30
31QT_BEGIN_NAMESPACE
32
33class QScreen;
34
35class QPlatformScreenPrivate
36{
37public:
38 QPointer<QScreen> screen;
39};
40
41// ----------------- QNativeInterface -----------------
42
43namespace QNativeInterface::Private {
44
45#if QT_CONFIG(xcb) || defined(Q_QDOC)
46struct Q_GUI_EXPORT QXcbScreen
47{
48 QT_DECLARE_NATIVE_INTERFACE(QXcbScreen, 1, QScreen)
49 virtual int virtualDesktopNumber() const = 0;
50};
51#endif
52
53#if QT_CONFIG(vsp2) || defined(Q_QDOC)
54struct Q_GUI_EXPORT QVsp2Screen
55{
56 QT_DECLARE_NATIVE_INTERFACE(QVsp2Screen, 1, QScreen)
57 virtual int addLayer(int dmabufFd, const QSize &size, const QPoint &position, uint drmPixelFormat, uint bytesPerLine) = 0;
58 virtual void setLayerBuffer(int id, int dmabufFd) = 0;
59 virtual void setLayerPosition(int id, const QPoint &position) = 0;
60 virtual void setLayerAlpha(int id, qreal alpha) = 0;
61 virtual bool removeLayer(int id) = 0;
62 virtual void addBlendListener(void (*callback)()) = 0;
63};
64#endif
65
66#if defined(Q_OS_WEBOS) || defined(Q_QDOC)
67struct Q_GUI_EXPORT QWebOSScreen
68{
69 QT_DECLARE_NATIVE_INTERFACE(QWebOSScreen, 1, QScreen)
70 virtual int addLayer(void *gbm_bo, const QRectF &geometry) = 0;
71 virtual void setLayerBuffer(int id, void *gbm_bo) = 0;
72 virtual void setLayerGeometry(int id, const QRectF &geometry) = 0;
73 virtual void setLayerAlpha(int id, qreal alpha) = 0;
74 virtual bool removeLayer(int id) = 0;
75 virtual void addFlipListener(void (*callback)()) = 0;
76};
77#endif
78
79#if defined(Q_OS_WIN32) || defined(Q_QDOC)
80struct Q_GUI_EXPORT QWindowsScreen
81{
82 QT_DECLARE_NATIVE_INTERFACE(QWindowsScreen, 1, QScreen)
83 virtual HMONITOR handle() const = 0;
84};
85#endif
86
87#if defined(Q_OS_UNIX) || defined(Q_CLANG_QDOC)
88struct Q_GUI_EXPORT QWaylandScreen
89{
90 QT_DECLARE_NATIVE_INTERFACE(QWaylandScreen, 1, QScreen)
91 virtual wl_output *output() const = 0;
92};
93#endif
94
95#if defined(Q_OS_ANDROID) || defined(Q_QDOC)
96struct Q_GUI_EXPORT QAndroidScreen
97{
98 QT_DECLARE_NATIVE_INTERFACE(QAndroidScreen, 1, QScreen)
99 virtual int displayId() const = 0;
100};
101#endif
102
103} // QNativeInterface::Private
104
105QT_END_NAMESPACE
106
107#endif // QPLATFORMSCREEN_P_H
108

source code of qtbase/src/gui/kernel/qplatformscreen_p.h