Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:08:00

0001 // Copyright (C) 2020 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QOFFSCREENSURFACE_H
0005 #define QOFFSCREENSURFACE_H
0006 
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/QObject>
0009 #include <QtCore/qnativeinterface.h>
0010 #include <QtGui/qsurface.h>
0011 Q_MOC_INCLUDE(<QtGui/qscreen.h>)
0012 
0013 QT_BEGIN_NAMESPACE
0014 
0015 class QOffscreenSurfacePrivate;
0016 
0017 class QScreen;
0018 class QPlatformOffscreenSurface;
0019 
0020 class Q_GUI_EXPORT QOffscreenSurface : public QObject, public QSurface
0021 {
0022     Q_OBJECT
0023     Q_DECLARE_PRIVATE(QOffscreenSurface)
0024 
0025 public:
0026     explicit QOffscreenSurface(QScreen *screen = nullptr, QObject *parent = nullptr);
0027     ~QOffscreenSurface();
0028 
0029     SurfaceType surfaceType() const override;
0030 
0031     void create();
0032     void destroy();
0033 
0034     bool isValid() const;
0035 
0036     void setFormat(const QSurfaceFormat &format);
0037     QSurfaceFormat format() const override;
0038     QSurfaceFormat requestedFormat() const;
0039 
0040     QSize size() const override;
0041 
0042     QScreen *screen() const;
0043     void setScreen(QScreen *screen);
0044 
0045     QPlatformOffscreenSurface *handle() const;
0046 
0047     QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QOffscreenSurface)
0048 
0049 Q_SIGNALS:
0050     void screenChanged(QScreen *screen);
0051 
0052 private Q_SLOTS:
0053     void screenDestroyed(QObject *screen);
0054 
0055 private:
0056 
0057     QPlatformSurface *surfaceHandle() const override;
0058 
0059     Q_DISABLE_COPY(QOffscreenSurface)
0060 };
0061 
0062 QT_END_NAMESPACE
0063 
0064 #include <QtGui/qoffscreensurface_platform.h>
0065 
0066 #endif // QOFFSCREENSURFACE_H