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
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#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 window()->type() == Qt::Desktop ? -1 : (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;
55 void requestActivateWindow() override;
56 void setWindowState(Qt::WindowStates state) override;
57 void setExposed(bool exposed);
58
59 void propagateSizeHints() override;
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; }
72
73 bool shouldMakeFullScreen() const;
74
75 void windowPosted();
77
78protected:
79 virtual int pixelFormat() const = 0;
80 virtual void resetBuffers() = 0;
81
82 void initWindow();
83
84 screen_context_t m_screenContext;
85
86private:
87 void collectWindowGroup();
88 void createWindowGroup();
89 void setGeometryHelper(const QRect &rect);
90 void removeFromParent();
91 void updateVisibility(bool parentVisible);
92 void updateZorder(int &topZorder);
93 void updateZorder(screen_window_t window, int &zOrder);
94 void applyWindowState();
95 void setFocus(screen_window_t newFocusWindow);
96 bool showWithoutActivating() const;
97 bool focusable() const;
98
99 void addContextPermission();
100 void removeContextPermission();
101
102 screen_window_t m_window;
103 QSize m_bufferSize;
104
105 QQnxScreen *m_screen;
106 QQnxWindow *m_parentWindow;
107 QList<QQnxWindow*> m_childWindows;
108 QScopedPointer<QQnxAbstractCover> m_cover;
109 bool m_visible;
110 bool m_exposed;
111 bool m_foreign;
112 QRect m_unmaximizedGeometry;
113 Qt::WindowStates m_windowState;
114
115 // Group name of window group headed by this window
116 QByteArray m_windowGroupName;
117 // Group name that we have joined or "" if we've not joined any group.
118 QByteArray m_parentGroupName;
119
120 bool m_isTopLevel;
121 bool m_firstActivateHandled;
122};
123
125
126#endif // QQNXWINDOW_H
\inmodule QtCore
Definition qbytearray.h:57
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:31
void windowPosted()
screen_context_t m_screenContext
Definition qqnxwindow.h:84
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.
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.
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()
\inmodule QtCore\reentrant
Definition qrect.h:30
\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:215
static void * context
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLenum GLuint GLint level
GLenum GLuint GLintptr GLsizeiptr size
[1]
double qreal
Definition qtypes.h:187