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#endif
63
64#if QT_CONFIG(xcb) || defined(Q_QDOC)
65struct Q_GUI_EXPORT QXcbWindow
66{
68
69 enum WindowType {
70 None = 0x000000,
71 Normal = 0x000001,
72 Desktop = 0x000002,
73 Dock = 0x000004,
74 Toolbar = 0x000008,
75 Menu = 0x000010,
76 Utility = 0x000020,
77 Splash = 0x000040,
78 Dialog = 0x000080,
79 DropDownMenu = 0x000100,
80 PopupMenu = 0x000200,
81 Tooltip = 0x000400,
82 Notification = 0x000800,
83 Combo = 0x001000,
84 Dnd = 0x002000,
85 KdeOverride = 0x004000
86 };
87 Q_DECLARE_FLAGS(WindowTypes, WindowType)
88
89 virtual void setWindowType(WindowTypes type) = 0;
90 virtual void setWindowRole(const QString &role) = 0;
91 virtual void setWindowIconText(const QString &text) = 0;
92 virtual uint visualId() const = 0;
93};
94#endif // xcb
95
96#if defined(Q_OS_WIN) || defined(Q_QDOC)
97struct Q_GUI_EXPORT QWindowsWindow
98{
100
101 virtual void setHasBorderInFullScreen(bool border) = 0;
102 virtual bool hasBorderInFullScreen() const = 0;
103
104 virtual QMargins customMargins() const = 0;
105 virtual void setCustomMargins(const QMargins &margins) = 0;
106};
107#endif // Q_OS_WIN
108
109#if QT_CONFIG(wayland)
110struct Q_GUI_EXPORT QWaylandWindow : public QObject
111{
113public:
114 QT_DECLARE_NATIVE_INTERFACE(QWaylandWindow, 1, QWindow)
115
116 virtual wl_surface *surface() const = 0;
117 virtual void setCustomMargins(const QMargins &margins) = 0;
118 virtual void requestXdgActivationToken(uint serial) = 0;
119 template<typename T>
120 T *surfaceRole() const
121 {
122 std::any anyRole = _surfaceRole();
123 auto role = std::any_cast<T *>(&anyRole);
124 return role ? *role : nullptr;
125 }
127 void surfaceCreated();
128 void surfaceDestroyed();
129 void surfaceRoleCreated();
130 void surfaceRoleDestroyed();
131 void xdgActivationTokenCreated(const QString &token);
132
133protected:
134 virtual std::any _surfaceRole() const = 0;
135};
136#endif
137
138} // QNativeInterface::Private
139
141
142#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