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
qqnxscreen.h
Go to the documentation of this file.
1// Copyright (C) 2011 - 2012 Research In Motion
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 QBBSCREEN_H
5#define QBBSCREEN_H
6
7#include <qpa/qplatformscreen.h>
8
9#include "qqnxwindow.h"
10
11#include <QtCore/QObject>
12#include <QtCore/QScopedPointer>
13
14#include <screen/screen.h>
15
16#if !defined(_SCREEN_VERSION)
17#define _SCREEN_MAKE_VERSION(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch))
18#define _SCREEN_VERSION _SCREEN_MAKE_VERSION(0, 0, 0)
19#endif
20
21// For pre-1.0.0 screen, map some screen property names to the old
22// names.
23#if _SCREEN_VERSION < _SCREEN_MAKE_VERSION(1, 0, 0)
24const int SCREEN_PROPERTY_FLAGS = SCREEN_PROPERTY_KEY_FLAGS;
25const int SCREEN_PROPERTY_FOCUS = SCREEN_PROPERTY_KEYBOARD_FOCUS;
26const int SCREEN_PROPERTY_MODIFIERS = SCREEN_PROPERTY_KEY_MODIFIERS;
27const int SCREEN_PROPERTY_SCAN = SCREEN_PROPERTY_KEY_SCAN;
28const int SCREEN_PROPERTY_SYM = SCREEN_PROPERTY_KEY_SYM;
29#endif
30
32
34Q_DECLARE_LOGGING_CATEGORY(lcQpaScreenEvents);
35Q_DECLARE_LOGGING_CATEGORY(lcQpaScreenBuffer);
36
37class QQnxWindow;
38
39class QQnxScreen : public QObject, public QPlatformScreen
40{
42public:
43 QQnxScreen(screen_context_t context, screen_display_t display, bool primaryScreen);
45
46 QPixmap grabWindow(WId window, int x, int y, int width, int height) const override;
47
48 QRect geometry() const override { return m_currentGeometry; }
49 QRect availableGeometry() const override;
50 int depth() const override;
51 QImage::Format format() const override { return (depth() == 32) ? QImage::Format_RGB32 : QImage::Format_RGB16; }
52 QSizeF physicalSize() const override { return m_currentPhysicalSize; }
53
54 qreal refreshRate() const override;
55
57 Qt::ScreenOrientation orientation() const override;
58
59 QWindow *topLevelAt(const QPoint &point) const override;
60
61 bool isPrimaryScreen() const { return m_primaryScreen; }
62
63 int rotation() const { return m_currentRotation; }
64
65 QString name() const override { return m_name; }
66
67 int nativeFormat() const { return (depth() == 32) ? SCREEN_FORMAT_RGBA8888 : SCREEN_FORMAT_RGB565; }
68 screen_display_t nativeDisplay() const { return m_display; }
69 screen_context_t nativeContext() const { return m_screenContext; }
70 const char *windowGroupName() const { return m_rootWindow ? m_rootWindow->groupName().constData() : 0; }
71
72 QQnxWindow *findWindow(screen_window_t windowHandle) const;
73
74 /* Window hierarchy management */
79 void updateHierarchy();
80
81 void adjustOrientation();
82
83 QQnxWindow *rootWindow() const;
85
86 QPlatformCursor *cursor() const override;
87
91
92public Q_SLOTS:
93 void setRotation(int rotation);
94 void newWindowCreated(void *window);
95 void windowClosed(void *window);
97 void activateWindowGroup(const QByteArray &id);
98 void deactivateWindowGroup(const QByteArray &id);
99
100private Q_SLOTS:
101 void keyboardHeightChanged(int height);
102
103private:
104 void resizeNativeWidgetWindow(QQnxWindow *w, const QRect &previousScreenGeometry) const;
105 void resizeTopLevelWindow(QQnxWindow *w, const QRect &previousScreenGeometry) const;
106 void resizeWindows(const QRect &previousScreenGeometry);
107 void addOverlayWindow(screen_window_t window);
108 void addUnderlayWindow(screen_window_t window);
109 void removeOverlayOrUnderlayWindow(screen_window_t window);
110
111 screen_context_t m_screenContext;
112 screen_display_t m_display;
113 QQnxWindow *m_rootWindow;
114 const bool m_primaryScreen;
115
116 int m_initialRotation;
117 int m_currentRotation;
118 int m_keyboardHeight;
119 QString m_name;
120 QSize m_initialPhysicalSize;
121 QSize m_currentPhysicalSize;
122 Qt::ScreenOrientation m_nativeOrientation;
123 QRect m_initialGeometry;
124 QRect m_currentGeometry;
125
126 QList<QQnxWindow *> m_childWindows;
127 QQnxWindow *m_coverWindow;
128 QList<screen_window_t> m_overlays;
129 QList<screen_window_t> m_underlays;
130
131 QPlatformCursor *m_cursor;
132};
133
135
136#endif // QBBSCREEN_H
\inmodule QtCore
Definition qbytearray.h:57
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
Definition qbytearray.h:124
Format
The following image formats are available in Qt.
Definition qimage.h:41
@ Format_RGB32
Definition qimage.h:46
@ Format_RGB16
Definition qimage.h:49
\inmodule QtCore
Definition qobject.h:103
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
The QPlatformCursor class provides information about pointer device events (movement,...
The QPlatformScreen class provides an abstraction for visual displays.
\inmodule QtCore\reentrant
Definition qpoint.h:25
void windowClosed(void *window)
QQnxScreen(screen_context_t context, screen_display_t display, bool primaryScreen)
const char * windowGroupName() const
Definition qqnxscreen.h:70
Qt::ScreenOrientation nativeOrientation() const override
Reimplement this function in subclass to return the native orientation of the screen,...
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
Definition qqnxscreen.h:48
QPlatformCursor * cursor() const override
Reimplement this function in subclass to return the cursor of the screen.
Qt::ScreenOrientation orientation() const override
Reimplement this function in subclass to return the current orientation of the screen,...
QWindow * topLevelAt(const QPoint &point) const override
Return the given top level window for a given position.
void lowerWindow(QQnxWindow *window)
bool isPrimaryScreen() const
Definition qqnxscreen.h:61
void raiseWindow(QQnxWindow *window)
void activateWindowGroup(const QByteArray &id)
void foreignWindowClosed(void *window)
void removeWindow(QQnxWindow *child)
void addWindow(QQnxWindow *child)
QRect availableGeometry() const override
Reimplement in subclass to return the pixel geometry of the available space This normally is the desk...
screen_context_t nativeContext() const
Definition qqnxscreen.h:69
void deactivateWindowGroup(const QByteArray &id)
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
Definition qqnxscreen.h:51
int nativeFormat() const
Definition qqnxscreen.h:67
int rotation() const
Definition qqnxscreen.h:63
QPixmap grabWindow(WId window, int x, int y, int width, int height) const override
This function is called when Qt needs to be able to grab the content of a window.
QQnxWindow * findWindow(screen_window_t windowHandle) const
void foreignWindowCreated(void *window)
QSizeF physicalSize() const override
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
Definition qqnxscreen.h:52
QString name() const override
Definition qqnxscreen.h:65
void setRootWindow(QQnxWindow *)
int depth() const override
Reimplement in subclass to return current depth of the screen.
void adjustOrientation()
screen_display_t nativeDisplay() const
Definition qqnxscreen.h:68
void setRotation(int rotation)
QQnxWindow * rootWindow() const
void newWindowCreated(void *window)
qreal refreshRate() const override
Reimplement this function in subclass to return the vertical refresh rate of the screen,...
void updateHierarchy()
void windowGroupStateChanged(const QByteArray &id, Qt::WindowState state)
The QQnxWindow is the base class of the various classes used as instances of QPlatformWindow in the Q...
Definition qqnxwindow.h:31
QByteArray groupName() const
Definition qqnxwindow.h:70
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:208
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtGui
Definition qwindow.h:63
else opt state
[0]
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
WindowState
Definition qnamespace.h:251
ScreenOrientation
Definition qnamespace.h:271
static void * context
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLint GLsizei width
GLint y
const int SCREEN_PROPERTY_SYM
Definition qqnxscreen.h:28
const int SCREEN_PROPERTY_SCAN
Definition qqnxscreen.h:27
const int SCREEN_PROPERTY_FOCUS
Definition qqnxscreen.h:25
const int SCREEN_PROPERTY_MODIFIERS
Definition qqnxscreen.h:26
const int SCREEN_PROPERTY_FLAGS
Definition qqnxscreen.h:24
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
QLayoutItem * child
[0]
aWidget window() -> setWindowTitle("New Window Title")
[2]