remote-desktop, screen-cast: Add version number to D-Bus APIs

In order to let applications gracefully handle version mismatches, add
a version property to the APIs. Also add a warning on the APIs that
these are not meant for public consumption.
This commit is contained in:
Jonas Ådahl 2018-01-29 14:52:06 +08:00
parent 8dd377da38
commit e502adfa04
4 changed files with 28 additions and 0 deletions

View File

@ -42,6 +42,7 @@
#define META_REMOTE_DESKTOP_DBUS_SERVICE "org.gnome.Mutter.RemoteDesktop" #define META_REMOTE_DESKTOP_DBUS_SERVICE "org.gnome.Mutter.RemoteDesktop"
#define META_REMOTE_DESKTOP_DBUS_PATH "/org/gnome/Mutter/RemoteDesktop" #define META_REMOTE_DESKTOP_DBUS_PATH "/org/gnome/Mutter/RemoteDesktop"
#define META_REMOTE_DESKTOP_API_VERSION 1
typedef enum _MetaRemoteDesktopDeviceTypes typedef enum _MetaRemoteDesktopDeviceTypes
{ {
@ -262,6 +263,9 @@ meta_remote_desktop_init (MetaRemoteDesktop *remote_desktop)
meta_dbus_remote_desktop_set_supported_device_types ( meta_dbus_remote_desktop_set_supported_device_types (
META_DBUS_REMOTE_DESKTOP (remote_desktop), META_DBUS_REMOTE_DESKTOP (remote_desktop),
calculate_supported_device_types ()); calculate_supported_device_types ());
meta_dbus_remote_desktop_set_version (
META_DBUS_REMOTE_DESKTOP (remote_desktop),
META_REMOTE_DESKTOP_API_VERSION);
} }
static void static void

View File

@ -32,6 +32,7 @@
#define META_SCREEN_CAST_DBUS_SERVICE "org.gnome.Mutter.ScreenCast" #define META_SCREEN_CAST_DBUS_SERVICE "org.gnome.Mutter.ScreenCast"
#define META_SCREEN_CAST_DBUS_PATH "/org/gnome/Mutter/ScreenCast" #define META_SCREEN_CAST_DBUS_PATH "/org/gnome/Mutter/ScreenCast"
#define META_SCREEN_CAST_API_VERSION 1
struct _MetaScreenCast struct _MetaScreenCast
{ {
@ -264,6 +265,9 @@ meta_screen_cast_init (MetaScreenCast *screen_cast)
pw_init (NULL, NULL); pw_init (NULL, NULL);
is_pipewire_initialized = TRUE; is_pipewire_initialized = TRUE;
} }
meta_dbus_screen_cast_set_version (META_DBUS_SCREEN_CAST (screen_cast),
META_SCREEN_CAST_API_VERSION);
} }
static void static void

View File

@ -6,6 +6,10 @@
<!-- <!--
org.gnome.Mutter.RemoteDesktop: org.gnome.Mutter.RemoteDesktop:
@short_description: Remote desktop interface @short_description: Remote desktop interface
This API is private and not intended to be used outside of the integrated
system that uses libmutter. No compatibility between versions are
promised.
--> -->
<interface name="org.gnome.Mutter.RemoteDesktop"> <interface name="org.gnome.Mutter.RemoteDesktop">
@ -28,6 +32,12 @@
--> -->
<property name="SupportedDeviceTypes" type="u" access="read" /> <property name="SupportedDeviceTypes" type="u" access="read" />
<!--
Version:
@short_description: API version
-->
<property name="Version" type="i" access="read" />
</interface> </interface>
<!-- <!--

View File

@ -6,6 +6,10 @@
<!-- <!--
org.gnome.Mutter.ScreenCast: org.gnome.Mutter.ScreenCast:
@short_description: Screen cast interface @short_description: Screen cast interface
This API is private and not intended to be used outside of the integrated
system that uses libmutter. No compatibility between versions are
promised.
--> -->
<interface name="org.gnome.Mutter.ScreenCast"> <interface name="org.gnome.Mutter.ScreenCast">
@ -24,6 +28,12 @@
<arg name="session_path" type="o" direction="out" /> <arg name="session_path" type="o" direction="out" />
</method> </method>
<!--
Version:
@short_description: API version
-->
<property name="Version" type="i" access="read" />
</interface> </interface>
<!-- <!--