#include "Xlibint.h" #include "XTest.h" #include "xteststr.h" #include "Xext.h" #include "extutil.h" #include "XInput.h" #include "XIproto.h"Bool XTestQueryExtension (dpy, event_basep, error_basep, majorp, minorp) Display *dpy; int *event_basep, *error_basep; int *majorp, *minorp;
Bool XTestCompareCursorWithWindow(dpy, window, cursor) Display *dpy; Window window; Cursor cursor;
Bool XTestCompareCurrentCursorWithWindow(dpy, window) Display *dpy; Window window;
XTestFakeKeyEvent(dpy, keycode, is_press, delay) Display *dpy; unsigned int keycode; Bool is_press; unsigned long delay;
XTestFakeButtonEvent(dpy, button, is_press, delay) Display *dpy; unsigned int button; Bool is_press; unsigned long delay;
XTestFakeMotionEvent(dpy, screen, x, y, delay) Display *dpy; int screen; int x, y; unsigned long delay;
XTestFakeRelativeMotionEvent(dpy, dx, dy, delay) Display *dpy; int dx, dy; unsigned long delay;
XTestFakeDeviceKeyEvent(dpy, dev, keycode, is_press, axes, n_axes, delay) Display *dpy; XDevice *dev; unsigned int keycode; Bool is_press; int *axes; int n_axes; unsigned long delay;XTestFakeDeviceButtonEvent(dpy, dev, button, is_press, axes, n_axes, delay) Display *dpy; XDevice *dev; unsigned int button; Bool is_press; int *axes; int n_axes; unsigned long delay;
XTestFakeProximityEvent(dpy, dev, in_prox, axes, n_axes, delay) Display *dpy; XDevice *dev; Bool in_prox; int *axes; int n_axes; unsigned long delay;
XTestFakeDeviceMotionEvent(dpy, dev, is_relative, first_axis, axes, n_axes, delay) Display *dpy; XDevice *dev; Bool is_relative; int first_axis; int *axes; int n_axes; unsigned long delay;
XTestGrabControl(dpy, impervious) Display *dpy; Bool impervious;
void XTestSetGContextOfGC(gc, gid) GC gc; GContext gid;
void XTestSetVisualIDOfVisual(visual, visualid) Visual *visual; VisualID visualid;
Status XTestDiscard(dpy) Display *dpy;
Status
will retun non-zero for
``success'' and zero for ``failure''.
This extension provides the following functionality:
Use XTestSetGContextOfGC to reset the ``GContext'' within a GC. The ``GContext'' field indicates the lastGCID.
Use XTestSetVisualIDOfVisual to reset the ``VisualID'' within a Visual. The ``VisualID'' field indicates the lastVisualID.
The cursor is a write-only resource associated with a window and is one of the few window attributes that is settable but not observable directly or indirectly. The XTestCompareCursorOfWindow and XTestCompareCurrentCursorWithWindow functions compare the cursor of a given window with either a supplied cursor ID or the current cursor, respectively. The latter version is required to enable testing whether the cursor for a given window has reverted to the default cursor. The default cursor can only be accessed via the current cursor, not explicitly as an ID.
The XTestDiscard function is used to check the status of a buffer. The function returns True if something was in the buffer, else False. In addition bufptr is reset to buffer, last_req is reset to point to a dummy request {0,0,0} and conditionally decrement request.
The following functions are used to
specify the bare minimum input synthesis
mechanism at as high a level,
with respect to the server, as possible.
The following functions describe
input for the standard devices (viz., keyboard and pointer)
XTestFakeKeyEvent
XTestFakeButtonEvent
XTestFakeMotionEvent
XTestFakeRelativeMotionEvent
The following functions describe
input for non-standard devices.
XTestFakeDeviceKeyEvent
XTestFakeDeviceButtonEvent
XTestFakeProximityEvent
XTestFakeDeviceMotionEvent
The input functions provided cause the server to initiate event generation and distribution, grab activation, etc.
XTestGrabControl is used to indicate whether to allow the test client to continue sending event requests inspite of other grabs.
Use XTestQueryExtension to query and initialize the extension. The XTestQueryExtension checks to see if the XTest extensions are available for the specified display. If the extension is not present, False is returned; otherwise True is returned.