File indexing completed on 2025-09-17 09:09:40
0001
0002
0003
0004 #ifndef QEGLFSWINDOW_H
0005 #define QEGLFSWINDOW_H
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include "qeglfsglobal_p.h"
0019 #include "qeglfsintegration_p.h"
0020 #include "qeglfsscreen_p.h"
0021
0022 #include <qpa/qplatformwindow.h>
0023 #ifndef QT_NO_OPENGL
0024 # include <QtOpenGL/private/qopenglcompositor_p.h>
0025 #endif
0026
0027 QT_BEGIN_NAMESPACE
0028
0029 class QOpenGLCompositorBackingStore;
0030 class QPlatformTextureList;
0031
0032 #ifndef QT_NO_OPENGL
0033 class Q_EGLFS_EXPORT QEglFSWindow : public QPlatformWindow, public QOpenGLCompositorWindow
0034 #else
0035 class Q_EGLFS_EXPORT QEglFSWindow : public QPlatformWindow
0036 #endif
0037 {
0038 public:
0039 QEglFSWindow(QWindow *w);
0040 ~QEglFSWindow();
0041
0042 void create();
0043 void destroy();
0044
0045 void setGeometry(const QRect &) override;
0046 QRect geometry() const override;
0047 void setVisible(bool visible) override;
0048 void requestActivateWindow() override;
0049 void raise() override;
0050 void lower() override;
0051
0052 void propagateSizeHints() override { }
0053 void setMask(const QRegion &) override { }
0054 bool setKeyboardGrabEnabled(bool) override { return false; }
0055 bool setMouseGrabEnabled(bool) override { return false; }
0056 void setOpacity(qreal) override;
0057 WId winId() const override;
0058
0059 QSurfaceFormat format() const override;
0060
0061 EGLNativeWindowType eglWindow() const;
0062 EGLSurface surface() const;
0063 QEglFSScreen *screen() const override;
0064
0065 bool hasNativeWindow() const { return m_flags.testFlag(HasNativeWindow); }
0066
0067 void invalidateSurface() override;
0068 virtual void resetSurface();
0069
0070 bool isRaster() const;
0071
0072 #ifndef QT_NO_OPENGL
0073 QOpenGLCompositorBackingStore *backingStore() const override { return m_backingStore; }
0074 void setBackingStore(QOpenGLCompositorBackingStore *backingStore) override;
0075 QWindow *sourceWindow() const override;
0076 const QPlatformTextureList *textures() const override;
0077 void endCompositing() override;
0078 #endif
0079
0080 protected:
0081 #ifndef QT_NO_OPENGL
0082 QOpenGLCompositorBackingStore *m_backingStore;
0083 QOpenGLContext *m_rasterCompositingContext;
0084 #endif
0085 WId m_winId;
0086
0087 EGLSurface m_surface;
0088 EGLNativeWindowType m_window;
0089
0090 EGLConfig m_config;
0091 QSurfaceFormat m_format;
0092
0093 enum Flag {
0094 Created = 0x01,
0095 HasNativeWindow = 0x02
0096 };
0097 Q_DECLARE_FLAGS(Flags, Flag)
0098 Flags m_flags;
0099 };
0100
0101 QT_END_NAMESPACE
0102
0103 #endif