summaryrefslogtreecommitdiff
path: root/src/XTest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/XTest.c')
-rw-r--r--src/XTest.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/XTest.c b/src/XTest.c
index 108d9e4..1542dd9 100644
--- a/src/XTest.c
+++ b/src/XTest.c
@@ -30,15 +30,16 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
+/* $XFree86: xc/lib/Xtst/XTest.c,v 1.6 2002/10/16 00:37:33 dawes Exp $ */
#define NEED_REPLIES
-#include "Xlibint.h"
-#include "XTest.h"
-#include "xteststr.h"
-#include "Xext.h"
-#include "extutil.h"
-#include "XInput.h"
-#include "XIproto.h"
+#include <X11/Xlibint.h>
+#include <X11/extensions/XTest.h>
+#include <X11/extensions/xteststr.h>
+#include <X11/extensions/Xext.h>
+#include <X11/extensions/extutil.h>
+#include <X11/extensions/XInput.h>
+#include <X11/extensions/XIproto.h>
static XExtensionInfo _xtest_info_data;
static XExtensionInfo *xtest_info = &_xtest_info_data;
@@ -80,7 +81,7 @@ get_xinput_base(dpy)
first_event = 0;
XQueryExtension(dpy, INAME, &major_opcode, &first_event, &first_error);
- return (XPointer)first_event;
+ return (XPointer)(long)first_event;
}
static XEXT_GENERATE_FIND_DISPLAY (find_display, xtest_info,
@@ -166,6 +167,7 @@ XTestCompareCurrentCursorWithWindow(dpy, window)
return XTestCompareCursorWithWindow(dpy, window, XTestCurrentCursor);
}
+int
XTestFakeKeyEvent(dpy, keycode, is_press, delay)
Display *dpy;
unsigned int keycode;
@@ -189,6 +191,7 @@ XTestFakeKeyEvent(dpy, keycode, is_press, delay)
return 1;
}
+int
XTestFakeButtonEvent(dpy, button, is_press, delay)
Display *dpy;
unsigned int button;
@@ -212,6 +215,7 @@ XTestFakeButtonEvent(dpy, button, is_press, delay)
return 1;
}
+int
XTestFakeMotionEvent(dpy, screen, x, y, delay)
Display *dpy;
int screen;
@@ -241,6 +245,7 @@ XTestFakeMotionEvent(dpy, screen, x, y, delay)
return 1;
}
+int
XTestFakeRelativeMotionEvent(dpy, dx, dy, delay)
Display *dpy;
int dx, dy;
@@ -281,7 +286,7 @@ send_axes(dpy, info, req, dev, first_axis, axes, n_axes)
req->deviceid |= MORE_EVENTS;
req->length += ((n_axes + 5) / 6) * (SIZEOF(xEvent) >> 2);
- ev.type = XI_DeviceValuator + (int)info->data;
+ ev.type = XI_DeviceValuator + (long)info->data;
ev.deviceid = dev->device_id;
ev.num_valuators = n_axes;
ev.first_valuator = first_axis;
@@ -310,6 +315,7 @@ send_axes(dpy, info, req, dev, first_axis, axes, n_axes)
}
}
+int
XTestFakeDeviceKeyEvent(dpy, dev, keycode, is_press, axes, n_axes, delay)
Display *dpy;
XDevice *dev;
@@ -329,7 +335,7 @@ XTestFakeDeviceKeyEvent(dpy, dev, keycode, is_press, axes, n_axes, delay)
req->reqType = info->codes->major_opcode;
req->xtReqType = X_XTestFakeInput;
req->type = is_press ? XI_DeviceKeyPress : XI_DeviceKeyRelease;
- req->type += (int)info->data;
+ req->type += (int)(long)info->data;
req->detail = keycode;
req->time = delay;
req->deviceid = dev->device_id;
@@ -340,6 +346,7 @@ XTestFakeDeviceKeyEvent(dpy, dev, keycode, is_press, axes, n_axes, delay)
return 1;
}
+int
XTestFakeDeviceButtonEvent(dpy, dev, button, is_press, axes, n_axes, delay)
Display *dpy;
XDevice *dev;
@@ -359,7 +366,7 @@ XTestFakeDeviceButtonEvent(dpy, dev, button, is_press, axes, n_axes, delay)
req->reqType = info->codes->major_opcode;
req->xtReqType = X_XTestFakeInput;
req->type = is_press ? XI_DeviceButtonPress : XI_DeviceButtonRelease;
- req->type += (int)info->data;
+ req->type += (int)(long)info->data;
req->detail = button;
req->time = delay;
req->deviceid = dev->device_id;
@@ -370,6 +377,7 @@ XTestFakeDeviceButtonEvent(dpy, dev, button, is_press, axes, n_axes, delay)
return 1;
}
+int
XTestFakeProximityEvent(dpy, dev, in_prox, axes, n_axes, delay)
Display *dpy;
XDevice *dev;
@@ -388,7 +396,7 @@ XTestFakeProximityEvent(dpy, dev, in_prox, axes, n_axes, delay)
req->reqType = info->codes->major_opcode;
req->xtReqType = X_XTestFakeInput;
req->type = in_prox ? XI_ProximityIn : XI_ProximityOut;
- req->type += (int)info->data;
+ req->type += (int)(long)info->data;
req->time = delay;
req->deviceid = dev->device_id;
if (n_axes)
@@ -398,6 +406,7 @@ XTestFakeProximityEvent(dpy, dev, in_prox, axes, n_axes, delay)
return 1;
}
+int
XTestFakeDeviceMotionEvent(dpy, dev, is_relative,
first_axis, axes, n_axes, delay)
Display *dpy;
@@ -417,7 +426,7 @@ XTestFakeDeviceMotionEvent(dpy, dev, is_relative,
GetReq(XTestFakeInput, req);
req->reqType = info->codes->major_opcode;
req->xtReqType = X_XTestFakeInput;
- req->type = XI_DeviceMotionNotify + (int)info->data;
+ req->type = XI_DeviceMotionNotify + (int)(long)info->data;
req->detail = is_relative;
req->time = delay;
req->deviceid = dev->device_id;
@@ -427,6 +436,7 @@ XTestFakeDeviceMotionEvent(dpy, dev, is_relative,
return 1;
}
+int
XTestGrabControl(dpy, impervious)
Display *dpy;
Bool impervious;