1XTEST(3) libXtst XTEST(3)
2
3
4
6 XTestQueryExtension, XTestCompareCursorWithWindow,
7 XTestCompareCurrentCursorWithWindow, XTestFakeKeyEvent,
8 XTestFakeButtonEvent, XTestFakeMotionEvent,
9 XTestFakeRelativeMotionEvent, XTestGrabControl, XTestSetGContextOfGC,
10 XTestSetVisualIDOfVisual, XTestDiscard - XTest extension functions
11
13 cc [ flag ... ] file ... -lXtst [ library ... ]
14
15 #include <X11/extensions/XTest.h>
16
17 Bool XTestQueryExtension(display, event_base_return, error_base_return,
18 major_version_return, minor_version_return);
19
20 Display *display;
21 int *event_base_return;
22 int *error_base_return;
23 int *major_version_return;
24 int *minor_version_return;
25
26 Bool XTestCompareCursorWithWindow(display, window, cursor);
27
28 Display *display;
29 Window window;
30 Cursor cursor;
31
32 Bool XTestCompareCurrentCursorWithWindow(display, window);
33
34 Display *display;
35 Window window;
36
37 int XTestFakeKeyEvent(display, keycode, is_press, delay);
38
39 Display *display;
40 unsigned int keycode;
41 Bool is_press;
42 unsigned long delay;
43
44 int XTestFakeButtonEvent(display, button, is_press, delay);
45
46 Display *display;
47 unsigned int button;
48 Bool is_press;
49 unsigned long delay;
50
51 int XTestFakeMotionEvent(display, screen_number, x, y, delay);
52
53 Display *display;
54 int screen_number;
55 int x, y;
56 unsigned long delay;
57
58 int XTestFakeRelativeMotionEvent(display, screen_number, x, y, delay);
59
60 Display *display;
61 int screen_number;
62 int x, y;
63 unsigned long delay;
64
65 int XTestGrabControl(display, impervious);
66
67 Display *display;
68 Bool impervious;
69
70 void XTestSetGContextOfGC(gc, gid);
71
72 GC gc;
73 GContext gid;
74
75 void XTestSetVisualIDOfVisual(visual, visualid);
76
77 Visual *visual;
78 VisualID visualid;
79
80 Status XTestDiscard(display);
81
82 Display *display;
83
85 This extension is a minimal set of client and server extensions
86 required to completely test the X11 server with no user intervention.
87 This extension is not intended to support general journaling and
88 playback of user actions.
89
90 The functions provided by this extension fall into two groups:
91
92 Client Operations
93 These routines manipulate otherwise hidden client-side behavior.
94 The actual implementation will depend on the details of the actual
95 language binding and what degree of request buffering, GContext
96 caching, and so on, is provided. In the C binding, routines are
97 provided to access the internals of two opaque data structures —
98 GCs and Visuals — and to discard any requests pending within the
99 output buffer of a connection. The exact details can be expected to
100 differ for other language bindings.
101
102 Server Requests
103 The first of these requests is similar to that provided in most
104 extensions: it allows a client to specify a major and minor version
105 number to the server and for the server to respond with major and
106 minor versions of its own. The remaining two requests allow the
107 following:
108
109 · Access to an otherwise write-only server resource: the cursor
110 associated with a given window
111
112 · Perhaps most importantly, limited synthesis of input device
113 events, almost as if a cooperative user had moved the pointing
114 device or pressed a key or button.
115
116 All XTEST extension functions and procedures, and all manifest
117 constants and macros, will start with the string XTest. All operations
118 are classified as server/client (Server) or client-only (Client).
119
120 XTestQueryExtension returns True if the specified display supports the
121 XTEST extension, else False. If the extension is supported, *event_base
122 would be set to the event number for the first event for this extension
123 and *error_base would be set to the error number for the first error
124 for this extension. As no errors or events are defined for this version
125 of the extension, the values returned here are not defined (nor
126 useful). If the extension is supported, *major_version and
127 *minor_version are set to the major and minor version numbers of the
128 extension supported by the display. Otherwise, none of the arguments
129 are set.
130
131 If the extension is supported, XTestCompareCursorWithWindow performs a
132 comparison of the cursor whose ID is specified by cursor (which may be
133 None) with the cursor of the window specified by window returning True
134 if they are the same and False otherwise. If the extension is not
135 supported, then the request is ignored and zero is returned.
136
137 If the extension is supported, XTestCompareCurrentCursorWithWindow
138 performs a comparison of the current cursor with the cursor of the
139 specified window returning True if they are the same and False
140 otherwise. If the extension is not supported, then the request is
141 ignored and zero is returned.
142
143 If the extension is supported, XTestFakeKeyEvent requests the server to
144 simulate either a KeyPress (if is_press is True) or a KeyRelease (if
145 is_press is False) of the key with the specified keycode; otherwise,
146 the request is ignored.
147
148 If the extension is supported, the simulated event will not be
149 processed until delay milliseconds after the request is received (if
150 delay is CurrentTime, then this is interpreted as no delay at all). No
151 other requests from this client will be processed until this delay, if
152 any, has expired and subsequent processing of the simulated event has
153 been completed.
154
155 If the extension is supported, XTestFakeButtonEvent requests the server
156 to simulate either a ButtonPress (if is_press is True) or a
157 ButtonRelease (if is_press is False) of the logical button numbered by
158 the specified button; otherwise, the request is ignored.
159
160 If the extension is supported, the simulated event will not be
161 processed until delay milliseconds after the request is received (if
162 delay is CurrentTime, then this is interpreted as no delay at all). No
163 other requests from this client will be processed until this delay, if
164 any, has expired and subsequent processing of the simulated event has
165 been completed.
166
167 If the extension is supported, XTestFakeMotionEvent requests the server
168 to simulate a movement of the pointer to the specified position (x, y)
169 on the root window of screen_number; otherwise, the request is ignored.
170 If screen_number is -1, the current screen (that the pointer is on) is
171 used.
172
173 If the extension is supported, the simulated event will not be
174 processed until delay milliseconds after the request is received (if
175 delay is CurrentTime, then this is interpreted as no delay at all). No
176 other requests from this client will be processed until this delay, if
177 any, has expired and subsequent processing of the simulated event has
178 been completed.
179
180 If the extension is supported, XTestFakeRelativeMotionEvent requests
181 the server to simulate a movement of the pointer by the specified
182 offsets (x, y) relative to the current pointer position on
183 screen_number; otherwise, the request is ignored. If screen_number is
184 -1, the current screen (that the pointer is on) is used.
185
186 If the extension is supported, the simulated event will not be
187 processed until delay milliseconds after the request is received (if
188 delay is CurrentTime, then this is interpreted as no delay at all). No
189 other requests from this client will be processed until this delay, if
190 any, has expired and subsequent processing of the simulated event has
191 been completed.
192
193 If impervious is True, then the executing client becomes impervious to
194 server grabs. If impervious is False, then the executing client returns
195 to the normal state of being susceptible to server grabs.
196
197 XTestSetGContextOfGC sets the GContext within the opaque datatype
198 referenced by gc to be that specified by gid.
199
200 XTestSetVisualIDOfVisual sets the VisualID within the opaque datatype
201 referenced by visual to be that specified by visualid.
202
203 XTestDiscard discards any requests within the output buffer for the
204 specified display. It returns True if any requests were discarded;
205 otherwise, it returns False.
206
208 All routines that have return type Status will return nonzero for
209 success and zero for failure. Even if the XTEST extension is supported,
210 the server may withdraw such facilities arbitrarily; in which case they
211 will subsequently return zero.
212
214 Kieron Drake
215 UniSoft Ltd.
216 Author.
217
218
219
220 <pubdate>6 June 2007</pubdate> XTEST(3)