Qt 6.x
The Qt SDK
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>
8#include "qqnxabstractcover.h"
9
10#include <QtCore/QScopedPointer>
11
12#if !defined(QT_NO_OPENGL)
13#include <EGL/egl.h>
14#endif
15
16#include <screen/screen.h>
17
19
20// all surfaces double buffered
21#define MAX_BUFFER_COUNT 2
22
23class QQnxScreen;
24
25class QSurfaceFormat;
26
28{
29friend class QQnxScreen;
30public:
31 explicit QQnxWindow(QWindow *window, screen_context_t context, bool needRootWindow);
32 explicit QQnxWindow(QWindow *window, screen_context_t context, screen_window_t screenWindow);
33 virtual ~QQnxWindow();
34
35 void setGeometry(const QRect &rect) override;
36 void setVisible(bool visible) override;
37 void setOpacity(qreal level) override;
38
39 bool isExposed() const override;
40
41 WId winId() const override { return window()->type() == Qt::Desktop ? -1 : (WId)m_window; }
42 screen_window_t nativeHandle() const { return m_window; }
43
44 void setBufferSize(const QSize &size);
45 QSize bufferSize() const { return m_bufferSize; }
46
47 void setScreen(QQnxScreen *platformScreen);
48
49 void setParent(const QPlatformWindow *window) override;
50 void raise() override;
51 void lower() override;
52 void requestActivateWindow() override;
53 void setWindowState(Qt::WindowStates state) override;
54 void setExposed(bool exposed);
55
56 void propagateSizeHints() override;
57
58 QPlatformScreen *screen() const override;
59 const QList<QQnxWindow*>& children() const { return m_childWindows; }
60
61 QQnxWindow *findWindow(screen_window_t windowHandle);
62
63 void minimize();
64
65 void setRotation(int rotation);
66
67 QByteArray groupName() const { return m_windowGroupName; }
69
70 bool shouldMakeFullScreen() const;
71
72 void windowPosted();
74
75protected:
76 virtual int pixelFormat() const = 0;
77 virtual void resetBuffers() = 0;
78
79 void initWindow();
80
81 screen_context_t m_screenContext;
82
83private:
84 void collectWindowGroup();
85 void createWindowGroup();
86 void setGeometryHelper(const QRect &rect);
87 void removeFromParent();
88 void updateVisibility(bool parentVisible);
89 void updateZorder(int &topZorder);
90 void updateZorder(screen_window_t window, int &zOrder);
91 void applyWindowState();
92 void setFocus(screen_window_t newFocusWindow);
93 bool showWithoutActivating() const;
94 bool focusable() const;
95
96 void addContextPermission();
97 void removeContextPermission();
98
99 screen_window_t m_window;
100 QSize m_bufferSize;
101
102 QQnxScreen *m_screen;
103 QQnxWindow *m_parentWindow;
104 QList<QQnxWindow*> m_childWindows;
106 bool m_visible;
107 bool m_exposed;
108 bool m_foreign;
109 QRect m_unmaximizedGeometry;
110 Qt::WindowStates m_windowState;
111
112 // Group name of window group headed by this window
113 QByteArray m_windowGroupName;
114 // Group name that we have joined or "" if we've not joined any group.
115 QByteArray m_parentGroupName;
116
117 bool m_isTopLevel;
118 bool m_firstActivateHandled;
119};
120
122
123#endif // QQNXWINDOW_H
\inmodule QtCore
Definition qbytearray.h:57
Definition qlist.h:74
The QPlatformScreen class provides an abstraction for visual displays.
The QPlatformWindow class provides an abstraction for top-level windows.
QWindow * window() const
Returns the window which belongs to the QPlatformWindow.
The QQnxWindow is the base class of the various classes used as instances of QPlatformWindow in the Q...
Definition qqnxwindow.h:28
void windowPosted()
screen_context_t m_screenContext
Definition qqnxwindow.h:81
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 * 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.
void joinWindowGroup(const QByteArray &groupName)
void minimize()
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
QByteArray groupName() const
Definition qqnxwindow.h:67
const QList< QQnxWindow * > & children() const
Definition qqnxwindow.h:59
screen_window_t nativeHandle() const
Definition qqnxwindow.h:42
void setScreen(QQnxScreen *platformScreen)
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
Definition qqnxwindow.h:41
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:45
void setOpacity(qreal level) override
Reimplement to be able to let Qt set the opacity level of a window.
virtual ~QQnxWindow()
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
\inmodule QtCore
Definition qsize.h:25
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
\inmodule QtGui
Definition qwindow.h:63
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
@ Desktop
Definition qnamespace.h:214
static void * context
GLenum GLuint GLint level
GLenum GLuint GLintptr GLsizeiptr size
[1]
double qreal
Definition qtypes.h:92