8#include "EGL/eglplatform.h"
10#include <QSharedPointer>
11#include <QtCore/qglobal.h>
12#include <QtCore/qsize.h>
13#include <qohosplugincore.h>
20 enum class SurfaceFlagBits {
21 PreserveBufferContentsOnSwap = 1 << 0,
23 Q_DECLARE_FLAGS(SurfaceFlags, SurfaceFlagBits)
25 QOhosEGLSurface() =
default;
27 QOhosEGLSurface(
const QOhosEGLSurface&) =
delete;
28 QOhosEGLSurface& operator=(
const QOhosEGLSurface&) =
delete;
30 QOhosEGLSurface(QOhosEGLSurface &&) =
delete;
31 QOhosEGLSurface& operator=(QOhosEGLSurface &&) =
delete;
35 EGLSurface tryGetOrCreateEGLWindowSurface(
36 EGLDisplay display, EGLConfig config,
bool swappingBuffers, SurfaceFlags flags = {});
37 void setNativeWindowSurface(
38 EGLNativeWindowType nativeWindow,
const QOhosOptional<QSize> &optSurfaceSize);
39 SurfaceFlags currentSurfaceFlags()
const;
43 void tryCreateSurface(EGLDisplay display, EGLConfig config, SurfaceFlags surfaceFlags);
44 QOhosOptional<QSize> currentSurfaceSize()
const;
46 EGLDisplay m_refCurrentDisplay = EGL_NO_DISPLAY;
47 EGLConfig m_refCurrentConfig =
nullptr;
48 EGLNativeWindowType m_refCurrentNativeWindow =
nullptr;
49 EGLNativeWindowType m_refTargetNativeWindow =
nullptr;
50 EGLSurface m_ownEglSurface = EGL_NO_SURFACE;
51 SurfaceFlags m_currentSurfaceFlags = {};
52 QOhosOptional<QSize> m_targetSurfaceSize;
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)
void setNativeWindowSurface(::OHNativeWindow *nativeWindow, const QOhosOptional< QSize > &optSurfaceSize)
QOhosOptional< QSize > surfaceResolution() const
::OHNativeWindow * nativeWindow() const
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)
EGLSurface tryGetOrCreateEGLWindowSurface(EGLDisplay display, EGLConfig config, bool swappingBuffers)
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()
QT_END_NAMESPACE Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhos::enums::kit::ShareKit::systemShare::SelectionMode))
std::nullopt_t makeEmptyQOhosOptional()
void setQOhosPropertyOnQObject(QObject *qObject, T propertyValue)
QOhosOptional< T > tryGetQOhosPropertyFromQObject(QObject *qObject)