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();
165 QMargins frameMarginsOnScreen(
const QPlatformScreen *platformScreen)
const;
167 QPlatformWindow *m_parent {
nullptr};
170 bool m_exposed =
false;
171 QRect m_lastRequestedWindowFrameGeometry;
172 std::optional<QRect> m_optLastReportedWindowGeometry;
175template<
typename T,
const QOhosPropertyDescriptor<T> *propertyPtr>
178 if (windowOrWidget ==
nullptr)
179 qOhosReportFatalErrorAndAbort(
"%s: windowOrWidget is null", Q_FUNC_INFO);
181 if (!windowOrWidget->isWindowType() && !windowOrWidget->isWidgetType()) {
182 qOhosReportFatalErrorAndAbort(
183 "%s: Invalid object - expected either window or widget, got %s",
185 windowOrWidget->metaObject()->className());
188 setQOhosPropertyOnQObject<T, propertyPtr>(windowOrWidget, propertyValue);
191template<
typename T,
const QOhosPropertyDescriptor<T> *propertyPtr>
194 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()