X Version 11 (Release 6.1)

XTEST(X3xext)


XTEST -- Test X11 server without user intervention.

Synopsis

   #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;

Description

This extension is a minimal set of client and server extensions required to completely test the X11 server with no user intervention. All functions that have the return type 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.

Arguments


axes
Used to define the field of motion for a non-standard device. Standard devices use the x/y axis only.

button
Specifies a pointer button.

cursor
Specifies a cursor ID.

delay
Specifies time (in milliseconds).

dev
Specifies a device.

dpy
Specifies the X server connection.

dx, dy
Specifies x and y coordinates for the pointer.

event_basep
First event number for the extension.

error_basep
First error number for the extension.

first_axis
Used to define the field of motion for a non-standard device. Standard devices use the x/y axis only.

gc
Specifies a Graphic Context.

gid
A Graphic Context ID, used to invalidate theGC.

impervious
Boolean value, if true the display will be impervious to further requests from the testing client. If false, further requests from the testing client will be displayed.

in_prox
Boolean value indicating the input is in proximity (``0'', true) or out of proximity (``1'', false).

is_press
A boolean value, indicating the action is a press ``0'' or release ``1''.

is_relative
Boolean value, true when motion is relative to previous specified request.

keycode
Specifies a KeyCode.

majorp,
Indicates the major version number.

minorp
Indicates the minor version number.

n_axes
Used to define the field of motion for a non-standard device. Standard devices use the x/y axis only.

screen
Specifies a screen within the display.

visual
Specifies a Visual.

visualid
A visual ID, used to invalidate the Visual.

window,
Identifies a window within the display.

x, y
Specifies x and y coordinates for the pointer.

References

Xlib - C Language X Interface
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004