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
4#ifndef QQNXWINDOW_H
5#define QQNXWINDOW_H
6
7#include <qpa/qplatformwindow.h>
9
10#include <QtCore/QScopedPointer>
11#include <QtCore/QLoggingCategory>
12
13#if !defined(QT_NO_OPENGL)
14#include <EGL/egl.h>
15#endif
16
17#include <screen/screen.h>
18
20
22
23// all surfaces double buffered
24#define MAX_BUFFER_COUNT 2
25
26class QQnxScreen;
27
28class QSurfaceFormat;
29
31{
32friend class QQnxScreen;
33public:
34 explicit QQnxWindow(QWindow *window, screen_context_t context, bool needRootWindow);
35 explicit QQnxWindow(QWindow *window, screen_context_t context, screen_window_t screenWindow);
36 virtual ~QQnxWindow();
37
38 void setGeometry(const QRect &rect) override;
39 void setVisible(bool visible) override;
40 void setOpacity(qreal level) override;
41
42 bool isExposed() const override;
43
44 WId winId() const override { return (WId)m_window; }
45 screen_window_t nativeHandle() const { return m_window; }
46 screen_context_t screenContext() const { return m_screenContext; }
47
48 void setBufferSize(const QSize &size);
49 QSize bufferSize() const { return m_bufferSize; }
50
51 void setScreen(QQnxScreen *platformScreen);
52
53 void setParent(const QPlatformWindow *window) override;
54 void raise() override;
55 void lower() override;
57 void setWindowState(Qt::WindowStates state) override;
58 void setExposed(bool exposed);
59
61
62 QPlatformScreen *screen() const override;
63 const QList<QQnxWindow*>& children() const { return m_childWindows; }
64
65 QQnxWindow *findWindow(screen_window_t windowHandle);
66
67 void minimize();
68
69 void setRotation(int rotation);
70
71 QByteArray groupName() const { return m_windowGroupName; }
72 void joinWindowGroup(const QByteArray &groupName);
73
74 bool shouldMakeFullScreen() const;
75
76 void windowPosted();
78
79 void setWindowTitle(const QString &title);
80
81protected:
82 virtual int pixelFormat() const = 0;
83 virtual void resetBuffers() = 0;
84
85 void initWindow();
86
88
89private:
90 void collectWindowGroup();
91 void createWindowGroup();
92 void setGeometryHelper(const QRect &rect);
93 void removeFromParent();
94 void updateVisibility(bool parentVisible);
95 void updateZorder(int &topZorder);
96 void updateZorder(screen_window_t window, int &zOrder);
97 void applyWindowState();
98 void setFocus(screen_window_t newFocusWindow);
99 bool showWithoutActivating() const;
100 bool focusable() const;
101 void notifyManager(const QString &msg);
102
103 void addContextPermission();
104 void removeContextPermission();
105
106 screen_window_t m_window;
107 QSize m_bufferSize;
108
109 QQnxScreen *m_screen;
110 QQnxWindow *m_parentWindow;
111 QList<QQnxWindow*> m_childWindows;
112 QScopedPointer<QQnxAbstractCover> m_cover;
113 bool m_visible;
114 bool m_exposed;
115 bool m_foreign;
116 QRect m_unmaximizedGeometry;
117 Qt::WindowStates m_windowState;
118
119 // Group name of window group headed by this window
120 QByteArray m_windowGroupName;
121 // Group name that we have joined or "" if we've not joined any group.
122 QByteArray m_parentGroupName;
123
124 bool m_isTopLevel;
125 bool m_firstActivateHandled;
126 int m_desktopNotify;
127
128 enum {
129 DesktopNotifyTitle = 0x1,
130 DesktopNotifyPosition = 0x2,
131 DesktopNotifyVisible = 0x2
132 };
133};
134
135QT_END_NAMESPACE
136
137#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:31
void windowPosted()
screen_context_t m_screenContext
Definition qqnxwindow.h:87
void setExposed(bool exposed)
screen_context_t screenContext() const
Definition qqnxwindow.h:46
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:71
const QList< QQnxWindow * > & children() const
Definition qqnxwindow.h:63
screen_window_t nativeHandle() const
Definition qqnxwindow.h:45
void setScreen(QQnxScreen *platformScreen)
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
Definition qqnxwindow.h:44
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 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:49
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:18
#define _SCREEN_MAKE_VERSION(major, minor, patch)
Definition qqnxscreen.h:17