summaryrefslogtreecommitdiff
path: root/tests/common/helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common/helpers.h')
-rw-r--r--tests/common/helpers.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/common/helpers.h b/tests/common/helpers.h
index 3576d93..56f7ce6 100644
--- a/tests/common/helpers.h
+++ b/tests/common/helpers.h
@@ -28,6 +28,7 @@
#include <string>
#include <xorg/gtest/xorg-gtest.h>
#include "xorg-conf.h"
+#include <X11/extensions/XInput2.h>
#include "xit-server.h"
@@ -185,5 +186,26 @@ int double_cmp(double a, double b, int precision = 2);
*/
void SelectXI2Events(Display *dpy, int deviceid, Window win,
const std::vector<int>& evtypes);
+
+/**
+ * Grab the specific device for event types given in evtypes
+ */
+void GrabXI2Device(::Display *dpy, int deviceid, Window grab_win, int grab_mode,
+ int paired_device_mode, const std::vector<int>& evtypes);
+
+/**
+ * Builds a XI2 event mask
+ */
+class EventMaskBuilder {
+public:
+ EventMaskBuilder(int deviceid, const std::vector<int>& evtypes);
+
+ XIEventMask* GetMask() { return &mask; }
+
+private:
+ XIEventMask mask;
+ std::vector<unsigned char> storage;
+};
+
#endif