summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiraj Razick <siraj.razick@collabora.co.uk>2012-02-03 17:11:03 -0500
committerSiraj Razick <siraj.razick@collabora.co.uk>2012-02-17 15:46:52 -0500
commitf4c3aaf503acb9d26f15d8cb21432b9dfbf7e51a (patch)
tree3eac5f24692fbcdb5b896405e51981d8ee4860b9
parent2d9394fb317626a07105fc91f3a392d357d5f91c (diff)
downloadtelepathy-salut-f4c3aaf503acb9d26f15d8cb21432b9dfbf7e51a.tar.gz
plugins: Replace SalutConnection with SalutPluginConnection in plugins
This patch removes the use of SalutConnection in plugins and code related to loading and defining the plugin API.
-rw-r--r--plugins/test.c7
-rw-r--r--salut/plugin.h10
-rw-r--r--src/connection.c3
-rw-r--r--src/plugin-loader.c12
-rw-r--r--src/plugin-loader.h2
-rw-r--r--src/plugin.c6
6 files changed, 23 insertions, 17 deletions
diff --git a/plugins/test.c b/plugins/test.c
index 61c3f507..accd0312 100644
--- a/plugins/test.c
+++ b/plugins/test.c
@@ -3,6 +3,7 @@
#include "test.h"
#include <salut/plugin.h>
+#include <salut/plugin-connection.h>
#include "extensions/extensions.h"
@@ -48,9 +49,9 @@ initialize (SalutPlugin *plugin,
static GPtrArray *
create_channel_managers (SalutPlugin *plugin,
- TpBaseConnection *connection)
+ SalutPluginConnection *plugin_connection)
{
- DEBUG ("%p on connection %p", plugin, connection);
+ DEBUG ("%p on connection %p", plugin, plugin_connection);
return NULL;
}
@@ -59,7 +60,7 @@ static void
test_plugin_create_sidecar_async (
SalutPlugin *plugin,
const gchar *sidecar_interface,
- SalutConnection *connection,
+ SalutPluginConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data)
diff --git a/salut/plugin.h b/salut/plugin.h
index baa0b7a0..5b7e7849 100644
--- a/salut/plugin.h
+++ b/salut/plugin.h
@@ -28,7 +28,7 @@
#include <wocky/wocky.h>
-#include <salut/connection.h>
+#include <salut/plugin-connection.h>
#include <salut/sidecar.h>
G_BEGIN_DECLS
@@ -48,7 +48,7 @@ typedef struct _SalutPluginInterface SalutPluginInterface;
typedef void (*SalutPluginCreateSidecarImpl) (
SalutPlugin *plugin,
const gchar *sidecar_interface,
- SalutConnection *connection,
+ SalutPluginConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -63,7 +63,7 @@ typedef SalutSidecar * (*SalutPluginCreateSidecarFinishImpl) (
* same semantics as TpBaseConnectionCreateChannelManagersImpl. */
typedef GPtrArray * (*SalutPluginCreateChannelManagersImpl) (
SalutPlugin *plugin,
- TpBaseConnection *connection);
+ SalutPluginConnection *plugin_connection);
typedef void (*SalutPluginInitializeImpl) (
SalutPlugin *plugin,
@@ -137,7 +137,7 @@ gboolean salut_plugin_implements_sidecar (
void salut_plugin_create_sidecar_async (
SalutPlugin *plugin,
const gchar *sidecar_interface,
- SalutConnection *connection,
+ SalutPluginConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -153,7 +153,7 @@ void salut_plugin_initialize (
GPtrArray * salut_plugin_create_channel_managers (
SalutPlugin *plugin,
- TpBaseConnection *connection);
+ SalutPluginConnection *plugin_connection);
/**
* salut_plugin_create:
diff --git a/src/connection.c b/src/connection.c
index 49b6aeb4..a6d326da 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -3607,6 +3607,7 @@ static GPtrArray *
salut_connection_create_channel_managers (TpBaseConnection *base)
{
SalutConnection *self = SALUT_CONNECTION (base);
+ SalutPluginConnection *plugin_connection = SALUT_PLUGIN_CONNECTION (self);
SalutConnectionPrivate *priv = self->priv;
GPtrArray *managers = g_ptr_array_sized_new (1);
GPtrArray *tmp;
@@ -3646,7 +3647,7 @@ salut_connection_create_channel_managers (TpBaseConnection *base)
/* plugin channel managers */
loader = salut_plugin_loader_dup ();
- tmp = salut_plugin_loader_create_channel_managers (loader, base);
+ tmp = salut_plugin_loader_create_channel_managers (loader, plugin_connection);
g_object_unref (loader);
g_ptr_array_foreach (tmp, add_to_array, managers);
diff --git a/src/plugin-loader.c b/src/plugin-loader.c
index 75420ab7..928d2a0b 100644
--- a/src/plugin-loader.c
+++ b/src/plugin-loader.c
@@ -284,8 +284,11 @@ salut_plugin_loader_create_sidecar_async (
GSimpleAsyncResult *res = g_simple_async_result_new (G_OBJECT (self),
callback, user_data, salut_plugin_loader_create_sidecar_async);
- salut_plugin_create_sidecar_async (p, sidecar_interface, connection, session,
- create_sidecar_cb, res);
+ SalutPluginConnection *plugin_connection =
+ SALUT_PLUGIN_CONNECTION (connection);
+
+ salut_plugin_create_sidecar_async (p, sidecar_interface,
+ plugin_connection, session, create_sidecar_cb, res);
return;
}
}
@@ -339,7 +342,7 @@ copy_to_other_array (gpointer data,
GPtrArray *
salut_plugin_loader_create_channel_managers (
SalutPluginLoader *self,
- TpBaseConnection *connection)
+ SalutPluginConnection *plugin_connection)
{
GPtrArray *out = g_ptr_array_new ();
guint i;
@@ -349,7 +352,8 @@ salut_plugin_loader_create_channel_managers (
SalutPlugin *plugin = g_ptr_array_index (self->priv->plugins, i);
GPtrArray *managers;
- managers = salut_plugin_create_channel_managers (plugin, connection);
+ managers = salut_plugin_create_channel_managers (plugin,
+ plugin_connection);
if (managers == NULL)
continue;
diff --git a/src/plugin-loader.h b/src/plugin-loader.h
index 181e590c..d28e5e20 100644
--- a/src/plugin-loader.h
+++ b/src/plugin-loader.h
@@ -83,6 +83,6 @@ void salut_plugin_loader_initialize (
GPtrArray * salut_plugin_loader_create_channel_managers (
SalutPluginLoader *self,
- TpBaseConnection *connection);
+ SalutPluginConnection *plugin_connection);
#endif /* #ifndef __PLUGIN_LOADER_H__ */
diff --git a/src/plugin.c b/src/plugin.c
index 58fda9f1..dcc015c2 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -70,7 +70,7 @@ void
salut_plugin_create_sidecar_async (
SalutPlugin *plugin,
const gchar *sidecar_interface,
- SalutConnection *connection,
+ SalutPluginConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -134,14 +134,14 @@ salut_plugin_initialize (SalutPlugin *plugin,
GPtrArray *
salut_plugin_create_channel_managers (SalutPlugin *plugin,
- TpBaseConnection *connection)
+ SalutPluginConnection *plugin_connection)
{
SalutPluginInterface *iface = SALUT_PLUGIN_GET_INTERFACE (plugin);
SalutPluginCreateChannelManagersImpl func = iface->create_channel_managers;
GPtrArray *out = NULL;
if (func != NULL)
- out = func (plugin, connection);
+ out = func (plugin, plugin_connection);
return out;
}