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
qqnxwindow.h
Go to the documentation of this file.
1// Copyright (C) 2011 - 2013 BlackBerry Limited. All rights reserved.
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 QQNXWINDOW_H
6#define QQNXWINDOW_H
7
8#include <qpa/qplatformwindow.h>
10
11#include <QtCore/QScopedPointer>
12#include <QtCore/QLoggingCategory>
13
14#if !defined(QT_NO_OPENGL)
15#include <EGL/egl.h>
16#endif
17
18#include <screen/screen.h>
19
21
23
24// all surfaces double buffered
25#define MAX_BUFFER_COUNT 2
26
27class QQnxScreen;
28
29class QSurfaceFormat;
30
32{
33friend class QQnxScreen;
34public:
35 explicit QQnxWindow(QWindow *window, screen_context_t context, bool needRootWindow);
36 explicit QQnxWindow(QWindow *window, screen_context_t context, screen_window_t screenWindow);
37 virtual ~QQnxWindow();
38
39 void setGeometry(const QRect &rect) override;
40 void setVisible(bool visible) override;
41 void setOpacity(qreal level) override;
42
43 bool isExposed() const override;
44
45 WId winId() const override { return (WId)m_window; }
46 screen_window_t nativeHandle() const { return m_window; }
47 screen_context_t screenContext() const { return m_screenContext; }
48
49 void setBufferSize(const QSize &size);
50 QSize bufferSize() const { return m_bufferSize; }
51
52 void setScreen(QQnxScreen *platformScreen);
53
54 void setParent(const QPlatformWindow *window) override;
55 void raise() override;
56 void lower() override;
58 void setWindowState(Qt::WindowStates state) override;
59 void setExposed(bool exposed);
60
62
63 QPlatformScreen *screen() const override;
64 const QList<QQnxWindow*>& children() const { return m_childWindows; }
65
66 QQnxWindow *findWindow(screen_window_t windowHandle);
67
68 void minimize();
69
70 void setRotation(int rotation);
71
72 QByteArray groupName() const { return m_windowGroupName; }
73 void joinWindowGroup(const QByteArray &groupName);
74
75 bool shouldMakeFullScreen() const;
76
77 void windowPosted();
79
80 void setWindowTitle(const QString &title);
81
83 void handlePostEvent();
84
85protected:
86 virtual int pixelFormat() const = 0;
87 virtual void resetBuffers() = 0;
88
89 void initWindow();
90
92
93private:
94 void collectWindowGroup();
95 void createWindowGroup();
96 void setGeometryHelper(const QRect &rect);
97 void removeFromParent();
98 void updateVisibility(bool parentVisible);
99 void updateZorder(int &topZorder);
100 void updateZorder(screen_window_t window, int &zOrder);
101 void applyWindowState();
102 void setFocus(screen_window_t newFocusWindow);
103 bool showWithoutActivating() const;
104 bool focusable() const;
105 void notifyManager(const QString &msg);
106
107 void addContextPermission();
108 void removeContextPermission();
109
110 screen_window_t m_window;
111 QSize m_bufferSize;
112
113 QQnxScreen *m_screen;
114 QQnxWindow *m_parentWindow;
115 QList<QQnxWindow*> m_childWindows;
116 QScopedPointer<QQnxAbstractCover> m_cover;
117 bool m_visible;
118 bool m_exposed;
119 bool m_foreign;
120 QRect m_unmaximizedGeometry;
121 Qt::WindowStates m_windowState;
122
123 // Group name of window group headed by this window
124 QByteArray m_windowGroupName;
125 // Group name that we have joined or "" if we've not joined any group.
126 QByteArray m_parentGroupName;
127
128 bool m_isTopLevel;
129 bool m_firstActivateHandled;
130 int m_desktopNotify;
131
132 enum {
133 DesktopNotifyTitle = 0x1,
134 DesktopNotifyPosition = 0x2,
135 DesktopNotifyVisible = 0x2
136 };
137
138 QAtomicInt m_waitingForPost = 0;
139 QAtomicInt m_fallbackQueued = 0;
140 bool m_postEventRegistered = false;
141 QSharedPointer<bool> m_alive { new bool(true) };
142};
143
144QT_END_NAMESPACE
145
146#endif // QQNXWINDOW_H
bool isInitialized() const
void resetBuffers() override
QQnxEglWindow(QWindow *window, screen_context_t context, bool needRootWindow)
QSurfaceFormat format() const override
Returns the actual surface format of the window.
int pixelFormat() const override
EGLSurface surface() const
void ensureInitialized(QQnxGLContext *context)
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
void doneCurrent() override
The QQnxWindow is the base class of the various classes used as instances of QPlatformWindow in the Q...
Definition qqnxwindow.h:32
void windowPosted()
screen_context_t m_screenContext
Definition qqnxwindow.h:91
void setExposed(bool exposed)
screen_context_t screenContext() const
Definition qqnxwindow.h:47
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
virtual int pixelFormat() const =0
QQnxWindow(QWindow *window, screen_context_t context, screen_window_t screenWindow)
QQnxWindow * findWindow(screen_window_t windowHandle)
void setParent(const QPlatformWindow *window) override
This function is called to enable native child window in QPA.
bool shouldMakeFullScreen() const
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
virtual void resetBuffers()=0
bool isExposed() const override
Returns if this window is exposed in the windowing system.
void initWindow()
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
QQnxWindow(QWindow *window, screen_context_t context, bool needRootWindow)
void joinWindowGroup(const QByteArray &groupName)
void minimize()
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
void setWindowTitle(const QString &title)
Reimplement to set the window title to title.
QByteArray groupName() const
Definition qqnxwindow.h:72
const QList< QQnxWindow * > & children() const
Definition qqnxwindow.h:64
screen_window_t nativeHandle() const
Definition qqnxwindow.h:46
void handlePostEvent()
void setScreen(QQnxScreen *platformScreen)
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
Definition qqnxwindow.h:45
void setBufferSize(const QSize &size)
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
QPlatformScreen * screen() const override
Returns the platform screen handle corresponding to this platform window, or null if the window is no...
void setRotation(int rotation)
void handleActivationEvent()
void requestUpdate() override
Requests an QEvent::UpdateRequest event.
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
QSize bufferSize() const
Definition qqnxwindow.h:50
void setOpacity(qreal level) override
Reimplement to be able to let Qt set the opacity level of a window.
virtual ~QQnxWindow()
Combined button and popup list for selecting options.
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQIORing)
#define _SCREEN_VERSION
Definition qqnxscreen.h:19
#define _SCREEN_MAKE_VERSION(major, minor, patch)
Definition qqnxscreen.h:18