4#ifndef OHOSPLATFORMWINDOW_H
5#define OHOSPLATFORMWINDOW_H
7#include <QtCore/private/qohoscommon_p.h>
8#include <QtCore/qglobal.h>
9#include <QtCore/qharmonyjsobjectref.h>
10#include <QtCore/qobject.h>
11#include <QtCore/qrect.h>
12#include <QtGui/qpa/qplatformwindow_p.h>
13#include <QtGui/qwindow_platform.h>
17#include <qohosdisplayinfo.h>
18#include <qohosinternalwindowid_p.h>
19#include <qohoswindowproperty.h>
20#include <qpa/qplatformwindow.h>
21#include <render/qohossurface.h>
26class QOhosPlatformBackingStore;
61 template<
typename T,
const QOhosPropertyDescriptor<T> *propertyPtr>
64 template<
typename T,
const QOhosPropertyDescriptor<T> *propertyPtr>
68 QWindow *targetWindow, QObject *surfaceConsumerContext,
69 std::function<
void(
std::optional<
void *>)> surfaceConsumer);
80 void setParent(
const QPlatformWindow *newParent)
override;
89 if (isForeignWindow())
92 return window()->surfaceType() == QSurface::RasterSurface;
146 Qt::WindowFlags previousWindowFlags,
147 Qt::WindowFlags currentWindowFlags);
149 Qt::WindowStates oldWindowState, Qt::WindowStates currentWindowState);
164 void sendExposeUpdate();
166 QPlatformWindow *m_parent {
nullptr};
169 bool m_exposed =
false;
170 QRect m_lastRequestedWindowFrameGeometry;
171 std::optional<QSize> m_optLastReportedWindowSize;
174template<
typename T,
const QOhosPropertyDescriptor<T> *propertyPtr>
177 if (windowOrWidget ==
nullptr)
178 qOhosReportFatalErrorAndAbort(
"%s: windowOrWidget is null", Q_FUNC_INFO);
180 if (!windowOrWidget->isWindowType() && !windowOrWidget->isWidgetType()) {
181 qOhosReportFatalErrorAndAbort(
182 "%s: Invalid object - expected either window or widget, got %s",
184 windowOrWidget->metaObject()->className());
187 setQOhosPropertyOnQObject<T, propertyPtr>(windowOrWidget, propertyValue);
190template<
typename T,
const QOhosPropertyDescriptor<T> *propertyPtr>
193 return tryGetQOhosPropertyFromQObject<T, propertyPtr>(windowOrWidget);
bool sendEvent(WindowSystemEvent *event) override
Combined button and popup list for selecting options.
@ ForwardToGuiApplication
QOhosView * mapQWindowToViewOrNull(QWindow *window)
std::shared_ptr< QWindowSystemEventHandler > makeApplicationStateTracker()