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