[telepathy-gabble/master] use tp-glib instead of extensions to implement tube new API
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Tue May 26 05:40:16 PDT 2009
---
src/muc-factory.c | 20 +++++-----
src/private-tubes-factory.c | 44 +++++++++++-----------
src/tube-dbus.c | 64 +++++++++++++++++-----------------
src/tube-stream.c | 82 +++++++++++++++++++++---------------------
src/tubes-channel.c | 14 ++++----
5 files changed, 112 insertions(+), 112 deletions(-)
diff --git a/src/muc-factory.c b/src/muc-factory.c
index 88b37f8..2caba47 100644
--- a/src/muc-factory.c
+++ b/src/muc-factory.c
@@ -1397,13 +1397,13 @@ gabble_muc_factory_foreach_channel_class (TpChannelManager *manager,
/* Muc Channel.Type.StreamTube */
g_value_set_static_string (channel_type_value,
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE);
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE);
func (manager, table, gabble_tube_stream_channel_get_allowed_properties (),
user_data);
/* Muc Channel.Type.DBusTube */
g_value_set_static_string (channel_type_value,
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE);
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE);
func (manager, table, gabble_tube_dbus_channel_get_allowed_properties (),
user_data);
@@ -1616,12 +1616,12 @@ handle_stream_tube_channel_request (GabbleMucFactory *self,
/* "Service" is a mandatory, not-fixed property */
service = tp_asv_get_string (request_properties,
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service");
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service");
if (service == NULL)
{
g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"Request does not contain the mandatory property '%s'",
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service");
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service");
return FALSE;
}
@@ -1647,12 +1647,12 @@ handle_dbus_tube_channel_request (GabbleMucFactory *self,
/* "ServiceName" is a mandatory, not-fixed property */
service = tp_asv_get_string (request_properties,
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
if (service == NULL)
{
g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"Request does not contain the mandatory property '%s'",
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
return FALSE;
}
@@ -1679,8 +1679,8 @@ gabble_muc_factory_request (GabbleMucFactory *self,
if (tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TEXT) &&
tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TUBES) &&
- tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE) &&
- tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE))
+ tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE) &&
+ tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE))
return FALSE;
/* validity already checked by TpBaseConnection */
@@ -1700,13 +1700,13 @@ gabble_muc_factory_request (GabbleMucFactory *self,
request_properties, require_new, handle, &error))
return TRUE;
}
- else if (!tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE))
+ else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE))
{
if (handle_stream_tube_channel_request (self, request_token,
request_properties, require_new, handle, &error))
return TRUE;
}
- else if (!tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE))
+ else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE))
{
if (handle_dbus_tube_channel_request (self, request_token,
request_properties, require_new, handle, &error))
diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c
index a32b538..668e402 100644
--- a/src/private-tubes-factory.c
+++ b/src/private-tubes-factory.c
@@ -445,10 +445,10 @@ add_service_to_array (gchar *service,
channel_type_value = tp_g_value_slice_new (G_TYPE_STRING);
if (type == TP_TUBE_TYPE_STREAM)
g_value_set_static_string (channel_type_value,
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE);
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE);
else
g_value_set_static_string (channel_type_value,
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE);
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE);
g_hash_table_insert (fixed_properties, TP_IFACE_CHANNEL ".ChannelType",
channel_type_value);
@@ -461,11 +461,11 @@ add_service_to_array (gchar *service,
g_value_set_string (target_handle_type_value, service);
if (type == TP_TUBE_TYPE_STREAM)
g_hash_table_insert (fixed_properties,
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service",
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service",
target_handle_type_value);
else
g_hash_table_insert (fixed_properties,
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName",
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName",
target_handle_type_value);
dbus_g_type_struct_set (&monster,
@@ -497,7 +497,7 @@ add_generic_tube_caps (GPtrArray *arr)
channel_type_value = tp_g_value_slice_new (G_TYPE_STRING);
g_value_set_static_string (channel_type_value,
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE);
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE);
g_hash_table_insert (fixed_properties, TP_IFACE_CHANNEL ".ChannelType",
channel_type_value);
@@ -526,7 +526,7 @@ add_generic_tube_caps (GPtrArray *arr)
channel_type_value = tp_g_value_slice_new (G_TYPE_STRING);
g_value_set_static_string (channel_type_value,
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE);
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE);
g_hash_table_insert (fixed_properties, TP_IFACE_CHANNEL ".ChannelType",
channel_type_value);
@@ -849,8 +849,8 @@ gabble_private_tubes_factory_add_cap (GabbleCapsChannelManager *manager,
/* this channel is not for this factory */
if (tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TUBES) &&
- tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE) &&
- tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE))
+ tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE) &&
+ tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE))
return;
if (tp_asv_get_uint32 (cap,
@@ -882,21 +882,21 @@ gabble_private_tubes_factory_add_cap (GabbleCapsChannelManager *manager,
caps->tubes_supported = TRUE;
}
- if (!tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE))
+ if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE))
{
Feature *feat = g_new0 (Feature, 1);
gchar *service = g_strdup (tp_asv_get_string (cap,
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service"));
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service"));
feat->feature_type = FEATURE_OPTIONAL;
feat->ns = g_strdup_printf ("%s/stream#%s", NS_TUBES, service);
feat->caps = 0;
g_hash_table_insert (caps->stream_tube_caps, service, feat);
}
- else if (!tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE))
+ else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE))
{
Feature *feat = g_new0 (Feature, 1);
gchar *service = g_strdup (tp_asv_get_string (cap,
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName"));
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName"));
feat->feature_type = FEATURE_OPTIONAL;
feat->ns = g_strdup_printf ("%s/dbus#%s", NS_TUBES, service);
feat->caps = 0;
@@ -1108,7 +1108,7 @@ gabble_private_tubes_factory_foreach_channel_class (
(GDestroyNotify) tp_g_value_slice_free);
value = tp_g_value_slice_new (G_TYPE_STRING);
- g_value_set_static_string (value, GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE);
+ g_value_set_static_string (value, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE);
g_hash_table_insert (table, TP_IFACE_CHANNEL ".ChannelType",
value);
@@ -1127,7 +1127,7 @@ gabble_private_tubes_factory_foreach_channel_class (
(GDestroyNotify) tp_g_value_slice_free);
value = tp_g_value_slice_new (G_TYPE_STRING);
- g_value_set_static_string (value, GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE);
+ g_value_set_static_string (value, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE);
g_hash_table_insert (table, TP_IFACE_CHANNEL ".ChannelType",
value);
@@ -1163,8 +1163,8 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
TP_IFACE_CHANNEL ".ChannelType");
if (tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TUBES) &&
- tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE) &&
- tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE))
+ tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE) &&
+ tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE))
return FALSE;
if (! tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TUBES))
@@ -1175,7 +1175,7 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
&error))
goto error;
}
- else if (! tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE))
+ else if (! tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE))
{
const gchar *service;
@@ -1187,16 +1187,16 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
/* "Service" is a mandatory, not-fixed property */
service = tp_asv_get_string (request_properties,
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service");
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service");
if (service == NULL)
{
g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"Request does not contain the mandatory property '%s'",
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service");
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service");
goto error;
}
}
- else if (! tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE))
+ else if (! tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE))
{
const gchar *service;
GError *err = NULL;
@@ -1209,12 +1209,12 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
/* "ServiceName" is a mandatory, not-fixed property */
service = tp_asv_get_string (request_properties,
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
if (service == NULL)
{
g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"Request does not contain the mandatory property '%s'",
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
goto error;
}
diff --git a/src/tube-dbus.c b/src/tube-dbus.c
index 3ab93f9..c14fa49 100644
--- a/src/tube-dbus.c
+++ b/src/tube-dbus.c
@@ -72,9 +72,9 @@ G_DEFINE_TYPE_WITH_CODE (GabbleTubeDBus, gabble_tube_dbus, G_TYPE_OBJECT,
tp_dbus_properties_mixin_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
G_IMPLEMENT_INTERFACE (GABBLE_TYPE_TUBE_IFACE, tube_iface_init);
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_CHANNEL_TYPE_DBUS_TUBE,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_DBUS_TUBE,
dbustube_iface_init);
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_CHANNEL_INTERFACE_TUBE,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_TUBE,
NULL);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
tp_external_group_mixin_iface_init);
@@ -86,14 +86,14 @@ static const gchar *gabble_tube_dbus_interfaces[] = {
/* If more interfaces are added, either keep Group as the first, or change
* the implementations of gabble_tube_dbus_get_interfaces () and
* gabble_tube_dbus_get_property () too */
- GABBLE_IFACE_CHANNEL_INTERFACE_TUBE,
+ TP_IFACE_CHANNEL_INTERFACE_TUBE,
NULL
};
static const gchar * const gabble_tube_dbus_channel_allowed_properties[] = {
TP_IFACE_CHANNEL ".TargetHandle",
TP_IFACE_CHANNEL ".TargetID",
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName",
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName",
NULL
};
@@ -476,32 +476,32 @@ unref_handle_foreach (gpointer key,
tp_handle_unref (contact_repo, handle);
}
-static GabbleTubeChannelState
+static TpTubeChannelState
get_tube_state (GabbleTubeDBus *self)
{
GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
GabbleBytestreamState bytestream_state;
if (!priv->offered)
- return GABBLE_TUBE_CHANNEL_STATE_NOT_OFFERED;
+ return TP_TUBE_CHANNEL_STATE_NOT_OFFERED;
if (priv->bytestream == NULL)
/* bytestream not yet created as we're waiting for the SI reply */
- return GABBLE_TUBE_CHANNEL_STATE_REMOTE_PENDING;
+ return TP_TUBE_CHANNEL_STATE_REMOTE_PENDING;
g_object_get (priv->bytestream, "state", &bytestream_state, NULL);
switch (bytestream_state)
{
case GABBLE_BYTESTREAM_STATE_OPEN:
- return GABBLE_TUBE_CHANNEL_STATE_OPEN;
+ return TP_TUBE_CHANNEL_STATE_OPEN;
break;
case GABBLE_BYTESTREAM_STATE_LOCAL_PENDING:
case GABBLE_BYTESTREAM_STATE_ACCEPTED:
- return GABBLE_TUBE_CHANNEL_STATE_LOCAL_PENDING;
+ return TP_TUBE_CHANNEL_STATE_LOCAL_PENDING;
break;
case GABBLE_BYTESTREAM_STATE_INITIATING:
- return GABBLE_TUBE_CHANNEL_STATE_REMOTE_PENDING;
+ return TP_TUBE_CHANNEL_STATE_REMOTE_PENDING;
break;
default:
g_return_val_if_reached (0);
@@ -530,8 +530,8 @@ bytestream_state_changed_cb (GabbleBytestreamIface *bytestream,
{
tube_dbus_open (self);
- gabble_svc_channel_interface_tube_emit_tube_channel_state_changed (self,
- GABBLE_TUBE_CHANNEL_STATE_OPEN);
+ tp_svc_channel_interface_tube_emit_tube_channel_state_changed (self,
+ TP_TUBE_CHANNEL_STATE_OPEN);
g_signal_emit (G_OBJECT (self), signals[OPENED], 0);
}
@@ -655,7 +655,7 @@ gabble_tube_dbus_get_property (GObject *object,
break;
case PROP_CHANNEL_TYPE:
g_value_set_static_string (value,
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE);
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE);
break;
case PROP_CONNECTION:
g_value_set_object (value, priv->conn);
@@ -730,8 +730,8 @@ gabble_tube_dbus_get_property (GObject *object,
TP_IFACE_CHANNEL, "InitiatorID",
TP_IFACE_CHANNEL, "Requested",
TP_IFACE_CHANNEL, "Interfaces",
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE, "ServiceName",
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE, "SupportedAccessControls",
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, "ServiceName",
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, "SupportedAccessControls",
NULL);
if (priv->initiator != priv->self_handle)
@@ -742,12 +742,12 @@ gabble_tube_dbus_get_property (GObject *object,
/* FIXME: use tp_dbus_properties_mixin_add_properties once it's
* added in tp-glib */
tp_dbus_properties_mixin_get (object,
- GABBLE_IFACE_CHANNEL_INTERFACE_TUBE, "Parameters",
+ TP_IFACE_CHANNEL_INTERFACE_TUBE, "Parameters",
prop_value, NULL);
g_assert (G_IS_VALUE (prop_value));
g_hash_table_insert (properties,
- g_strdup_printf ("%s.%s", GABBLE_IFACE_CHANNEL_INTERFACE_TUBE,
+ g_strdup_printf ("%s.%s", TP_IFACE_CHANNEL_INTERFACE_TUBE,
"Parameters"), prop_value);
}
@@ -1009,12 +1009,12 @@ gabble_tube_dbus_class_init (GabbleTubeDBusClass *gabble_tube_dbus_class)
NULL,
channel_props,
},
- { GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE,
+ { TP_IFACE_CHANNEL_TYPE_DBUS_TUBE,
tp_dbus_properties_mixin_getter_gobject_properties,
NULL,
dbus_tube_props,
},
- { GABBLE_IFACE_CHANNEL_INTERFACE_TUBE,
+ { TP_IFACE_CHANNEL_INTERFACE_TUBE,
tp_dbus_properties_mixin_getter_gobject_properties,
NULL,
tube_iface_props,
@@ -1111,7 +1111,7 @@ gabble_tube_dbus_class_init (GabbleTubeDBusClass *gabble_tube_dbus_class)
"dbus-names",
"D-Bus names",
"Mapping of contact handles to D-Bus names (used for muc tubes only).",
- GABBLE_HASH_TYPE_DBUS_TUBE_PARTICIPANTS,
+ TP_HASH_TYPE_DBUS_TUBE_PARTICIPANTS,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_DBUS_NAMES, param_spec);
@@ -1290,8 +1290,8 @@ gabble_tube_dbus_offer (GabbleTubeDBus *tube,
if (!result)
return FALSE;
- gabble_svc_channel_interface_tube_emit_tube_channel_state_changed (tube,
- GABBLE_TUBE_CHANNEL_STATE_REMOTE_PENDING);
+ tp_svc_channel_interface_tube_emit_tube_channel_state_changed (tube,
+ TP_TUBE_CHANNEL_STATE_REMOTE_PENDING);
}
else
@@ -1708,7 +1708,7 @@ gabble_tube_dbus_add_name (GabbleTubeDBus *self,
g_hash_table_insert (added, GUINT_TO_POINTER (handle), (gchar *) name);
- gabble_svc_channel_type_dbus_tube_emit_d_bus_names_changed (self, added,
+ tp_svc_channel_type_dbus_tube_emit_dbus_names_changed (self, added,
removed);
g_hash_table_destroy (added);
@@ -1746,7 +1746,7 @@ gabble_tube_dbus_remove_name (GabbleTubeDBus *self,
g_array_append_val (removed, handle);
- gabble_svc_channel_type_dbus_tube_emit_d_bus_names_changed (self, added,
+ tp_svc_channel_type_dbus_tube_emit_dbus_names_changed (self, added,
removed);
g_hash_table_destroy (added);
@@ -1843,7 +1843,7 @@ gabble_tube_dbus_get_channel_type (TpSvcChannel *iface,
DBusGMethodInvocation *context)
{
tp_svc_channel_return_from_get_channel_type (context,
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE);
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE);
}
/**
@@ -1916,7 +1916,7 @@ gabble_tube_dbus_check_access_control (GabbleTubeDBus *self,
* org.freedesktop.Telepathy.Channel.Type.DBusTube
*/
static void
-gabble_tube_dbus_offer_async (GabbleSvcChannelTypeDBusTube *self,
+gabble_tube_dbus_offer_async (TpSvcChannelTypeDBusTube *self,
GHashTable *parameters,
guint access_control,
DBusGMethodInvocation *context)
@@ -1938,7 +1938,7 @@ gabble_tube_dbus_offer_async (GabbleSvcChannelTypeDBusTube *self,
if (gabble_tube_dbus_offer (tube, &error))
{
- gabble_svc_channel_type_dbus_tube_return_from_offer (context,
+ tp_svc_channel_type_dbus_tube_return_from_offer (context,
tube->priv->dbus_srv_addr);
}
else
@@ -1956,7 +1956,7 @@ gabble_tube_dbus_offer_async (GabbleSvcChannelTypeDBusTube *self,
* org.freedesktop.Telepathy.Channel.Type.DBusTube
*/
static void
-gabble_tube_dbus_accept_async (GabbleSvcChannelTypeDBusTube *self,
+gabble_tube_dbus_accept_async (TpSvcChannelTypeDBusTube *self,
guint access_control,
DBusGMethodInvocation *context)
{
@@ -1972,7 +1972,7 @@ gabble_tube_dbus_accept_async (GabbleSvcChannelTypeDBusTube *self,
if (gabble_tube_dbus_accept (GABBLE_TUBE_IFACE (tube), &error))
{
- gabble_svc_channel_type_dbus_tube_return_from_accept (context,
+ tp_svc_channel_type_dbus_tube_return_from_accept (context,
tube->priv->dbus_srv_addr);
;
}
@@ -2020,10 +2020,10 @@ static void
dbustube_iface_init (gpointer g_iface,
gpointer iface_data)
{
- GabbleSvcChannelTypeDBusTubeClass *klass =
- (GabbleSvcChannelTypeDBusTubeClass *) g_iface;
+ TpSvcChannelTypeDBusTubeClass *klass =
+ (TpSvcChannelTypeDBusTubeClass *) g_iface;
-#define IMPLEMENT(x, suffix) gabble_svc_channel_type_dbus_tube_implement_##x (\
+#define IMPLEMENT(x, suffix) tp_svc_channel_type_dbus_tube_implement_##x (\
klass, gabble_tube_dbus_##x##suffix)
IMPLEMENT(offer,_async);
IMPLEMENT(accept,_async);
diff --git a/src/tube-stream.c b/src/tube-stream.c
index 9c235d3..d1156db 100644
--- a/src/tube-stream.c
+++ b/src/tube-stream.c
@@ -80,9 +80,9 @@ G_DEFINE_TYPE_WITH_CODE (GabbleTubeStream, gabble_tube_stream, G_TYPE_OBJECT,
tp_dbus_properties_mixin_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
G_IMPLEMENT_INTERFACE (GABBLE_TYPE_TUBE_IFACE, tube_iface_init);
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_CHANNEL_TYPE_STREAM_TUBE,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_STREAM_TUBE,
streamtube_iface_init);
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_CHANNEL_INTERFACE_TUBE,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_TUBE,
NULL);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
tp_external_group_mixin_iface_init);
@@ -92,7 +92,7 @@ G_DEFINE_TYPE_WITH_CODE (GabbleTubeStream, gabble_tube_stream, G_TYPE_OBJECT,
static const gchar * const gabble_tube_stream_channel_allowed_properties[] = {
TP_IFACE_CHANNEL ".TargetHandle",
TP_IFACE_CHANNEL ".TargetID",
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service",
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service",
NULL
};
@@ -101,7 +101,7 @@ static const gchar *gabble_tube_stream_interfaces[] = {
/* If more interfaces are added, either keep Group as the first, or change
* the implementations of gabble_tube_stream_get_interfaces () and
* gabble_tube_stream_get_property () too */
- GABBLE_IFACE_CHANNEL_INTERFACE_TUBE,
+ TP_IFACE_CHANNEL_INTERFACE_TUBE,
NULL
};
@@ -194,7 +194,7 @@ struct _GabbleTubeStreamPrivate
TpHandle initiator;
gchar *service;
GHashTable *parameters;
- GabbleTubeChannelState state;
+ TpTubeChannelState state;
TpSocketAddressType address_type;
GValue *address;
@@ -281,7 +281,7 @@ fire_connection_closed (GabbleTubeStream *self,
* same connection. */
g_hash_table_remove (priv->transport_to_id, transport);
- gabble_svc_channel_type_stream_tube_emit_connection_closed (self,
+ tp_svc_channel_type_stream_tube_emit_connection_closed (self,
connection_id, error, debug_msg);
}
@@ -608,7 +608,7 @@ fire_new_local_connection (GabbleTubeStream *self,
connection_id = generate_connection_id (self, transport);
- gabble_svc_channel_type_stream_tube_emit_new_local_connection (self,
+ tp_svc_channel_type_stream_tube_emit_new_local_connection (self,
connection_id);
}
@@ -918,7 +918,7 @@ fire_new_remote_connection (GabbleTubeStream *self,
transport));
g_assert (connection_id != 0);
- gabble_svc_channel_type_stream_tube_emit_new_remote_connection (self,
+ tp_svc_channel_type_stream_tube_emit_new_remote_connection (self,
contact, &access_control_param, connection_id);
g_value_unset (&access_control_param);
}
@@ -1282,7 +1282,7 @@ gabble_tube_stream_get_property (GObject *object,
break;
case PROP_CHANNEL_TYPE:
g_value_set_static_string (value,
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE);
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE);
break;
case PROP_CONNECTION:
g_value_set_object (value, priv->conn);
@@ -1354,8 +1354,8 @@ gabble_tube_stream_get_property (GObject *object,
TP_IFACE_CHANNEL, "InitiatorID",
TP_IFACE_CHANNEL, "Requested",
TP_IFACE_CHANNEL, "Interfaces",
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE, "Service",
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE, "SupportedSocketTypes",
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, "Service",
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, "SupportedSocketTypes",
NULL);
if (priv->initiator != priv->self_handle)
@@ -1366,12 +1366,12 @@ gabble_tube_stream_get_property (GObject *object,
/* FIXME: use tp_dbus_properties_mixin_add_properties once it's
* added in tp-glib */
tp_dbus_properties_mixin_get (object,
- GABBLE_IFACE_CHANNEL_INTERFACE_TUBE, "Parameters",
+ TP_IFACE_CHANNEL_INTERFACE_TUBE, "Parameters",
prop_value, NULL);
g_assert (G_IS_VALUE (prop_value));
g_hash_table_insert (properties,
- g_strdup_printf ("%s.%s", GABBLE_IFACE_CHANNEL_INTERFACE_TUBE,
+ g_strdup_printf ("%s.%s", TP_IFACE_CHANNEL_INTERFACE_TUBE,
"Parameters"), prop_value);
}
@@ -1520,11 +1520,11 @@ gabble_tube_stream_constructor (GType type,
if (priv->initiator == priv->self_handle)
{
/* We initiated this tube */
- priv->state = GABBLE_TUBE_CHANNEL_STATE_NOT_OFFERED;
+ priv->state = TP_TUBE_CHANNEL_STATE_NOT_OFFERED;
}
else
{
- priv->state = GABBLE_TUBE_CHANNEL_STATE_LOCAL_PENDING;
+ priv->state = TP_TUBE_CHANNEL_STATE_LOCAL_PENDING;
}
if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
@@ -1575,12 +1575,12 @@ gabble_tube_stream_class_init (GabbleTubeStreamClass *gabble_tube_stream_class)
NULL,
channel_props,
},
- { GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE,
+ { TP_IFACE_CHANNEL_TYPE_STREAM_TUBE,
tp_dbus_properties_mixin_getter_gobject_properties,
NULL,
stream_tube_props,
},
- { GABBLE_IFACE_CHANNEL_INTERFACE_TUBE,
+ { TP_IFACE_CHANNEL_INTERFACE_TUBE,
tp_dbus_properties_mixin_getter_gobject_properties,
NULL,
tube_iface_props,
@@ -1853,7 +1853,7 @@ gabble_tube_stream_accept (GabbleTubeIface *tube,
goto fail;
}
- if (priv->state != GABBLE_TUBE_CHANNEL_STATE_LOCAL_PENDING)
+ if (priv->state != TP_TUBE_CHANNEL_STATE_LOCAL_PENDING)
{
g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"Tube is not in the local pending state");
@@ -1866,10 +1866,10 @@ gabble_tube_stream_accept (GabbleTubeIface *tube,
goto fail;
}
- priv->state = GABBLE_TUBE_CHANNEL_STATE_OPEN;
+ priv->state = TP_TUBE_CHANNEL_STATE_OPEN;
- gabble_svc_channel_interface_tube_emit_tube_channel_state_changed (self,
- GABBLE_TUBE_CHANNEL_STATE_OPEN);
+ tp_svc_channel_interface_tube_emit_tube_channel_state_changed (self,
+ TP_TUBE_CHANNEL_STATE_OPEN);
g_signal_emit (G_OBJECT (self), signals[OPENED], 0);
@@ -1982,13 +1982,13 @@ gabble_tube_stream_add_bytestream (GabbleTubeIface *tube,
transport = new_connection_to_socket (self, bytestream, contact);
if (transport != NULL)
{
- if (priv->state == GABBLE_TUBE_CHANNEL_STATE_REMOTE_PENDING)
+ if (priv->state == TP_TUBE_CHANNEL_STATE_REMOTE_PENDING)
{
DEBUG ("Received first connection. Tube is now open");
- priv->state = GABBLE_TUBE_CHANNEL_STATE_OPEN;
+ priv->state = TP_TUBE_CHANNEL_STATE_OPEN;
- gabble_svc_channel_interface_tube_emit_tube_channel_state_changed (
- self, GABBLE_TUBE_CHANNEL_STATE_OPEN);
+ tp_svc_channel_interface_tube_emit_tube_channel_state_changed (
+ self, TP_TUBE_CHANNEL_STATE_OPEN);
g_signal_emit (G_OBJECT (self), signals[OPENED], 0);
}
@@ -2301,7 +2301,7 @@ send_tube_offer (GabbleTubeStream *self,
result = _gabble_connection_send (priv->conn, msg, error);
if (result)
{
- priv->state = GABBLE_TUBE_CHANNEL_STATE_REMOTE_PENDING;
+ priv->state = TP_TUBE_CHANNEL_STATE_REMOTE_PENDING;
}
lm_message_unref (msg);
@@ -2315,7 +2315,7 @@ gabble_tube_stream_offer (GabbleTubeStream *self,
{
GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
- g_assert (priv->state == GABBLE_TUBE_CHANNEL_STATE_NOT_OFFERED);
+ g_assert (priv->state == TP_TUBE_CHANNEL_STATE_NOT_OFFERED);
if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
{
@@ -2326,7 +2326,7 @@ gabble_tube_stream_offer (GabbleTubeStream *self,
else
{
/* muc tube is open as soon it's offered */
- priv->state = GABBLE_TUBE_CHANNEL_STATE_OPEN;
+ priv->state = TP_TUBE_CHANNEL_STATE_OPEN;
g_signal_emit (G_OBJECT (self), signals[OPENED], 0);
}
@@ -2399,7 +2399,7 @@ gabble_tube_stream_get_supported_socket_types (void)
* on org.freedesktop.Telepathy.Channel.Type.StreamTube
*/
static void
-gabble_tube_stream_offer_async (GabbleSvcChannelTypeStreamTube *iface,
+gabble_tube_stream_offer_async (TpSvcChannelTypeStreamTube *iface,
guint address_type,
const GValue *address,
guint access_control,
@@ -2410,7 +2410,7 @@ gabble_tube_stream_offer_async (GabbleSvcChannelTypeStreamTube *iface,
GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
GError *error = NULL;
- if (priv->state != GABBLE_TUBE_CHANNEL_STATE_NOT_OFFERED)
+ if (priv->state != TP_TUBE_CHANNEL_STATE_NOT_OFFERED)
{
g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"Tube is not in the not offered state");
@@ -2450,16 +2450,16 @@ gabble_tube_stream_offer_async (GabbleSvcChannelTypeStreamTube *iface,
if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
{
- gabble_svc_channel_interface_tube_emit_tube_channel_state_changed (
- self, GABBLE_TUBE_CHANNEL_STATE_REMOTE_PENDING);
+ tp_svc_channel_interface_tube_emit_tube_channel_state_changed (
+ self, TP_TUBE_CHANNEL_STATE_REMOTE_PENDING);
}
else
{
- gabble_svc_channel_interface_tube_emit_tube_channel_state_changed (
- self, GABBLE_TUBE_CHANNEL_STATE_OPEN);
+ tp_svc_channel_interface_tube_emit_tube_channel_state_changed (
+ self, TP_TUBE_CHANNEL_STATE_OPEN);
}
- gabble_svc_channel_type_stream_tube_return_from_offer (context);
+ tp_svc_channel_type_stream_tube_return_from_offer (context);
}
/**
@@ -2469,7 +2469,7 @@ gabble_tube_stream_offer_async (GabbleSvcChannelTypeStreamTube *iface,
* on org.freedesktop.Telepathy.Channel.Type.StreamTube
*/
static void
-gabble_tube_stream_accept_async (GabbleSvcChannelTypeStreamTube *iface,
+gabble_tube_stream_accept_async (TpSvcChannelTypeStreamTube *iface,
guint address_type,
guint access_control,
const GValue *access_control_param,
@@ -2499,7 +2499,7 @@ gabble_tube_stream_accept_async (GabbleSvcChannelTypeStreamTube *iface,
gabble_muc_channel_send_presence (self->muc, NULL);
#endif
- gabble_svc_channel_type_stream_tube_return_from_accept (context,
+ tp_svc_channel_type_stream_tube_return_from_accept (context,
priv->address);
}
@@ -2528,7 +2528,7 @@ gabble_tube_stream_get_channel_type (TpSvcChannel *iface,
DBusGMethodInvocation *context)
{
tp_svc_channel_return_from_get_channel_type (context,
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE);
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE);
}
/**
@@ -2610,10 +2610,10 @@ static void
streamtube_iface_init (gpointer g_iface,
gpointer iface_data)
{
- GabbleSvcChannelTypeStreamTubeClass *klass =
- (GabbleSvcChannelTypeStreamTubeClass *) g_iface;
+ TpSvcChannelTypeStreamTubeClass *klass =
+ (TpSvcChannelTypeStreamTubeClass *) g_iface;
-#define IMPLEMENT(x, suffix) gabble_svc_channel_type_stream_tube_implement_##x (\
+#define IMPLEMENT(x, suffix) tp_svc_channel_type_stream_tube_implement_##x (\
klass, gabble_tube_stream_##x##suffix)
IMPLEMENT(offer,_async);
IMPLEMENT(accept,_async);
diff --git a/src/tubes-channel.c b/src/tubes-channel.c
index 847d5b2..54b762c 100644
--- a/src/tubes-channel.c
+++ b/src/tubes-channel.c
@@ -568,7 +568,7 @@ create_new_tube (GabbleTubesChannel *self,
/* The old API doesn't know the "not offered" state, so we have to wait that
* the tube is offered before announcing it. */
- if (state != GABBLE_TUBE_CHANNEL_STATE_NOT_OFFERED)
+ if (state != TP_TUBE_CHANNEL_STATE_NOT_OFFERED)
{
tp_svc_channel_type_tubes_emit_new_tube (self,
tube_id,
@@ -967,7 +967,7 @@ copy_tube_in_ptr_array (gpointer key,
TpHandle initiator;
gchar *service;
GHashTable *parameters;
- GabbleTubeChannelState state;
+ TpTubeChannelState state;
TpTubeType type;
GPtrArray *array = (GPtrArray *) user_data;
GValue entry = {0,};
@@ -979,7 +979,7 @@ copy_tube_in_ptr_array (gpointer key,
/* The old interface has no way to represent unoffered tubes, so they
* shouldn't appear in the result of ListTubes()
*/
- if (state == GABBLE_TUBE_CHANNEL_STATE_NOT_OFFERED)
+ if (state == TP_TUBE_CHANNEL_STATE_NOT_OFFERED)
return;
g_object_get (tube,
@@ -1505,18 +1505,18 @@ GabbleTubeIface *gabble_tubes_channel_tube_request (GabbleTubesChannel *self,
channel_type = tp_asv_get_string (request_properties,
TP_IFACE_CHANNEL ".ChannelType");
- if (! tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE))
+ if (! tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE))
{
type = TP_TUBE_TYPE_STREAM;
service = tp_asv_get_string (request_properties,
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service");
+ TP_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service");
}
- else if (! tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE))
+ else if (! tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE))
{
type = TP_TUBE_TYPE_DBUS;
service = tp_asv_get_string (request_properties,
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
+ TP_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
}
else
/* This assertion is safe: this function's caller only calls it in one of
--
1.5.6.5
More information about the telepathy-commits
mailing list