1a5602400Smrg<?xml version="1.0" encoding="UTF-8" ?>
2a5602400Smrg<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3a5602400Smrg                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
4a5602400Smrg
5a5602400Smrg
6a5602400Smrg<article id="xtest1">
7a5602400Smrg
8a5602400Smrg<articleinfo>
9a5602400Smrg   <title>X11 INPUT SYNTHESIS EXTENSION PROPOSAL</title>
10a5602400Smrg   <subtitle>X Consortium Standard</subtitle>
11a5602400Smrg   <releaseinfo>Version 1.0</releaseinfo>
12a5602400Smrg   <authorgroup>
13a5602400Smrg      <author>
14a5602400Smrg         <firstname>Larry</firstname><surname>Woestman</surname>
15a5602400Smrg         <affiliation><jobtitle>Member of Technical Staff</jobtitle>
16a5602400Smrg	   <orgname>Hewlett Packard</orgname></affiliation>
17a5602400Smrg      </author>
18a5602400Smrg   </authorgroup>
19a5602400Smrg   <copyright><year>1993</year><holder>X Consortium</holder></copyright>
20af9a7ee5Smrg
21af9a7ee5Smrg<legalnotice>
22af9a7ee5Smrg<para>
23af9a7ee5SmrgPermission is hereby granted, free of charge, to any person obtaining a copy of
24af9a7ee5Smrgthis software and associated documentation files (the "Software"), to deal in
25af9a7ee5Smrgthe Software without restriction, including without limitation the rights to
26af9a7ee5Smrguse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
27af9a7ee5Smrgof the Software, and to permit persons to whom the Software is furnished to do
28af9a7ee5Smrgso, subject to the following conditions:
29af9a7ee5Smrg</para>
30af9a7ee5Smrg<para>
31af9a7ee5SmrgThe above copyright notice and this permission notice shall be included in all
32af9a7ee5Smrgcopies or substantial portions of the Software.
33af9a7ee5Smrg</para>
34af9a7ee5Smrg<para>
35af9a7ee5SmrgTHE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36af9a7ee5SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37af9a7ee5SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X
38af9a7ee5SmrgCONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
39af9a7ee5SmrgACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40af9a7ee5SmrgWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41af9a7ee5Smrg</para>
42af9a7ee5Smrg<para>
43af9a7ee5SmrgExcept as contained in this notice, the name of the X Consortium shall not be
44af9a7ee5Smrgused in advertising or otherwise to promote the sale, use or other dealings in
45af9a7ee5Smrgthis Software without prior written authorization from the X Consortium.
46af9a7ee5Smrg</para>
47af9a7ee5Smrg<para>X Window System is a trademark of The Open Group.</para>
48af9a7ee5Smrg</legalnotice>
49a5602400Smrg
50a5602400Smrg<abstract>
51a5602400Smrg<para>
52a5602400SmrgThis is a proposal for an extension to the X11 server and Xlib.
53a5602400Smrg</para>
54a5602400Smrg</abstract>
55a5602400Smrg
56a5602400Smrg</articleinfo>
57a5602400Smrg
58a5602400Smrg<sect1 id="introduction">
59a5602400Smrg<title>Introduction</title>
60a5602400Smrg<para>
61a5602400SmrgThis is a proposal for an extension to the X11 server and Xlib.
62a5602400SmrgIt provides two capabilities:
63a5602400Smrg</para>
64a5602400Smrg
65a5602400Smrg<itemizedlist>
66a5602400Smrg  <listitem>
67a5602400Smrg    <para>
68a5602400SmrgIt allows a client to generate user input actions in the server without
69a5602400Smrgrequiring a user to be present.
70a5602400Smrg    </para>
71a5602400Smrg  </listitem>
72a5602400Smrg  <listitem>
73a5602400Smrg    <para>
74a5602400SmrgIt also allows a client to control the
75a5602400Smrghandling of user input actions by the server.
76a5602400Smrg    </para>
77a5602400Smrg  </listitem>
78a5602400Smrg</itemizedlist>
79a5602400Smrg
80a5602400Smrg<para>
81a5602400SmrgThe capability
82a5602400Smrgto allow a client to generate user input actions in the server
83a5602400Smrgwill be used by some of the X Testing Consortium Xlib tests.
84a5602400SmrgBoth capabilities will be used by the X Testing Consortium client exerciser
85a5602400Smrgprogram.
86a5602400SmrgThese capabilities may also be useful in other programs.
87a5602400Smrg</para>
88a5602400Smrg
89a5602400Smrg<para>
90a5602400SmrgThis extension requires modification to device-dependent code in the
91a5602400Smrgserver.  Therefore it is not a 'portable' extension as defined by the
92a5602400SmrgX11 Server Extensions document.  However, the majority of the code
93a5602400Smrgand functionality of this extension will be implementation-independent.
94a5602400Smrg</para>
95a5602400Smrg
96a5602400Smrg</sect1>
97a5602400Smrg
98a5602400Smrg<sect1 id="conventions_used_in_this_document">
99a5602400Smrg<title>Conventions Used In This Document</title>
100a5602400Smrg
101a5602400Smrg<para>
102a5602400SmrgThe naming conventions used in the Xlib documentation are followed
103a5602400Smrgwith these additions:
104a5602400Smrg</para>
105a5602400Smrg
106a5602400Smrg<itemizedlist>
107a5602400Smrg  <listitem>
108a5602400Smrg    <para>
109a5602400SmrgThe names of all functions defined in this extension begin with 'XTest',
110a5602400Smrgwith the first letter of each additional word capitalized.
111a5602400Smrg    </para>
112a5602400Smrg  </listitem>
113a5602400Smrg  <listitem>
114a5602400Smrg    <para>
115a5602400SmrgThe names of the protocol request structures follow the Xlib convention
116a5602400Smrgof 'x&lt;name&gt;Req'.
117a5602400Smrg    </para>
118a5602400Smrg  </listitem>
119a5602400Smrg  <listitem>
120a5602400Smrg    <para>
121a5602400SmrgThe names of the protocol request minor type codes follow the Xlib convention
122a5602400Smrgof 'X_&lt;name&gt;'.
123a5602400Smrg    </para>
124a5602400Smrg  </listitem>
125a5602400Smrg  <listitem>
126a5602400Smrg    <para>
127a5602400SmrgThe names of all other constants defined in this extension begin with 'XTest',
128a5602400Smrgwith the rest of the name in upper case letters.
129a5602400Smrg    </para>
130a5602400Smrg  </listitem>
131a5602400Smrg  <listitem>
132a5602400Smrg    <para>
133a5602400SmrgAll constants and structures defined in this extension will have their
134a5602400Smrgvalues specified in the 'xtestext1.h' file (listed in section 5).
135a5602400Smrg    </para>
136a5602400Smrg  </listitem>
137a5602400Smrg</itemizedlist>
138a5602400Smrg
139a5602400Smrg</sect1>
140a5602400Smrg<sect1 id="definition_of_terms">
141a5602400Smrg<title>Definition Of Terms</title>
142a5602400Smrg
143a5602400Smrg<sect2 id="input_actions">
144a5602400Smrg<title>Input Actions</title>
145a5602400Smrg<para>
146a5602400SmrgInput actions are pointer movements, button presses and releases,
147a5602400Smrgand key presses and releases.  They can be generated by a user or by a client
148a5602400Smrg(using functions in this extension).
149a5602400Smrg</para>
150a5602400Smrg</sect2>
151a5602400Smrg
152a5602400Smrg<sect2 id="user_input_actions">
153a5602400Smrg<title>User Input Actions</title>
154a5602400Smrg<para>
155a5602400SmrgUser input actions are input actions that are generated by the user
156a5602400Smrgmoving a pointing device (typically a mouse), pressing and releasing buttons on
157a5602400Smrgthe pointing device, and pressing and releasing keys on the keyboard.
158a5602400Smrg</para>
159a5602400Smrg</sect2>
160a5602400Smrg
161a5602400Smrg</sect1>
162a5602400Smrg
163a5602400Smrg<sect1 id="what_does_this_extension_do">
164a5602400Smrg<title>What Does This Extension Do?</title>
165a5602400Smrg<para>
166a5602400SmrgWithout this extension, user input actions are processed by the server,
167a5602400Smrgand are converted into normal X events that are sent to the
168a5602400Smrgappropriate client or clients.
169a5602400Smrg</para>
170a5602400Smrg
171a5602400Smrg<para>
172a5602400SmrgThis extension adds the following capabilities:
173a5602400Smrg</para>
174a5602400Smrg
175a5602400Smrg<itemizedlist>
176a5602400Smrg  <listitem>
177a5602400Smrg    <para>
178a5602400SmrgInput actions may be sent from a client to the server to be
179a5602400Smrgprocessed just as if the user had physically performed them.
180a5602400SmrgThe input actions are provided to the server in the form of X protocol
181a5602400Smrgrequests defined by this extension.
182a5602400SmrgThe information provided to the server includes what action should be
183a5602400Smrgperformed, and how long to delay before processing the action in the server.
184a5602400Smrg    </para>
185a5602400Smrg  </listitem>
186a5602400Smrg  <listitem>
187a5602400Smrg    <para>
188a5602400SmrgUser input actions may be diverted to a client before being processed by the
189a5602400Smrgserver.
190a5602400SmrgThe effect on the server is as if the user had performed no input action.
191a5602400SmrgThe user input actions are provided to the client in the form of X events
192a5602400Smrgdefined by this extension.
193a5602400SmrgThe information provided to the client includes what user input action
194a5602400Smrgoccurred and the delay between this user input action and the previous user
195a5602400Smrginput action.
196a5602400SmrgThe client may then do anything it wishes with this information.
197a5602400Smrg    </para>
198a5602400Smrg  </listitem>
199a5602400Smrg  <listitem>
200a5602400Smrg    <para>
201a5602400SmrgUser input actions may be copied, with one copy going to the server in the
202a5602400Smrgnormal way, and the other copy being sent to a client as described above.
203a5602400Smrg    </para>
204a5602400Smrg  </listitem>
205a5602400Smrg</itemizedlist>
206a5602400Smrg
207a5602400Smrg</sect1>
208a5602400Smrg<sect1 id="functions_in_this_extension">
209a5602400Smrg<title>Functions In This Extension</title>
210a5602400Smrg
211a5602400Smrg<sect2 id="high_level_functions">
212a5602400Smrg<title>High Level Functions</title>
213a5602400Smrg
214a5602400Smrg<para>
215a5602400SmrgThese functions are built on top of the low level functions described later.
216a5602400Smrg</para>
217a5602400Smrg
218a5602400Smrg<sect3 id="xtestmovepointer">
219a5602400Smrg<title>XTestMovePointer</title>
220a5602400Smrg
221a5602400Smrg<funcsynopsis>
222a5602400Smrg<funcprototype>
223a5602400Smrg  <funcdef>int <function>XTestMovePointer</function></funcdef>
224a5602400Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
225a5602400Smrg    <paramdef>int <parameter>device_id</parameter></paramdef>
226a5602400Smrg    <paramdef>unsigned long <parameter>delay</parameter></paramdef>
227a5602400Smrg    <paramdef>int <parameter>x</parameter></paramdef>
228a5602400Smrg    <paramdef>int <parameter>y</parameter></paramdef>
229a5602400Smrg    <paramdef>unsigned int <parameter>count</parameter></paramdef>
230a5602400Smrg</funcprototype>
231a5602400Smrg</funcsynopsis>
232a5602400Smrg
233a5602400Smrg<variablelist>
234a5602400Smrg  <varlistentry>
235a5602400Smrg    <term>display</term>
236a5602400Smrg    <listitem>
237a5602400Smrg      <para>
238a5602400SmrgSpecifies the connection to the X server.
239a5602400Smrg      </para>
240a5602400Smrg    </listitem>
241a5602400Smrg  </varlistentry>
242a5602400Smrg  <varlistentry>
243a5602400Smrg    <term>device_id</term>
244a5602400Smrg    <listitem>
245a5602400Smrg      <para>
246a5602400SmrgSpecifies which pointer device was supposed to have caused the input action.
247a5602400SmrgThis is a provision for future support of multiple (distinguishable) pointer
248a5602400Smrgdevices, and should always be set to 0 for now.
249a5602400Smrg      </para>
250a5602400Smrg    </listitem>
251a5602400Smrg  </varlistentry>
252a5602400Smrg  <varlistentry>
253a5602400Smrg    <term>delay</term>
254a5602400Smrg    <listitem>
255a5602400Smrg      <para>
256a5602400SmrgSpecifies the time (in milliseconds) to wait before each movement
257a5602400Smrgof the pointer.
258a5602400Smrg      </para>
259a5602400Smrg    </listitem>
260a5602400Smrg  </varlistentry>
261a5602400Smrg  <varlistentry>
262a5602400Smrg    <term>x, y</term>
263a5602400Smrg    <listitem>
264a5602400Smrg      <para>
265a5602400SmrgSpecifies the x and y coordinates to move the pointer to relative to the
266a5602400Smrgroot window for the specified display.
267a5602400Smrg      </para>
268a5602400Smrg    </listitem>
269a5602400Smrg  </varlistentry>
270a5602400Smrg  <varlistentry>
271a5602400Smrg    <term>count</term>
272a5602400Smrg    <listitem>
273a5602400Smrg      <para>
274a5602400SmrgSpecifies the number of 'delay, x, y' triplets contained in the
275a5602400Smrg<emphasis>delay</emphasis>,
276a5602400Smrg<emphasis>x</emphasis> and
277a5602400Smrg<emphasis>y</emphasis> arrays.
278a5602400Smrg      </para>
279a5602400Smrg    </listitem>
280a5602400Smrg  </varlistentry>
281a5602400Smrg</variablelist>
282a5602400Smrg
283a5602400Smrg<para>
284a5602400SmrgThe
285a5602400Smrg<function>XTestMovePointer</function>
286a5602400Smrgfunction creates input actions to be sent to the the server.
287a5602400SmrgThe input actions will be accumulated in a request defined by this extension
288a5602400Smrguntil the request is full or the XTestFlush function is called.
289a5602400SmrgThey will then be sent to the server.
290a5602400SmrgWhen the input actions are sent to the server, the input actions will cause
291a5602400Smrgthe server to think that the pointer was moved to the specified position(s),
292a5602400Smrgwith the specified delay before each input action.
293a5602400Smrg</para>
294a5602400Smrg<para>
295a5602400SmrgThe
296a5602400Smrg<function>XTestMovePointer</function>
297a5602400Smrgfunction will return -1 if there is an error, and 0 otherwise.
298a5602400Smrg</para>
299a5602400Smrg</sect3>
300a5602400Smrg
301a5602400Smrg<sect3 id="xtestpressbutton">
302a5602400Smrg<title>XTestPressButton</title>
303a5602400Smrg
304a5602400Smrg<funcsynopsis>
305a5602400Smrg<funcprototype>
306a5602400Smrg  <funcdef>int <function>XTestPressButton</function></funcdef>
307a5602400Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
308a5602400Smrg    <paramdef>int <parameter>device_id</parameter></paramdef>
309a5602400Smrg    <paramdef>unsigned long <parameter>delay</parameter></paramdef>
310a5602400Smrg    <paramdef>unsigned int <parameter>button_number</parameter></paramdef>
311a5602400Smrg    <paramdef>unsigned int <parameter>button_action</parameter></paramdef>
312a5602400Smrg</funcprototype>
313a5602400Smrg</funcsynopsis>
314a5602400Smrg
315a5602400Smrg
316a5602400Smrg<!-- .VL 15 -->
317a5602400Smrg<variablelist>
318a5602400Smrg  <varlistentry>
319a5602400Smrg    <term>display</term>
320a5602400Smrg    <listitem>
321a5602400Smrg      <para>
322a5602400SmrgSpecifies the connection to the X server.
323a5602400Smrg      </para>
324a5602400Smrg    </listitem>
325a5602400Smrg  </varlistentry>
326a5602400Smrg  <varlistentry>
327a5602400Smrg    <term>device_id</term>
328a5602400Smrg    <listitem>
329a5602400Smrg      <para>
330a5602400SmrgSpecifies which button device was supposed to have caused the input action.
331a5602400SmrgThis is a provision for future support of multiple (distinguishable) button
332a5602400Smrgdevices, and should always be set to 0 for now.
333a5602400Smrg      </para>
334a5602400Smrg    </listitem>
335a5602400Smrg  </varlistentry>
336a5602400Smrg  <varlistentry>
337a5602400Smrg    <term>delay</term>
338a5602400Smrg    <listitem>
339a5602400Smrg      <para>
340a5602400SmrgSpecifies the time (in milliseconds) to wait before the input action.
341a5602400Smrg      </para>
342a5602400Smrg    </listitem>
343a5602400Smrg  </varlistentry>
344a5602400Smrg  <varlistentry>
345a5602400Smrg    <term>button_number</term>
346a5602400Smrg    <listitem>
347a5602400Smrg      <para>
348a5602400SmrgSpecifies which button is being acted upon.
349a5602400Smrg      </para>
350a5602400Smrg    </listitem>
351a5602400Smrg  </varlistentry>
352a5602400Smrg  <varlistentry>
353a5602400Smrg    <term>button_action</term>
354a5602400Smrg    <listitem>
355a5602400Smrg      <para>
356a5602400SmrgSpecifies the action to be performed (one of
357a5602400Smrg<emphasis>XTestPRESS</emphasis>,
358a5602400Smrg<emphasis>XTestRELEASE</emphasis>, or
359a5602400Smrg<emphasis>XTestSTROKE</emphasis>).
360a5602400Smrg      </para>
361a5602400Smrg    </listitem>
362a5602400Smrg  </varlistentry>
363a5602400Smrg</variablelist>
364a5602400Smrg
365a5602400Smrg<para>
366a5602400SmrgThe
367a5602400Smrg<function>XTestPressButton</function>
368a5602400Smrgfunction creates input actions to be sent to the the server.
369a5602400SmrgThe input actions will be accumulated in a request defined by this extension
370a5602400Smrguntil the request is full or the XTestFlush function is called.
371a5602400SmrgThey will then be sent to the server.
372a5602400SmrgWhen the input actions are sent to the server, the input actions will cause
373a5602400Smrgthe server to think that the specified button was moved as specified.
374a5602400Smrg</para>
375a5602400Smrg<para>
376a5602400SmrgThe
377a5602400Smrg<function>XTestPressButton</function>
378a5602400Smrgfunction will return -1 if there is an error, and 0 otherwise.
379a5602400Smrg</para>
380a5602400Smrg</sect3>
381a5602400Smrg
382a5602400Smrg<sect3 id="xtestpresskey">
383a5602400Smrg<title>XTestPressKey</title>
384a5602400Smrg
385a5602400Smrg<funcsynopsis>
386a5602400Smrg<funcprototype>
387a5602400Smrg  <funcdef>int <function>XTestPressKey</function></funcdef>
388a5602400Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
389a5602400Smrg    <paramdef>int <parameter>device_id</parameter></paramdef>
390a5602400Smrg    <paramdef>unsigned long <parameter>delay</parameter></paramdef>
391a5602400Smrg    <paramdef>unsigned int <parameter>keycode</parameter></paramdef>
392a5602400Smrg    <paramdef>unsigned int <parameter>key_action</parameter></paramdef>
393a5602400Smrg</funcprototype>
394a5602400Smrg</funcsynopsis>
395a5602400Smrg
396a5602400Smrg<!-- .VL 12 -->
397a5602400Smrg<variablelist>
398a5602400Smrg  <varlistentry>
399a5602400Smrg    <term>display</term>
400a5602400Smrg    <listitem>
401a5602400Smrg      <para>
402a5602400SmrgSpecifies the connection to the X server.
403a5602400Smrg      </para>
404a5602400Smrg    </listitem>
405a5602400Smrg  </varlistentry>
406a5602400Smrg  <varlistentry>
407a5602400Smrg    <term>device_id</term>
408a5602400Smrg    <listitem>
409a5602400Smrg      <para>
410a5602400SmrgSpecifies which keyboard device was supposed to have caused the input action.
411a5602400SmrgThis is a provision for future support of multiple (distinguishable) keyboard
412a5602400Smrgdevices, and should always be set to 0 for now.
413a5602400Smrg      </para>
414a5602400Smrg    </listitem>
415a5602400Smrg  </varlistentry>
416a5602400Smrg  <varlistentry>
417a5602400Smrg    <term>delay</term>
418a5602400Smrg    <listitem>
419a5602400Smrg      <para>
420a5602400SmrgSpecifies the time (in milliseconds) to wait before the input action.
421a5602400Smrg      </para>
422a5602400Smrg    </listitem>
423a5602400Smrg  </varlistentry>
424a5602400Smrg  <varlistentry>
425a5602400Smrg    <term>keycode</term>
426a5602400Smrg    <listitem>
427a5602400Smrg      <para>
428a5602400SmrgSpecifies which keycode is being acted upon.
429a5602400Smrg      </para>
430a5602400Smrg    </listitem>
431a5602400Smrg  </varlistentry>
432a5602400Smrg  <varlistentry>
433a5602400Smrg    <term>key_action</term>
434a5602400Smrg    <listitem>
435a5602400Smrg      <para>
436a5602400SmrgSpecifies the action to be performed (one of
437a5602400Smrg<emphasis>XTestPRESS</emphasis>,
438a5602400Smrg<emphasis>XTestRELEASE</emphasis>, or
439a5602400Smrg<emphasis>XTestSTROKE</emphasis>).
440a5602400Smrg      </para>
441a5602400Smrg    </listitem>
442a5602400Smrg  </varlistentry>
443a5602400Smrg</variablelist>
444a5602400Smrg
445a5602400Smrg
446a5602400Smrg<para>
447a5602400SmrgThe
448a5602400Smrg<function>XTestPressKey</function>
449a5602400Smrgfunction creates input actions to be sent to the the server.
450a5602400SmrgThe input actions will be accumulated in a request defined by this extension
451a5602400Smrguntil the request is full or the XTestFlush function is called.
452a5602400SmrgThey will then be sent to the server.
453a5602400SmrgWhen the input actions are sent to the server, the input actions will cause
454a5602400Smrgthe server to think that the specified key on the keyboard was moved as
455a5602400Smrgspecified.
456a5602400Smrg</para>
457a5602400Smrg
458a5602400Smrg<para>
459a5602400SmrgThe
460a5602400Smrg<function>XTestPressKey</function>
461a5602400Smrgfunction will return -1 if there is an error, and 0 otherwise.
462a5602400Smrg</para>
463a5602400Smrg
464a5602400Smrg</sect3>
465a5602400Smrg<sect3 id="xtestflush">
466a5602400Smrg<title>XTestFlush</title>
467a5602400Smrg
468a5602400Smrg<funcsynopsis>
469a5602400Smrg<funcprototype>
470a5602400Smrg  <funcdef>int <function>XTestFlush</function></funcdef>
471a5602400Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
472a5602400Smrg</funcprototype>
473a5602400Smrg</funcsynopsis>
474a5602400Smrg
475a5602400Smrg<!-- .VL 9 -->
476a5602400Smrg<variablelist>
477a5602400Smrg  <varlistentry>
478a5602400Smrg    <term>display</term>
479a5602400Smrg    <listitem>
480a5602400Smrg      <para>
481a5602400SmrgSpecifies the connection to the X server.
482a5602400Smrg      </para>
483a5602400Smrg    </listitem>
484a5602400Smrg  </varlistentry>
485a5602400Smrg</variablelist>
486a5602400Smrg
487a5602400Smrg<para>
488a5602400SmrgThe
489a5602400Smrg<function>XTestFlush</function>
490a5602400Smrgwill send any remaining input actions to the server.
491a5602400Smrg</para>
492a5602400Smrg
493a5602400Smrg<para>
494a5602400SmrgThe
495a5602400Smrg<function>XTestFlush</function>
496a5602400Smrgfunction will return -1 if there is an error, and 0 otherwise.
497a5602400Smrg</para>
498a5602400Smrg
499a5602400Smrg</sect3>
500a5602400Smrg</sect2>
501a5602400Smrg
502a5602400Smrg<!-- .H 2 Low~Level~Functions -->
503a5602400Smrg<sect2 id="low_level_functions">
504a5602400Smrg<title>Low Level Functions</title>
505a5602400Smrg
506a5602400Smrg<!-- .H 3 XTestGetInput -->
507a5602400Smrg<sect3 id="xtestgetinput">
508a5602400Smrg<title>XTestGetInput</title>
509a5602400Smrg
510a5602400Smrg<funcsynopsis>
511a5602400Smrg<funcprototype>
512a5602400Smrg  <funcdef>int <function>XTestGetInput</function></funcdef>
513a5602400Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
514a5602400Smrg    <paramdef>int <parameter>action_handling</parameter></paramdef>
515a5602400Smrg</funcprototype>
516a5602400Smrg</funcsynopsis>
517a5602400Smrg
518a5602400Smrg
519a5602400Smrg<variablelist>
520a5602400Smrg  <varlistentry>
521a5602400Smrg    <term>display</term>
522a5602400Smrg    <listitem>
523a5602400Smrg      <para>
524a5602400SmrgSpecifies the connection to the X server.
525a5602400Smrg      </para>
526a5602400Smrg    </listitem>
527a5602400Smrg  </varlistentry>
528a5602400Smrg  <varlistentry>
529a5602400Smrg    <term>action_handling</term>
530a5602400Smrg    <listitem>
531a5602400Smrg      <para>
532a5602400SmrgSpecifies to the server what to do with the user input actions.  (one of
533a5602400Smrg0, <emphasis>XTestPACKED_MOTION</emphasis> or
534a5602400Smrg<emphasis>XTestPACKED_ACTIONS</emphasis>; optionally 'or'ed
535a5602400Smrgwith <emphasis>XTestEXCLUSIVE</emphasis>).
536a5602400Smrg      </para>
537a5602400Smrg    </listitem>
538a5602400Smrg  </varlistentry>
539a5602400Smrg</variablelist>
540a5602400Smrg
541a5602400Smrg
542a5602400Smrg<para>
543a5602400SmrgThe
544a5602400Smrg<function>XTestGetInput</function>
545a5602400Smrgfunction tells the server to begin putting information about user input actions
546a5602400Smrginto events to be sent to the client that called this function.  These events
547a5602400Smrgcan be read via the Xlib <function>XNextEvent</function>fR function.
548a5602400Smrg</para>
549a5602400Smrg
550a5602400Smrg<para>
551a5602400SmrgThe server assigns an event type of
552a5602400Smrg<emphasis>XTestInputActionType</emphasis> to these events
553a5602400Smrgto distinguish them from other events.
554a5602400SmrgSince the actual value of the event type may vary depending on how many
555a5602400Smrgextensions are included with an X11 implementation,
556a5602400Smrg<emphasis>XTestInputActionType</emphasis> is a variable that will be
557a5602400Smrgcontained in the Xlib
558a5602400Smrgpart of this extension.  It may be referenced as follows:
559a5602400Smrg</para>
560a5602400Smrg
561a5602400Smrg<para>
562a5602400Smrgextern int XTestInputActionType;
563a5602400Smrg</para>
564a5602400Smrg
565a5602400Smrg<itemizedlist>
566a5602400Smrg  <listitem>
567a5602400Smrg    <para>
568a5602400SmrgAn <emphasis>action_handling</emphasis> value of 0 causes the server
569a5602400Smrgto send one user input action in each
570a5602400Smrg<emphasis>XTestInputActionType</emphasis> event.
571a5602400SmrgThis can sometimes cause performance problems.
572a5602400Smrg    </para>
573a5602400Smrg  </listitem>
574a5602400Smrg  <listitem>
575a5602400Smrg    <para>
576a5602400SmrgAn <emphasis>action_handling</emphasis> value of
577a5602400Smrg<emphasis>XTestPACKED_ACTIONS</emphasis> causes the server
578a5602400Smrgto pack as many user input actions as possible into a
579a5602400Smrg<emphasis>XTestInputActionType</emphasis> event.
580a5602400SmrgThis is needed if user input actions are happening rapidly (such as
581a5602400Smrgwhen the user moves the pointer) to keep performance at a reasonable level.
582a5602400Smrg    </para>
583a5602400Smrg  </listitem>
584a5602400Smrg  <listitem>
585a5602400Smrg    <para>
586a5602400SmrgAn <emphasis>action_handling</emphasis> value of
587a5602400Smrg<emphasis>XTestPACKED_MOTION</emphasis> causes the server
588a5602400Smrgto pack only user input actions associated with moving the pointer.
589a5602400SmrgThis allows the
590a5602400Smrgclient to receive button and key motions as they happen without waiting for the
591a5602400Smrgevent to fill up, while still keeping performance at a reasonable level.
592a5602400Smrg    </para>
593a5602400Smrg  </listitem>
594a5602400Smrg  <listitem>
595a5602400Smrg    <para>
596a5602400SmrgAn <emphasis>action_handling</emphasis> value with
597a5602400Smrg<emphasis>XTestEXCLUSIVE</emphasis> 'or'ed in
598a5602400Smrgcauses the server to send user input actions only to the client.
599a5602400SmrgThe effect on the server is as if the user had performed no input actions.
600a5602400Smrg    </para>
601a5602400Smrg  </listitem>
602a5602400Smrg  <listitem>
603a5602400Smrg    <para>
604a5602400SmrgAn <emphasis>action_handling</emphasis> value without
605a5602400Smrg<emphasis>XTestEXCLUSIVE</emphasis>
606a5602400Smrgcauses the server to copy user input actions, sending one copy to the
607a5602400Smrgclient, and handling the other copy normally (as it would if this extension
608a5602400Smrgwere not installed).
609a5602400Smrg    </para>
610a5602400Smrg  </listitem>
611a5602400Smrg</itemizedlist>
612a5602400Smrg
613a5602400Smrg<para>
614a5602400SmrgThere are four types of input actions that are passed from the server
615a5602400Smrgto the client.  They are:
616a5602400Smrg</para>
617a5602400Smrg
618a5602400Smrg<variablelist>
619a5602400Smrg  <varlistentry>
620a5602400Smrg    <term>key/button~state~change</term>
621a5602400Smrg    <listitem>
622a5602400Smrg      <para>
623a5602400SmrgThis type of input action contains the keycode of the key or button that
624a5602400Smrgchanged state;
625a5602400Smrgwhether the key or button is up or down,
626a5602400Smrgand the time delay between this input action and the previous input action.
627a5602400Smrg      </para>
628a5602400Smrg    </listitem>
629a5602400Smrg  </varlistentry>
630a5602400Smrg  <varlistentry>
631a5602400Smrg    <term>pointer~motions</term>
632a5602400Smrg    <listitem>
633a5602400Smrg      <para>
634a5602400SmrgThis type of input action contains information about the motion of the
635a5602400Smrgpointer when the pointer has only moved a short distance.
636a5602400SmrgIf the pointer has moved a long distance,
637a5602400Smrgthe pointer jump input action is used.
638a5602400Smrg      </para>
639a5602400Smrg    </listitem>
640a5602400Smrg  </varlistentry>
641a5602400Smrg  <varlistentry>
642a5602400Smrg    <term>pointer~jumps</term>
643a5602400Smrg    <listitem>
644a5602400Smrg      <para>
645a5602400SmrgThis type of input action contains information about the motion of the
646a5602400Smrgpointer when the pointer has moved a long distance.
647a5602400Smrg      </para>
648a5602400Smrg    </listitem>
649a5602400Smrg  </varlistentry>
650a5602400Smrg  <varlistentry>
651a5602400Smrg    <term>delays</term>
652a5602400Smrg    <listitem>
653a5602400Smrg      <para>
654a5602400SmrgThis type of input action is used when the delay between input actions is too
655a5602400Smrglarge to be held in the other input actions.
656a5602400Smrg      </para>
657a5602400Smrg    </listitem>
658a5602400Smrg  </varlistentry>
659a5602400Smrg</variablelist>
660a5602400Smrg
661a5602400Smrg<para>
662a5602400SmrgThe
663a5602400Smrg<function>XTestGetInput</function>
664a5602400Smrgfunction will return -1 if there is an error, and 0 otherwise.
665a5602400Smrg</para>
666a5602400Smrg<para>
667a5602400SmrgAn error code of <emphasis>BadAccess</emphasis> means that another client
668a5602400Smrghas already requested that user input actions be sent to it.
669a5602400Smrg</para>
670a5602400Smrg
671a5602400Smrg</sect3>
672a5602400Smrg
673a5602400Smrg<!-- .H 3 XTestStopInput -->
674a5602400Smrg<sect3 id="xteststopinput">
675a5602400Smrg<title>XTestStopInput</title>
676a5602400Smrg
677a5602400Smrg<funcsynopsis>
678a5602400Smrg<funcprototype>
679a5602400Smrg  <funcdef>int <function>XTestStopInput</function></funcdef>
680a5602400Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
681a5602400Smrg</funcprototype>
682a5602400Smrg</funcsynopsis>
683a5602400Smrg
684a5602400Smrg
685a5602400Smrg
686a5602400Smrg<variablelist>
687a5602400Smrg  <varlistentry>
688a5602400Smrg    <term>display</term>
689a5602400Smrg    <listitem>
690a5602400Smrg      <para>
691a5602400SmrgSpecifies the connection to the X server.
692a5602400Smrg      </para>
693a5602400Smrg    </listitem>
694a5602400Smrg  </varlistentry>
695a5602400Smrg</variablelist>
696a5602400Smrg
697a5602400Smrg<para>
698a5602400SmrgThe
699a5602400Smrg<function>XTestStopInput</function>
700a5602400Smrgfunction tells the server to stop putting information about user input actions
701a5602400Smrginto events.
702a5602400SmrgThe server will process user input actions normally (as it would
703a5602400Smrgif this extension were not in the server).
704a5602400Smrg</para>
705a5602400Smrg
706a5602400Smrg<para>
707a5602400SmrgThe
708a5602400Smrg<function>XTestStopInput</function>
709a5602400Smrgfunction will return -1 if there is an error, and 0 otherwise.
710a5602400Smrg</para>
711a5602400Smrg
712a5602400Smrg<para>
713a5602400SmrgAn error code of <emphasis>BadAccess</emphasis> means that a request
714a5602400Smrgwas made to stop input when input has never been started.
715a5602400Smrg</para>
716a5602400Smrg
717a5602400Smrg</sect3>
718a5602400Smrg
719a5602400Smrg<!-- .H 3 XTestFakeInput -->
720a5602400Smrg<sect3 id="xtestfakeinput">
721a5602400Smrg<title>XTestFakeInput</title>
722a5602400Smrg
723a5602400Smrg<funcsynopsis>
724a5602400Smrg<funcprototype>
725a5602400Smrg  <funcdef>int <function>XTestFakeInput</function></funcdef>
726a5602400Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
727a5602400Smrg    <paramdef>char <parameter>*action_list_addr</parameter></paramdef>
728a5602400Smrg    <paramdef>int <parameter>action_list_size</parameter></paramdef>
729a5602400Smrg    <paramdef>int <parameter>ack_flag</parameter></paramdef>
730a5602400Smrg</funcprototype>
731a5602400Smrg</funcsynopsis>
732a5602400Smrg
733a5602400Smrg
734a5602400Smrg<!-- .VL 18 -->
735a5602400Smrg
736a5602400Smrg<variablelist>
737a5602400Smrg  <varlistentry>
738a5602400Smrg    <term>display</term>
739a5602400Smrg    <listitem>
740a5602400Smrg      <para>
741a5602400SmrgSpecifies the connection to the X server.
742a5602400Smrg      </para>
743a5602400Smrg    </listitem>
744a5602400Smrg  </varlistentry>
745a5602400Smrg  <varlistentry>
746a5602400Smrg    <term>action_list_addr</term>
747a5602400Smrg    <listitem>
748a5602400Smrg      <para>
749a5602400SmrgSpecifies the address of an list of input actions to be sent to the server.
750a5602400Smrg      </para>
751a5602400Smrg    </listitem>
752a5602400Smrg  </varlistentry>
753a5602400Smrg  <varlistentry>
754a5602400Smrg    <term>action_list_size</term>
755a5602400Smrg    <listitem>
756a5602400Smrg      <para>
757a5602400SmrgSpecifies the size (in bytes) of the list of input actions.
758a5602400SmrgIt may be no larger than <emphasis>XTestMAX_ACTION_LIST_SIZE</emphasis> bytes.
759a5602400Smrg      </para>
760a5602400Smrg    </listitem>
761a5602400Smrg  </varlistentry>
762a5602400Smrg  <varlistentry>
763a5602400Smrg    <term>ack_flag</term>
764a5602400Smrg    <listitem>
765a5602400Smrg      <para>
766a5602400SmrgSpecifies whether the server needs to send an event to indicate that its
767a5602400Smrginput action buffer is empty (one of
768a5602400Smrg<emphasis>XTestFAKE_ACK_NOT_NEEDED</emphasis> or
769a5602400Smrg<emphasis>XTestFAKE_ACK_REQUEST</emphasis>).
770a5602400Smrg      </para>
771a5602400Smrg    </listitem>
772a5602400Smrg  </varlistentry>
773a5602400Smrg</variablelist>
774a5602400Smrg
775a5602400Smrg<para>
776a5602400SmrgThe
777a5602400Smrg<function>XTestFakeInput</function>
778a5602400Smrgfunction tells the server to take the specified user input actions and process
779a5602400Smrgthem as if the user had physically performed them.
780a5602400Smrg</para>
781a5602400Smrg
782a5602400Smrg<para>
783a5602400SmrgThe server can only accept a limited number of input actions at one
784a5602400Smrgtime.  This limit can be determined by the
785a5602400Smrg<function>XTestQueryInputSize</function> function
786a5602400Smrgin this extension.
787a5602400Smrg</para>
788a5602400Smrg
789a5602400Smrg<para>
790a5602400SmrgThe client should set <emphasis>ack_flag</emphasis> to
791a5602400Smrg<emphasis>XTestFAKE_ACK_NOT_NEEDED</emphasis>
792a5602400Smrgon calls to <emphasis>XTestFakeInput</emphasis> that do not reach this limit.
793a5602400Smrg</para>
794a5602400Smrg
795a5602400Smrg<para>
796a5602400SmrgThe client should set <emphasis>ack_flag</emphasis> to
797a5602400Smrg<emphasis>XTestFAKE_ACK_REQUEST</emphasis>
798a5602400Smrgon the call to <emphasis>XTestFakeInput</emphasis> that reaches this limit.
799a5602400Smrg</para>
800a5602400Smrg
801a5602400Smrg<para>
802a5602400SmrgWhen the server sees an <emphasis>ack_flag</emphasis> value of
803a5602400Smrg<emphasis>XTestFAKE_ACK_REQUEST</emphasis>
804a5602400Smrgit finishes processing its input action buffer, then sends an event with
805a5602400Smrgtype <emphasis>XTestFakeAckType</emphasis> to the client.
806a5602400SmrgWhen the client reads this event, it knows that it is safe to resume
807a5602400Smrgsending input actions to the server.
808a5602400Smrg</para>
809a5602400Smrg
810a5602400Smrg<para>
811a5602400SmrgSince the actual value of the event type may vary depending on how many
812a5602400Smrgextensions are included with an X11 implementation,
813a5602400Smrg<emphasis>XTestFakeAckType</emphasis> is a variable that is contained
814a5602400Smrgin the Xlib part of this extension.  It may be referenced as follows:
815a5602400Smrg</para>
816a5602400Smrg
817a5602400Smrg<para>
818a5602400Smrgextern int XTestFakeAckType;
819a5602400Smrg</para>
820a5602400Smrg
821a5602400Smrg<para>
822a5602400SmrgThere are four types of input actions that are passed from the client
823a5602400Smrgto the server.  They are:
824a5602400Smrg</para>
825a5602400Smrg
826a5602400Smrg<variablelist>
827a5602400Smrg  <varlistentry>
828a5602400Smrg    <term>key/button~state~change</term>
829a5602400Smrg    <listitem>
830a5602400Smrg      <para>
831a5602400SmrgThis type of input action contains the keycode of the key or button that
832a5602400Smrgis to change state;
833a5602400Smrgwhether the key or button is to be up or down,
834a5602400Smrgand the time to delay before changing the state of the key or button.
835a5602400Smrg      </para>
836a5602400Smrg    </listitem>
837a5602400Smrg  </varlistentry>
838a5602400Smrg  <varlistentry>
839a5602400Smrg    <term>pointer~motions</term>
840a5602400Smrg    <listitem>
841a5602400Smrg      <para>
842a5602400SmrgThis type of input action contains information about the motion of the
843a5602400Smrgpointer when the pointer is to be moved a short distance,
844a5602400Smrgand the time to delay before moving the pointer.
845a5602400SmrgIf the pointer is to be moved a long distance,
846a5602400Smrgthe pointer jump input action must be used.
847a5602400Smrg      </para>
848a5602400Smrg    </listitem>
849a5602400Smrg  </varlistentry>
850a5602400Smrg  <varlistentry>
851a5602400Smrg    <term>pointer~jumps</term>
852a5602400Smrg    <listitem>
853a5602400Smrg      <para>
854a5602400SmrgThis type of input action contains information about the motion of the
855a5602400Smrgpointer when the pointer is to be moved a long distance,
856a5602400Smrgand the time to delay before moving the pointer.
857a5602400Smrg      </para>
858a5602400Smrg    </listitem>
859a5602400Smrg  </varlistentry>
860a5602400Smrg  <varlistentry>
861a5602400Smrg    <term>delays</term>
862a5602400Smrg    <listitem>
863a5602400Smrg      <para>
864a5602400SmrgThis type of input action is used when the delay between input actions is too
865a5602400Smrglarge to be held in the other input actions.
866a5602400Smrg      </para>
867a5602400Smrg    </listitem>
868a5602400Smrg  </varlistentry>
869a5602400Smrg</variablelist>
870a5602400Smrg
871a5602400Smrg
872a5602400Smrg<para>
873a5602400SmrgThe
874a5602400Smrg<function>XTestFakeInput</function>
875a5602400Smrgfunction will return -1 if there is an error, and 0 otherwise.
876a5602400Smrg</para>
877a5602400Smrg
878a5602400Smrg<para>
879a5602400SmrgAn error code of \fIBadAccess\fR means that another client has already
880a5602400Smrgsent user input actions to the server, and the server has not finished
881a5602400Smrgprocessing the user input actions.
882a5602400Smrg</para>
883a5602400Smrg
884a5602400Smrg</sect3>
885a5602400Smrg
886a5602400Smrg<!-- .H 3 XTestQueryInputSize -->
887a5602400Smrg<sect3 id="xtestqueryinputsize">
888a5602400Smrg<title>XTestQueryInputSize</title>
889a5602400Smrg
890a5602400Smrg<funcsynopsis>
891a5602400Smrg<funcprototype>
892a5602400Smrg  <funcdef>int <function>XTestQueryInputSize</function></funcdef>
893a5602400Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
894a5602400Smrg    <paramdef>unsigned long <parameter>size_return</parameter></paramdef>
895a5602400Smrg</funcprototype>
896a5602400Smrg</funcsynopsis>
897a5602400Smrg
898a5602400Smrg
899a5602400Smrg<variablelist>
900a5602400Smrg  <varlistentry>
901a5602400Smrg    <term>display</term>
902a5602400Smrg    <listitem>
903a5602400Smrg      <para>
904a5602400SmrgSpecifies the connection to the X server.
905a5602400Smrg      </para>
906a5602400Smrg    </listitem>
907a5602400Smrg  </varlistentry>
908a5602400Smrg  <varlistentry>
909a5602400Smrg    <term>size_return</term>
910a5602400Smrg    <listitem>
911a5602400Smrg      <para>
912a5602400SmrgReturns the number of input actions that the server's input action buffer can
913a5602400Smrghold.
914a5602400Smrg      </para>
915a5602400Smrg    </listitem>
916a5602400Smrg  </varlistentry>
917a5602400Smrg</variablelist>
918a5602400Smrg
919a5602400Smrg<para>
920a5602400SmrgThe
921a5602400Smrg<function>XTestQueryInputSize</function>
922a5602400Smrgfunction asks the server to return the number of input actions that it can hold
923a5602400Smrgin its input action buffer in the unsigned long pointed to by \fIsize_return\fR.
924a5602400Smrg</para>
925a5602400Smrg<para>
926a5602400SmrgThe
927a5602400Smrg<function>XTestQueryInputSize</function>
928a5602400Smrgfunction will return -1 if there is an error, and 0 otherwise.
929a5602400Smrg</para>
930a5602400Smrg</sect3>
931a5602400Smrg
932a5602400Smrg<!-- .H 3 XTestReset -->
933a5602400Smrg<sect3 id="xtestreset">
934a5602400Smrg<title>XTestReset</title>
935a5602400Smrg
936a5602400Smrg<funcsynopsis>
937a5602400Smrg<funcprototype>
938a5602400Smrg  <funcdef>int <function>XTestReset</function></funcdef>
939a5602400Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
940a5602400Smrg</funcprototype>
941a5602400Smrg</funcsynopsis>
942a5602400Smrg
943a5602400Smrg
944a5602400Smrg<variablelist>
945a5602400Smrg  <varlistentry>
946a5602400Smrg    <term>display</term>
947a5602400Smrg    <listitem>
948a5602400Smrg      <para>
949a5602400SmrgSpecifies the connection to the X server.
950a5602400Smrg      </para>
951a5602400Smrg    </listitem>
952a5602400Smrg  </varlistentry>
953a5602400Smrg</variablelist>
954a5602400Smrg
955a5602400Smrg<para>
956a5602400SmrgThe
957a5602400Smrg<function>XTestReset</function>
958a5602400Smrgfunction tells the server to set everything having to do with this extension
959a5602400Smrgback to its initial state.  After this call the server will act as if this
960a5602400Smrgextension were not installed until one of the extension functions is called by
961a5602400Smrga client.  This function is not normally needed, but is included in case a
962a5602400Smrgclient wishes to clean up the server state, such as after a serious error.
963a5602400Smrg</para>
964a5602400Smrg
965a5602400Smrg<para>
966a5602400SmrgThe
967a5602400Smrg<function>XTestReset</function>
968a5602400Smrgfunction will return -1 if there is an error, and 0 otherwise.
969a5602400Smrg</para>
970a5602400Smrg
971a5602400Smrg</sect3>
972a5602400Smrg</sect2>
973a5602400Smrg</sect1>
974a5602400Smrg
975a5602400Smrg<!-- .H 1 'xtestext1.h'~File~Listing -->
976a5602400Smrg<!-- .so xtestext1.h -->
977a5602400Smrg<!-- .TC 1 1 4 -->
978a5602400Smrg</article>
979