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
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
26
29
31{
33
34public:
36 bool hasMouse() const;
37
38public slots:
40
41private:
42 QEglFSKmsGbmCursor *m_cursor;
43};
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
64
65private:
66 void initCursorAtlas();
67
68 enum CursorState {
69 CursorDisabled,
70 CursorPendingHidden,
71 CursorHidden,
72 CursorPendingVisible,
73 CursorVisible
74 };
75
76 QEglFSKmsGbmScreen *m_screen;
77 QSize m_cursorSize;
78 gbm_bo *m_bo;
79 QPoint m_pos;
80 QPlatformCursorImage m_cursorImage;
81 CursorState m_state;
82 QEglFSKmsGbmCursorDeviceListener *m_deviceListener;
83
84 // cursor atlas information
85 struct CursorAtlas {
86 CursorAtlas() : cursorsPerRow(0), cursorWidth(0), cursorHeight(0) { }
87 int cursorsPerRow;
88 int width, height; // width and height of the atlas
89 int cursorWidth, cursorHeight; // width and height of cursors inside the atlas
90 QList<QPoint> hotSpots;
92 } m_cursorAtlas;
93};
94
96
97#endif // QEGLFSKMSGBMCURSOR_H
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition qcursor.h:45
void onDeviceListChanged(QInputDeviceManager::DeviceType type)
QEglFSKmsGbmCursorDeviceListener(QEglFSKmsGbmCursor *cursor)
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
QEglFSKmsGbmCursor(QEglFSKmsGbmScreen *screen)
\inmodule QtGui
Definition qimage.h:37
\inmodule QtGui
Definition qevent.h:196
\inmodule QtCore
Definition qobject.h:103
The QPlatformCursorImage class provides a set of graphics intended to be used as cursors.
The QPlatformCursor class provides information about pointer device events (movement,...
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore
Definition qsize.h:25
\inmodule QtGui
Definition qwindow.h:63
QCursor cursor
Combined button and popup list for selecting options.
Definition image.cpp:4
GLint GLsizei GLsizei height
GLint GLsizei width
GLenum type
struct _cl_event * event
QScreen * screen
[1]
Definition main.cpp:29
#define Q_OBJECT
#define slots
aWidget window() -> setWindowTitle("New Window Title")
[2]