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
qeglfskmsgbmcursor_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
QEGLFSKMSGBMCURSOR_H
6
#
define
QEGLFSKMSGBMCURSOR_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
<
qpa
/
qplatformcursor
.
h
>
20
#
include
<
QtCore
/
QList
>
21
#
include
<
QtGui
/
QImage
>
22
#
include
<
QtGui
/
private
/
qinputdevicemanager_p
.
h
>
23
24
#
include
<
gbm
.
h
>
25
26
QT_BEGIN_NAMESPACE
27
28
class
QEglFSKmsGbmScreen;
29
class
QEglFSKmsGbmCursor
;
30
31
class
QEglFSKmsGbmCursorDeviceListener
:
public
QObject
32
{
33
Q_OBJECT
34
35
public
:
36
QEglFSKmsGbmCursorDeviceListener
(
QEglFSKmsGbmCursor
*
cursor
) :
m_cursor
(
cursor
) { }
37
bool
hasMouse
()
const
;
38
39
public
slots
:
40
void
onDeviceListChanged
(
QInputDeviceManager
::
DeviceType
type
);
41
42
private
:
43
QEglFSKmsGbmCursor
*m_cursor;
44
};
45
46
class
QEglFSKmsGbmCursor
:
public
QPlatformCursor
47
{
48
Q_OBJECT
49
50
public
:
51
QEglFSKmsGbmCursor
(
QEglFSKmsGbmScreen
*
screen
);
52
~
QEglFSKmsGbmCursor
();
53
54
// input methods
55
void
pointerEvent
(
const
QMouseEvent & event)
override
;
56
#
ifndef
QT_NO_CURSOR
57
void
changeCursor
(QCursor * windowCursor, QWindow * window)
override
;
58
#
endif
59
QPoint
pos
()
const
override
;
60
void
setPos
(
const
QPoint &pos)
override
;
61
62
void
updateMouseStatus
();
63
64
void
reevaluateVisibilityForScreens
() { setPos(pos()); }
65
66
QEglFSKmsGbmScreen *
screen
()
const
{
return
m_screen; }
67
68
private
:
69
void
initCursorAtlas();
70
71
enum
CursorState {
72
CursorDisabled,
73
CursorPendingHidden,
74
CursorHidden,
75
CursorPendingVisible,
76
CursorVisible
77
};
78
79
QEglFSKmsGbmScreen *m_screen;
80
QSize m_cursorSize;
81
gbm_bo *m_bo;
82
QPoint m_pos;
83
QPlatformCursorImage m_cursorImage;
84
CursorState m_state;
85
QEglFSKmsGbmCursorDeviceListener
*m_deviceListener;
86
87
// cursor atlas information
88
struct
CursorAtlas {
89
CursorAtlas() : cursorsPerRow(0), cursorWidth(0), cursorHeight(0) { }
90
int
cursorsPerRow;
91
int
width, height;
// width and height of the atlas
92
int
cursorWidth, cursorHeight;
// width and height of cursors inside the atlas
93
QList<QPoint> hotSpots;
94
QImage image;
95
} m_cursorAtlas;
96
};
97
98
QT_END_NAMESPACE
99
100
#
endif
// QEGLFSKMSGBMCURSOR_H
QEglFSKmsGbmCursorDeviceListener
Definition
qeglfskmsgbmcursor_p.h:32
QEglFSKmsGbmCursor
Definition
qeglfskmsgbmcursor_p.h:47
QEglFSKmsGbmCursor::updateMouseStatus
void updateMouseStatus()
Definition
qeglfskmsgbmcursor.cpp:94
QEglFSKmsGbmCursor::pointerEvent
void pointerEvent(const QMouseEvent &event) override
This method is called by Qt whenever a QMouseEvent is generated by the underlying pointer input.
Definition
qeglfskmsgbmcursor.cpp:119
QEglFSKmsGbmCursor::changeCursor
void changeCursor(QCursor *windowCursor, QWindow *window) override
This method is called by Qt whenever the cursor graphic should be changed.
Definition
qeglfskmsgbmcursor.cpp:125
QEglFSKmsGbmCursor::setPos
void setPos(const QPoint &pos) override
Definition
qeglfskmsgbmcursor.cpp:200
QEglFSKmsGbmCursor::reevaluateVisibilityForScreens
void reevaluateVisibilityForScreens()
Definition
qeglfskmsgbmcursor_p.h:64
QEglFSKmsGbmCursor::pos
QPoint pos() const override
Definition
qeglfskmsgbmcursor.cpp:195
QEglFSKmsGbmCursor::screen
QEglFSKmsGbmScreen * screen() const
Definition
qeglfskmsgbmcursor_p.h:66
QEglFSKmsGbmCursor::~QEglFSKmsGbmCursor
~QEglFSKmsGbmCursor()
Definition
qeglfskmsgbmcursor.cpp:78
DRM_CAP_CURSOR_HEIGHT
#define DRM_CAP_CURSOR_HEIGHT
Definition
qeglfskmsgbmcursor.cpp:29
DRM_CAP_CURSOR_WIDTH
#define DRM_CAP_CURSOR_WIDTH
Definition
qeglfskmsgbmcursor.cpp:25
qtbase
src
plugins
platforms
eglfs
deviceintegration
eglfs_kms
qeglfskmsgbmcursor_p.h
Generated on
for Qt by
1.18.0