/*
* By Stephen Gildea, X Consortium, and Martha Zimet, NCD.
*/
+/* $XFree86: xc/lib/Xtst/XRecord.c,v 1.6 2002/10/16 00:37:33 dawes Exp $ */
#include <stdio.h>
#include <assert.h>
#define NEED_EVENTS
#define NEED_REPLIES
#include <X11/Xlibint.h>
-#include "Xext.h"
+#include <X11/extensions/Xext.h>
#include <X11/Xtrans.h>
-#include "extutil.h"
-#include "recordstr.h"
+#include <X11/extensions/extutil.h>
+#include <X11/extensions/recordstr.h>
extern unsigned long _XSetLastRequestRead();
XPointer closure;
{
int current_index;
- int datum_bytes;
+ int datum_bytes = 0;
XRecordInterceptData *data;
/* call the callback for each protocol element in the reply */
if (current_index + datum_bytes > rep->length << 2)
fprintf(stderr,
"XRecord: %lu-byte reply claims %d-byte element (seq %lu)\n",
- rep->length << 2, current_index + datum_bytes,
+ (long)rep->length << 2, current_index + datum_bytes,
dpy->last_request_read);
/*
* This assignment (and indeed the whole buffer sharing
register record_async_state *state = (record_async_state *)adata;
struct reply_buffer *reply;
enum parser_return status;
- extern void _XGetAsyncData();
if (dpy->last_request_read != state->enable_seq)
{
return False;
}
- _XGetAsyncData(dpy, reply->buf, buf, len,
+ _XGetAsyncData(dpy, (char *)reply->buf, buf, len,
SIZEOF(xRecordEnableContextReply),
rep->generic.length << 2, 0);
} else {
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;
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,
return XTestCompareCursorWithWindow(dpy, window, XTestCurrentCursor);
}
+int
XTestFakeKeyEvent(dpy, keycode, is_press, delay)
Display *dpy;
unsigned int keycode;
return 1;
}
+int
XTestFakeButtonEvent(dpy, button, is_press, delay)
Display *dpy;
unsigned int button;
return 1;
}
+int
XTestFakeMotionEvent(dpy, screen, x, y, delay)
Display *dpy;
int screen;
return 1;
}
+int
XTestFakeRelativeMotionEvent(dpy, dx, dy, delay)
Display *dpy;
int dx, dy;
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;
}
}
+int
XTestFakeDeviceKeyEvent(dpy, dev, keycode, is_press, axes, n_axes, delay)
Display *dpy;
XDevice *dev;
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;
return 1;
}
+int
XTestFakeDeviceButtonEvent(dpy, dev, button, is_press, axes, n_axes, delay)
Display *dpy;
XDevice *dev;
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;
return 1;
}
+int
XTestFakeProximityEvent(dpy, dev, in_prox, axes, n_axes, delay)
Display *dpy;
XDevice *dev;
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)
return 1;
}
+int
XTestFakeDeviceMotionEvent(dpy, dev, is_relative,
first_axis, axes, n_axes, delay)
Display *dpy;
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;
return 1;
}
+int
XTestGrabControl(dpy, impervious)
Display *dpy;
Bool impervious;