[Xfce4-commits] [xfce/xfce4-session] 01/11: Start with the dbus register interface
noreply at xfce.org
noreply at xfce.org
Tue Jun 28 09:26:04 CEST 2016
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository xfce/xfce4-session.
commit 894894991b90c3deab7a3ba230aafb6c91ca42f6
Author: Eric Koegel <eric.koegel at gmail.com>
Date: Tue May 31 10:32:36 2016 +0300
Start with the dbus register interface
---
xfce4-session/xfsm-manager-dbus.xml | 28 ++++++++++++++++++++++++++++
xfce4-session/xfsm-manager.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+)
diff --git a/xfce4-session/xfsm-manager-dbus.xml b/xfce4-session/xfsm-manager-dbus.xml
index 9b0c7c0..9c0aa67 100644
--- a/xfce4-session/xfsm-manager-dbus.xml
+++ b/xfce4-session/xfsm-manager-dbus.xml
@@ -149,6 +149,34 @@
</method>
<!--
+ ObjectPath[] org.Xfce.Session.Manager.RegisterClient
+
+ @app_id: The application identifier
+ @client_startup_id: Client startup identifier
+
+ Returns:
+ @client_id: The object path of the newly registered client
+
+ Register the caller as a Session Management client.
+ -->
+ <method name="RegisterClient">
+ <arg direction="in" name="app_id" type="s" />
+ <arg direction="in" name="client_startup_id" type="s" />
+ <arg direction="out" name="client_id" type="o" />
+ </method>
+
+ <!--
+ void org.Xfce.Session.Manager.UnregisterClient
+
+ @client_id: The object path of the previously registered client
+
+ Unregister the specified client from Session Management.
+ -->
+ <method name="UnregisterClient">
+ <arg direction="in" name="client_id" type="o" />
+ </method>
+
+ <!--
void org.xfce.Session.Manager.StateChanged(Unsigned Int old_state,
Unsigned Int new_state)
diff --git a/xfce4-session/xfsm-manager.c b/xfce4-session/xfsm-manager.c
index e53dd69..d586f55 100644
--- a/xfce4-session/xfsm-manager.c
+++ b/xfce4-session/xfsm-manager.c
@@ -1840,6 +1840,13 @@ static gboolean xfsm_manager_dbus_hibernate (XfsmDbusManager *object,
GDBusMethodInvocation *invocation);
static gboolean xfsm_manager_dbus_can_hibernate (XfsmDbusManager *object,
GDBusMethodInvocation *invocation);
+static gboolean xfsm_manager_dbus_register_client (XfsmDbusManager *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *arg_app_id,
+ const gchar *arg_client_startup_id);
+static gboolean xfsm_manager_dbus_unregister_client (XfsmDbusManager *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *arg_client_id);
/* eader needs the above fwd decls */
@@ -1894,6 +1901,8 @@ xfsm_manager_iface_init (XfsmDbusManagerIface *iface)
iface->handle_restart = xfsm_manager_dbus_restart;
iface->handle_shutdown = xfsm_manager_dbus_shutdown;
iface->handle_suspend = xfsm_manager_dbus_suspend;
+ iface->handle_register_client = xfsm_manager_dbus_register_client;
+ iface->handle_unregister_client = xfsm_manager_dbus_unregister_client;
}
static void
@@ -2225,3 +2234,25 @@ xfsm_manager_dbus_can_hibernate (XfsmDbusManager *object,
xfsm_dbus_manager_complete_can_hibernate (object, invocation, can_hibernate);
return TRUE;
}
+
+static gboolean
+xfsm_manager_dbus_register_client (XfsmDbusManager *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *arg_app_id,
+ const gchar *arg_client_startup_id)
+{
+ gchar *client_id = g_strdup_printf("/org/xfce/SessionManager/%s", arg_client_startup_id);
+
+ xfsm_dbus_manager_complete_register_client (object, invocation, client_id);
+ g_free(client_id);
+ return TRUE;
+}
+
+static gboolean
+xfsm_manager_dbus_unregister_client (XfsmDbusManager *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *arg_client_id)
+{
+ xfsm_dbus_manager_complete_unregister_client (object, invocation);
+ return TRUE;
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list