| 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 QEGLFSSCREEN_H |
| 5 |
#define QEGLFSSCREEN_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 "qeglfsglobal_p.h" |
| 19 |
#include <QtCore/QPointer> |
| 20 |
|
| 21 |
#include <qpa/qplatformscreen.h> |
| 22 |
|
| 23 |
QT_BEGIN_NAMESPACE |
| 24 |
|
| 25 |
class QEglFSWindow; |
| 26 |
class QOpenGLContext; |
| 27 |
|
| 28 |
class Q_EGLFS_EXPORT QEglFSScreen : public QPlatformScreen |
| 29 |
{ |
| 30 |
public: |
| 31 |
QEglFSScreen(EGLDisplay display); |
| 32 |
~QEglFSScreen(); |
| 33 |
|
| 34 |
QRect geometry() const override; |
| 35 |
virtual QRect rawGeometry() const; |
| 36 |
int depth() const override; |
| 37 |
QImage::Format format() const override; |
| 38 |
|
| 39 |
QSizeF physicalSize() const override; |
| 40 |
QDpi logicalDpi() const override; |
| 41 |
QDpi logicalBaseDpi() const override; |
| 42 |
Qt::ScreenOrientation nativeOrientation() const override; |
| 43 |
Qt::ScreenOrientation orientation() const override; |
| 44 |
|
| 45 |
QPlatformCursor *cursor() const override; |
| 46 |
|
| 47 |
qreal refreshRate() const override; |
| 48 |
|
| 49 |
QPixmap grabWindow(WId wid, int x, int y, int width, int height) const override; |
| 50 |
|
| 51 |
EGLSurface primarySurface() const { return m_surface; } |
| 52 |
|
| 53 |
EGLDisplay display() const { return m_dpy; } |
| 54 |
|
| 55 |
void handleCursorMove(const QPoint &pos); |
| 56 |
|
| 57 |
QWindow *topLevelAt(const QPoint &point) const override; |
| 58 |
|
| 59 |
private: |
| 60 |
void setPrimarySurface(EGLSurface surface); |
| 61 |
|
| 62 |
EGLDisplay m_dpy; |
| 63 |
EGLSurface m_surface; |
| 64 |
QPlatformCursor *m_cursor; |
| 65 |
|
| 66 |
friend class QEglFSWindow; |
| 67 |
}; |
| 68 |
|
| 69 |
QT_END_NAMESPACE |
| 70 |
|
| 71 |
#endif // QEGLFSSCREEN_H |