Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
32
33class QMargins;
34
41
42// ----------------- QNativeInterface -----------------
43
45
46#if defined(Q_OS_WASM) || defined(Q_QDOC)
47struct Q_GUI_EXPORT QWasmWindow
48{
50 virtual emscripten::val document() const = 0;
51 virtual emscripten::val clientArea() const = 0;
52};
53#endif
54
55#if defined(Q_OS_MACOS) || defined(Q_QDOC)
56struct Q_GUI_EXPORT QCocoaWindow
57{
59 virtual void setContentBorderEnabled(bool enable) = 0;
60 virtual QPoint bottomLeftClippedByNSWindowOffset() const = 0;
61
62 virtual bool inLiveResize() const = 0;
63};
64#endif
65
66#if QT_CONFIG(xcb) || defined(Q_QDOC)
67struct Q_GUI_EXPORT QXcbWindow
68{
70
71 enum WindowType {
72 None = 0x000000,
73 Normal = 0x000001,
74 Desktop = 0x000002,
75 Dock = 0x000004,
76 Toolbar = 0x000008,
77 Menu = 0x000010,
78 Utility = 0x000020,
79 Splash = 0x000040,
80 Dialog = 0x000080,
81 DropDownMenu = 0x000100,
82 PopupMenu = 0x000200,
83 Tooltip = 0x000400,
84 Notification = 0x000800,
85 Combo = 0x001000,
86 Dnd = 0x002000,
87 KdeOverride = 0x004000
88 };
89 Q_DECLARE_FLAGS(WindowTypes, WindowType)
90
91 virtual void setWindowType(WindowTypes type) = 0;
92 virtual void setWindowRole(const QString &role) = 0;
93 virtual void setWindowIconText(const QString &text) = 0;
94 virtual uint visualId() const = 0;
95};
96#endif // xcb
97
98#if defined(Q_OS_WIN) || defined(Q_QDOC)
99struct Q_GUI_EXPORT QWindowsWindow
100{
102
103 virtual void setHasBorderInFullScreen(bool border) = 0;
104 virtual bool hasBorderInFullScreen() const = 0;
105
106 virtual QMargins customMargins() const = 0;
107 virtual void setCustomMargins(const QMargins &margins) = 0;
108};
109#endif // Q_OS_WIN
110
111#if QT_CONFIG(wayland)
112struct Q_GUI_EXPORT QWaylandWindow : public QObject
113{
115public:
116 QT_DECLARE_NATIVE_INTERFACE(QWaylandWindow, 1, QWindow)
117
118 virtual wl_surface *surface() const = 0;
119 virtual void setCustomMargins(const QMargins &margins) = 0;
120 virtual void requestXdgActivationToken(uint serial) = 0;
121 template<typename T>
122 T *surfaceRole() const
123 {
124 std::any anyRole = _surfaceRole();
125 auto role = std::any_cast<T *>(&anyRole);
126 return role ? *role : nullptr;
127 }
129 void surfaceCreated();
130 void surfaceDestroyed();
131 void surfaceRoleCreated();
132 void surfaceRoleDestroyed();
133 void xdgActivationTokenCreated(const QString &token);
134
135protected:
136 virtual std::any _surfaceRole() const = 0;
137};
138#endif
139
140} // QNativeInterface::Private
141
143
144#endif // QPLATFORMWINDOW_P_H
\inmodule QtCore
Definition qbasictimer.h:18
\inmodule QtCore
Definition qmargins.h:24
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtGui
Definition qwindow.h:63
Raster or OpenGL Window.
QString text
Token token
Definition keywords.cpp:444
Combined button and popup list for selecting options.
WindowType
Definition qnamespace.h:205
@ Desktop
Definition qnamespace.h:215
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
@ None
Definition qhash.cpp:531
#define QT_DECLARE_NATIVE_INTERFACE(...)
GLint GLenum GLsizei GLsizei GLsizei GLint border
GLenum type
GLboolean enable
#define Q_OBJECT
#define Q_SIGNALS
unsigned int uint
Definition qtypes.h:34