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-02-06 12:06:49 -0500
commitf54da139bb483fce675d6f11bfc000ec2d6732aa (patch)
tree19f5988d1b8ef9d42d686b4a57320dadd712128b /plugins
parentbb63a668664a2003c966b7e3d9806c98d0875bf5 (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 d6ecb5018..6e24e4fca 100644
--- a/plugins/console.c
+++ b/plugins/console.c
@@ -76,7 +76,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)
@@ -311,7 +311,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 02e2f5844..b9b232325 100644
--- a/plugins/gateways.c
+++ b/plugins/gateways.c
@@ -76,7 +76,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)
@@ -351,7 +351,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 eca607940..c506cc111 100644
--- a/plugins/test.c
+++ b/plugins/test.c
@@ -82,7 +82,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)
@@ -105,7 +105,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
@@ -148,15 +148,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;
@@ -359,7 +360,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);
@@ -398,9 +399,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));
}
@@ -538,7 +539,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);
@@ -557,7 +558,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);
@@ -582,7 +583,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);
}
@@ -597,9 +599,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 16a209c7e..3b5d89dfc 100644
--- a/plugins/test.h
+++ b/plugins/test.h
@@ -3,6 +3,7 @@
#include <gio/gio.h>
#include <wocky/wocky.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);