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
47 void setBufferSize(const QSize &size);
48 QSize bufferSize() const { return m_bufferSize; }
49
50 void setScreen(QQnxScreen *platformScreen);
51
52 void setParent(const QPlatformWindow *window) override;
53 void raise() override;
54 void lower() override;
56 void setWindowState(Qt::WindowStates state) override;
57 void setExposed(bool exposed);
58
60
61 QPlatformScreen *screen() const override;
62 const QList<QQnxWindow*>& children() const { return m_childWindows; }
63
64 QQnxWindow *findWindow(screen_window_t windowHandle);
65
66 void minimize();
67
68 void setRotation(int rotation);
69
70 QByteArray groupName() const { return m_windowGroupName; }
71 void joinWindowGroup(const QByteArray &groupName);
72
73 bool shouldMakeFullScreen() const;
74
75 void windowPosted();
77
78 void setWindowTitle(const QString &title);
79
80protected:
81 virtual int pixelFormat() const = 0;
82 virtual void resetBuffers() = 0;
83
84 void initWindow();
85
87
88private:
89 void collectWindowGroup();
90 void createWindowGroup();
91 void setGeometryHelper(const QRect &rect);
92 void removeFromParent();
93 void updateVisibility(bool parentVisible);
94 void updateZorder(int &topZorder);
95 void updateZorder(screen_window_t window, int &zOrder);
96 void applyWindowState();
97 void setFocus(screen_window_t newFocusWindow);
98 bool showWithoutActivating() const;
99 bool focusable() const;
100 void notifyManager(const QString &msg);
101
102 void addContextPermission();
103 void removeContextPermission();
104
105 screen_window_t m_window;
106 QSize m_bufferSize;
107
108 QQnxScreen *m_screen;
109 QQnxWindow *m_parentWindow;
110 QList<QQnxWindow*> m_childWindows;
111 QScopedPointer<QQnxAbstractCover> m_cover;
112 bool m_visible;
113 bool m_exposed;
114 bool m_foreign;
115 QRect m_unmaximizedGeometry;
116 Qt::WindowStates m_windowState;
117
118 // Group name of window group headed by this window
119 QByteArray m_windowGroupName;
120 // Group name that we have joined or "" if we've not joined any group.
121 QByteArray m_parentGroupName;
122
123 bool m_isTopLevel;
124 bool m_firstActivateHandled;
125 int m_desktopNotify;
126
127 enum {
128 DesktopNotifyTitle = 0x1,
129 DesktopNotifyPosition = 0x2,
130 DesktopNotifyVisible = 0x2
131 };
132};
133
134QT_END_NAMESPACE
135
136#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:86
void setExposed(bool exposed)
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:70
const QList< QQnxWindow * > & children() const
Definition qqnxwindow.h:62
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:48
void setOpacity(qreal level) override
Reimplement to be able to let Qt set the opacity level of a window.
virtual ~QQnxWindow()
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)
#define _SCREEN_VERSION
Definition qqnxscreen.h:18
#define _SCREEN_MAKE_VERSION(major, minor, patch)
Definition qqnxscreen.h:17