7#include <qpa/qplatformcursor.h>
9#include <xcb/xcb_cursor.h>
11#include <QtCore/QCache>
30 return k1.shape == k2.shape &&
k1.bitmapCacheKey == k2.bitmapCacheKey &&
k1.maskCacheKey == k2.maskCacheKey;
35 return (
size_t(k.shape) +
size_t(k.bitmapCacheKey) +
size_t(k.maskCacheKey)) ^
seed;
65 typedef QHash<QXcbCursorCacheKey, xcb_cursor_t> CursorHash;
69 explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t
c)
70 :
cursor(
c), connection(conn) {}
71 ~CachedCursor() { xcb_free_cursor(connection, cursor); }
73 xcb_connection_t *connection;
75 typedef QCache<QXcbCursorCacheKey, CachedCursor> BitmapCursorCache;
77 xcb_cursor_t createFontCursor(
int cshape);
79 xcb_cursor_t createNonStandardCursor(
int cshape);
83 xcb_cursor_context_t *m_cursorContext;
85 CursorHash m_cursorHash;
86 BitmapCursorCache m_bitmapCache;
92 bool m_callbackForPropertyRegistered;
The QCursor class provides a mouse cursor with an arbitrary shape.
T value(const Key &key) const noexcept
\inmodule QtCore\reentrant
xcb_cursor_t xcbCursor(const QCursor &c) const
void changeCursor(QCursor *cursor, QWindow *window) override
This method is called by Qt whenever the cursor graphic should be changed.
QPoint pos() const override
QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask=nullptr)
void setPos(const QPoint &pos) override
QSize size() const override
Returns the size of the cursor, in native pixels.
Combined button and popup list for selecting options.
GLuint64 GLenum void * handle
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2)
size_t qHash(const QXcbCursorCacheKey &k, size_t seed) noexcept
QXcbCursorCacheKey(Qt::CursorShape s)