Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
26QT_BEGIN_NAMESPACE
27
28class QEglFSKmsGbmScreen;
30
45
47{
49
50public:
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
68private:
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
98QT_END_NAMESPACE
99
100#endif // QEGLFSKMSGBMCURSOR_H
void pointerEvent(const QMouseEvent &event) override
This method is called by Qt whenever a QMouseEvent is generated by the underlying pointer input.
void changeCursor(QCursor *windowCursor, QWindow *window) override
This method is called by Qt whenever the cursor graphic should be changed.
void setPos(const QPoint &pos) override
QPoint pos() const override
QEglFSKmsGbmScreen * screen() const
#define DRM_CAP_CURSOR_HEIGHT
#define DRM_CAP_CURSOR_WIDTH