19 #ifndef MOUSE_TOUCH_ADAPTOR_H
20 #define MOUSE_TOUCH_ADAPTOR_H
22 #include <QtCore/QAbstractNativeEventFilter>
31 class MouseTouchAdaptor :
public QObject,
public QAbstractNativeEventFilter {
34 virtual ~MouseTouchAdaptor();
36 static MouseTouchAdaptor* instance();
39 bool nativeEventFilter(
const QByteArray & eventType,
void *message,
long *result)
override;
41 Q_PROPERTY(
bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
44 void setEnabled(
bool value);
47 void enabledChanged(
bool value);
51 void fetchXInput2Info();
52 bool xi2HandleEvent(xcb_ge_event_t *event);
54 bool handleButtonPress(WId windowId, uint32_t detail,
int x,
int y);
55 bool handleButtonRelease(WId windowId, uint32_t detail,
int x,
int y);
56 bool handleMotionNotify(WId windowId,
int x,
int y);
57 QWindow *findQWindowWithXWindowID(WId windowId);
59 QTouchDevice *m_touchDevice;
60 bool m_leftButtonIsPressed;
64 bool m_xi2Enabled{
false};
66 int m_xiOpCode, m_xiEventBase, m_xiErrorBase;
69 #endif // MOUSE_TOUCH_ADAPTOR_H