xref: /openbmc/qemu/ui/dbus-display1.xml (revision 34e29d85a7734802317c4cac9ad52b10d461c1dc)
1<?xml version="1.0" encoding="utf-8"?>
2<node>
3  <!--
4      org.qemu.Display1.VM:
5
6      This interface is implemented on ``/org/qemu/Display1/VM``.
7  -->
8  <interface name="org.qemu.Display1.VM">
9    <!--
10        Name:
11
12        The name of the VM.
13    -->
14    <property name="Name" type="s" access="read"/>
15
16    <!--
17        UUID:
18
19        The UUID of the VM.
20    -->
21    <property name="UUID" type="s" access="read"/>
22
23    <!--
24        ConsoleIDs:
25
26        The list of consoles available on ``/org/qemu/Display1/Console_$id``.
27    -->
28    <property name="ConsoleIDs" type="au" access="read"/>
29  </interface>
30
31  <!--
32      org.qemu.Display1.Console:
33
34      This interface is implemented on ``/org/qemu/Display1/Console_$id``. You
35      may discover available consoles through introspection or with the
36      :dbus:prop:`org.qemu.Display1.VM.ConsoleIDs` property.
37
38      A console is attached to a video device head. It may be "Graphic" or
39      "Text" (see :dbus:prop:`Type` and other properties).
40
41      Interactions with a console may be done with
42      :dbus:iface:`org.qemu.Display1.Keyboard`,
43      :dbus:iface:`org.qemu.Display1.Mouse` and
44      :dbus:iface:`org.qemu.Display1.MultiTouch` interfaces when available.
45  -->
46  <interface name="org.qemu.Display1.Console">
47    <!--
48        RegisterListener:
49        @listener: a Unix socket FD, for peer-to-peer D-Bus communication.
50
51        Register a console listener, which will receive display updates, until
52        it is disconnected.
53
54        Multiple listeners may be registered simultaneously.
55
56        The listener is expected to implement the
57        :dbus:iface:`org.qemu.Display1.Listener` interface.
58    -->
59    <method name="RegisterListener">
60      <arg type="h" name="listener" direction="in"/>
61    </method>
62
63    <!--
64        SetUIInfo:
65        @width_mm: the physical display width in millimeters.
66        @height_mm: the physical display height in millimeters.
67        @xoff: horizontal offset, in pixels.
68        @yoff: vertical offset, in pixels.
69        @width: console width, in pixels.
70        @height: console height, in pixels.
71
72        Modify the dimensions and display settings.
73    -->
74    <method name="SetUIInfo">
75      <arg name="width_mm" type="q" direction="in"/>
76      <arg name="height_mm" type="q" direction="in"/>
77      <arg name="xoff" type="i" direction="in"/>
78      <arg name="yoff" type="i" direction="in"/>
79      <arg name="width" type="u" direction="in"/>
80      <arg name="height" type="u" direction="in"/>
81    </method>
82
83    <!--
84        Label:
85
86        A user-friendly name for the console (for ex: "VGA").
87    -->
88    <property name="Label" type="s" access="read"/>
89
90    <!--
91        Head:
92
93        Graphical device head number.
94    -->
95    <property name="Head" type="u" access="read"/>
96
97    <!--
98        Type:
99
100        Console type ("Graphic" or "Text").
101    -->
102    <property name="Type" type="s" access="read"/>
103
104    <!--
105        Width:
106
107        Console width, in pixels.
108    -->
109    <property name="Width" type="u" access="read"/>
110
111    <!--
112        Height:
113
114        Console height, in pixels.
115    -->
116    <property name="Height" type="u" access="read"/>
117
118    <!--
119        DeviceAddress:
120
121        The device address (ex: "pci/0000/02.0").
122    -->
123    <property name="DeviceAddress" type="s" access="read"/>
124  </interface>
125
126  <!--
127      org.qemu.Display1.Keyboard:
128
129      This interface in implemented on ``/org/qemu/Display1/Console_$id`` (see
130      :dbus:iface:`~org.qemu.Display1.Console`).
131  -->
132  <interface name="org.qemu.Display1.Keyboard">
133    <!--
134        Press:
135        @keycode: QEMU key number (xtkbd + special re-encoding of high bit)
136
137        Send a key press event.
138    -->
139    <method name="Press">
140      <arg type="u" name="keycode" direction="in"/>
141    </method>
142
143    <!--
144        Release:
145        @keycode: QEMU key number (xtkbd + special re-encoding of high bit)
146
147        Send a key release event.
148    -->
149    <method name="Release">
150      <arg type="u" name="keycode" direction="in"/>
151    </method>
152
153    <!--
154        Modifiers:
155
156        The active keyboard modifiers::
157
158          Scroll = 1 << 0
159          Num    = 1 << 1
160          Caps   = 1 << 2
161    -->
162    <property name="Modifiers" type="u" access="read"/>
163  </interface>
164
165  <!--
166      org.qemu.Display1.Mouse:
167
168      This interface in implemented on ``/org/qemu/Display1/Console_$id`` (see
169      :dbus:iface:`~org.qemu.Display1.Console` documentation).
170
171      .. _dbus-button-values:
172
173      **Button values**::
174
175        Left       = 0
176        Middle     = 1
177        Right      = 2
178        Wheel-up   = 3
179        Wheel-down = 4
180        Side       = 5
181        Extra      = 6
182  -->
183  <interface name="org.qemu.Display1.Mouse">
184    <!--
185        Press:
186        @button: :ref:`button value<dbus-button-values>`.
187
188        Send a mouse button press event.
189    -->
190    <method name="Press">
191      <arg type="u" name="button" direction="in"/>
192    </method>
193
194    <!--
195        Release:
196        @button: :ref:`button value<dbus-button-values>`.
197
198        Send a mouse button release event.
199    -->
200    <method name="Release">
201      <arg type="u" name="button" direction="in"/>
202    </method>
203
204    <!--
205        SetAbsPosition:
206        @x: X position, in pixels.
207        @y: Y position, in pixels.
208
209        Set the mouse pointer position.
210
211        Returns an error if not :dbus:prop:`IsAbsolute`.
212    -->
213    <method name="SetAbsPosition">
214      <arg type="u" name="x" direction="in"/>
215      <arg type="u" name="y" direction="in"/>
216    </method>
217
218    <!--
219        RelMotion:
220        @dx: X-delta, in pixels.
221        @dy: Y-delta, in pixels.
222
223        Move the mouse pointer position, relative to the current position.
224
225        Returns an error if :dbus:prop:`IsAbsolute`.
226    -->
227    <method name="RelMotion">
228      <arg type="i" name="dx" direction="in"/>
229      <arg type="i" name="dy" direction="in"/>
230    </method>
231
232    <!--
233        IsAbsolute:
234
235        Whether the mouse is using absolute movements.
236    -->
237    <property name="IsAbsolute" type="b" access="read"/>
238  </interface>
239
240  <!--
241      org.qemu.Display1.MultiTouch:
242
243      This interface in implemented on ``/org/qemu/Display1/Console_$id`` (see
244      :dbus:iface:`~org.qemu.Display1.Console` documentation).
245
246      .. _dbus-kind-values:
247
248      **Kind values**::
249
250        Begin       = 0
251        Update      = 1
252        End         = 2
253        Cancel      = 3
254  -->
255  <interface name="org.qemu.Display1.MultiTouch">
256    <!--
257        SendEvent:
258        @kind: The touch event kind
259        @num_slot: The slot number.
260        @x: The x coordinates.
261        @y: The y coordinates.
262
263        Send a touch gesture event.
264    -->
265    <method name="SendEvent">
266      <arg type="u" name="kind" direction="in"/>
267      <arg type="t" name="num_slot" direction="in"/>
268      <arg type="d" name="x" direction="in"/>
269      <arg type="d" name="y" direction="in"/>
270    </method>
271
272    <!--
273        MaxSlots:
274
275        The maximum number of slots.
276    -->
277    <property name="MaxSlots" type="i" access="read"/>
278  </interface>
279
280  <!--
281      org.qemu.Display1.Listener:
282
283      This client-side interface must be available on
284      ``/org/qemu/Display1/Listener`` when registering the peer-to-peer
285      connection with :dbus:meth:`~org.qemu.Display1.Console.Register`.
286  -->
287  <interface name="org.qemu.Display1.Listener">
288    <!--
289        Scanout:
290        @width: display width, in pixels.
291        @height: display height, in pixels.
292        @stride: data stride, in bytes.
293        @pixman_format: image format (ex: ``PIXMAN_X8R8G8B8``).
294        @data: image data.
295
296        Resize and update the display content.
297
298        The data to transfer for the display update may be large. The preferred
299        scanout method is :dbus:meth:`ScanoutDMABUF`, used whenever possible.
300    -->
301    <method name="Scanout">
302      <arg type="u" name="width" direction="in"/>
303      <arg type="u" name="height" direction="in"/>
304      <arg type="u" name="stride" direction="in"/>
305      <arg type="u" name="pixman_format" direction="in"/>
306      <arg type="ay" name="data" direction="in">
307        <annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
308      </arg>
309    </method>
310
311    <!--
312        Update:
313        @x: X update position, in pixels.
314        @y: Y update position, in pixels.
315        @width: update width, in pixels.
316        @height: update height, in pixels.
317        @stride: data stride, in bytes.
318        @pixman_format: image format (ex: ``PIXMAN_X8R8G8B8``).
319        @data: display image data.
320
321        Update the display content.
322
323        This method is only called after a :dbus:meth:`Scanout` call.
324    -->
325    <method name="Update">
326      <arg type="i" name="x" direction="in"/>
327      <arg type="i" name="y" direction="in"/>
328      <arg type="i" name="width" direction="in"/>
329      <arg type="i" name="height" direction="in"/>
330      <arg type="u" name="stride" direction="in"/>
331      <arg type="u" name="pixman_format" direction="in"/>
332      <arg type="ay" name="data" direction="in">
333        <annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
334      </arg>
335    </method>
336
337    <!--
338        ScanoutDMABUF:
339        @dmabuf: the DMABUF file descriptor.
340        @width: display width, in pixels.
341        @height: display height, in pixels.
342        @stride: stride, in bytes.
343        @fourcc: DMABUF fourcc.
344        @modifier: DMABUF modifier.
345        @y0_top: whether Y position 0 is the top or not.
346
347        Resize and update the display content with a DMABUF.
348    -->
349    <method name="ScanoutDMABUF">
350      <arg type="h" name="dmabuf" direction="in"/>
351      <arg type="u" name="width" direction="in"/>
352      <arg type="u" name="height" direction="in"/>
353      <arg type="u" name="stride" direction="in"/>
354      <arg type="u" name="fourcc" direction="in"/>
355      <!-- xywh? -->
356      <arg type="t" name="modifier" direction="in"/>
357      <arg type="b" name="y0_top" direction="in"/>
358    </method>
359
360    <!--
361        UpdateDMABUF:
362        @x: the X update position, in pixels.
363        @y: the Y update position, in pixels.
364        @width: the update width, in pixels.
365        @height: the update height, in pixels.
366
367        Update the display content with the current DMABUF and the given region.
368    -->
369    <method name="UpdateDMABUF">
370      <arg type="i" name="x" direction="in"/>
371      <arg type="i" name="y" direction="in"/>
372      <arg type="i" name="width" direction="in"/>
373      <arg type="i" name="height" direction="in"/>
374    </method>
375
376    <!--
377        Disable:
378
379        Disable the display (turn it off).
380    -->
381    <method name="Disable">
382    </method>
383
384    <!--
385        MouseSet:
386        @x: X mouse position, in pixels.
387        @y: Y mouse position, in pixels.
388        @on: whether the mouse is visible or not.
389
390        Set the mouse position and visibility.
391    -->
392    <method name="MouseSet">
393      <arg type="i" name="x" direction="in"/>
394      <arg type="i" name="y" direction="in"/>
395      <arg type="i" name="on" direction="in"/>
396    </method>
397
398    <!--
399        CursorDefine:
400        @width: cursor width, in pixels.
401        @height: cursor height, in pixels.
402        @hot_x: hot-spot X position, in pixels.
403        @hot_y: hot-spot Y position, in pixels.
404        @data: the cursor data.
405
406        Set the mouse cursor shape and hot-spot. The "data" must be ARGB, 32-bit
407        per pixel.
408    -->
409    <method name="CursorDefine">
410      <arg type="i" name="width" direction="in"/>
411      <arg type="i" name="height" direction="in"/>
412      <arg type="i" name="hot_x" direction="in"/>
413      <arg type="i" name="hot_y" direction="in"/>
414      <arg type="ay" name="data" direction="in">
415        <annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
416      </arg>
417    </method>
418  </interface>
419
420  <!--
421      org.qemu.Display1.Clipboard:
422
423      This interface must be implemented by both the client and the server on
424      ``/org/qemu/Display1/Clipboard`` to support clipboard sharing between
425      the client and the guest.
426
427      Once :dbus:meth:`Register`'ed, method calls may be sent and received in both
428      directions. Unregistered callers will get error replies.
429
430      .. _dbus-clipboard-selection:
431
432      **Selection values**::
433
434        Clipboard   = 0
435        Primary     = 1
436        Secondary   = 2
437
438      .. _dbus-clipboard-serial:
439
440      **Serial counter**
441
442      To solve potential clipboard races, clipboard grabs have an associated
443      serial counter. It is set to 0 on registration, and incremented by 1 for
444      each grab. The peer with the highest serial is the clipboard grab owner.
445
446      When a grab with a lower serial is received, it should be discarded.
447
448      When a grab is attempted with the same serial number as the current grab,
449      the one coming from the client should have higher priority, and the client
450      should gain clipboard grab ownership.
451  -->
452  <interface name="org.qemu.Display1.Clipboard">
453    <!--
454        Register:
455
456        Register a clipboard session and reinitialize the serial counter.
457
458        The client must register itself, and is granted an exclusive
459        access for handling the clipboard.
460
461        The server can reinitialize the session as well (to reset the counter).
462    -->
463    <method name="Register"/>
464
465    <!--
466        Unregister:
467
468        Unregister the clipboard session.
469    -->
470    <method name="Unregister"/>
471    <!--
472        Grab:
473        @selection: a :ref:`selection value<dbus-clipboard-selection>`.
474        @serial: the current grab :ref:`serial<dbus-clipboard-serial>`.
475        @mimes: the list of available content MIME types.
476
477        Grab the clipboard, claiming current clipboard content.
478    -->
479    <method name="Grab">
480      <arg type="u" name="selection"/>
481      <arg type="u" name="serial"/>
482      <arg type="as" name="mimes"/>
483    </method>
484
485    <!--
486        Release:
487        @selection: a :ref:`selection value<dbus-clipboard-selection>`.
488
489        Release the clipboard (does nothing if not the current owner).
490    -->
491    <method name="Release">
492      <arg type="u" name="selection"/>
493    </method>
494
495    <!--
496        Request:
497        @selection: a :ref:`selection value<dbus-clipboard-selection>`
498        @mimes: requested MIME types (by order of preference).
499        @reply_mime: the returned data MIME type.
500        @data: the clipboard data.
501
502        Request the clipboard content.
503
504        Return an error if the clipboard is empty, or the requested MIME types
505        are unavailable.
506    -->
507    <method name="Request">
508      <arg type="u" name="selection"/>
509      <arg type="as" name="mimes"/>
510      <arg type="s" name="reply_mime" direction="out"/>
511      <arg type="ay" name="data" direction="out">
512        <annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
513      </arg>
514    </method>
515  </interface>
516
517  <!--
518      org.qemu.Display1.Audio:
519
520      Audio backend may be available on ``/org/qemu/Display1/Audio``.
521  -->
522  <interface name="org.qemu.Display1.Audio">
523    <!--
524        RegisterOutListener:
525        @listener: a Unix socket FD, for peer-to-peer D-Bus communication.
526
527        Register an audio backend playback handler.
528
529        Multiple listeners may be registered simultaneously.
530
531        The listener is expected to implement the
532        :dbus:iface:`org.qemu.Display1.AudioOutListener` interface.
533    -->
534    <method name="RegisterOutListener">
535      <arg type="h" name="listener" direction="in"/>
536    </method>
537
538    <!--
539        RegisterInListener:
540        @listener: a Unix socket FD, for peer-to-peer D-Bus communication.
541
542        Register an audio backend record handler.
543
544        Multiple listeners may be registered simultaneously.
545
546        The listener is expected to implement the
547        :dbus:iface:`org.qemu.Display1.AudioInListener` interface.
548    -->
549    <method name="RegisterInListener">
550      <arg type="h" name="listener" direction="in"/>
551    </method>
552  </interface>
553
554  <!--
555      org.qemu.Display1.AudioOutListener:
556
557      This client-side interface must be available on
558      ``/org/qemu/Display1/AudioOutListener`` when registering the peer-to-peer
559      connection with :dbus:meth:`~org.qemu.Display1.Audio.RegisterOutListener`.
560  -->
561  <interface name="org.qemu.Display1.AudioOutListener">
562    <!--
563        Init:
564        @id: the stream ID.
565        @bits: PCM bits per sample.
566        @is_signed: whether the PCM data is signed.
567        @is_float: PCM floating point format.
568        @freq: the PCM frequency in Hz.
569        @nchannels: the number of channels.
570        @bytes_per_frame: the bytes per frame.
571        @bytes_per_second: the bytes per second.
572        @be: whether using big-endian format.
573
574        Initializes a PCM playback stream.
575    -->
576    <method name="Init">
577      <arg name="id" type="t" direction="in"/>
578      <arg name="bits" type="y" direction="in"/>
579      <arg name="is_signed" type="b" direction="in"/>
580      <arg name="is_float" type="b" direction="in"/>
581      <arg name="freq" type="u" direction="in"/>
582      <arg name="nchannels" type="y" direction="in"/>
583      <arg name="bytes_per_frame" type="u" direction="in"/>
584      <arg name="bytes_per_second" type="u" direction="in"/>
585      <arg name="be" type="b" direction="in"/>
586    </method>
587
588    <!--
589        Fini:
590        @id: the stream ID.
591
592        Finish & close a playback stream.
593    -->
594    <method name="Fini">
595      <arg name="id" type="t" direction="in"/>
596    </method>
597
598    <!--
599        SetEnabled:
600        @id: the stream ID.
601
602        Resume or suspend the playback stream.
603    -->
604    <method name="SetEnabled">
605      <arg name="id" type="t" direction="in"/>
606      <arg name="enabled" type="b" direction="in"/>
607    </method>
608
609    <!--
610        SetVolume:
611        @id: the stream ID.
612        @mute: whether the stream is muted.
613        @volume: the volume per-channel.
614
615        Set the stream volume and mute state (volume without unit, 0-255).
616    -->
617    <method name="SetVolume">
618      <arg name="id" type="t" direction="in"/>
619      <arg name="mute" type="b" direction="in"/>
620      <arg name="volume" type="ay" direction="in">
621        <annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
622      </arg>
623    </method>
624
625    <!--
626        Write:
627        @id: the stream ID.
628        @data: the PCM data.
629
630        PCM stream to play.
631    -->
632    <method name="Write">
633      <arg name="id" type="t" direction="in"/>
634      <arg type="ay" name="data" direction="in">
635        <annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
636      </arg>
637    </method>
638  </interface>
639
640  <!--
641      org.qemu.Display1.AudioInListener:
642
643      This client-side interface must be available on
644      ``/org/qemu/Display1/AudioInListener`` when registering the peer-to-peer
645      connection with :dbus:meth:`~org.qemu.Display1.Audio.RegisterInListener`.
646  -->
647  <interface name="org.qemu.Display1.AudioInListener">
648    <!--
649        Init:
650        @id: the stream ID.
651        @bits: PCM bits per sample.
652        @is_signed: whether the PCM data is signed.
653        @is_float: PCM floating point format.
654        @freq: the PCM frequency in Hz.
655        @nchannels: the number of channels.
656        @bytes_per_frame: the bytes per frame.
657        @bytes_per_second: the bytes per second.
658        @be: whether using big-endian format.
659
660        Initializes a PCM record stream.
661    -->
662    <method name="Init">
663      <arg name="id" type="t" direction="in"/>
664      <arg name="bits" type="y" direction="in"/>
665      <arg name="is_signed" type="b" direction="in"/>
666      <arg name="is_float" type="b" direction="in"/>
667      <arg name="freq" type="u" direction="in"/>
668      <arg name="nchannels" type="y" direction="in"/>
669      <arg name="bytes_per_frame" type="u" direction="in"/>
670      <arg name="bytes_per_second" type="u" direction="in"/>
671      <arg name="be" type="b" direction="in"/>
672    </method>
673
674    <!--
675        Fini:
676        @id: the stream ID.
677
678        Finish & close a record stream.
679    -->
680    <method name="Fini">
681      <arg name="id" type="t" direction="in"/>
682    </method>
683
684    <!--
685        SetEnabled:
686        @id: the stream ID.
687
688        Resume or suspend the record stream.
689    -->
690    <method name="SetEnabled">
691      <arg name="id" type="t" direction="in"/>
692      <arg name="enabled" type="b" direction="in"/>
693    </method>
694
695    <!--
696        SetVolume:
697        @id: the stream ID.
698        @mute: whether the stream is muted.
699        @volume: the volume per-channel.
700
701        Set the stream volume and mute state (volume without unit, 0-255).
702    -->
703    <method name="SetVolume">
704      <arg name="id" type="t" direction="in"/>
705      <arg name="mute" type="b" direction="in"/>
706      <arg name="volume" type="ay" direction="in">
707        <annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
708      </arg>
709    </method>
710
711    <!--
712        Read:
713        @id: the stream ID.
714        @size: the amount to read, in bytes.
715        @data: the recorded data (which may be less than requested).
716
717        Read "size" bytes from the record stream.
718    -->
719    <method name="Read">
720      <arg name="id" type="t" direction="in"/>
721      <arg name="size" type="t" direction="in"/>
722      <arg type="ay" name="data" direction="out">
723        <annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
724      </arg>
725    </method>
726  </interface>
727
728  <!--
729      org.qemu.Display1.Chardev:
730
731      Character devices may be available on ``/org/qemu/Display1/Chardev_$id``.
732
733      They may be used for different kind of streams, which are identified via
734      their FQDN :dbus:prop:`Name`.
735
736      .. _dbus-chardev-fqdn:
737
738      Here are some known reserved kind names (the ``org.qemu`` prefix is
739      reserved by QEMU):
740
741      org.qemu.console.serial.0
742        A serial console stream.
743
744      org.qemu.monitor.hmp.0
745        A QEMU HMP human monitor.
746
747      org.qemu.monitor.qmp.0
748        A QEMU QMP monitor.
749
750      org.qemu.usbredir
751        A usbredir stream.
752  -->
753  <interface name="org.qemu.Display1.Chardev">
754    <!--
755        Register:
756        @stream: a Unix FD to redirect the stream to.
757
758        Register a file-descriptor for the stream handling.
759
760        The current handler, if any, will be replaced.
761    -->
762    <method name="Register">
763      <arg type="h" name="stream" direction="in"/>
764    </method>
765
766    <!--
767        SendBreak:
768
769        Send a break event to the character device.
770    -->
771    <method name="SendBreak"/>
772
773    <!--
774        Name:
775
776        The FQDN name to identify the kind of stream. See :ref:`reserved
777        names<dbus-chardev-fqdn>`.
778    -->
779    <property name="Name" type="s" access="read"/>
780
781    <!--
782        FEOpened:
783
784        Whether the front-end side is opened.
785    -->
786    <property name="FEOpened" type="b" access="read"/>
787
788    <!--
789        Echo:
790
791        Whether the input should be echo'ed (for serial streams).
792    -->
793    <property name="Echo" type="b" access="read"/>
794
795    <!--
796        Owner:
797
798        The D-Bus unique name of the registered handler.
799    -->
800    <property name="Owner" type="s" access="read"/>
801  </interface>
802</node>
803