1706f2543Smrg
2706f2543Smrg
3706f2543Smrg            Client-to-Server DMX Extension to the X Protocol
4706f2543Smrg
5706f2543Smrg           $Date: 2016/06/09 09:07:57 $, $Revision: 1.1.1.1 $
6706f2543Smrg
7706f2543Smrg               Rickard E. (Rik) Faith (faith@redhat.com)
8706f2543Smrg                    Kevin E. Martin (kem@redhat.com)
9706f2543Smrg
10706f2543Smrg    Copyright 2002,2003 Red Hat Inc., Raleigh, North Carolina.
11706f2543Smrg
12706f2543Smrg    Permission is hereby granted, free of charge, to any person
13706f2543Smrg    obtaining a copy of this software and associated documentation files
14706f2543Smrg    (the "Software"), to deal in the Software without restriction,
15706f2543Smrg    including without limitation on the rights to use, copy, modify,
16706f2543Smrg    merge, publish, distribute, sublicense, and/or sell copies of the
17706f2543Smrg    Software, and to permit persons to whom the Software is furnished to
18706f2543Smrg    do so, subject to the following conditions:
19706f2543Smrg
20706f2543Smrg    The above copyright notice and this permission notice (including the
21706f2543Smrg    next paragraph) shall be included in all copies or substantial
22706f2543Smrg    portions of the Software.
23706f2543Smrg
24706f2543Smrg    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25706f2543Smrg    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26706f2543Smrg    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27706f2543Smrg    NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
28706f2543Smrg    BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29706f2543Smrg    ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30706f2543Smrg    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31706f2543Smrg    SOFTWARE.
32706f2543Smrg
33706f2543Smrg
34706f2543Smrg
35706f2543Smrg1. Overview
36706f2543Smrg
37706f2543Smrg    The client-to-server DMX extension to the X protocol (DMX) provides
38706f2543Smrg    normal client applications with the ability to determine information
39706f2543Smrg    about the characteristics of the Xdmx server and the back-end X
40706f2543Smrg    servers that DMX is using.
41706f2543Smrg
42706f2543Smrg    The name for this extension is "DMX".
43706f2543Smrg
44706f2543Smrg
45706f2543Smrg
46706f2543Smrg2. Syntactic conventions
47706f2543Smrg
48706f2543Smrg    This document uses the same syntactic conventions requests and data
49706f2543Smrg    types as [X11R6.4].
50706f2543Smrg
51706f2543Smrg
52706f2543Smrg
53706f2543Smrg3. Data types
54706f2543Smrg
55706f2543Smrg    No new data types are defined by this extension.  All data types
56706f2543Smrg    referenced in this document are defined in [X11R6.4].
57706f2543Smrg
58706f2543Smrg
59706f2543Smrg
60706f2543Smrg4. Requests
61706f2543Smrg
62706f2543Smrg    DMXQueryVersion
63706f2543Smrg        ==>
64706f2543Smrg        majorVersion: CARD32
65706f2543Smrg        minorVersion: CARD32
66706f2543Smrg        patchVersion: CARD32
67706f2543Smrg
68706f2543Smrg    The protocol this extension actually supports is indicated by
69706f2543Smrg    majorVersion and minorVersion (patchVersion indicates the
70706f2543Smrg    patchlevel and is for informational purposes only).
71706f2543Smrg
72706f2543Smrg    Any incompatible changes to the protocol should be indicated by
73706f2543Smrg    incrementing majorVersion.
74706f2543Smrg
75706f2543Smrg    Small, upward-compatible changes should be indicated by incrementing
76706f2543Smrg    minorVersion.
77706f2543Smrg
78706f2543Smrg    Servers that support the protocol defined in this document will
79706f2543Smrg    return a majorVersion of 1 and a minorVersion of 1.
80706f2543Smrg
81706f2543Smrg
82706f2543Smrg
83706f2543Smrg    DMXGetScreenCount
84706f2543Smrg        ==>
85706f2543Smrg        screenCount: CARD32
86706f2543Smrg
87706f2543Smrg    This request returns the number of back-end screens that the Xdmx
88706f2543Smrg    server controls.  A back-end screen may be managed as a regular X
89706f2543Smrg    screen in the Xdmx server or may be joined with other back-end
90706f2543Smrg    screens using Xinerama.  (The information returned by this request
91706f2543Smrg    does not change while Xdmx is running and may be cached on the
92706f2543Smrg    client side.)
93706f2543Smrg    
94706f2543Smrg
95706f2543Smrg
96706f2543Smrg    DMXGetScreenInformation
97706f2543Smrg        physicalScreen: CARD32
98706f2543Smrg        ==>
99706f2543Smrg        displayName: STRING8
100706f2543Smrg        width: CARD16
101706f2543Smrg        height: CARD16
102706f2543Smrg        xoffset: INT16
103706f2543Smrg        yoffset: INT16
104706f2543Smrg        logicalScreen: CARD32
105706f2543Smrg        xorigin: INT16
106706f2543Smrg        yorigin: INT16
107706f2543Smrg
108706f2543Smrg        Errors: Value
109706f2543Smrg
110706f2543Smrg    This request returns information about individual back-end screens.
111706f2543Smrg    The physicalScreen value is between 0 and screenCount-1, inclusive
112706f2543Smrg    (values outside this range will result in a Value error).  The
113706f2543Smrg    displayname is the name used to open the display, either from the
114706f2543Smrg    Xdmx command-line or from the configuration file.  The width,
115706f2543Smrg    height, xoffset, and yoffset values comprise a geometry
116706f2543Smrg    specification (see X(7x)) for the location of the DMX window on the
117706f2543Smrg    back-end screen.  This request will always return non-negative
118706f2543Smrg    (i.e., normalized) values for xoffset and yoffset.  The
119706f2543Smrg    logicalScreen value is the value of the screen that that Xdmx server
120706f2543Smrg    exports to clients.  When Xinerama is in use, this value is
121706f2543Smrg    typically 0 for all values of physicalScreen.  If Xinerama is in
122706f2543Smrg    use, the xorigin and yorigin values specify where the physical
123706f2543Smrg    screen is positioned in the global Xinerama coordinate system.
124706f2543Smrg    Otherwise, these values are set to 0.  (The information returned by
125706f2543Smrg    this request does not change while Xdmx is running and may be cached
126706f2543Smrg    on the client side.)
127706f2543Smrg
128706f2543Smrg
129706f2543Smrg
130706f2543Smrg    DMXGetWindowInformation
131706f2543Smrg        window: CARD32
132706f2543Smrg        ==>
133706f2543Smrg        screenCount: CARD32
134706f2543Smrg        screens: LISTofCARD32
135706f2543Smrg        windows: LISTofCARD32
136706f2543Smrg        pos: LISTofRECTANGLE
137706f2543Smrg        vis: LISTofRECTANGLE
138706f2543Smrg
139706f2543Smrg        Errors: Window, Alloc
140706f2543Smrg
141706f2543Smrg    This request computed the return values incorrectly for version 1.0
142706f2543Smrg    of this protocol.  Version 1.1 of this protocol conforms to this
143706f2543Smrg    description.
144706f2543Smrg
145706f2543Smrg    Given a window ID on the Xdmx server, this request returns data
146706f2543Smrg    about how the window is represented on the back-end X servers.  For
147706f2543Smrg    each back-end X server that displays a portion of the window, the
148706f2543Smrg    following information is returned:
149706f2543Smrg        1) the number of the physical screen containing that portion
150706f2543Smrg           (which can be used with the DMXGetScreenInformation request
151706f2543Smrg           to obtain more information about the screen),
152706f2543Smrg        2) the window ID on the back-end X server of the window
153706f2543Smrg           containing that portion,
154706f2543Smrg        3) the position and dimensions of the window on the back-end, in
155706f2543Smrg           screen coordinates, and
156706f2543Smrg        4) the visible area of the window on the back-end, in
157706f2543Smrg           window-relative coordinates (all zeros for windows that are
158706f2543Smrg           not visible)
159706f2543Smrg    Note that DMX allows multiple back-end windows to overlap in their
160706f2543Smrg    view of the DMX logical window.  Further, a logical window does not
161706f2543Smrg    have to be completely covered by back-end windows -- there may be
162706f2543Smrg    gaps.
163706f2543Smrg
164706f2543Smrg    As an example, consider a 500x500 window that spans the top two
165706f2543Smrg    1024x768 back-end displays (A and B) of a 2048x1536 DMX display
166706f2543Smrg    composed of 4 1024x768 back-end displays arranged in a cube:
167706f2543Smrg        A B
168706f2543Smrg        C D
169706f2543Smrg
170706f2543Smrg    In this case, the DMXGetWindowInformation call would return the
171706f2543Smrg    following information for the 500x500 window:
172706f2543Smrg
173706f2543Smrg    display A: 500x500 window at 1024-250,0 (relative to back end)
174706f2543Smrg               with 250x500 visible at 0,0 (relative to window origin)
175706f2543Smrg
176706f2543Smrg    display B: 500x500 window at -250,0 (relative to back end)
177706f2543Smrg               with 250x500 visible at 250,0 (relative to window origin)
178706f2543Smrg
179706f2543Smrg    display C: 500x500 window at 1024-250,-768 with 0x0 visible at 0,0
180706f2543Smrg
181706f2543Smrg    display D: 500x500 window at -250,-768 with 0x0 visible at 0,0
182706f2543Smrg
183706f2543Smrg    Note that if the specified window has not yet been mapped when
184706f2543Smrg    DMXGetWindowInformation is called, then a subsequent XMapWindow call
185706f2543Smrg    might be buffered in xlib while requests directly to the back-end X
186706f2543Smrg    servers are processed.  This race condition can be solved by calling
187706f2543Smrg    DMXSync before talking directly to the back-end X servers.
188706f2543Smrg
189706f2543Smrg
190706f2543Smrg    DMXGetInputCount
191706f2543Smrg        ==>
192706f2543Smrg        inputCount: CARD32
193706f2543Smrg
194706f2543Smrg    This request was first supported in version 1.1 of this protocol.
195706f2543Smrg
196706f2543Smrg    This request returns the number of input devices connected to the
197706f2543Smrg    Xdmx server.  This number is the same as that returned by
198706f2543Smrg    XListInputDevices, but is available even when the XInput extension
199706f2543Smrg    is not supported.
200706f2543Smrg
201706f2543Smrg
202706f2543Smrg
203706f2543Smrg    DMXGetInputInformation
204706f2543Smrg        deviceId: CARD32
205706f2543Smrg        ==>
206706f2543Smrg        inputType: CARD32
207706f2543Smrg        physicalScreen: CARD32
208706f2543Smrg        physicalId: CARD32
209706f2543Smrg        isCore: BOOL
210706f2543Smrg        sendsCore: BOOL
211706f2543Smrg        name: STRING8
212706f2543Smrg
213706f2543Smrg        Errors: Value
214706f2543Smrg
215706f2543Smrg    This request was first supported in version 1.1 of this protocol.
216706f2543Smrg
217706f2543Smrg    This request returns information about the specified input device
218706f2543Smrg    that cannot be obtained from the XListInputDeivices call.  The
219706f2543Smrg    deviceId is the same as that used by the XListInputDevices call, and
220706f2543Smrg    must be in the range 0 to inputCount-1, inclusive (values outside
221706f2543Smrg    this range will result in a Value error).
222706f2543Smrg
223706f2543Smrg    The value of inputType will always be value, and will be one of the
224706f2543Smrg    following values:
225706f2543Smrg        0 for local (and dummy) devices,
226706f2543Smrg        1 for console devices, and
227706f2543Smrg        2 for back-end devices.
228706f2543Smrg
229706f2543Smrg    For local devices, all other fields returned, except isCore and
230706f2543Smrg    sendsCore, are invalid.
231706f2543Smrg
232706f2543Smrg    For console devices, the physicalScreen and physicalID will be
233706f2543Smrg    invalid, and the name will return the name of the X server on which
234706f2543Smrg    the console window is displayed.
235706f2543Smrg
236706f2543Smrg    For back-end devices, the physicalScreen will identify the back-end
237706f2543Smrg    display and can be used as an argument to DMXGetScreenInformation to
238706f2543Smrg    obtain more information; the physicalId will be the XInput device id
239706f2543Smrg    on the back-end X server; and the name will be invalid (since it
240706f2543Smrg    does not provide any additional information that cannot be obtained
241706f2543Smrg    with DMXGetScreenInformation).
242706f2543Smrg
243706f2543Smrg    If isCore is True, then this device is active as a true core input
244706f2543Smrg    device and will send core events.  If sendsCore is True, then this
245706f2543Smrg    device queried an XInput extension device, but sends core events
246706f2543Smrg    instead of extension events.  Note that this behavior is different
247706f2543Smrg    from that of XFree86, where XInput extension devices may send both
248706f2543Smrg    extension events and core events.
249706f2543Smrg
250706f2543Smrg
251706f2543Smrg
252706f2543Smrg    DMXForceWindowCreation
253706f2543Smrg        window: CARD32
254706f2543Smrg        ==>
255706f2543Smrg
256706f2543Smrg        Errors: Window
257706f2543Smrg
258706f2543Smrg    This request was first supported in version 1.2 of this protocol.
259706f2543Smrg
260706f2543Smrg    When using the lazy window creation optimization, windows are not
261706f2543Smrg    created on the back-end X servers until they are required.  This
262706f2543Smrg    request forces the immediate creation of the window requested.
263706f2543Smrg
264706f2543Smrg
265706f2543Smrg
266706f2543Smrg    DMXReconfigureScreen
267706f2543Smrg        screen: CARD32
268706f2543Smrg        x: INT16
269706f2543Smrg        y: INT16
270706f2543Smrg        ==>
271706f2543Smrg        status: CARD32
272706f2543Smrg
273706f2543Smrg        Errors: Value
274706f2543Smrg
275706f2543Smrg    This request was first supported in version 1.3 of this protocol.
276706f2543Smrg
277706f2543Smrg    This request reconfigures the screen position to coordinates (x,y)
278706f2543Smrg    when using the Xinerama extension.  Otherwise, it is a NOP.  Illegal
279706f2543Smrg    values for screen will result in a BadValue error.  Other non-fatal
280706f2543Smrg    errors will be returned in status.
281706f2543Smrg
282706f2543Smrg
283706f2543Smrg
284706f2543Smrg    DMXSync
285706f2543Smrg        ==>
286706f2543Smrg
287706f2543Smrg    This request was first supported in version 1.5 of this protocol.
288706f2543Smrg
289706f2543Smrg    This request flushes all pending protocol requests between the Xdmx
290706f2543Smrg    server and each back-end X server.  It is used by a client that
291706f2543Smrg    talks directly to back-end X servers
292706f2543Smrg
293706f2543Smrg    To ensure proper synchronization semantics, this request has a
294706f2543Smrg    reply, but the reply does not carry any information.
295706f2543Smrg
296706f2543Smrg
297706f2543Smrg
298706f2543Smrg5. Events
299706f2543Smrg
300706f2543Smrg    No new events are defined by this extension.
301706f2543Smrg
302706f2543Smrg
303706f2543Smrg
304706f2543Smrg6. Errors
305706f2543Smrg
306706f2543Smrg    No new events are defined by this extension.
307706f2543Smrg
308706f2543Smrg
309706f2543Smrg
310706f2543Smrg7. Encoding
311706f2543Smrg
312706f2543Smrg    DMXQueryVersion
313706f2543Smrg        1           CARD8           opcode (X assigned)
314706f2543Smrg        1           0               DMX opcode (X_DMXQueryVersion)
315706f2543Smrg        2           1               request length
316706f2543Smrg    ==>
317706f2543Smrg        1           1               Reply
318706f2543Smrg        1                           unused
319706f2543Smrg        2           CARD16          sequence number
320706f2543Smrg        4           0               reply length
321706f2543Smrg        4           CARD32          majorVersion
322706f2543Smrg        4           CARD32          minorVersion
323706f2543Smrg        4           CARD32          patchVersion
324706f2543Smrg        12                          unused
325706f2543Smrg
326706f2543Smrg    DMXGetScreenCount
327706f2543Smrg        1           CARD8           opcode (X assigned)
328706f2543Smrg        1           1               DMX opcode (X_DMXGetScreenCount)
329706f2543Smrg        2           1               request length
330706f2543Smrg    ==>
331706f2543Smrg        1           1               Reply
332706f2543Smrg        1                           unused
333706f2543Smrg        2           CARD16          sequence number
334706f2543Smrg        4           0               reply length
335706f2543Smrg        4           CARD32          screenCount
336706f2543Smrg        20                          unused
337706f2543Smrg
338706f2543Smrg    DMXGetScreenInformation
339706f2543Smrg        1           CARD8           opcode (X assigned)
340706f2543Smrg        1           2               DMX opcode (X_DMXGetScreenInformation)
341706f2543Smrg        2           2               request length
342706f2543Smrg        4           CARD32          physicalScreen
343706f2543Smrg    ==>
344706f2543Smrg        1           1               Reply
345706f2543Smrg        1                           unused
346706f2543Smrg        2           CARD16          sequence number
347706f2543Smrg        4           n/4+p           reply length
348706f2543Smrg        4           n               displayNameLength
349706f2543Smrg        2           CARD16          width
350706f2543Smrg        2           CARD16          height
351706f2543Smrg        2           INT16           xoffset
352706f2543Smrg        2           INT16           yoffset
353706f2543Smrg        4           CARD32          logicalScreen
354706f2543Smrg        2           INT16           xorigin
355706f2543Smrg        2           INT16           yorigin
356706f2543Smrg        4                           unused
357706f2543Smrg        n                           displayName
358706f2543Smrg        p                           pad(n)
359706f2543Smrg
360706f2543Smrg    DMXGetWindowInformation
361706f2543Smrg        1           CARD8           opcode (X assigned)
362706f2543Smrg        1           3               DMX opcode (X_DMXGetWindowInformation)
363706f2543Smrg        2           2               request length
364706f2543Smrg        4           CARD32          window
365706f2543Smrg    ==>
366706f2543Smrg        1           1               Reply
367706f2543Smrg        1                           unused
368706f2543Smrg        2           CARD16          sequence number
369706f2543Smrg        4           n*6             reply length
370706f2543Smrg        4           n               screenCount
371706f2543Smrg        20                          unused
372706f2543Smrg        n*4         LISTofCARD32    screens
373706f2543Smrg        n*4         LISTofCARD32    windows
374706f2543Smrg        n*8         LISTofRECTANGLE pos
375706f2543Smrg        n*8         LISTofRECTANGLE vis
376706f2543Smrg
377706f2543Smrg    DMXGetInputCount
378706f2543Smrg        1           CARD8           opcode (X assigned)
379706f2543Smrg        1                           DMX opcode (X_DMXGetInputCount)
380706f2543Smrg        2           1               request length
381706f2543Smrg    ==>
382706f2543Smrg        1           1               Reply
383706f2543Smrg        1                           unused
384706f2543Smrg        2           CARD16          sequence number
385706f2543Smrg        4           0               reply length
386706f2543Smrg        4           CARD32          inputCount
387706f2543Smrg        20                          unused
388706f2543Smrg
389706f2543Smrg    DMXGetInputInformation
390706f2543Smrg        1           CARD8           opcode (X assigned)
391706f2543Smrg        1           4               DMX opcode (X_DMXGetInputInformation)
392706f2543Smrg        2           2               request length
393706f2543Smrg        4           CARD32          deviceId
394706f2543Smrg    ==>
395706f2543Smrg        1           1               Reply
396706f2543Smrg        1                           unused
397706f2543Smrg        2           CARD16          sequence number
398706f2543Smrg        4           n/4+p           reply length
399706f2543Smrg        4           CARD32          inputType
400706f2543Smrg        4           CARD32          physicalScreen
401706f2543Smrg        4           CARD32          physicalId
402706f2543Smrg        4           n               nameLength
403706f2543Smrg        1           BOOL            isCore
404706f2543Smrg        1           BOOL            sendsCore
405706f2543Smrg        6                           unused
406706f2543Smrg        n                           name
407706f2543Smrg        p                           pad(n)
408706f2543Smrg
409706f2543Smrg    DMXForceWindowCreation
410706f2543Smrg        1           CARD8           opcode (X assigned)
411706f2543Smrg        1           2               DMX opcode (X_DMXForceWindowCreation)
412706f2543Smrg        2           2               request length
413706f2543Smrg        4           CARD32          window
414706f2543Smrg    ==>
415706f2543Smrg
416706f2543Smrg    DMXReconfigureScreen
417706f2543Smrg        1           CARD8           opcode (X assigned)
418706f2543Smrg        1           2               DMX opcode (X_DMXReconfigureScreen)
419706f2543Smrg        2           2               request length
420706f2543Smrg        4           CARD32          screen
421706f2543Smrg        2           INT16           x
422706f2543Smrg        2           INT16           y
423706f2543Smrg    ==>
424706f2543Smrg        1           1               Reply
425706f2543Smrg        1                           unused
426706f2543Smrg        2           CARD16          sequence number
427706f2543Smrg        4           0               reply length
428706f2543Smrg        4           CARD32          status
429706f2543Smrg        20                          unused
430706f2543Smrg
431706f2543Smrg    DMXSync
432706f2543Smrg        1           CARD8           opcode (X assigned)
433706f2543Smrg        1           0               DMX opcode (X_DMXSync)
434706f2543Smrg        2           1               request length
435706f2543Smrg    ==>
436706f2543Smrg        1           1               Reply
437706f2543Smrg        1                           unused
438706f2543Smrg        2           CARD16          sequence number
439706f2543Smrg        4           0               reply length
440706f2543Smrg        24                          unused
441706f2543Smrg
442706f2543Smrg
443706f2543Smrg8. Changes to existing requests/replies/events
444706f2543Smrg
445706f2543Smrg    No changes to existing requests, replies, or events are necessitated
446706f2543Smrg    by this extension.
447706f2543Smrg
448706f2543Smrg
449706f2543Smrg
450706f2543Smrg9. Acknowledgments
451706f2543Smrg
452706f2543Smrg
453706f2543Smrg
454706f2543Smrg10. References
455706f2543Smrg
456706f2543Smrg    [X11R6.4] Robert W. Sheifler.  X Window System Protocol, X Consortium
457706f2543Smrg              Standard, X Version 11, Release 6.4.  Available from
458706f2543Smrg              xc/doc/specs/XProtocol and xc/doc/hardcopy/XProtocol.
459