Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qohosplatformscreen.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOHOSPLATFORMSCREEN_H
5#define QOHOSPLATFORMSCREEN_H
6
7#include <qpa/qplatformscreen.h>
8#include <QList>
9#include <QPainter>
10#include <QTimer>
11#include <QWaitCondition>
12#include <QtCore/qatomic.h>
13
14#include <qohosdisplayinfo.h>
15#include <qohosplugincore.h>
16#include "EGL/eglplatform.h"
18// #include <ohos/native_window.h>
19
21
23class QOhosNativeXComponent;
24
26{
28public:
31
32 static QOhosPlatformScreen *fromQScreen(QScreen *screen);
33
34 QRect geometry() const override;
35 QRect availableGeometry() const override;
36 int depth() const override;
37 QImage::Format format() const override;
38 QSizeF physicalSize() const override;
40 QString name() const override;
41
42 QWindow *topLevelAt(const QPoint & p) const override;
43
44 QPlatformCursor *cursor() const override;
45
46 // compositor api
49
50 const QOhosDisplayInfo &displayInfo() const;
51
52 QPixmap grabWindow(WId wId, int x, int y, int width, int height) const override;
53
54 void setDisplayInfo(const QOhosDisplayInfo &displayInfo);
55 void setAvailableGeometry(const QRect &rect);
56
57protected:
58 QDpi logicalDpi() const override;
59 QDpi logicalBaseDpi() const override;
60 Qt::ScreenOrientation orientation() const override;
61 Qt::ScreenOrientation nativeOrientation() const override;
62
63private:
64 QRect getAvailableArea() const;
65
66 QImage::Format m_format;
67 int m_depth;
68
69 void releaseSurface();
70 QScopedPointer<QOhosPlatformCursor> m_platformCursor;
71 QOhosDisplayInfo m_displayInfo;
72 QRect m_availableGeometry;
73};
74
75QT_END_NAMESPACE
76#endif
QOhosFloatingWindow(QWindow *window)
~QOhosFloatingWindow() override
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
bool startSystemMove() override
Reimplement this method to start a system move operation if the system supports it and return true to...
QOhosView * ownedViewOrNull() const override
void onWindowStateChanged(Qt::WindowStates oldWindowState, Qt::WindowStates currentWindowState) override
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
void initialize() override
Called as part of QWindow::create(), after constructing the window.
void onWindowFlagsChanged(Qt::WindowFlags previousWindowFlags, Qt::WindowFlags currentWindowFlags) override
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
QOhosSurface * ownedSurfaceOrNull() const override
void setMask(const QRegion &region) override
Reimplement to be able to let Qt set the mask of a window.
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
std::enable_if_t< qohosplugincore_h_detail::isQOhosOptional< QOhosInvokeResult< Func, T > >, QOhosInvokeResult< Func, T > > andThen(Func &&func) const
static QOhosPlatformScreen * fromQScreen(QScreen *screen)
QPixmap grabWindow(WId wId, int x, int y, int width, int height) const override
This function is called when Qt needs to be able to grab the content of a window.
QWindow * topLevelAt(const QPoint &p) const override
Return the given top level window for a given position.
Qt::ScreenOrientation orientation() const override
Reimplement this function in subclass to return the current orientation of the screen,...
void removeWindow(QOhosPlatformWindow *window)
QRect availableGeometry() const override
Reimplement in subclass to return the pixel geometry of the available space This normally is the desk...
QSizeF physicalSize() const override
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
Qt::ScreenOrientation nativeOrientation() const override
Reimplement this function in subclass to return the native orientation of the screen,...
const QOhosDisplayInfo & displayInfo() const
QString name() const override
QPlatformCursor * cursor() const override
Reimplement this function in subclass to return the cursor of the screen.
qreal pixelScalingCoefficient() const
void setAvailableGeometry(const QRect &rect)
void setDisplayInfo(const QOhosDisplayInfo &displayInfo)
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
QDpi logicalDpi() const override
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch met...
int depth() const override
Reimplement in subclass to return current depth of the screen.
QDpi logicalBaseDpi() const override
Reimplement to return the base logical DPI for the platform.
void notifyWindowVisibleAndActivated(QOhosPlatformWindow *window)
Combined button and popup list for selecting options.