dbus: add a version to the plugin d-bus interface
authorAlexander Kanavin <alexander.kanavin@intel.com>
Thu, 13 Feb 2014 17:09:57 +0000 (19:09 +0200)
committerAlexander Kanavin <alexander.kanavin@intel.com>
Thu, 13 Feb 2014 17:19:08 +0000 (19:19 +0200)
src/daemon/dbus/interfaces/com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.xml
src/daemon/plugins/gsignond-plugin-remote-private.h
src/daemon/plugins/gsignond-plugin-remote.c
src/gplugind/gsignond-plugin-daemon.c

index ba0fa43..7918caa 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
 <node>
-  <interface name="com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin">
+  <interface name="com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin.V1">
     <property type='s' name='method' access='read'/>
     <property type='as' name='mechanisms' access='read'/>
     <method name="cancel">
index f8b7375..64e3ec0 100644 (file)
@@ -35,7 +35,7 @@ G_BEGIN_DECLS
 struct _GSignondPluginRemotePrivate
 {
     GDBusConnection   *connection;
-    GSignondDbusRemotePlugin *dbus_plugin_proxy;
+    GSignondDbusRemotePluginV1 *dbus_plugin_proxy;
     GPid cpid;
     guint child_watch_id;
 
index f2ddcfc..4ddfaba 100644 (file)
@@ -158,12 +158,12 @@ gsignond_plugin_remote_get_property (
     switch (property_id) {
         case PROP_TYPE: {
             g_value_set_string (value,
-                                gsignond_dbus_remote_plugin_get_method(self->priv->dbus_plugin_proxy));
+                                gsignond_dbus_remote_plugin_v1_get_method(self->priv->dbus_plugin_proxy));
             break;
         }
         case PROP_MECHANISMS: {
             g_value_set_boxed (value,
-                               gsignond_dbus_remote_plugin_get_mechanisms(self->priv->dbus_plugin_proxy));
+                               gsignond_dbus_remote_plugin_v1_get_mechanisms(self->priv->dbus_plugin_proxy));
             break;
         }
         default:
@@ -285,10 +285,10 @@ _cancel_async_cb (
         gpointer user_data)
 {
     GError *error = NULL;
-    GSignondDbusRemotePlugin *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN (object);
+    GSignondDbusRemotePluginV1 *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN_V1 (object);
     GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (user_data);
 
-    gsignond_dbus_remote_plugin_call_cancel_finish (proxy, res, &error);
+    gsignond_dbus_remote_plugin_v1_call_cancel_finish (proxy, res, &error);
     if (error) {
         gsignond_plugin_error (GSIGNOND_PLUGIN(self), error);
         g_error_free (error);
@@ -302,7 +302,7 @@ gsignond_plugin_remote_cancel (
     g_return_if_fail (plugin && GSIGNOND_IS_PLUGIN_REMOTE (plugin));
     GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (plugin);
 
-    gsignond_dbus_remote_plugin_call_cancel (
+    gsignond_dbus_remote_plugin_v1_call_cancel (
             self->priv->dbus_plugin_proxy, NULL, _cancel_async_cb, self);
 }
 
@@ -313,9 +313,9 @@ _request_initial_async_cb (
         gpointer user_data)
 {
     GError *error = NULL;
-    GSignondDbusRemotePlugin *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN (object);
+    GSignondDbusRemotePluginV1 *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN_V1 (object);
     GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (user_data);
-    gsignond_dbus_remote_plugin_call_request_initial_finish (proxy,
+    gsignond_dbus_remote_plugin_v1_call_request_initial_finish (proxy,
             res, &error);
     if (error) {
         gsignond_plugin_error (GSIGNOND_PLUGIN(self), error);
@@ -343,7 +343,7 @@ gsignond_plugin_remote_request_initial (
         cache = gsignond_dictionary_to_variant (empty_cache);
         gsignond_dictionary_unref(empty_cache);
     }
-    gsignond_dbus_remote_plugin_call_request_initial (
+    gsignond_dbus_remote_plugin_v1_call_request_initial (
             self->priv->dbus_plugin_proxy, data, cache, mechanism, NULL,
             _request_initial_async_cb, self);
 }
@@ -355,10 +355,10 @@ _request_async_cb (
         gpointer user_data)
 {
     GError *error = NULL;
-    GSignondDbusRemotePlugin *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN (object);
+    GSignondDbusRemotePluginV1 *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN_V1 (object);
     GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (user_data);
 
-    gsignond_dbus_remote_plugin_call_request_finish (proxy, res, &error);
+    gsignond_dbus_remote_plugin_v1_call_request_finish (proxy, res, &error);
     if (error) {
         gsignond_plugin_error (GSIGNOND_PLUGIN(self), error);
         g_error_free (error);
@@ -375,7 +375,7 @@ gsignond_plugin_remote_request (
     GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (plugin);
 
     GVariant *data = gsignond_dictionary_to_variant (session_data);
-    gsignond_dbus_remote_plugin_call_request (
+    gsignond_dbus_remote_plugin_v1_call_request (
             self->priv->dbus_plugin_proxy, data, NULL, _request_async_cb, self);
 }
 
@@ -386,10 +386,10 @@ _user_action_finished_async_cb (
         gpointer user_data)
 {
     GError *error = NULL;
-    GSignondDbusRemotePlugin *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN (object);
+    GSignondDbusRemotePluginV1 *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN_V1 (object);
     GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (user_data);
 
-    gsignond_dbus_remote_plugin_call_user_action_finished_finish (proxy,
+    gsignond_dbus_remote_plugin_v1_call_user_action_finished_finish (proxy,
             res, &error);
     if (error) {
         gsignond_plugin_error (GSIGNOND_PLUGIN(self), error);
@@ -407,7 +407,7 @@ gsignond_plugin_remote_user_action_finished (
     GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (plugin);
 
     GVariant *data = gsignond_dictionary_to_variant (signonui_data);
-    gsignond_dbus_remote_plugin_call_user_action_finished (
+    gsignond_dbus_remote_plugin_v1_call_user_action_finished (
             self->priv->dbus_plugin_proxy, data, NULL,
             _user_action_finished_async_cb, self);
 }
@@ -419,10 +419,10 @@ _refresh_async_cb (
         gpointer user_data)
 {
     GError *error = NULL;
-    GSignondDbusRemotePlugin *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN (object);
+    GSignondDbusRemotePluginV1 *proxy = GSIGNOND_DBUS_REMOTE_PLUGIN_V1 (object);
     GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (user_data);
 
-    gsignond_dbus_remote_plugin_call_refresh_finish (proxy, res, &error);
+    gsignond_dbus_remote_plugin_v1_call_refresh_finish (proxy, res, &error);
     if (error) {
         gsignond_plugin_error (GSIGNOND_PLUGIN(self), error);
         g_error_free (error);
@@ -439,7 +439,7 @@ gsignond_plugin_remote_refresh (
     GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (plugin);
 
     GVariant *data = gsignond_dictionary_to_variant (signonui_data);
-    gsignond_dbus_remote_plugin_call_refresh (
+    gsignond_dbus_remote_plugin_v1_call_refresh (
             self->priv->dbus_plugin_proxy, data, NULL, _refresh_async_cb, self);
 }
 
@@ -598,7 +598,7 @@ gsignond_plugin_remote_new (
 
     /* Create dbus proxy */
     plugin->priv->dbus_plugin_proxy =
-            gsignond_dbus_remote_plugin_proxy_new_sync (
+            gsignond_dbus_remote_plugin_v1_proxy_new_sync (
                     plugin->priv->connection,
                     G_DBUS_PROXY_FLAGS_NONE,
                     NULL,
index 0640cc3..4ce60b6 100644 (file)
@@ -35,7 +35,7 @@
 struct _GSignondPluginDaemonPrivate
 {
     GDBusConnection   *connection;
-    GSignondDbusRemotePlugin *dbus_remote_plugin;
+    GSignondDbusRemotePluginV1 *dbus_remote_plugin;
     GSignondPlugin *plugin;
     gchar *plugin_type;
 };
@@ -137,7 +137,7 @@ _handle_cancel_from_dbus (
 {
     DBG ("");
     g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE);
-    gsignond_dbus_remote_plugin_complete_cancel (self->priv->dbus_remote_plugin,
+    gsignond_dbus_remote_plugin_v1_complete_cancel (self->priv->dbus_remote_plugin,
             invocation);
 
     gsignond_plugin_cancel (self->priv->plugin);
@@ -154,7 +154,7 @@ _handle_request_from_dbus (
     DBG ("");
     g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE);
 
-    gsignond_dbus_remote_plugin_complete_request (
+    gsignond_dbus_remote_plugin_v1_complete_request (
             self->priv->dbus_remote_plugin, invocation);
 
     GSignondSessionData *data = (GSignondSessionData *)
@@ -182,7 +182,7 @@ _handle_request_initial_from_dbus (
     DBG ("");
     g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE);
 
-    gsignond_dbus_remote_plugin_complete_request_initial (
+    gsignond_dbus_remote_plugin_v1_complete_request_initial (
             self->priv->dbus_remote_plugin, invocation);
 
     GSignondSessionData *data = (GSignondSessionData *)
@@ -206,7 +206,7 @@ _handle_user_action_finished_from_dbus (
     DBG ("");
     g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE);
 
-    gsignond_dbus_remote_plugin_complete_user_action_finished (
+    gsignond_dbus_remote_plugin_v1_complete_user_action_finished (
             self->priv->dbus_remote_plugin, invocation);
 
     GSignondSignonuiData *data = (GSignondSignonuiData *)
@@ -226,7 +226,7 @@ _handle_refresh_from_dbus (
     DBG ("");
     g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE);
 
-    gsignond_dbus_remote_plugin_complete_refresh (
+    gsignond_dbus_remote_plugin_v1_complete_refresh (
             self->priv->dbus_remote_plugin, invocation);
 
     GSignondSignonuiData *data = (GSignondSignonuiData *)
@@ -247,7 +247,7 @@ _handle_response_from_plugin (
 
     GVariant *data = gsignond_dictionary_to_variant (
             (GSignondDictionary *)session_data);
-    gsignond_dbus_remote_plugin_emit_response (self->priv->dbus_remote_plugin,
+    gsignond_dbus_remote_plugin_v1_emit_response (self->priv->dbus_remote_plugin,
             data);
 }
 
@@ -262,7 +262,7 @@ _handle_response_final_from_plugin (
 
     GVariant *data = gsignond_dictionary_to_variant (
             (GSignondDictionary *)session_data);
-    gsignond_dbus_remote_plugin_emit_response_final (
+    gsignond_dbus_remote_plugin_v1_emit_response_final (
             self->priv->dbus_remote_plugin, data);
 }
 
@@ -277,7 +277,7 @@ _handle_store_from_plugin (
 
     GVariant *data = gsignond_dictionary_to_variant (
             (GSignondDictionary *)session_data);
-    gsignond_dbus_remote_plugin_emit_store (self->priv->dbus_remote_plugin,
+    gsignond_dbus_remote_plugin_v1_emit_store (self->priv->dbus_remote_plugin,
             data);
 }
 
@@ -291,7 +291,7 @@ _handle_error_from_plugin (
     g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self));
 
     GVariant *error = gsignond_error_to_variant (gerror);
-    gsignond_dbus_remote_plugin_emit_error (self->priv->dbus_remote_plugin,
+    gsignond_dbus_remote_plugin_v1_emit_error (self->priv->dbus_remote_plugin,
             error);
 }
 
@@ -305,7 +305,7 @@ _handle_user_action_required_from_plugin (
     g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self));
 
     GVariant *data = gsignond_dictionary_to_variant (ui_data);
-    gsignond_dbus_remote_plugin_emit_user_action_required (
+    gsignond_dbus_remote_plugin_v1_emit_user_action_required (
             self->priv->dbus_remote_plugin, data);
 }
 
@@ -319,7 +319,7 @@ _handle_refreshed_from_plugin(
     g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self));
 
     GVariant *data = gsignond_dictionary_to_variant (ui_data);
-    gsignond_dbus_remote_plugin_emit_refreshed (self->priv->dbus_remote_plugin,
+    gsignond_dbus_remote_plugin_v1_emit_refreshed (self->priv->dbus_remote_plugin,
             data);
 }
 
@@ -333,7 +333,7 @@ _handle_status_changed_from_plugin (
     DBG ("");
     g_return_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self));
 
-    gsignond_dbus_remote_plugin_emit_status_changed (
+    gsignond_dbus_remote_plugin_v1_emit_status_changed (
             self->priv->dbus_remote_plugin, (gint)status,
             (const gchar *)message);
 }
@@ -373,7 +373,7 @@ gsignond_plugin_daemon_new (
 
     /* Create dbus object */
     daemon->priv->dbus_remote_plugin =
-            gsignond_dbus_remote_plugin_skeleton_new ();
+            gsignond_dbus_remote_plugin_v1_skeleton_new ();
 
     g_dbus_interface_skeleton_export (
                 G_DBUS_INTERFACE_SKELETON(daemon->priv->dbus_remote_plugin),
@@ -425,8 +425,8 @@ gsignond_plugin_daemon_new (
     gchar** mechanisms;
 
     g_object_get(daemon->priv->plugin, "type", &type, "mechanisms", &mechanisms, NULL);
-    gsignond_dbus_remote_plugin_set_method(daemon->priv->dbus_remote_plugin, type);
-    gsignond_dbus_remote_plugin_set_mechanisms(daemon->priv->dbus_remote_plugin, (const gchar* const*) mechanisms);
+    gsignond_dbus_remote_plugin_v1_set_method(daemon->priv->dbus_remote_plugin, type);
+    gsignond_dbus_remote_plugin_v1_set_mechanisms(daemon->priv->dbus_remote_plugin, (const gchar* const*) mechanisms);
 
     g_free(type);
     g_strfreev(mechanisms);