[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/21] ui/dbus: introduce "Interfaces" properties
From: |
marcandre . lureau |
Subject: |
[PATCH 08/21] ui/dbus: introduce "Interfaces" properties |
Date: |
Tue, 6 Jun 2023 15:56:45 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
This property is similar to ``org.freedesktop.DBus.Interfaces`` property
on the bus interface: it's an array of strings listing the extra
interfaces and capabilities available, in a convenient way.
Most interfaces are implicit, as they are required. For
``org/qemu/Display1_$id``, we can list the Keyboard And Mouse
interfaces. Those could be optional.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
ui/dbus-console.c | 6 +++
ui/dbus-display1.xml | 118 ++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 122 insertions(+), 2 deletions(-)
diff --git a/ui/dbus-console.c b/ui/dbus-console.c
index f0a060dc81..2f4d3439d1 100644
--- a/ui/dbus-console.c
+++ b/ui/dbus-console.c
@@ -494,6 +494,11 @@ dbus_display_console_new(DBusDisplay *display, QemuConsole
*con)
char device_addr[256] = "";
DBusDisplayConsole *ddc;
int idx;
+ const char *interfaces[] = {
+ "org.qemu.Display1.Keyboard",
+ "org.qemu.Display1.Mouse",
+ NULL
+ };
assert(display);
assert(con);
@@ -518,6 +523,7 @@ dbus_display_console_new(DBusDisplay *display, QemuConsole
*con)
"width", qemu_console_get_width(con, 0),
"height", qemu_console_get_height(con, 0),
"device-address", device_addr,
+ "interfaces", interfaces,
NULL);
g_object_connect(ddc->iface,
"swapped-signal::handle-register-listener",
diff --git a/ui/dbus-display1.xml b/ui/dbus-display1.xml
index 80eae363f0..2c4acce593 100644
--- a/ui/dbus-display1.xml
+++ b/ui/dbus-display1.xml
@@ -26,6 +26,20 @@
The list of consoles available on ``/org/qemu/Display1/Console_$id``.
-->
<property name="ConsoleIDs" type="au" access="read"/>
+
+ <!--
+ Interfaces:
+
+ This property lists extra interfaces provided by the
+ /org/qemu/Display1/VM object, and can be used to detect
+ the capabilities with which they are communicating.
+
+ Unlike the standard D-Bus Introspectable interface, querying this
+ property does not require parsing XML.
+
+ (earlier version of the display interface do not provide this property)
+ -->
+ <property name="Interfaces" type="as" access="read"/>
</interface>
<!--
@@ -126,12 +140,27 @@
The device address (ex: "pci/0000/02.0").
-->
<property name="DeviceAddress" type="s" access="read"/>
+
+ <!--
+ Interfaces:
+
+ This property lists extra interfaces provided by the
+ ``/org/qemu/Display1/Console_$id`` object, and can be used to detect
the
+ capabilities with which they are communicating.
+
+ Unlike the standard D-Bus Introspectable interface, querying this
+ property does not require parsing XML.
+
+ (earlier version of the display interface do not provide this property)
+ -->
+ <property name="Interfaces" type="as" access="read"/>
</interface>
<!--
org.qemu.Display1.Keyboard:
- This interface in implemented on ``/org/qemu/Display1/Console_$id`` (see
+ This interface is optionally implemented on
+ ``/org/qemu/Display1/Console_$id`` (see
:dbus:iface:`~org.qemu.Display1.Console`).
-->
<interface name="org.qemu.Display1.Keyboard">
@@ -170,7 +199,8 @@
<!--
org.qemu.Display1.Mouse:
- This interface in implemented on ``/org/qemu/Display1/Console_$id`` (see
+ This interface is optionally implemented on
+ ``/org/qemu/Display1/Console_$id`` (see
:dbus:iface:`~org.qemu.Display1.Console` documentation).
.. _dbus-button-values:
@@ -384,6 +414,20 @@
<annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
</arg>
</method>
+
+ <!--
+ Interfaces:
+
+ This property lists extra interfaces provided by the
+ /org/qemu/Display1/Listener object, and can be used to detect
+ the capabilities with which they are communicating.
+
+ Unlike the standard D-Bus Introspectable interface, querying this
+ property does not require parsing XML.
+
+ (earlier version of the display interface do not provide this property)
+ -->
+ <property name="Interfaces" type="as" access="read"/>
</interface>
<!--
@@ -481,6 +525,20 @@
<annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
</arg>
</method>
+
+ <!--
+ Interfaces:
+
+ This property lists extra interfaces provided by the
+ /org/qemu/Display1/Clipboard object, and can be used to detect
+ the capabilities with which they are communicating.
+
+ Unlike the standard D-Bus Introspectable interface, querying this
+ property does not require parsing XML.
+
+ (earlier version of the display interface do not provide this property)
+ -->
+ <property name="Interfaces" type="as" access="read"/>
</interface>
<!--
@@ -530,6 +588,20 @@
<arg type="h" name="listener" direction="in"/>
<?endif?>
</method>
+
+ <!--
+ Interfaces:
+
+ This property lists extra interfaces provided by the
+ /org/qemu/Display1/Audio object, and can be used to detect
+ the capabilities with which they are communicating.
+
+ Unlike the standard D-Bus Introspectable interface, querying this
+ property does not require parsing XML.
+
+ (earlier version of the display interface do not provide this property)
+ -->
+ <property name="Interfaces" type="as" access="read"/>
</interface>
<!--
@@ -616,6 +688,20 @@
<annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
</arg>
</method>
+
+ <!--
+ Interfaces:
+
+ This property lists extra interfaces provided by the
+ /org/qemu/Display1/AudioOutListener object, and can be used to detect
+ the capabilities with which they are communicating.
+
+ Unlike the standard D-Bus Introspectable interface, querying this
+ property does not require parsing XML.
+
+ (earlier version of the display interface do not provide this property)
+ -->
+ <property name="Interfaces" type="as" access="read"/>
</interface>
<!--
@@ -704,6 +790,20 @@
<annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
</arg>
</method>
+
+ <!--
+ Interfaces:
+
+ This property lists extra interfaces provided by the
+ /org/qemu/Display1/AudioInListener object, and can be used to detect
+ the capabilities with which they are communicating.
+
+ Unlike the standard D-Bus Introspectable interface, querying this
+ property does not require parsing XML.
+
+ (earlier version of the display interface do not provide this property)
+ -->
+ <property name="Interfaces" type="as" access="read"/>
</interface>
<!--
@@ -785,5 +885,19 @@
The D-Bus unique name of the registered handler.
-->
<property name="Owner" type="s" access="read"/>
+
+ <!--
+ Interfaces:
+
+ This property lists extra interfaces provided by the
+ ``/org/qemu/Display1/Chardev_$i`` object, and can be used to detect
+ the capabilities with which they are communicating.
+
+ Unlike the standard D-Bus Introspectable interface, querying this
+ property does not require parsing XML.
+
+ (earlier version of the display interface do not provide this property)
+ -->
+ <property name="Interfaces" type="as" access="read"/>
</interface>
</node>
--
2.40.1
- [PATCH 00/21] -display dbus: add win32 support, marcandre . lureau, 2023/06/06
- [PATCH 01/21] ui/egl: export qemu_egl_get_error_string(), marcandre . lureau, 2023/06/06
- [PATCH 02/21] ui/egl: fix make_context_current() callback return value, marcandre . lureau, 2023/06/06
- [PATCH 03/21] ui/dbus: compile without gio/gunixfdlist.h, marcandre . lureau, 2023/06/06
- [PATCH 04/21] scripts: add a XML preprocessor script, marcandre . lureau, 2023/06/06
- [PATCH 05/21] ui/dbus: win32 support, marcandre . lureau, 2023/06/06
- [PATCH 06/21] qtest: add qtest_pid(), marcandre . lureau, 2023/06/06
- [PATCH 07/21] tests: make dbus-display-test work on win32, marcandre . lureau, 2023/06/06
- [PATCH 08/21] ui/dbus: introduce "Interfaces" properties,
marcandre . lureau <=
- [PATCH 10/21] virtio-gpu/win32: allocate shareable 2d resources/images, marcandre . lureau, 2023/06/06
- [PATCH 11/21] ui/dbus: use shared memory when possible on win32, marcandre . lureau, 2023/06/06
- [PATCH 12/21] ui: add egl-headless support on win32, marcandre . lureau, 2023/06/06
- [PATCH 13/21] ui/egl: default to GLES on windows, marcandre . lureau, 2023/06/06
- [PATCH 14/21] ui: add egl_fb_read_rect(), marcandre . lureau, 2023/06/06
- [PATCH 15/21] ui/dbus: add GL support on win32, marcandre . lureau, 2023/06/06
- [PATCH 16/21] ui/dbus: add some GL traces, marcandre . lureau, 2023/06/06
- [PATCH 18/21] ui/egl: query ANGLE d3d device, marcandre . lureau, 2023/06/06
- [PATCH 17/21] virtio-gpu-virgl: teach it to get the QEMU EGL display, marcandre . lureau, 2023/06/06
- [PATCH 19/21] ui: add optional d3d texture pointer to scanout texture, marcandre . lureau, 2023/06/06