17#include <KSharedConfig>
29namespace ExtendedCursor
63 return m_shape == o.m_shape;
72 QByteArray name()
const;
77 static QList<QByteArray> alternatives(
const QByteArray &name);
80 int m_shape = Qt::ArrowCursor;
107 void startMousePolling();
108 void stopMousePolling();
122 void startCursorTracking();
130 void stopCursorTracking();
137 const QString &themeName()
const;
143 int themeSize()
const;
147 static QString defaultThemeName();
151 static int defaultThemeSize();
164 void setPos(
const QPointF &pos);
170 xcb_cursor_t x11Cursor(
const QByteArray &name);
172 QPointF hotspot()
const;
173 QRectF geometry()
const;
182 bool isOnOutput(
Output *output)
const;
184 void markAsRendered(std::chrono::milliseconds timestamp);
189 Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons,
190 Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers);
201 void rendered(std::chrono::milliseconds timestamp);
207 virtual void doSetPos();
212 virtual void doGetPos();
217 virtual void doStartMousePolling();
222 virtual void doStopMousePolling();
227 virtual void doStartCursorTracking();
232 virtual void doStopCursorTracking();
233 bool isCursorTracking()
const;
239 const QPointF ¤tPos()
const;
244 void updatePos(
const QPointF &pos);
247 void loadThemeSettings();
248 void slotKGlobalSettingsNotifyChange(
int type,
int arg);
251 void updateTheme(
const QString &name,
int size);
252 void loadThemeFromKConfig();
254 QHash<QByteArray, xcb_cursor_t> m_cursors;
256 int m_mousePollingCounter;
257 int m_cursorTrackingCounter;
273 if (m_mouse != mouse) {
277 setCurrentCursor(m_mouse);
281 void addCursor(
Cursor *cursor);
282 void removeCursor(
Cursor *cursor);
287 return m_currentCursor;
292 bool isCursorHidden()
const;
302 void emitCurrentCursorChanged();
303 void setCurrentCursor(
Cursor *cursor);
306 Cursor *m_currentCursor =
nullptr;
307 Cursor *m_mouse =
nullptr;
308 QList<Cursor *> m_cursors;
309 int m_cursorHideCounter = 0;
329 return m_cursorTrackingCounter > 0;
void mouseChanged(const QPointF &pos, const QPointF &oldpos, Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons, Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers)
bool isCursorTracking() const
int themeSize() const
The size of the currently used Cursor theme.
void posChanged(const QPointF &pos)
const QString & themeName() const
The name of the currently used Cursor theme.
const QPointF & currentPos() const
void cursorChanged()
Signal emitted when the cursor image changes.
void rendered(std::chrono::milliseconds timestamp)
Wrapper round Qt::CursorShape with extensions enums into a single entity.
CursorShape(KWin::ExtendedCursor::Shape kwinShape)
bool operator==(const CursorShape &o) const
CursorShape(Qt::CursorShape qtShape)
void positionChanged(Cursor *cursor, const QPointF &position)
void currentCursorChanged(Cursor *cursor)
Cursor * currentCursor() const
void setMouse(Cursor *mouse)