1ea1d6981Smrg<?xml version="1.0" encoding="UTF-8" ?>
2ea1d6981Smrg<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3ea1d6981Smrg                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
4ea1d6981Smrg[
5ea1d6981Smrg<!ENTITY % defs SYSTEM "defs.ent"> %defs;
6ea1d6981Smrg]>
7ea1d6981Smrg
8ea1d6981Smrg<book id="xtest">
9ea1d6981Smrg
10ea1d6981Smrg<bookinfo>
11ea1d6981Smrg   <title>XTEST Extension Protocol</title>
12ea1d6981Smrg   <subtitle>X Consortium Standard</subtitle>
13ea1d6981Smrg   <authorgroup>
14ea1d6981Smrg      <author>
15ea1d6981Smrg         <firstname>Kieron</firstname><surname>Drake</surname>
16ea1d6981Smrg         <affiliation><orgname>UniSoft Ltd.</orgname></affiliation>
17ea1d6981Smrg      </author>
18ea1d6981Smrg   </authorgroup>
19ea1d6981Smrg   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
20ea1d6981Smrg   <releaseinfo>Version 2.2</releaseinfo>
21ea1d6981Smrg   <copyright><year>1992</year><holder>UniSoft Group Ltd.</holder></copyright>
22ea1d6981Smrg   <copyright><year>1992</year><year>1994</year><holder>X Consortium</holder></copyright>
23ea1d6981Smrg
24ea1d6981Smrg<legalnotice>
25ea1d6981Smrg<para>
26ea1d6981SmrgPermission to use, copy, modify, and distribute this documentation for any
27ea1d6981Smrgpurpose and without fee is hereby granted, provided that the above copyright
28ea1d6981Smrgnotice and this permission notice appear in all copies.  UniSoft makes no
29ea1d6981Smrgrepresentations about the suitability for any purpose of the information in
30ea1d6981Smrgthis document.  This documentation is provided "as is" without express or
31ea1d6981Smrgimplied warranty.
32ea1d6981Smrg</para>
33ea1d6981Smrg
34ea1d6981Smrg<para>
35ea1d6981SmrgPermission is hereby granted, free of charge, to any person obtaining a copy
36ea1d6981Smrgof this software and associated documentation files (the "Software"), to deal
37ea1d6981Smrgin the Software without restriction, including without limitation the rights
38ea1d6981Smrgto use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39ea1d6981Smrgcopies of the Software, and to permit persons to whom the Software is
40ea1d6981Smrgfurnished to do so, subject to the following conditions:
41ea1d6981Smrg</para>
42ea1d6981Smrg
43ea1d6981Smrg<para>
44ea1d6981SmrgThe above copyright notice and this permission notice shall be included in
45ea1d6981Smrgall copies or substantial portions of the Software.
46ea1d6981Smrg</para>
47ea1d6981Smrg
48ea1d6981Smrg<para>
49ea1d6981SmrgTHE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
50ea1d6981SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
51ea1d6981SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
52ea1d6981SmrgX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
53ea1d6981SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
54ea1d6981SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
55ea1d6981Smrg</para>
56ea1d6981Smrg
57ea1d6981Smrg<para>
58ea1d6981SmrgExcept as contained in this notice, the name of the X Consortium shall not be
59ea1d6981Smrgused in advertising or otherwise to promote the sale, use or other dealings
60ea1d6981Smrgin this Software without prior written authorization from the X Consortium.
61ea1d6981Smrg</para>
62ea1d6981Smrg</legalnotice>
63ea1d6981Smrg</bookinfo>
64ea1d6981Smrg
65ea1d6981Smrg
66ea1d6981Smrg<chapter id="Overview">
67ea1d6981Smrg<title>Overview</title>
68ea1d6981Smrg<para>
69ea1d6981SmrgThis extension is a minimal set of client and server extensions
70ea1d6981Smrgrequired to completely test the X11 server with no user intervention.
71ea1d6981Smrg</para>
72ea1d6981Smrg
73ea1d6981Smrg<para>
74ea1d6981SmrgThis extension is not intended to support general journaling and
75ea1d6981Smrgplayback of user actions.  This is a difficult area [XTrap, 89] as it attempts
76ea1d6981Smrgto synchronize synthetic user interactions with their effects; it is at the
77ea1d6981Smrghigher level of dialogue recording/playback rather than at the strictly lexical
78ea1d6981Smrglevel.  We are interested only in the latter, simpler, case.  A more detailed
79ea1d6981Smrgdiscussion and justification of the extension functionality is given in
80ea1d6981Smrg[Drake, 91].
81ea1d6981Smrg</para>
82ea1d6981Smrg
83ea1d6981Smrg<para>
84ea1d6981SmrgWe are aiming only to provide a minimum set of facilities that
85ea1d6981Smrgsolve immediate testing and validation problems.  The testing extension
86ea1d6981Smrgitself needs testing, where possible, and so should be as simple as possible.
87ea1d6981Smrg</para>
88ea1d6981Smrg
89ea1d6981Smrg<para>
90ea1d6981SmrgWe have also tried to:
91ea1d6981Smrg</para>
92ea1d6981Smrg
93ea1d6981Smrg<itemizedlist>
94ea1d6981Smrg  <listitem>
95ea1d6981Smrg    <para>
96ea1d6981SmrgConfine the extension to an appropriate high level within the server
97ea1d6981Smrgto minimize portability problems.  In practice this means that the extension
98ea1d6981Smrgshould be at the DIX level or use the DIX/DDX interface, or both.  This
99ea1d6981Smrghas effects, in particular, on the level at which "input synthesis"
100ea1d6981Smrgcan occur.
101ea1d6981Smrg    </para>
102ea1d6981Smrg  </listitem>
103ea1d6981Smrg  <listitem>
104ea1d6981Smrg    <para>
105ea1d6981SmrgMinimize the changes required in the rest of the server.
106ea1d6981Smrg    </para>
107ea1d6981Smrg  </listitem>
108ea1d6981Smrg  <listitem>
109ea1d6981Smrg    <para>
110ea1d6981SmrgMinimize performance penalties on normal server operation.
111ea1d6981Smrg    </para>
112ea1d6981Smrg  </listitem>
113ea1d6981Smrg</itemizedlist>
114ea1d6981Smrg</chapter>
115ea1d6981Smrg
116ea1d6981Smrg<chapter id="Description">
117ea1d6981Smrg<title>Description</title>
118ea1d6981Smrg<para>
119ea1d6981SmrgThe functions provided by this extension fall into two groups:
120ea1d6981Smrg</para>
121ea1d6981Smrg
122ea1d6981Smrg<variablelist>
123ea1d6981Smrg  <varlistentry>
124ea1d6981Smrg    <term>Client Operations</term>
125ea1d6981Smrg    <listitem>
126ea1d6981Smrg      <para>
127ea1d6981SmrgThese routines manipulate otherwise hidden client-side behavior.  The
128ea1d6981Smrgactual implementation will depend on the details of the actual language
129ea1d6981Smrgbinding and what degree of request buffering, GContext caching, and so on, is
130ea1d6981Smrgprovided.
131ea1d6981SmrgIn the C binding, defined in "XTEST Extension Library", routines are
132ea1d6981Smrgprovided to access the internals of two opaque data structures
133ea1d6981Smrg-- <function>GC</function>s
134ea1d6981Smrgand
135ea1d6981Smrg<function>Visual</function>s --
136ea1d6981Smrgand to discard any requests pending within the
137ea1d6981Smrgoutput buffer of a connection.  The exact details can be expected to differ for
138ea1d6981Smrgother language bindings.
139ea1d6981Smrg      </para>
140ea1d6981Smrg    </listitem>
141ea1d6981Smrg  </varlistentry>
142ea1d6981Smrg  <varlistentry>
143ea1d6981Smrg    <term>Server Requests</term>
144ea1d6981Smrg    <listitem>
145ea1d6981Smrg      <para>
146ea1d6981SmrgThe first of these requests is similar to that provided in most
147ea1d6981Smrgextensions: it allows a client to specify a major and minor version
148ea1d6981Smrgnumber to the server and for the server to respond with major and minor
149ea1d6981Smrgversions of its own.  The remaining two requests allow the following:
150ea1d6981Smrg<!-- .RS -->
151ea1d6981Smrg      </para>
152ea1d6981Smrg      <itemizedlist>
153ea1d6981Smrg        <listitem>
154ea1d6981Smrg          <para>
155ea1d6981SmrgAccess to an otherwise "write-only" server resource: the cursor
156ea1d6981Smrgassociated with a given window
157ea1d6981Smrg          </para>
158ea1d6981Smrg        </listitem>
159ea1d6981Smrg        <listitem>
160ea1d6981Smrg          <para>
161ea1d6981SmrgPerhaps most importantly, limited synthesis of input device events,
162ea1d6981Smrgalmost as if a cooperative user had moved the pointing device
163ea1d6981Smrgor pressed a key or button.
164ea1d6981Smrg          </para>
165ea1d6981Smrg        </listitem>
166ea1d6981Smrg      </itemizedlist>
167ea1d6981Smrg    </listitem>
168ea1d6981Smrg  </varlistentry>
169ea1d6981Smrg</variablelist>
170ea1d6981Smrg
171ea1d6981Smrg</chapter>
172ea1d6981Smrg
173ea1d6981Smrg<chapter id="Types">
174ea1d6981Smrg<title>Types</title>
175ea1d6981Smrg<para>
176ea1d6981SmrgThe following types are used in the request and event definitions in
177ea1d6981Smrgsubsequent sections:
178ea1d6981Smrg</para>
179ea1d6981Smrg
180ea1d6981Smrg<informaltable frame="none">
181ea1d6981Smrg  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
182ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
183ea1d6981Smrg  <colspec colname='c2' colwidth="3.0*"/>
184ea1d6981Smrg  <tbody>
185ea1d6981Smrg    <row>
186ea1d6981Smrg      <entry namest="c1" nameend="c2">
187ea1d6981SmrgFAKE_EVENT_TYPE
188ea1d6981Smrg{ <function>KeyPress</function>,
189ea1d6981Smrg<function>KeyRelease</function>,
190ea1d6981Smrg<function>MotionNotify</function>,
191ea1d6981Smrg<function>ButtonPress</function>,
192ea1d6981Smrg<function>ButtonRelease</function> }
193ea1d6981Smrg      </entry>
194ea1d6981Smrg    </row>
195ea1d6981Smrg    <row>
196ea1d6981Smrg      <entry></entry>
197ea1d6981Smrg    </row>
198ea1d6981Smrg    <row>
199ea1d6981Smrg      <entry>FAKE_EVENT</entry>
200ea1d6981Smrg      <entry>[type: FAKE_EVENT_TYPE,</entry>
201ea1d6981Smrg    </row>
202ea1d6981Smrg    <row>
203ea1d6981Smrg      <entry></entry>
204ea1d6981Smrg      <entry>detail: BYTE,</entry>
205ea1d6981Smrg    </row>
206ea1d6981Smrg    <row>
207ea1d6981Smrg      <entry></entry>
208ea1d6981Smrg      <entry>time: TIME,</entry>
209ea1d6981Smrg    </row>
210ea1d6981Smrg    <row>
211ea1d6981Smrg      <entry></entry>
212ea1d6981Smrg      <entry>root: WINDOW,</entry>
213ea1d6981Smrg    </row>
214ea1d6981Smrg    <row>
215ea1d6981Smrg      <entry></entry>
216ea1d6981Smrg      <entry>rootX, rootY: INT16]</entry>
217ea1d6981Smrg    </row>
218ea1d6981Smrg  </tbody>
219ea1d6981Smrg  </tgroup>
220ea1d6981Smrg</informaltable>
221ea1d6981Smrg
222ea1d6981Smrg<para>
223ea1d6981SmrgCURSOR { <function>CurrentCursor</function>, <function> None</function> }
224ea1d6981Smrgor a cursor as defined by the X11 Protocol.
225ea1d6981Smrg</para>
226ea1d6981Smrg
227ea1d6981Smrg</chapter>
228ea1d6981Smrg
229ea1d6981Smrg<chapter id="Client_Operations">
230ea1d6981Smrg<title>Client Operations</title>
231ea1d6981Smrg
232ea1d6981Smrg<para>
233ea1d6981SmrgThese are abstract definitions of functionality.  They refer to client-side
234ea1d6981Smrgobjects such as "GC" and "VISUAL" that are quoted to
235ea1d6981Smrgdenote their abstract nature.  Concrete versions of these functions are
236ea1d6981Smrgdefined only for particular language bindings.  In some circumstances
237ea1d6981Smrga particular language binding may not implement the relevant abstract
238ea1d6981Smrgtype or may provide it as a transparent, rather than opaque, type, with
239ea1d6981Smrgthe result that the corresponding function does not make sense or is
240ea1d6981Smrgnot required, respectively.
241ea1d6981Smrg</para>
242ea1d6981Smrg
243ea1d6981Smrg<para>
244ea1d6981Smrg<olink targetdoc='xtestlib' targetptr='XTestSetGContextOfGC'><function>XTestSetGContextOfGC</function></olink>
245ea1d6981Smrg</para>
246ea1d6981Smrg
247ea1d6981Smrg<informaltable frame="none">
248ea1d6981Smrg  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
249ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
250ea1d6981Smrg  <tbody>
251ea1d6981Smrg    <row>
252ea1d6981Smrg      <entry>
253ea1d6981Smrg<emphasis remap='I'>gc</emphasis>: "GC"
254ea1d6981Smrg      </entry>
255ea1d6981Smrg    </row>
256ea1d6981Smrg    <row>
257ea1d6981Smrg      <entry>
258ea1d6981Smrg<emphasis remap='I'>gid</emphasis>: GCONTEXT
259ea1d6981Smrg      </entry>
260ea1d6981Smrg    </row>
261ea1d6981Smrg  </tbody>
262ea1d6981Smrg  </tgroup>
263ea1d6981Smrg</informaltable>
264ea1d6981Smrg
265ea1d6981Smrg<para>
266ea1d6981SmrgSets the GCONTEXT within the "GC" gc to have
267ea1d6981Smrgthe value specified by gid.
268ea1d6981Smrg</para>
269ea1d6981Smrg
270ea1d6981Smrg<para>
271ea1d6981Smrg<olink targetdoc='xtestlib' targetptr='XTestSetVisualIDOfVisual'><function>XTestSetVisualIDOfVisual</function></olink>
272ea1d6981Smrg</para>
273ea1d6981Smrg
274ea1d6981Smrg<informaltable frame="none">
275ea1d6981Smrg  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
276ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
277ea1d6981Smrg  <tbody>
278ea1d6981Smrg    <row>
279ea1d6981Smrg      <entry>
280ea1d6981Smrg<emphasis remap='I'>visual</emphasis>: "VISUAL"
281ea1d6981Smrg      </entry>
282ea1d6981Smrg    </row>
283ea1d6981Smrg    <row>
284ea1d6981Smrg      <entry>
285ea1d6981Smrg<emphasis remap='I'>visualid</emphasis>: VISUALID
286ea1d6981Smrg      </entry>
287ea1d6981Smrg    </row>
288ea1d6981Smrg  </tbody>
289ea1d6981Smrg  </tgroup>
290ea1d6981Smrg</informaltable>
291ea1d6981Smrg
292ea1d6981Smrg<para>
293ea1d6981SmrgSets the VISUALID within the "VISUAL" visual to have
294ea1d6981Smrgthe value specified by visualid.
295ea1d6981Smrg</para>
296ea1d6981Smrg
297ea1d6981Smrg<para>
298ea1d6981Smrg<olink targetdoc='xtestlib' targetptr='XTestDiscard'><function>XTestDiscard</function></olink>
299ea1d6981Smrg</para>
300ea1d6981Smrg
301ea1d6981Smrg<informaltable frame="none">
302ea1d6981Smrg  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
303ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
304ea1d6981Smrg  <tbody>
305ea1d6981Smrg    <row>
306ea1d6981Smrg      <entry>
307ea1d6981Smrg<emphasis remap='I'>dpy</emphasis>: "CONNECTION"
308ea1d6981Smrg      </entry>
309ea1d6981Smrg    </row>
310ea1d6981Smrg    <row>
311ea1d6981Smrg      <entry>
312ea1d6981Smrg=&gt;
313ea1d6981Smrg      </entry>
314ea1d6981Smrg    </row>
315ea1d6981Smrg    <row>
316ea1d6981Smrg      <entry>
317ea1d6981Smrgstatus: BOOL
318ea1d6981Smrg      </entry>
319ea1d6981Smrg    </row>
320ea1d6981Smrg  </tbody>
321ea1d6981Smrg  </tgroup>
322ea1d6981Smrg</informaltable>
323ea1d6981Smrg
324ea1d6981Smrg<para>
325ea1d6981SmrgDiscards any requests that are present in the request buffer associated with
326ea1d6981Smrgthe "CONNECTION" dpy.
327ea1d6981SmrgThe status returned is
328ea1d6981Smrg<function>True</function>
329ea1d6981Smrgif there were one or more requests
330ea1d6981Smrgin the buffer and
331ea1d6981Smrg<function>False</function>
332ea1d6981Smrgotherwise.
333ea1d6981Smrg</para>
334ea1d6981Smrg</chapter>
335ea1d6981Smrg
336ea1d6981Smrg<chapter id="Server_Requests">
337ea1d6981Smrg<title>Server Requests</title>
338ea1d6981Smrg<para>
339ea1d6981Smrg<function>XTestGetVersion</function>
340ea1d6981Smrg</para>
341ea1d6981Smrg
342ea1d6981Smrg<informaltable frame="none">
343ea1d6981Smrg  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
344ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
345ea1d6981Smrg  <tbody>
346ea1d6981Smrg    <row>
347ea1d6981Smrg      <entry>
348ea1d6981Smrg<emphasis remap='I'>clientMajorVersion</emphasis>: CARD16
349ea1d6981Smrg      </entry>
350ea1d6981Smrg    </row>
351ea1d6981Smrg    <row>
352ea1d6981Smrg      <entry>
353ea1d6981Smrg<emphasis remap='I'>clientMinorVersion</emphasis>: CARD16
354ea1d6981Smrg      </entry>
355ea1d6981Smrg    </row>
356ea1d6981Smrg    <row>
357ea1d6981Smrg      <entry>
358ea1d6981Smrg   =&gt;
359ea1d6981Smrg      </entry>
360ea1d6981Smrg    </row>
361ea1d6981Smrg    <row>
362ea1d6981Smrg      <entry>
363ea1d6981SmrgserverMajorVersion: CARD16
364ea1d6981Smrg      </entry>
365ea1d6981Smrg    </row>
366ea1d6981Smrg    <row>
367ea1d6981Smrg      <entry>
368ea1d6981SmrgserverMinorVersion: CARD16
369ea1d6981Smrg      </entry>
370ea1d6981Smrg    </row>
371ea1d6981Smrg    <row>
372ea1d6981Smrg      <entry>
373ea1d6981SmrgErrors: <function>Length</function>
374ea1d6981Smrg      </entry>
375ea1d6981Smrg    </row>
376ea1d6981Smrg  </tbody>
377ea1d6981Smrg  </tgroup>
378ea1d6981Smrg</informaltable>
379ea1d6981Smrg
380ea1d6981Smrg
381ea1d6981Smrg<para>
382ea1d6981SmrgThis request can be used to ensure that the server version of the XTEST
383ea1d6981Smrgextension is usable by the client.  This document defines major version two
384ea1d6981Smrg(2), minor version one (1).
385ea1d6981Smrg</para>
386ea1d6981Smrg
387ea1d6981Smrg<para>
388ea1d6981Smrg<function>XTestCompareCursor</function>
389ea1d6981Smrg</para>
390ea1d6981Smrg
391ea1d6981Smrg<informaltable frame="none">
392ea1d6981Smrg  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
393ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
394ea1d6981Smrg  <tbody>
395ea1d6981Smrg    <row>
396ea1d6981Smrg      <entry>
397ea1d6981Smrg<emphasis remap='I'>window</emphasis>: WINDOW
398ea1d6981Smrg      </entry>
399ea1d6981Smrg    </row>
400ea1d6981Smrg    <row>
401ea1d6981Smrg      <entry>
402ea1d6981Smrg<emphasis remap='I'>cursor-id</emphasis>: CURSOR or
403ea1d6981Smrg<function>CurrentCursor</function>
404ea1d6981Smrgor
405ea1d6981Smrg<function>None</function>
406ea1d6981Smrg      </entry>
407ea1d6981Smrg    </row>
408ea1d6981Smrg    <row>
409ea1d6981Smrg      <entry>
410ea1d6981Smrg=&gt;
411ea1d6981Smrg      </entry>
412ea1d6981Smrg    </row>
413ea1d6981Smrg    <row>
414ea1d6981Smrg      <entry>
415ea1d6981Smrgsame: BOOL
416ea1d6981Smrg      </entry>
417ea1d6981Smrg    </row>
418ea1d6981Smrg    <row>
419ea1d6981Smrg      <entry>
420ea1d6981SmrgErrors:
421ea1d6981Smrg<function>Window</function>,
422ea1d6981Smrg<function>Length</function>,
423ea1d6981Smrg<function>Cursor</function>
424ea1d6981Smrg      </entry>
425ea1d6981Smrg    </row>
426ea1d6981Smrg  </tbody>
427ea1d6981Smrg  </tgroup>
428ea1d6981Smrg</informaltable>
429ea1d6981Smrg
430ea1d6981Smrg<para>
431ea1d6981SmrgThis request looks up the cursor associated with the window and
432ea1d6981Smrgcompares it with either the null cursor if cursor-id is
433ea1d6981Smrg<function>None ,</function>
434ea1d6981Smrgor the current cursor (that is, the one being displayed),
435ea1d6981Smrgor the cursor whose ID is cursor-id, and returns
436ea1d6981Smrgthe result of the comparison in same.
437ea1d6981Smrg</para>
438ea1d6981Smrg
439ea1d6981Smrg<para>
440ea1d6981Smrg<function>XTestFakeInput</function>
441ea1d6981Smrg</para>
442ea1d6981Smrg
443ea1d6981Smrg<informaltable frame="none">
444ea1d6981Smrg  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
445ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
446ea1d6981Smrg  <tbody>
447ea1d6981Smrg    <row>
448ea1d6981Smrg      <entry>
449ea1d6981Smrg<emphasis remap='I'>events</emphasis>: LISTofFAKE_EVENT
450ea1d6981Smrg      </entry>
451ea1d6981Smrg    </row>
452ea1d6981Smrg    <row>
453ea1d6981Smrg      <entry>
454ea1d6981SmrgErrors:
455ea1d6981Smrg<function>Window</function>,
456ea1d6981Smrg<function>Length</function>,
457ea1d6981Smrg<function>Alloc</function>,
458ea1d6981Smrg<function>Value</function>
459ea1d6981Smrg      </entry>
460ea1d6981Smrg    </row>
461ea1d6981Smrg  </tbody>
462ea1d6981Smrg  </tgroup>
463ea1d6981Smrg</informaltable>
464ea1d6981Smrg
465ea1d6981Smrg<para>
466ea1d6981SmrgThis request simulates the limited set of core protocol
467ea1d6981Smrgevents within the set FAKE_EVENT_TYPE.  Only the following event fields,
468ea1d6981Smrgdefined in FAKE_EVENT, are interpreted:
469ea1d6981Smrg</para>
470ea1d6981Smrg
471ea1d6981Smrg<variablelist>
472ea1d6981Smrg  <varlistentry>
473ea1d6981Smrg    <term>
474ea1d6981Smrg      <emphasis remap='I'>type</emphasis>
475ea1d6981Smrg    </term>
476ea1d6981Smrg    <listitem>
477ea1d6981Smrg      <para>
478ea1d6981SmrgThis must be one of
479ea1d6981Smrg<function>KeyPress</function>,
480ea1d6981Smrg<function>KeyRelease</function>,
481ea1d6981Smrg<function>MotionNotify</function>,
482ea1d6981Smrg<function>ButtonPress</function>,
483ea1d6981Smrgor
484ea1d6981Smrg<function>ButtonRelease</function>,
485ea1d6981Smrgor else a
486ea1d6981Smrg<function>Value</function>
487ea1d6981Smrgerror occurs.
488ea1d6981Smrg      </para>
489ea1d6981Smrg    </listitem>
490ea1d6981Smrg  </varlistentry>
491ea1d6981Smrg  <varlistentry>
492ea1d6981Smrg    <term>
493ea1d6981Smrg      <emphasis remap='I'>detail</emphasis>
494ea1d6981Smrg    </term>
495ea1d6981Smrg    <listitem>
496ea1d6981Smrg      <para>
497ea1d6981SmrgFor key events, this field is interpreted as the physical keycode.
498ea1d6981SmrgIf the keycode is less than min-keycode or greater than max-keycode,
499ea1d6981Smrgas returned in the connection setup, then a
500ea1d6981Smrg<function>Value</function>
501ea1d6981Smrgerror occurs.
502ea1d6981SmrgFor button events, this field is interpreted as the physical (or core) button,
503ea1d6981Smrgmeaning it will be mapped to the corresponding logical button according to
504ea1d6981Smrgthe most recent
505ea1d6981Smrg<function>SetPointerMapping</function>
506ea1d6981Smrgrequest.
507ea1d6981SmrgIf the button number is less than one or greater than the number of physical
508ea1d6981Smrgbuttons, then a
509ea1d6981Smrg<function>Value</function>
510ea1d6981Smrgerror occurs.
511ea1d6981SmrgFor motion events, if this field is
512ea1d6981Smrg<function>True ,</function>
513ea1d6981Smrgthen rootX and rootY
514ea1d6981Smrgare relative distances from the current pointer location; if this field is
515ea1d6981Smrg<function>False,</function>
516ea1d6981Smrgthen they are absolute positions.
517ea1d6981Smrg      </para>
518ea1d6981Smrg    </listitem>
519ea1d6981Smrg  </varlistentry>
520ea1d6981Smrg  <varlistentry>
521ea1d6981Smrg    <term>
522ea1d6981Smrg      <emphasis remap='I'>time</emphasis>
523ea1d6981Smrg    </term>
524ea1d6981Smrg    <listitem>
525ea1d6981Smrg      <para>
526ea1d6981SmrgThis is either
527ea1d6981Smrg<function>CurrentTime</function>
528ea1d6981Smrg(meaning no delay)
529ea1d6981Smrgor the delay in milliseconds that the server should wait before
530ea1d6981Smrgsimulating this event.  No other requests from this client will be
531ea1d6981Smrgprocessed until this delay, if any, has expired and subsequent processing
532ea1d6981Smrgof the simulated event has been completed.
533ea1d6981Smrg      </para>
534ea1d6981Smrg    </listitem>
535ea1d6981Smrg  </varlistentry>
536ea1d6981Smrg  <varlistentry>
537ea1d6981Smrg    <term>
538ea1d6981Smrg      <emphasis remap='I'>root</emphasis>
539ea1d6981Smrg    </term>
540ea1d6981Smrg    <listitem>
541ea1d6981Smrg      <para>
542ea1d6981SmrgIn the case of motion events this field is the ID of the root window on
543ea1d6981Smrgwhich the new motion is to take place.  If
544ea1d6981Smrg<function>None</function>
545ea1d6981Smrgis specified, the root window of the screen the pointer is currently on
546ea1d6981Smrgis used instead.
547ea1d6981SmrgIf this field is not a valid window, then a
548ea1d6981Smrg<function>Window</function>
549ea1d6981Smrgerror occurs.
550ea1d6981Smrg      </para>
551ea1d6981Smrg    </listitem>
552ea1d6981Smrg  </varlistentry>
553ea1d6981Smrg  <varlistentry>
554ea1d6981Smrg    <term>
555ea1d6981Smrg      <emphasis remap='I'>rootX</emphasis> &amp;
556ea1d6981Smrg      <emphasis remap='I'>rootY</emphasis>
557ea1d6981Smrg    </term>
558ea1d6981Smrg    <listitem>
559ea1d6981Smrg      <para>
560ea1d6981SmrgIn the case of motion events these fields indicate relative distance or
561ea1d6981Smrgabsolute pointer coordinates, according to the setting of detail.
562ea1d6981SmrgIf the specified coordinates are off-screen, the closest on-screen
563ea1d6981Smrgcoordinates will be substituted.
564ea1d6981Smrg    </para>
565ea1d6981Smrg  </listitem>
566ea1d6981Smrg  </varlistentry>
567ea1d6981Smrg</variablelist>
568ea1d6981Smrg
569ea1d6981Smrg<para>
570ea1d6981SmrgWhen the simulated event(s) are processed, they cause event propagation,
571ea1d6981Smrgpassive grab activation, and so on, just as if the corresponding input device
572ea1d6981Smrgaction had occurred.  However, motion events might not be recorded in the
573ea1d6981Smrgmotion history buffer.
574ea1d6981Smrg</para>
575ea1d6981Smrg
576ea1d6981Smrg<para>
577ea1d6981SmrgFor the currently supported event types, the event list must have length one,
578ea1d6981Smrgotherwise a
579ea1d6981Smrg<function>BadLength</function>
580ea1d6981Smrgerror occurs.
581ea1d6981Smrg</para>
582ea1d6981Smrg
583ea1d6981Smrg<para>
584ea1d6981Smrg<olink targetdoc='xtestlib' targetptr='XTestGrabControl'><function>XTestGrabControl</function></olink>
585ea1d6981Smrg</para>
586ea1d6981Smrg
587ea1d6981Smrg<informaltable frame="none">
588ea1d6981Smrg  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
589ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
590ea1d6981Smrg  <tbody>
591ea1d6981Smrg    <row>
592ea1d6981Smrg      <entry>
593ea1d6981Smrg<emphasis remap='I'>impervious</emphasis>: BOOL
594ea1d6981Smrg      </entry>
595ea1d6981Smrg    </row>
596ea1d6981Smrg  </tbody>
597ea1d6981Smrg  </tgroup>
598ea1d6981Smrg</informaltable>
599ea1d6981Smrg
600ea1d6981Smrg<para>
601ea1d6981SmrgIf impervious is
602ea1d6981Smrg<function>True</function>,
603ea1d6981Smrgthen the executing client becomes impervious to server grabs;
604ea1d6981Smrgthat is, it can continue executing requests even if another client
605ea1d6981Smrggrabs the server.
606ea1d6981SmrgIf impervious is
607ea1d6981Smrg<function>False</function>,
608ea1d6981Smrgthen the executing client returns to the normal state of being
609ea1d6981Smrgsusceptible to server grabs.
610ea1d6981Smrg</para>
611ea1d6981Smrg</chapter>
612ea1d6981Smrg
613ea1d6981Smrg<chapter id="Encoding">
614ea1d6981Smrg<title>Encoding</title>
615ea1d6981Smrg<para>
616ea1d6981SmrgPlease refer to the X11 Protocol Encoding document as this document uses
617ea1d6981Smrgconventions established there.
618ea1d6981Smrg</para>
619ea1d6981Smrg
620ea1d6981Smrg<para>
621ea1d6981SmrgThe name of this extension is "XTEST".
622ea1d6981Smrg</para>
623ea1d6981Smrg
624ea1d6981Smrg<sect1 id="New_Types">
625ea1d6981Smrg<title>New Types</title>
626ea1d6981Smrg<literallayout class="monospaced">
627ea1d6981SmrgFAKE_EVENT_TYPE
628ea1d6981Smrg     2     KeyPress
629ea1d6981Smrg     3     KeyRelease
630ea1d6981Smrg     4     ButtonPress
631ea1d6981Smrg     5     ButtonRelease
632ea1d6981Smrg     6     MotionNotify
633ea1d6981Smrg</literallayout>
634ea1d6981Smrg
635ea1d6981Smrg<para>
636ea1d6981SmrgNOTE that the above values are defined to be the same as those for
637ea1d6981Smrgthe corresponding core protocol event types.
638ea1d6981Smrg</para>
639ea1d6981Smrg</sect1>
640ea1d6981Smrg
641ea1d6981Smrg<sect1 id="Requests">
642ea1d6981Smrg<title>Requests</title>
643ea1d6981Smrg
644ea1d6981Smrg<literallayout class="monospaced">
645ea1d6981Smrg<function>XTestGetVersion</function>
646ea1d6981Smrg     1     CARD8               opcode
647ea1d6981Smrg     1     0                   xtest opcode
648ea1d6981Smrg     2     2                   request length
649ea1d6981Smrg     1     CARD8               client major version
650ea1d6981Smrg     1                         unused
651ea1d6981Smrg     2     CARD16              client minor version
652ea1d6981Smrg=&gt;
653ea1d6981Smrg     1     1                   Reply
654ea1d6981Smrg     1     CARD8               server major version
655ea1d6981Smrg     2     CARD16              sequence number
656ea1d6981Smrg     4     0                   reply length
657ea1d6981Smrg     2     CARD16              server minor version
658ea1d6981Smrg     22                        unused
659ea1d6981Smrg</literallayout>
660ea1d6981Smrg
661ea1d6981Smrg<literallayout class="monospaced">
662ea1d6981Smrg<function>XTestCompareCursor</function>
663ea1d6981Smrg     1     CARD8               opcode
664ea1d6981Smrg     1     1                   xtest opcode
665ea1d6981Smrg     2     3                   request length
666ea1d6981Smrg     4     WINDOW              window
667ea1d6981Smrg     4     CURSOR              cursor-id
668ea1d6981Smrg           0     None
669ea1d6981Smrg           1     CurrentCursor
670ea1d6981Smrg=&gt;
671ea1d6981Smrg     1     1                   Reply
672ea1d6981Smrg     1     BOOL                cursors are the same
673ea1d6981Smrg     2     CARD16              sequence number
674ea1d6981Smrg     4     0                   reply length
675ea1d6981Smrg     24                        unused
676ea1d6981Smrg</literallayout>
677ea1d6981Smrg
678ea1d6981Smrg<literallayout class="monospaced">
679ea1d6981Smrg<function>XTestFakeInput</function>
680ea1d6981Smrg     1     CARD8               opcode
681ea1d6981Smrg     1     2                   xtest opcode
682ea1d6981Smrg     2     1+(1*8)             request length
683ea1d6981Smrg     1     FAKE_EVENT_TYPE     fake device event type
684ea1d6981Smrg     1     BYTE                detail: button or keycode
685ea1d6981Smrg     2                         unused
686ea1d6981Smrg     4     TIME                delay (milliseconds)
687ea1d6981Smrg           0     CurrentTime
688ea1d6981Smrg     4     WINDOW              root window for MotionNotify
689ea1d6981Smrg           0     None
690ea1d6981Smrg     8                         unused
691ea1d6981Smrg     2     INT16               x position for MotionNotify
692ea1d6981Smrg     2     INT16               y position for MotionNotify
693ea1d6981Smrg     8                         unused
694ea1d6981Smrg</literallayout>
695ea1d6981Smrg
696ea1d6981Smrg<literallayout class="monospaced">
697ea1d6981Smrg<olink targetdoc='xtestlib' targetptr='XTestGrabControl'><function>XTestGrabControl</function></olink>
698ea1d6981Smrg     1     CARD8               opcode
699ea1d6981Smrg     1     3                   xtest opcode
700ea1d6981Smrg     2     2                   request length
701ea1d6981Smrg     1     BOOL                impervious
702ea1d6981Smrg     3                         unused
703ea1d6981Smrg</literallayout>
704ea1d6981Smrg</sect1>
705ea1d6981Smrg</chapter>
706ea1d6981Smrg
707ea1d6981Smrg<chapter id="References">
708ea1d6981Smrg<title>References</title>
709ea1d6981Smrg<para>
710ea1d6981SmrgAnnicchiarico, D., et al.,
711ea1d6981Smrg<emphasis remap='I'>XTrap: The XTrap Architecture</emphasis>.
712ea1d6981SmrgDigital Equipment Corporation, July 1991.
713ea1d6981Smrg</para>
714ea1d6981Smrg
715ea1d6981Smrg<para>
716ea1d6981SmrgDrake, K. J.,
717ea1d6981Smrg<emphasis remap='I'>Some Proposals for a
718ea1d6981SmrgMinimum X11 Testing Extension</emphasis>.
719ea1d6981SmrgUniSoft Ltd., June 1991.
720ea1d6981Smrg</para>
721ea1d6981Smrg</chapter>
722ea1d6981Smrg
723ea1d6981Smrg</book>
724