home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 45 / cda45.iso / Linux / XFree86-4.0 / doc / xtest.TXT < prev    next >
Encoding:
Text File  |  2000-03-09  |  11.5 KB  |  595 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.           XTEST Extension Protocol
  17.  
  18.  
  19.  
  20.             Version 2.2
  21.            X Consortium Standard
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.             Kieron Drake
  29.             UniSoft Ltd.
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. Copyright (C) 1992 by UniSoft Group Ltd.
  74.  
  75. Permission to use, copy, modify, and distribute this docu-
  76. mentation for any purpose and without fee is hereby granted,
  77. provided that the above copyright notice and this permission
  78. notice appear in all copies.  UniSoft makes no representa-
  79. tions about the suitability for any purpose of the informa-
  80. tion in this document.    This documentation is provided ``as
  81. is'' without express or implied warranty.
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88. Copyright (C) 1992, 1994 X Consortium
  89.  
  90. Permission is hereby granted, free of charge, to any person
  91. obtaining a copy of this software and associated documenta-
  92. tion files (the ``Software''), to deal in the Software with-
  93. out restriction, including without limitation the rights to
  94. use, copy, modify, merge, publish, distribute, sublicense,
  95. and/or sell copies of the Software, and to permit persons to
  96. whom the Software is furnished to do so, subject to the fol-
  97. lowing conditions:
  98.  
  99. The above copyright notice and this permission notice shall
  100. be included in all copies or substantial portions of the
  101. Software.
  102.  
  103. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY
  104. KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  105. WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PUR-
  106. POSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSOR-
  107. TIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  108. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  109. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  110. OR OTHER DEALINGS IN THE SOFTWARE.
  111.  
  112. Except as contained in this notice, the name of the X Con-
  113. sortium shall not be used in advertising or otherwise to
  114. promote the sale, use or other dealings in this Software
  115. without prior written authorization from the X Consortium.
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. 1.  Overview
  140.  
  141. This extension is a minimal set of client and server exten-
  142. sions required to completely test the X11 server with no
  143. user intervention.
  144.  
  145. This extension is not intended to support general journaling
  146. and playback of user actions.  This is a difficult area
  147. [XTrap, 89] as it attempts to synchronize synthetic user
  148. interactions with their effects; it is at the higher level
  149. of dialogue recording/playback rather than at the strictly
  150. lexical level.    We are interested only in the latter, sim-
  151. pler, case.  A more detailed discussion and justification of
  152. the extension functionality is given in [Drake, 91].
  153.  
  154. We are aiming only to provide a minimum set of facilities
  155. that solve immediate testing and validation problems.  The
  156. testing extension itself needs testing, where possible, and
  157. so should be as simple as possible.
  158.  
  159. We have also tried to:
  160.  
  161. o    Confine the extension to an appropriate high level
  162.      within the server to minimize portability problems.  In
  163.      practice this means that the extension should be at the
  164.      DIX level or use the DIX/DDX interface, or both.  This
  165.      has effects, in particular, on the level at which
  166.      "input synthesis" can occur.
  167.  
  168. o    Minimize the changes required in the rest of the
  169.      server.
  170.  
  171. o    Minimize performance penalties on normal server opera-
  172.      tion.
  173.  
  174.  
  175. 2.  Description
  176.  
  177. The functions provided by this extension fall into two
  178. groups:
  179.  
  180. Client Operations
  181.      These routines manipulate otherwise hidden client-side
  182.      behavior.    The actual implementation will depend on the
  183.      details of the actual language binding and what degree
  184.      of request buffering, GContext caching, and so on, is
  185.      provided.    In the C binding, defined in ``XTEST Exten-
  186.      sion Library'', routines are provided to access the
  187.      internals of two opaque data structures --GCs and
  188.      Visuals-- and to discard any requests pending within
  189.      the output buffer of a connection.  The exact details
  190.      can be expected to differ for other language bindings.
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                   1
  197.  
  198.  
  199.  
  200.  
  201.  
  202.           XTEST Extension Protocol
  203.  
  204.  
  205. Server Requests
  206.      The first of these requests is similar to that provided
  207.      in most extensions: it allows a client to specify a
  208.      major and minor version number to the server and for
  209.      the server to respond with major and minor versions of
  210.      its own.  The remaining two requests allow the follow-
  211.      ing:
  212.  
  213.      o      Access to an otherwise "write-only" server
  214.       resource: the cursor associated with a given win-
  215.       dow
  216.  
  217.      o      Perhaps most importantly, limited synthesis of
  218.       input device events, almost as if a cooperative
  219.       user had moved the pointing device or pressed a
  220.       key or button.
  221.  
  222. 3.  Types
  223.  
  224. The following types are used in the request and event defi-
  225. nitions in subsequent sections:
  226.  
  227. FAKE_EVENT_TYPE {KeyPress, KeyRelease, MotionNotify,
  228. ButtonPress, ButtonRelease}
  229.  
  230.  
  231. FAKE_EVENT  [type: FAKE_EVENT_TYPE,
  232.         detail: BYTE,
  233.         time: TIME,
  234.         root: WINDOW,
  235.         rootX, rootY: INT16]
  236.  
  237.  
  238. CURSOR {CurrentCursor, None} or a cursor as defined by the
  239. X11 Protocol.
  240.  
  241. 4.  Client Operations
  242.  
  243. These are abstract definitions of functionality.  They refer
  244. to client-side objects such as "GC" and "VISUAL" that are
  245. quoted to denote their abstract nature.  Concrete versions
  246. of these functions are defined only for particular language
  247. bindings.  In some circumstances a particular language bind-
  248. ing may not implement the relevant abstract type or may pro-
  249. vide it as a transparent, rather than opaque, type, with the
  250. result that the corresponding function does not make sense
  251. or is not required, respectively.
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                   2
  263.  
  264.  
  265.  
  266.  
  267.  
  268.           XTEST Extension Protocol
  269.  
  270. __
  271. |    XTestSetGContextOfGC
  272.  
  273.      gc: "GC"
  274.      gid: GCONTEXT
  275. |__
  276.  
  277.  
  278. Sets the GCONTEXT within the "GC" gc to have the value spec-
  279. ified by gid.
  280.  
  281. __
  282. |    XTestSetVisualIDOfVisual
  283.  
  284.      visual: "VISUAL"
  285.      visualid: VISUALID
  286. |__
  287.  
  288.  
  289. Sets the VISUALID within the "VISUAL" visual to have the
  290. value specified by visualid.
  291.  
  292. __
  293. |    XTestDiscard
  294.  
  295.      dpy: "CONNECTION"
  296.  
  297.    =>
  298.  
  299.      status: BOOL
  300. |__
  301.  
  302.  
  303. Discards any requests that are present in the request buffer
  304. associated with the "CONNECTION" dpy.  The status returned
  305. is True if there were one or more requests in the buffer and
  306. False otherwise.
  307.  
  308. 5.  Server Requests
  309.  
  310. __
  311. |    XTestGetVersion
  312.  
  313.      clientMajorVersion: CARD16
  314.      clientMinorVersion: CARD16
  315.  
  316.    =>
  317.  
  318.      serverMajorVersion: CARD16
  319.      serverMinorVersion: CARD16
  320.  
  321.      Errors: Length
  322. |__
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                   3
  329.  
  330.  
  331.  
  332.  
  333.  
  334.           XTEST Extension Protocol
  335.  
  336.  
  337. This request can be used to ensure that the server version
  338. of the XTEST extension is usable by the client.  This docu-
  339. ment defines major version two (2), minor version one (1).
  340.  
  341. __
  342. |    XTestCompareCursor
  343.  
  344.      window: WINDOW
  345.      cursor-id: CURSOR or CurrentCursor or None
  346.  
  347.    =>
  348.  
  349.      same: BOOL
  350.  
  351.      Errors: Window, Length, Cursor
  352. |__
  353.  
  354.  
  355. This request looks up the cursor associated with the window
  356. and compares it with either the null cursor if cursor-id is
  357. None, or the current cursor (that is, the one being dis-
  358. played), or the cursor whose ID is cursor-id, and returns
  359. the result of the comparison in same.
  360.  
  361. __
  362. |    XTestFakeInput
  363.  
  364.      events: LISTofFAKE_EVENT
  365.  
  366.      Errors: Window, Length, Alloc, Value
  367. |__
  368.  
  369.  
  370. This request simulates the limited set of core protocol
  371. events within the set FAKE_EVENT_TYPE.    Only the following
  372. event fields, defined in FAKE_EVENT, are interpreted:
  373.  
  374. type      This must be one of KeyPress, KeyRelease,
  375.       MotionNotify, ButtonPress, or ButtonRelease, or
  376.       else a Value error occurs.
  377.  
  378. detail      For key events, this field is interpreted as the
  379.       physical keycode.  If the keycode is less than
  380.       min-keycode or greater than max-keycode, as
  381.       returned in the connection setup, then a Value
  382.       error occurs.  For button events, this field is
  383.       interpreted as the physical (or core) button,
  384.       meaning it will be mapped to the corresponding
  385.       logical button according to the most recent Set-
  386.       PointerMapping request.  If the button number is
  387.       less than one or greater than the number of physi-
  388.       cal buttons, then a Value error occurs.  For
  389.       motion events, if this field is True, then rootX
  390.       and rootY are relative distances from the current
  391.  
  392.  
  393.  
  394.                   4
  395.  
  396.  
  397.  
  398.  
  399.  
  400.           XTEST Extension Protocol
  401.  
  402.  
  403.       pointer location; if this field is False, then
  404.       they are absolute positions.
  405.  
  406. time      This is either CurrentTime (meaning no delay) or
  407.       the delay in milliseconds that the server should
  408.       wait before simulating this event.  No other
  409.       requests from this client will be processed until
  410.       this delay, if any, has expired and subsequent
  411.       processing of the simulated event has been com-
  412.       pleted.
  413.  
  414. root      In the case of motion events this field is the ID
  415.       of the root window on which the new motion is to
  416.       take place.  If None is specified, the root window
  417.       of the screen the pointer is currently on is used
  418.       instead.  If this field is not a valid window,
  419.       then a Window error occurs.
  420.  
  421. rootX & rootY
  422.       In the case of motion events these fields indicate
  423.       relative distance or absolute pointer coordinates,
  424.       according to the setting of detail.  If the speci-
  425.       fied coordinates are off-screen, the closest on-
  426.       screen coordinates will be substituted.
  427.  
  428. When the simulated event(s) are processed, they cause event
  429. propagation, passive grab activation, and so on, just as if
  430. the corresponding input device action had occurred.  How-
  431. ever, motion events might not be recorded in the motion his-
  432. tory buffer.
  433.  
  434. For the currently supported event types, the event list must
  435. have length one, otherwise a BadLength error occurs.
  436.  
  437. __
  438. |    XTestGrabControl
  439.  
  440.      impervious: BOOL
  441. |__
  442.  
  443.  
  444. If impervious is True, then the executing client becomes
  445. impervious to server grabs; that is, it can continue execut-
  446. ing requests even if another client grabs the server.  If
  447. impervious is False, then the executing client returns to
  448. the normal state of being susceptible to server grabs.
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.                   5
  461.  
  462.  
  463.  
  464.  
  465.  
  466.           XTEST Extension Protocol
  467.  
  468.  
  469. 6.  Encoding
  470.  
  471. Please refer to the X11 Protocol Encoding document as this
  472. document uses conventions established there.
  473.  
  474. The name of this extension is ``XTEST''.
  475.  
  476. 6.1.  New Types
  477.  
  478.  
  479. FAKE_EVENT_TYPE
  480.        2     KeyPress
  481.        3     KeyRelease
  482.        4     ButtonPress
  483.        5     ButtonRelease
  484.        6     MotionNotify
  485.  
  486.  
  487. NOTE that the above values are defined to be the same as
  488. those for the corresponding core protocol event types.
  489.  
  490. 6.2.  Requests
  491.  
  492.  
  493. XTestGetVersion
  494.   1  CARD8         opcode
  495.   1  0             xtest opcode
  496.   2  2             request length
  497.   1  CARD8         client major version
  498.   1             unused
  499.   2  CARD16         client minor version
  500.  
  501.  
  502.  =>
  503.   1  1             Reply
  504.   1  CARD8         server major version
  505.   2  CARD16         sequence number
  506.   4  0             reply length
  507.   2  CARD16         server minor version
  508.   22             unused
  509.  
  510.  
  511.  
  512. XTestCompareCursor
  513.   1  CARD8         opcode
  514.   1  1             xtest opcode
  515.   2  3             request length
  516.   4  WINDOW         window
  517.   4  CURSOR         cursor-id
  518.      0           None
  519.      1           CurrentCursor
  520.  
  521.  
  522.  =>
  523.  
  524.  
  525.  
  526.                   6
  527.  
  528.  
  529.  
  530.  
  531.  
  532.           XTEST Extension Protocol
  533.  
  534.  
  535.   1  1             Reply
  536.   1  BOOL         cursors are the same
  537.   2  CARD16         sequence number
  538.   4  0             reply length
  539.   24             unused
  540.  
  541.  
  542.  
  543. XTestFakeInput
  544.   1  CARD8         opcode
  545.   1  2             xtest opcode
  546.   2  1+(1*8)         request length
  547.   1  FAKE_EVENT_TYPE     fake device event type
  548.   1  BYTE         detail: button or keycode
  549.   2             unused
  550.   4  TIME         delay (milliseconds)
  551.      0           CurrentTime
  552.   4  WINDOW         root window for MotionNotify
  553.      0           None
  554.   8             unused
  555.   2  INT16         x position for MotionNotify
  556.   2  INT16         y position for MotionNotify
  557.   8             unused
  558.  
  559.  
  560.  
  561. XTestGrabControl
  562.   1  CARD8         opcode
  563.   1  3             xtest opcode
  564.   2  2             request length
  565.   1  BOOL         impervious
  566.   3             unused
  567.  
  568.  
  569. 7.  References
  570.  
  571. Annicchiarico, D., et al., XTrap: The XTrap Architecture.
  572.      Digital Equipment Corporation, July 1991.
  573.  
  574. Drake, K. J., Some Proposals for a Minimum X11 Testing
  575.      Extension.  UniSoft Ltd., June 1991.
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.                   7
  593.  
  594.  
  595.