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
qplatformwindow_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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// Qt-Security score:significant reason:default
4
5#ifndef QPLATFORMWINDOW_P_H
6#define QPLATFORMWINDOW_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtGui/private/qtguiglobal_p.h>
20#include <QtCore/qbasictimer.h>
21#include <QtCore/qrect.h>
22#include <QtCore/qnativeinterface.h>
23#include <QtGui/qwindow.h>
24
25#if QT_CONFIG(wayland)
26#include <any>
27#include <QtCore/qobject.h>
28
29struct wl_surface;
30#endif
31
32#if defined(Q_OS_MACOS)
34typedef long NSInteger;
38#endif
39
41
42class QMargins;
43
50
51// ----------------- QNativeInterface -----------------
52
53namespace QNativeInterface::Private {
54
55#if defined(Q_OS_WASM) || defined(Q_QDOC)
57{
59 virtual emscripten::val document() const = 0;
60 virtual emscripten::val clientArea() const = 0;
61};
62#endif
63
64#if defined(Q_OS_MACOS) || defined(Q_QDOC)
66{
68 virtual void setContentBorderEnabled(bool enable) = 0;
69 virtual QPoint bottomLeftClippedByNSWindowOffset() const = 0;
70 virtual CALayer *contentLayer() const = 0;
74};
75#endif
76
77#if QT_CONFIG(xcb) || defined(Q_QDOC)
79{
81
82 enum WindowType {
83 None = 0x000000,
84 Normal = 0x000001,
85 Desktop = 0x000002,
86 Dock = 0x000004,
87 Toolbar = 0x000008,
88 Menu = 0x000010,
89 Utility = 0x000020,
90 Splash = 0x000040,
91 Dialog = 0x000080,
92 DropDownMenu = 0x000100,
93 PopupMenu = 0x000200,
94 Tooltip = 0x000400,
95 Notification = 0x000800,
96 Combo = 0x001000,
97 Dnd = 0x002000,
98 KdeOverride = 0x004000
99 };
101
102 virtual void setWindowType(WindowTypes type) = 0;
103 virtual void setWindowRole(const QString &role) = 0;
104 virtual void setWindowIconText(const QString &text) = 0;
105 virtual uint visualId() const = 0;
106};
107#endif // xcb
108
109#if defined(Q_OS_WIN) || defined(Q_QDOC)
111{
113
114 virtual void setHasBorderInFullScreen(bool border) = 0;
115 virtual bool hasBorderInFullScreen() const = 0;
116
117 virtual QMargins customMargins() const = 0;
118 virtual void setCustomMargins(const QMargins &margins) = 0;
119};
120#endif // Q_OS_WIN
121
122#if QT_CONFIG(wayland)
123struct Q_GUI_EXPORT QWaylandWindow : public QObject
124{
126public:
128
129 enum WindowType {
130 Default,
131 ToolTip,
132 ComboBox,
133 Menu,
134 SubMenu,
135 };
136
137 virtual wl_surface *surface() const = 0;
138 virtual void setCustomMargins(const QMargins &margins) = 0;
139 virtual void requestXdgActivationToken(uint serial) = 0;
140 template<typename T>
141 T *surfaceRole() const
142 {
144 auto role = std::any_cast<T *>(&anyRole);
145 return role ? *role : nullptr;
146 }
147 virtual void setSessionRestoreId(const QString &role) = 0;
148
150 virtual void setParentControlGeometry(const QRect &parentAnchor) = 0;
151
153 void surfaceCreated();
154 void surfaceDestroyed();
155 void surfaceRoleCreated();
158
159protected:
160 virtual std::any _surfaceRole() const = 0;
161};
162#endif
163
164} // QNativeInterface::Private
165
166QT_END_NAMESPACE
167
168#endif // QPLATFORMWINDOW_P_H
\inmodule QtCore
Definition qmargins.h:27
Combined button and popup list for selecting options.
static QSize fixInitialSize(QSize size, const QWindow *w, int deviceIndependentDefaultWidth, int deviceIndependentDefaultHeight)
static const QScreen * effectiveScreen(const QWindow *window)
#define QWINDOWSIZE_MAX