Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qeglfscursor_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QEGLFSCURSOR_H
6
#
define
QEGLFSCURSOR_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
"qeglfsglobal_p.h"
20
#
include
<
qpa
/
qplatformcursor
.
h
>
21
#
include
<
qpa
/
qplatformscreen
.
h
>
22
#
include
<
QtOpenGL
/
QOpenGLShaderProgram
>
23
#
include
<
QtGui
/
QMatrix4x4
>
24
#
include
<
QtGui
/
private
/
qinputdevicemanager_p
.
h
>
25
26
#
include
<
QtCore
/
qlist
.
h
>
27
28
QT_BEGIN_NAMESPACE
29
30
class
QOpenGLShaderProgram;
31
class
QEglFSCursor;
32
class
QEglFSScreen;
33
34
class
QEglFSCursorDeviceListener
:
public
QObject
35
{
36
Q_OBJECT
37
38
public
:
39
QEglFSCursorDeviceListener
(
QEglFSCursor
*
cursor
) :
m_cursor
(
cursor
) { }
40
bool
hasMouse
()
const
;
41
42
public
slots
:
43
void
onDeviceListChanged
(
QInputDeviceManager
::
DeviceType
type
);
44
45
private
:
46
QEglFSCursor *m_cursor;
47
};
48
49
#
if
QT_CONFIG
(
opengl
)
50
51
struct
QEglFSCursorData {
52
QScopedPointer<QOpenGLShaderProgram> program;
53
int
textureEntry = 0;
54
int
matEntry = 0;
55
uint customCursorTexture = 0;
56
uint atlasTexture = 0;
57
qint64 customCursorKey = 0;
58
};
59
60
class
Q_EGLFS_EXPORT QEglFSCursor :
public
QPlatformCursor
61
{
62
Q_OBJECT
63
public
:
64
QEglFSCursor(QPlatformScreen *screen);
65
~QEglFSCursor();
66
67
#
ifndef
QT_NO_CURSOR
68
void
changeCursor(QCursor *cursor, QWindow *widget) override;
69
#
endif
70
void
pointerEvent(
const
QMouseEvent &event) override;
71
QPoint pos()
const
override;
72
void
setPos(
const
QPoint &pos) override;
73
74
QRect cursorRect()
const
;
75
void
paintOnScreen();
76
void
resetResources();
77
78
void
updateMouseStatus();
79
80
private
:
81
bool
event(QEvent *e) override;
82
#
ifndef
QT_NO_CURSOR
83
bool
setCurrentCursor(QCursor *cursor);
84
#
endif
85
void
draw(
const
QRectF &rect);
86
void
update(
const
QRect &rect,
bool
allScreens);
87
void
createShaderPrograms();
88
void
createCursorTexture(uint *texture,
const
QImage &image);
89
void
initCursorAtlas();
90
91
// current cursor information
92
struct
Cursor {
93
Cursor() : shape(Qt::BlankCursor), customCursorPending(
false
), customCursorKey(0), useCustomCursor(
false
) { }
94
Qt::CursorShape shape;
95
QRectF textureRect;
// normalized rect inside texture
96
QSize size;
// size of the cursor
97
QPoint hotSpot;
98
QImage customCursorImage;
99
QPoint pos;
// current cursor position
100
bool
customCursorPending;
101
qint64 customCursorKey;
102
bool
useCustomCursor;
103
} m_cursor;
104
105
// cursor atlas information
106
struct
CursorAtlas {
107
CursorAtlas() : cursorsPerRow(0), cursorWidth(0), cursorHeight(0) { }
108
int
cursorsPerRow;
109
int
width, height;
// width and height of the atlas
110
int
cursorWidth, cursorHeight;
// width and height of cursors inside the atlas
111
QList<QPoint> hotSpots;
112
QImage image;
// valid until it's uploaded
113
} m_cursorAtlas;
114
115
bool
m_visible;
116
QEglFSScreen *m_screen;
117
QPlatformScreen *m_activeScreen;
118
QEglFSCursorDeviceListener *m_deviceListener;
119
bool
m_updateRequested;
120
QMatrix4x4 m_rotationMatrix;
121
};
122
#
endif
// QT_CONFIG(opengl)
123
124
QT_END_NAMESPACE
125
126
#
endif
// QEGLFSCURSOR_H
QEglFSContext
Definition
qeglfscontext_p.h:27
QEglFSCursorDeviceListener
Definition
qeglfscursor_p.h:35
QSqlRelationalDelegate
\inmodule QtSql
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
Q_EGLFS_EXPORT
#define Q_EGLFS_EXPORT
Definition
qeglfsglobal_p.h:28
qtbase
src
plugins
platforms
eglfs
api
qeglfscursor_p.h
Generated on
for Qt by
1.18.0