summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSiraj Razick <siraj.razick@collabora.co.uk>2012-01-13 11:32:48 -0500
committerSiraj Razick <siraj.razick@collabora.co.uk>2012-01-25 15:15:34 -0500
commitd3beae79aadab2e0adfc206082068fc6689ff290 (patch)
treeb6b106f0716801a0aa48900627668b2ab7700e7c /plugins
parent9ee76cdc02c550850c8490ddc97dc0c0fa24c38a (diff)
fd.o#44649 - Gabble plugin API symbols should be factored out to a separate library
This patch refactors gabble connection by introducing a new GInterface which the plugins will link agaist. And GabbleConnection implements the new Interface. https://bugs.freedesktop.org/show_bug.cgi?id=44649
Diffstat (limited to 'plugins')
-rw-r--r--plugins/console.c4
-rw-r--r--plugins/gateways.c4
-rw-r--r--plugins/test.c30
-rw-r--r--plugins/test.h5
4 files changed, 23 insertions, 20 deletions
diff --git a/plugins/console.c b/plugins/console.c
index b0ba7c592..64d10ae41 100644
--- a/plugins/console.c
+++ b/plugins/console.c
@@ -80,7 +80,7 @@ static void
gabble_console_plugin_create_sidecar_async (
GabblePlugin *plugin,
const gchar *sidecar_interface,
- GabbleConnection *connection,
+ GabblePluginConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -315,7 +315,7 @@ gabble_console_sidecar_class_init (GabbleConsoleSidecarClass *klass)
g_object_class_install_property (object_class, PROP_CONNECTION,
g_param_spec_object ("connection", "Connection",
"Gabble connection",
- GABBLE_TYPE_CONNECTION,
+ GABBLE_TYPE_PLUGIN_CONNECTION,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_SESSION,
diff --git a/plugins/gateways.c b/plugins/gateways.c
index 1e7b141a2..139c28de6 100644
--- a/plugins/gateways.c
+++ b/plugins/gateways.c
@@ -78,7 +78,7 @@ static void
gabble_gateway_plugin_create_sidecar_async (
GabblePlugin *plugin,
const gchar *sidecar_interface,
- GabbleConnection *connection,
+ GabblePluginConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -353,7 +353,7 @@ gabble_gateway_sidecar_class_init (GabbleGatewaySidecarClass *klass)
g_object_class_install_property (object_class, PROP_CONNECTION,
g_param_spec_object ("connection", "Connection",
"Gabble connection",
- GABBLE_TYPE_CONNECTION,
+ GABBLE_TYPE_PLUGIN_CONNECTION,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_SESSION,
diff --git a/plugins/test.c b/plugins/test.c
index 43b18ea3b..691b84969 100644
--- a/plugins/test.c
+++ b/plugins/test.c
@@ -83,7 +83,7 @@ static void
test_plugin_create_sidecar_async (
GabblePlugin *plugin,
const gchar *sidecar_interface,
- GabbleConnection *connection,
+ GabblePluginConnection *plugin_connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -106,7 +106,7 @@ test_plugin_create_sidecar_async (
{
g_async_initable_new_async (TEST_TYPE_SIDECAR_IQ, G_PRIORITY_DEFAULT,
NULL, sidecar_iq_created_cb, result, "session", session,
- "connection", connection, NULL);
+ "plugin-connection", plugin_connection, NULL);
return;
}
else
@@ -149,15 +149,16 @@ test_plugin_create_sidecar_finish (
static GPtrArray *
test_plugin_create_channel_managers (GabblePlugin *plugin,
+ GabblePluginConnection *plugin_connection,
TpBaseConnection *connection)
{
GPtrArray *ret = g_ptr_array_new ();
- DEBUG ("plugin %p on connection %p", plugin, connection);
+ DEBUG ("plugin %p on connection %p", plugin, plugin_connection);
g_ptr_array_add (ret,
g_object_new (TEST_TYPE_CHANNEL_MANAGER,
- "connection", connection,
+ "plugin-connection", plugin_connection,
NULL));
return ret;
@@ -360,7 +361,7 @@ test_sidecar_iq_set_property (
g_ptr_array_add (identities, identity);
/* set own caps so we proper reply to disco#info */
- hash = gabble_connection_add_sidecar_own_caps (self->connection,
+ hash = gabble_plugin_connection_add_sidecar_own_caps (self->connection,
features, identities);
g_free (hash);
@@ -399,9 +400,9 @@ test_sidecar_iq_class_init (TestSidecarIQClass *klass)
WOCKY_TYPE_SESSION,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_CONNECTION,
- g_param_spec_object ("connection", "Gabble Connection",
- "Gabble connection",
- GABBLE_TYPE_CONNECTION,
+ g_param_spec_object ("plugin-connection", "Gabble Plugin Connection",
+ "Gabble Plugin Connection",
+ GABBLE_TYPE_PLUGIN_CONNECTION,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
}
@@ -539,7 +540,7 @@ test_channel_manager_set_property (
/* Not reffing this: the connection owns all channel managers, so it
* must outlive us. Taking a reference leads to a cycle.
*/
- self->connection = g_value_get_object (value);
+ self->plugin_connection = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -558,7 +559,7 @@ test_channel_manager_get_property (
switch (property_id)
{
case PROP_CONNECTION:
- g_value_set_object (value, self->connection);
+ g_value_set_object (value, self->plugin_connection);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -583,7 +584,8 @@ test_channel_manager_constructed (GObject *object)
if (G_OBJECT_CLASS (test_channel_manager_parent_class)->constructed != NULL)
G_OBJECT_CLASS (test_channel_manager_parent_class)->constructed (object);
- tp_g_signal_connect_object (self->connection, "porter-available",
+ tp_g_signal_connect_object (self->plugin_connection,
+ "porter-available",
G_CALLBACK (test_channel_manager_porter_available_cb),
self, 0);
}
@@ -598,9 +600,9 @@ test_channel_manager_class_init (TestChannelManagerClass *klass)
oclass->constructed = test_channel_manager_constructed;
g_object_class_install_property (oclass, PROP_CONNECTION,
- g_param_spec_object ("connection", "Gabble Connection",
- "Gabble connection",
- GABBLE_TYPE_CONNECTION,
+ g_param_spec_object ("plugin-connection", "Gabble Plugin Connection",
+ "Gabble Plugin Connection",
+ GABBLE_TYPE_PLUGIN_CONNECTION,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
}
diff --git a/plugins/test.h b/plugins/test.h
index 6fe0d1434..cfd441f55 100644
--- a/plugins/test.h
+++ b/plugins/test.h
@@ -3,6 +3,7 @@
#include <gio/gio.h>
#include <wocky/wocky-session.h>
#include <gabble/gabble.h>
+#include <gabble/plugin-connection.h>
/* Plugin */
typedef struct _TestPluginClass TestPluginClass;
@@ -104,7 +105,7 @@ struct _TestSidecarIQ {
GObject parent;
GSimpleAsyncResult *result;
WockySession *session;
- GabbleConnection *connection;
+ GabblePluginConnection *connection;
};
GType test_sidecar_iq_get_type (void);
@@ -134,7 +135,7 @@ struct _TestChannelManagerClass {
struct _TestChannelManager {
GObject parent;
- GabbleConnection *connection;
+ GabblePluginConnection *plugin_connection;
};
GType test_channel_manager_get_type (void);