From cedde79d5964fa3574d1b9977aa58461e00d2381 Mon Sep 17 00:00:00 2001 From: Kaleb Keithley Date: Mon, 17 Nov 2003 19:03:42 +0000 Subject: merge XFree86 4.3.0.1 to -CURRENT --- src/XRecord.c | 14 +++++++------- src/XTest.c | 36 +++++++++++++++++++++++------------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/XRecord.c b/src/XRecord.c index 8c32491..138ff61 100644 --- a/src/XRecord.c +++ b/src/XRecord.c @@ -50,16 +50,17 @@ from The Open Group. /* * 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 #include #define NEED_EVENTS #define NEED_REPLIES #include -#include "Xext.h" +#include #include -#include "extutil.h" -#include "recordstr.h" +#include +#include extern unsigned long _XSetLastRequestRead(); @@ -739,7 +740,7 @@ parse_reply_call_callback(dpy, info, rep, reply, callback, closure) XPointer closure; { int current_index; - int datum_bytes; + int datum_bytes = 0; XRecordInterceptData *data; /* call the callback for each protocol element in the reply */ @@ -821,7 +822,7 @@ parse_reply_call_callback(dpy, info, rep, reply, callback, closure) 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 @@ -928,7 +929,6 @@ record_async_handler(dpy, rep, buf, len, adata) 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) { @@ -957,7 +957,7 @@ record_async_handler(dpy, rep, buf, len, adata) return False; } - _XGetAsyncData(dpy, reply->buf, buf, len, + _XGetAsyncData(dpy, (char *)reply->buf, buf, len, SIZEOF(xRecordEnableContextReply), rep->generic.length << 2, 0); } else { 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 +#include +#include +#include +#include +#include +#include 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; -- cgit v1.2.3