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
4#ifndef QEGLFSKMSGBMCURSOR_H
5#define QEGLFSKMSGBMCURSOR_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <qpa/qplatformcursor.h>
19#include <QtCore/QList>
20#include <QtGui/QImage>
21#include <QtGui/private/qinputdevicemanager_p.h>
22
23#include <gbm.h>
24
25QT_BEGIN_NAMESPACE
26
27class QEglFSKmsGbmScreen;
29
44
46{
48
49public:
52
53 // input methods
54 void pointerEvent(const QMouseEvent & event) override;
55#ifndef QT_NO_CURSOR
56 void changeCursor(QCursor * windowCursor, QWindow * window) override;
57#endif
58 QPoint pos() const override;
59 void setPos(const QPoint &pos) override;
60
61 void updateMouseStatus();
62
63 void reevaluateVisibilityForScreens() { setPos(pos()); }
64
65 QEglFSKmsGbmScreen *screen() const { return m_screen; }
66
67private:
68 void initCursorAtlas();
69
70 enum CursorState {
71 CursorDisabled,
72 CursorPendingHidden,
73 CursorHidden,
74 CursorPendingVisible,
75 CursorVisible
76 };
77
78 QEglFSKmsGbmScreen *m_screen;
79 QSize m_cursorSize;
80 gbm_bo *m_bo;
81 QPoint m_pos;
82 QPlatformCursorImage m_cursorImage;
83 CursorState m_state;
84 QEglFSKmsGbmCursorDeviceListener *m_deviceListener;
85
86 // cursor atlas information
87 struct CursorAtlas {
88 CursorAtlas() : cursorsPerRow(0), cursorWidth(0), cursorHeight(0) { }
89 int cursorsPerRow;
90 int width, height; // width and height of the atlas
91 int cursorWidth, cursorHeight; // width and height of cursors inside the atlas
92 QList<QPoint> hotSpots;
93 QImage image;
94 } m_cursorAtlas;
95};
96
97QT_END_NAMESPACE
98
99#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