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
displaymanager.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 QARKUI_DISPLAY_MANAGER_H
5#define QARKUI_DISPLAY_MANAGER_H
6
7#include <QtCore/private/qohoscommon_p.h>
8#include <QtCore/qglobal.h>
9#include <qohosdisplayinfo.h>
10
11QT_BEGIN_NAMESPACE
12
13namespace QArkUi {
14
16{
17public:
18 using JsDisplayId = QOhosDisplayInfo::JsDisplayId;
19
25
26 static std::shared_ptr<QOhosDisplayManager> create(QtOhos::JsState &jsState, CreateInfo createInfo);
27
29
30private:
31 QOhosDisplayManager(QtOhos::JsState &jsState, CreateInfo createInfo);
32
33 void registerDisplayCallbackListener(
34 QNapi::Object displayModule, const std::string &eventName,
35 QOhosConsumer<QtOhos::JsState &, QOhosDisplayInfo::JsDisplayId> handleFunction);
36 bool tryRegisterDisplay(QtOhos::JsState &jsState, JsDisplayId displayId);
37 void rebuildRegisteredDisplayList(QtOhos::JsState &jsState);
38
39 std::vector<QOhosDisplayInfo> m_registeredDisplayInfos;
40 std::vector<std::shared_ptr<void>> m_destroyNotifiers;
41 std::map<JsDisplayId, std::shared_ptr<void>> m_perDisplayDestroyNotifiers;
42 QOhosConsumer<QtOhos::JsState &, JsDisplayId, QRectF> m_availableAreaChangedCb;
43};
44
45QPoint mapFromDisplayToGlobal(const QPoint &displayOffset, QOhosDisplayInfo::JsDisplayId jsDisplayId);
46
47}
48
49QT_END_NAMESPACE
50
51#endif
std::vector< QOhosDisplayInfo > getRegisteredDisplayInfos()
static std::shared_ptr< QOhosDisplayManager > create(QtOhos::JsState &jsState, CreateInfo createInfo)
QOhosDisplayInfo::JsDisplayId JsDisplayId
QPoint mapFromDisplayToGlobal(const QPoint &displayOffset, QOhosDisplayInfo::JsDisplayId jsDisplayId)
Combined button and popup list for selecting options.
QOhosConsumer< QtOhos::JsState &, JsDisplayId, QRectF > displayAvailableAreaChangedCb
QOhosConsumer< QtOhos::JsState &, std::vector< QOhosDisplayInfo > > displaysUpdatedCb