8#include "EGL/eglplatform.h"
10#include <QSharedPointer>
11#include <QtCore/qglobal.h>
18 enum class SurfaceFlagBits {
19 PreserveBufferContentsOnSwap = 1 << 0,
21 Q_DECLARE_FLAGS(SurfaceFlags, SurfaceFlagBits)
23 QOhosEGLSurface() =
default;
25 QOhosEGLSurface(
const QOhosEGLSurface&) =
delete;
26 QOhosEGLSurface& operator=(
const QOhosEGLSurface&) =
delete;
28 QOhosEGLSurface(QOhosEGLSurface &&) =
delete;
29 QOhosEGLSurface& operator=(QOhosEGLSurface &&) =
delete;
33 EGLSurface tryGetOrCreateEGLWindowSurface(EGLDisplay display, EGLConfig config, SurfaceFlags flags = {});
34 void setNativeWindowSurface(EGLNativeWindowType nativeWindow);
35 SurfaceFlags currentSurfaceFlags()
const;
39 void tryCreateSurface(EGLDisplay display, EGLConfig config, SurfaceFlags surfaceFlags);
41 EGLDisplay m_refCurrentDisplay = EGL_NO_DISPLAY;
42 EGLConfig m_refCurrentConfig =
nullptr;
43 EGLNativeWindowType m_refCurrentNativeWindow =
nullptr;
44 EGLNativeWindowType m_refTargetNativeWindow =
nullptr;
45 EGLSurface m_ownEglSurface = EGL_NO_SURFACE;
46 SurfaceFlags m_currentSurfaceFlags = {};
std::enable_if_t< qohosplugincore_h_detail::isQOhosOptional< QOhosInvokeResult< Func, T > >, QOhosInvokeResult< Func, T > > andThen(Func &&func) const
QOhosPropertiesProvider(QOhosPropertiesStore &store)
QOhosOptional< T > tryGetProperty() const
std::shared_ptr< void > addPropertyWriteCallback(QOhosConsumer< T > propertyWriteCallback)
QOhosPropertiesStore(QObject *qObject)
std::shared_ptr< void > addPropertyWriteCallback(QOhosConsumer< T > propertyWriteCallback)
void notifyPropertyWrite(const QByteArray &propertyName)
QOhosOptional< T > tryGetProperty() const
void setExtraUsageBitsForNativeWindowBuffer(std::uint64_t usageSetBits)
EGLSurface tryGetOrCreateEGLWindowSurface(EGLDisplay display, EGLConfig config)
QOhosOptional< QSize > surfaceResolution() const
::OHNativeWindow * nativeWindow() const
void setNativeWindowSurface(::OHNativeWindow *nativeWindow)
static constexpr ::OH_NativeBuffer_Format bufferFormat
void paintOnNativeWindowSurface(std::function< std::vector<::Region::Rect >(QImage &, ::BufferHandle *)> paintFunc, std::function< void(::BufferHandle *)> onFlushSuccessFunc)
static QImage::Format mapNativeBufferFormatToQImageFormatOrFail(std::int32_t format)
static QOhosOptional< QSize > tryGetBufferGeometryForWindow(::OHNativeWindow *nativeWindow)
QOhosSurface(::OHNativeWindow *nativeWindow)
void clearNativeWindowSurface()
bool sendEvent(WindowSystemEvent *event) override
Combined button and popup list for selecting options.
@ ForwardToGuiApplication
QOhosView * mapQWindowToViewOrNull(QWindow *window)
std::string makeQObjectOhosPropertyName()
QOhosOptional< T > tryMapFromQVariant(QVariant variant)
const char * qObjectOhosPropertyName()
std::shared_ptr< QWindowSystemEventHandler > makeApplicationStateTracker()
QOhosOptional< void > makeEmptyQOhosOptional()
void setQOhosPropertyOnQObject(QObject *qObject, T propertyValue)
QOhosOptional< T > tryGetQOhosPropertyFromQObject(QObject *qObject)