diff options
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | examples/future/call-cm/Makefile.am | 1 | ||||
-rw-r--r-- | examples/future/call-cm/call-channel.c | 164 | ||||
-rw-r--r-- | examples/future/call-cm/call-content.c | 21 | ||||
-rw-r--r-- | examples/future/call-cm/call-manager.c | 24 | ||||
-rw-r--r-- | examples/future/call-cm/call-stream.c | 129 | ||||
-rw-r--r-- | examples/future/call-cm/main.c | 3 | ||||
-rw-r--r-- | extensions/Makefile.am | 179 | ||||
-rw-r--r-- | extensions/all.xml | 12 | ||||
-rw-r--r-- | extensions/call-content.c | 161 | ||||
-rw-r--r-- | extensions/call-content.h | 62 | ||||
-rw-r--r-- | extensions/call-content.xml | 10 | ||||
-rw-r--r-- | extensions/call-stream.c | 161 | ||||
-rw-r--r-- | extensions/call-stream.h | 62 | ||||
-rw-r--r-- | extensions/call-stream.xml | 10 | ||||
-rw-r--r-- | extensions/channel.xml | 9 | ||||
-rw-r--r-- | extensions/extensions-cli.c | 35 | ||||
-rw-r--r-- | extensions/extensions.c | 6 | ||||
-rw-r--r-- | extensions/extensions.h | 27 | ||||
-rw-r--r-- | extensions/misc.xml | 9 | ||||
-rw-r--r-- | tests/dbus/call-example.c | 203 |
22 files changed, 278 insertions, 1012 deletions
diff --git a/Makefile.am b/Makefile.am index a7d4454de..086eff19c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,6 @@ endif endif SUBDIRS += \ - extensions \ examples \ tests \ docs \ diff --git a/configure.ac b/configure.ac index a29efdd80..abb186b9b 100644 --- a/configure.ac +++ b/configure.ac @@ -325,7 +325,6 @@ AC_OUTPUT( Makefile \ examples/extensions/Makefile \ examples/future/Makefile \ examples/future/call-cm/Makefile \ - extensions/Makefile \ spec/Makefile \ telepathy-glib/Makefile \ telepathy-glib/telepathy-glib.pc \ diff --git a/examples/future/call-cm/Makefile.am b/examples/future/call-cm/Makefile.am index 9df367c54..3b7ad1fac 100644 --- a/examples/future/call-cm/Makefile.am +++ b/examples/future/call-cm/Makefile.am @@ -54,7 +54,6 @@ clean-local: # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ - $(top_builddir)/extensions/libfuture-extensions.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ diff --git a/examples/future/call-cm/call-channel.c b/examples/future/call-cm/call-channel.c index 85c87d625..ed510c18b 100644 --- a/examples/future/call-cm/call-channel.c +++ b/examples/future/call-cm/call-channel.c @@ -43,10 +43,9 @@ #include <telepathy-glib/base-connection.h> #include <telepathy-glib/channel-iface.h> #include <telepathy-glib/svc-channel.h> +#include <telepathy-glib/svc-call.h> #include <telepathy-glib/telepathy-glib.h> -#include "extensions/extensions.h" - #include "call-content.h" #include "call-stream.h" @@ -60,7 +59,7 @@ G_DEFINE_TYPE_WITH_CODE (ExampleCallChannel, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init); - G_IMPLEMENT_INTERFACE (FUTURE_TYPE_SVC_CHANNEL_TYPE_CALL, + G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_CALL, call_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_HOLD, hold_iface_init); @@ -104,11 +103,11 @@ struct _ExampleCallChannelPrivate TpHandle handle; TpHandle initiator; - FutureCallState call_state; - FutureCallFlags call_flags; + TpCallState call_state; + TpCallFlags call_flags; GValueArray *call_state_reason; GHashTable *call_state_details; - FutureCallMemberFlags peer_flags; + TpCallMemberFlags peer_flags; guint simulation_delay; @@ -140,10 +139,10 @@ static const char * example_call_channel_interfaces[] = { G_GNUC_NULL_TERMINATED static void example_call_channel_set_state (ExampleCallChannel *self, - FutureCallState state, - FutureCallFlags flags, + TpCallState state, + TpCallFlags flags, TpHandle actor, - FutureCallStateChangeReason reason, + TpCallStateChangeReason reason, const gchar *error, ...) { @@ -200,7 +199,7 @@ example_call_channel_set_state (ExampleCallChannel *self, va_end (va); - future_svc_channel_type_call_emit_call_state_changed (self, + tp_svc_channel_type_call_emit_call_state_changed (self, self->priv->call_state, self->priv->call_flags, self->priv->call_state_reason, self->priv->call_state_details); } @@ -216,11 +215,11 @@ example_call_channel_init (ExampleCallChannel *self) self->priv->contents = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); - self->priv->call_state = FUTURE_CALL_STATE_UNKNOWN; /* set in constructed */ + self->priv->call_state = TP_CALL_STATE_UNKNOWN; /* set in constructed */ self->priv->call_flags = 0; self->priv->call_state_reason = tp_value_array_build (4, G_TYPE_UINT, 0, /* actor */ - G_TYPE_UINT, FUTURE_CALL_STATE_CHANGE_REASON_UNKNOWN, + G_TYPE_UINT, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, G_TYPE_STRING, "", G_TYPE_STRING, "", G_TYPE_INVALID); @@ -263,8 +262,8 @@ constructed (GObject *object) * remote-pending state when we actually contact them, which is done * in example_call_channel_initiate_outgoing. */ example_call_channel_set_state (self, - FUTURE_CALL_STATE_PENDING_INITIATOR, 0, 0, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_PENDING_INITIATOR, 0, 0, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); } else @@ -272,8 +271,8 @@ constructed (GObject *object) /* This is an incoming call, so the self-handle is locally * pending, to indicate that we need to answer. */ example_call_channel_set_state (self, - FUTURE_CALL_STATE_RINGING, 0, self->priv->handle, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_RINGING, 0, self->priv->handle, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); } @@ -329,7 +328,7 @@ get_property (GObject *object, break; case PROP_CHANNEL_TYPE: - g_value_set_static_string (value, FUTURE_IFACE_CHANNEL_TYPE_CALL); + g_value_set_static_string (value, TP_IFACE_CHANNEL_TYPE_CALL); break; case PROP_HANDLE_TYPE: @@ -378,7 +377,7 @@ get_property (GObject *object, case PROP_CHANNEL_DESTROYED: g_value_set_boolean (value, - (self->priv->call_state == FUTURE_CALL_STATE_ENDED)); + (self->priv->call_state == TP_CALL_STATE_ENDED)); break; case PROP_CHANNEL_PROPERTIES: @@ -460,7 +459,7 @@ get_property (GObject *object, case PROP_INITIAL_TRANSPORT: /* this implementation has hardware_streaming, so the initial * transport is rather meaningless */ - g_value_set_uint (value, FUTURE_STREAM_TRANSPORT_TYPE_UNKNOWN); + g_value_set_uint (value, TP_STREAM_TRANSPORT_TYPE_UNKNOWN); break; case PROP_CALL_MEMBERS: @@ -556,24 +555,24 @@ static void example_call_channel_terminate (ExampleCallChannel *self, TpHandle actor, TpChannelGroupChangeReason reason, - FutureCallStateChangeReason call_reason, + TpCallStateChangeReason call_reason, const gchar *error_name) { - if (self->priv->call_state != FUTURE_CALL_STATE_ENDED) + if (self->priv->call_state != TP_CALL_STATE_ENDED) { GList *values; GHashTable *empty_uu_map = g_hash_table_new (NULL, NULL); GArray *au = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1); example_call_channel_set_state (self, - FUTURE_CALL_STATE_ENDED, 0, actor, + TP_CALL_STATE_ENDED, 0, actor, call_reason, error_name, NULL); /* FIXME: fd.o #24936 #c20: it's unclear in the spec whether we should * remove peers on call termination or not. For now this example does. */ g_array_append_val (au, self->priv->handle); - future_svc_channel_type_call_emit_call_members_changed (self, + tp_svc_channel_type_call_emit_call_members_changed (self, empty_uu_map, empty_uu_map, au, self->priv->call_state_reason); g_hash_table_unref (empty_uu_map); g_array_unref (au); @@ -625,7 +624,7 @@ example_call_channel_disconnected (ExampleCallChannel *self) { example_call_channel_terminate (self, 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, - FUTURE_CALL_STATE_CHANGE_REASON_UNKNOWN, + TP_CALL_STATE_CHANGE_REASON_UNKNOWN, TP_ERROR_STR_DISCONNECTED); if (!self->priv->closed) @@ -652,7 +651,7 @@ dispose (GObject *object) example_call_channel_terminate (self, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE, - FUTURE_CALL_STATE_CHANGE_REASON_UNKNOWN, ""); + TP_CALL_STATE_CHANGE_REASON_UNKNOWN, ""); /* the manager is meant to hold a ref to us until we've closed */ g_assert (self->priv->closed); @@ -713,7 +712,7 @@ example_call_channel_class_init (ExampleCallChannelClass *klass) NULL, channel_props, }, - { FUTURE_IFACE_CHANNEL_TYPE_CALL, + { TP_IFACE_CHANNEL_TYPE_CALL, tp_dbus_properties_mixin_getter_gobject_properties, NULL, call_props, @@ -813,7 +812,7 @@ example_call_channel_class_init (ExampleCallChannelClass *klass) param_spec = g_param_spec_uint ("call-state", "Call state", "High-level state of the call", - 0, NUM_FUTURE_CALL_STATES - 1, FUTURE_CALL_STATE_PENDING_INITIATOR, + 0, NUM_TP_CALL_STATES - 1, TP_CALL_STATE_PENDING_INITIATOR, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALL_STATE, param_spec); @@ -826,7 +825,7 @@ example_call_channel_class_init (ExampleCallChannelClass *klass) param_spec = g_param_spec_boxed ("call-state-reason", "Call state reason", "Reason for call-state and call-flags", - FUTURE_STRUCT_TYPE_CALL_STATE_REASON, + TP_STRUCT_TYPE_CALL_STATE_REASON, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALL_STATE_REASON, param_spec); @@ -848,7 +847,7 @@ example_call_channel_class_init (ExampleCallChannelClass *klass) param_spec = g_param_spec_boxed ("call-members", "Call members", "A map from call members (only one in this example) to their states", - FUTURE_HASH_TYPE_CALL_MEMBER_MAP, + TP_HASH_TYPE_CALL_MEMBER_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALL_MEMBERS, param_spec); @@ -862,8 +861,8 @@ example_call_channel_class_init (ExampleCallChannelClass *klass) param_spec = g_param_spec_uint ("initial-transport", "Initial transport", "The initial transport for this channel (there is none)", - 0, NUM_FUTURE_STREAM_TRANSPORT_TYPES, - FUTURE_STREAM_TRANSPORT_TYPE_UNKNOWN, + 0, NUM_TP_STREAM_TRANSPORT_TYPES, + TP_STREAM_TRANSPORT_TYPE_UNKNOWN, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIAL_TRANSPORT, param_spec); @@ -890,7 +889,7 @@ channel_close (TpSvcChannel *iface, example_call_channel_terminate (self, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); if (!self->priv->closed) { @@ -906,7 +905,7 @@ channel_get_channel_type (TpSvcChannel *iface G_GNUC_UNUSED, DBusGMethodInvocation *context) { tp_svc_channel_return_from_get_channel_type (context, - FUTURE_IFACE_CHANNEL_TYPE_CALL); + TP_IFACE_CHANNEL_TYPE_CALL); } static void @@ -988,7 +987,7 @@ media_remove_streams (TpSvcChannelTypeStreamedMedia *iface, static void streams_removed_cb (ExampleCallContent *content, const GPtrArray *stream_paths G_GNUC_UNUSED, - const GArray *reason G_GNUC_UNUSED, + const GValueArray *reason, ExampleCallChannel *self) { gchar *path, *name; @@ -1003,9 +1002,8 @@ streams_removed_cb (ExampleCallContent *content, g_hash_table_remove (self->priv->contents, name); - future_svc_call_content_emit_removed (content); - future_svc_channel_type_call_emit_content_removed (self, path, - self->priv->call_state_reason); + tp_svc_call_content_emit_removed (content); + tp_svc_channel_type_call_emit_content_removed (self, path, reason); g_free (path); g_free (name); @@ -1014,7 +1012,7 @@ streams_removed_cb (ExampleCallContent *content, /* no contents left, so the call terminates */ example_call_channel_terminate (self, 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, - FUTURE_CALL_STATE_CHANGE_REASON_UNKNOWN, ""); + TP_CALL_STATE_CHANGE_REASON_UNKNOWN, ""); /* FIXME: is there an appropriate error? */ } } @@ -1026,14 +1024,14 @@ simulate_contact_ended_cb (gpointer p) /* if the call has been cancelled while we were waiting for the * contact to do so, do nothing! */ - if (self->priv->call_state == FUTURE_CALL_STATE_ENDED) + if (self->priv->call_state == TP_CALL_STATE_ENDED) return FALSE; g_message ("SIGNALLING: receive: call terminated: <call-terminated/>"); example_call_channel_terminate (self, self->priv->handle, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); return FALSE; } @@ -1049,18 +1047,18 @@ simulate_contact_answered_cb (gpointer p) /* if the call has been cancelled while we were waiting for the * contact to answer, do nothing! */ - if (self->priv->call_state == FUTURE_CALL_STATE_ENDED) + if (self->priv->call_state == TP_CALL_STATE_ENDED) return FALSE; /* otherwise, we're waiting for a response from the contact, which now * arrives */ - g_assert_cmpuint (self->priv->call_state, ==, FUTURE_CALL_STATE_RINGING); + g_assert_cmpuint (self->priv->call_state, ==, TP_CALL_STATE_RINGING); g_message ("SIGNALLING: receive: contact answered our call"); example_call_channel_set_state (self, - FUTURE_CALL_STATE_ACCEPTED, 0, self->priv->handle, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_ACCEPTED, 0, self->priv->handle, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); g_hash_table_iter_init (&iter, self->priv->contents); @@ -1100,18 +1098,18 @@ simulate_contact_busy_cb (gpointer p) /* if the call has been cancelled while we were waiting for the * contact to answer, do nothing */ - if (self->priv->call_state == FUTURE_CALL_STATE_ENDED) + if (self->priv->call_state == TP_CALL_STATE_ENDED) return FALSE; /* otherwise, we're waiting for a response from the contact, which now * arrives */ - g_assert_cmpuint (self->priv->call_state, ==, FUTURE_CALL_STATE_RINGING); + g_assert_cmpuint (self->priv->call_state, ==, TP_CALL_STATE_RINGING); g_message ("SIGNALLING: receive: call terminated: <user-is-busy/>"); example_call_channel_terminate (self, self->priv->handle, TP_CHANNEL_GROUP_CHANGE_REASON_BUSY, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, TP_ERROR_STR_BUSY); return FALSE; @@ -1132,8 +1130,8 @@ example_call_channel_add_content (ExampleCallChannel *self, TpHandle creator; gchar *name; gchar *path; - FutureCallContentDisposition disposition = - FUTURE_CALL_CONTENT_DISPOSITION_NONE; + TpCallContentDisposition disposition = + TP_CALL_CONTENT_DISPOSITION_NONE; guint i; type_str = (media_type == TP_MEDIA_STREAM_TYPE_AUDIO ? "audio" : "video"); @@ -1173,7 +1171,7 @@ example_call_channel_add_content (ExampleCallChannel *self, } if (initial) - disposition = FUTURE_CALL_CONTENT_DISPOSITION_INITIAL; + disposition = TP_CALL_CONTENT_DISPOSITION_INITIAL; if (locally_requested) { @@ -1192,7 +1190,7 @@ example_call_channel_add_content (ExampleCallChannel *self, NULL); g_hash_table_insert (self->priv->contents, name, content); - future_svc_channel_type_call_emit_content_added (self, path); + tp_svc_channel_type_call_emit_content_added (self, path); g_free (path); path = g_strdup_printf ("%s/Stream%u", self->priv->object_path, id); @@ -1224,12 +1222,12 @@ simulate_contact_ringing_cb (gpointer p) GArray *empty_au = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0); /* ring, ring! */ - self->priv->peer_flags = FUTURE_CALL_MEMBER_FLAG_RINGING; + self->priv->peer_flags = TP_CALL_MEMBER_FLAG_RINGING; g_hash_table_insert (uu_map, GUINT_TO_POINTER (self->priv->handle), GUINT_TO_POINTER (self->priv->peer_flags)); g_hash_table_insert (us_map, GUINT_TO_POINTER (self->priv->handle), (gpointer) tp_handle_inspect (contact_repo, self->priv->handle)); - future_svc_channel_type_call_emit_call_members_changed (self, + tp_svc_channel_type_call_emit_call_members_changed (self, uu_map, us_map, empty_au, self->priv->call_state_reason); g_hash_table_unref (uu_map); g_array_unref (empty_au); @@ -1268,9 +1266,9 @@ example_call_channel_initiate_outgoing (ExampleCallChannel *self) { g_message ("SIGNALLING: send: new streamed media call"); example_call_channel_set_state (self, - FUTURE_CALL_STATE_RINGING, 0, + TP_CALL_STATE_RINGING, 0, tp_base_connection_get_self_handle (self->priv->conn), - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); /* After a moment, we're sent an informational message saying it's ringing */ @@ -1281,7 +1279,7 @@ example_call_channel_initiate_outgoing (ExampleCallChannel *self) } static void -call_set_ringing (FutureSvcChannelTypeCall *iface, +call_set_ringing (TpSvcChannelTypeCall *iface, DBusGMethodInvocation *context) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (iface); @@ -1294,7 +1292,7 @@ call_set_ringing (FutureSvcChannelTypeCall *iface, goto finally; } - if (self->priv->call_state != FUTURE_CALL_STATE_RINGING) + if (self->priv->call_state != TP_CALL_STATE_RINGING) { g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "Ringing() makes no sense now that we're not pending receiver"); @@ -1303,15 +1301,15 @@ call_set_ringing (FutureSvcChannelTypeCall *iface, g_message ("SIGNALLING: send: ring, ring!"); - example_call_channel_set_state (self, FUTURE_CALL_STATE_RINGING, - self->priv->call_flags | FUTURE_CALL_FLAG_LOCALLY_RINGING, + example_call_channel_set_state (self, TP_CALL_STATE_RINGING, + self->priv->call_flags | TP_CALL_FLAG_LOCALLY_RINGING, tp_base_connection_get_self_handle (self->priv->conn), - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); finally: if (error == NULL) { - future_svc_channel_type_call_return_from_set_ringing (context); + tp_svc_channel_type_call_return_from_set_ringing (context); } else { @@ -1328,15 +1326,15 @@ accept_incoming_call (ExampleCallChannel *self) GHashTableIter iter; gpointer v; - g_assert_cmpint (self->priv->call_state, ==, FUTURE_CALL_STATE_RINGING); + g_assert_cmpint (self->priv->call_state, ==, TP_CALL_STATE_RINGING); g_message ("SIGNALLING: send: Accepting incoming call from %s", tp_handle_inspect (contact_repo, self->priv->handle)); example_call_channel_set_state (self, - FUTURE_CALL_STATE_ACCEPTED, 0, + TP_CALL_STATE_ACCEPTED, 0, tp_base_connection_get_self_handle (self->priv->conn), - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); g_hash_table_iter_init (&iter, self->priv->contents); @@ -1351,7 +1349,7 @@ accept_incoming_call (ExampleCallChannel *self) NULL); if (stream == NULL || - disposition != FUTURE_CALL_CONTENT_DISPOSITION_INITIAL) + disposition != TP_CALL_CONTENT_DISPOSITION_INITIAL) continue; /* we accept the proposed stream direction */ @@ -1360,21 +1358,21 @@ accept_incoming_call (ExampleCallChannel *self) } static void -call_accept (FutureSvcChannelTypeCall *iface G_GNUC_UNUSED, +call_accept (TpSvcChannelTypeCall *iface G_GNUC_UNUSED, DBusGMethodInvocation *context) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (iface); if (self->priv->locally_requested) { - if (self->priv->call_state == FUTURE_CALL_STATE_PENDING_INITIATOR) + if (self->priv->call_state == TP_CALL_STATE_PENDING_INITIATOR) { /* Take the contents we've already added, and make them happen */ example_call_channel_initiate_outgoing (self); - future_svc_channel_type_call_return_from_accept (context); + tp_svc_channel_type_call_return_from_accept (context); } - else if (self->priv->call_state == FUTURE_CALL_STATE_ENDED) + else if (self->priv->call_state == TP_CALL_STATE_ENDED) { GError na = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "This call has already ended" }; @@ -1391,12 +1389,12 @@ call_accept (FutureSvcChannelTypeCall *iface G_GNUC_UNUSED, } else { - if (self->priv->call_state == FUTURE_CALL_STATE_RINGING) + if (self->priv->call_state == TP_CALL_STATE_RINGING) { accept_incoming_call (self); - future_svc_channel_type_call_return_from_accept (context); + tp_svc_channel_type_call_return_from_accept (context); } - else if (self->priv->call_state == FUTURE_CALL_STATE_ENDED) + else if (self->priv->call_state == TP_CALL_STATE_ENDED) { GError na = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "This call has already ended" }; @@ -1414,7 +1412,7 @@ call_accept (FutureSvcChannelTypeCall *iface G_GNUC_UNUSED, } static void -call_hangup (FutureSvcChannelTypeCall *iface, +call_hangup (TpSvcChannelTypeCall *iface, guint reason, const gchar *detailed_reason, const gchar *message G_GNUC_UNUSED, @@ -1422,7 +1420,7 @@ call_hangup (FutureSvcChannelTypeCall *iface, { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (iface); - if (self->priv->call_state == FUTURE_CALL_STATE_ENDED) + if (self->priv->call_state == TP_CALL_STATE_ENDED) { GError na = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "This call has already ended" }; @@ -1435,12 +1433,12 @@ call_hangup (FutureSvcChannelTypeCall *iface, example_call_channel_terminate (self, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE, reason, detailed_reason); - future_svc_channel_type_call_return_from_hangup (context); + tp_svc_channel_type_call_return_from_hangup (context); } } static void -call_add_content (FutureSvcChannelTypeCall *iface, +call_add_content (TpSvcChannelTypeCall *iface, const gchar *content_name, guint content_type, DBusGMethodInvocation *context) @@ -1471,7 +1469,7 @@ call_add_content (FutureSvcChannelTypeCall *iface, g_object_get (content, "object-path", &content_path, NULL); - future_svc_channel_type_call_return_from_add_content (context, + tp_svc_channel_type_call_return_from_add_content (context, content_path); g_free (content_path); @@ -1486,10 +1484,10 @@ static void call_iface_init (gpointer iface, gpointer data) { - FutureSvcChannelTypeCallClass *klass = iface; + TpSvcChannelTypeCallClass *klass = iface; #define IMPLEMENT(x) \ - future_svc_channel_type_call_implement_##x (klass, call_##x) + tp_svc_channel_type_call_implement_##x (klass, call_##x) IMPLEMENT (set_ringing); IMPLEMENT (hangup); IMPLEMENT (accept); @@ -1508,9 +1506,9 @@ simulate_hold (gpointer p) self->priv->hold_state, self->priv->hold_state_reason); example_call_channel_set_state (self, self->priv->call_state, - self->priv->call_flags | FUTURE_CALL_FLAG_LOCALLY_HELD, + self->priv->call_flags | TP_CALL_FLAG_LOCALLY_HELD, tp_base_connection_get_self_handle (self->priv->conn), - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); return FALSE; } @@ -1526,9 +1524,9 @@ simulate_unhold (gpointer p) self->priv->hold_state, self->priv->hold_state_reason); example_call_channel_set_state (self, self->priv->call_state, - self->priv->call_flags & ~FUTURE_CALL_FLAG_LOCALLY_HELD, + self->priv->call_flags & ~TP_CALL_FLAG_LOCALLY_HELD, tp_base_connection_get_self_handle (self->priv->conn), - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); return FALSE; } diff --git a/examples/future/call-cm/call-content.c b/examples/future/call-cm/call-content.c index 5bd6db6ee..92210b60c 100644 --- a/examples/future/call-cm/call-content.c +++ b/examples/future/call-cm/call-content.c @@ -23,8 +23,7 @@ #include <telepathy-glib/base-connection.h> #include <telepathy-glib/telepathy-glib.h> - -#include "extensions/extensions.h" +#include <telepathy-glib/svc-call.h> G_DEFINE_TYPE_WITH_CODE (ExampleCallContent, example_call_content, @@ -32,7 +31,7 @@ G_DEFINE_TYPE_WITH_CODE (ExampleCallContent, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); /* no methods, so no vtable needed */ - G_IMPLEMENT_INTERFACE (FUTURE_TYPE_SVC_CALL_CONTENT, NULL)) + G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_CONTENT, NULL)) enum { @@ -54,7 +53,7 @@ struct _ExampleCallContentPrivate gchar *name; TpMediaStreamType type; TpHandle creator; - FutureCallContentDisposition disposition; + TpCallContentDisposition disposition; ExampleCallStream *stream; }; @@ -250,7 +249,7 @@ example_call_content_class_init (ExampleCallContentClass *klass) { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { - { FUTURE_IFACE_CALL_CONTENT, + { TP_IFACE_CALL_CONTENT, tp_dbus_properties_mixin_getter_gobject_properties, NULL, content_props, @@ -287,10 +286,10 @@ example_call_content_class_init (ExampleCallContentClass *klass) g_object_class_install_property (object_class, PROP_TYPE, param_spec); param_spec = g_param_spec_uint ("disposition", - "FutureCallContentDisposition", + "TpCallContentDisposition", "Disposition of the content", - 0, NUM_FUTURE_CALL_CONTENT_DISPOSITIONS - 1, - FUTURE_CALL_CONTENT_DISPOSITION_NONE, + 0, NUM_TP_CALL_CONTENT_DISPOSITIONS - 1, + TP_CALL_CONTENT_DISPOSITION_NONE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DISPOSITION, param_spec); @@ -350,11 +349,11 @@ example_call_content_stream_removed_cb (ExampleCallContent *self, g_ptr_array_add (paths, path); reason = tp_value_array_build (4, G_TYPE_UINT, 0, - G_TYPE_UINT, FUTURE_CALL_STATE_CHANGE_REASON_UNKNOWN, + G_TYPE_UINT, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, G_TYPE_STRING, "", G_TYPE_STRING, "", G_TYPE_INVALID); - future_svc_call_content_emit_streams_removed (self, paths, reason); + tp_svc_call_content_emit_streams_removed (self, paths, reason); g_free (path); g_ptr_array_unref (paths); g_value_array_free (reason); @@ -380,7 +379,7 @@ example_call_content_add_stream (ExampleCallContent *self, NULL); paths = g_ptr_array_sized_new (1); g_ptr_array_add (paths, path); - future_svc_call_content_emit_streams_added (self, paths); + tp_svc_call_content_emit_streams_added (self, paths); g_free (path); g_ptr_array_unref (paths); diff --git a/examples/future/call-cm/call-manager.c b/examples/future/call-cm/call-manager.c index 7f923a713..494d6b4d9 100644 --- a/examples/future/call-cm/call-manager.c +++ b/examples/future/call-cm/call-manager.c @@ -32,8 +32,6 @@ #include <telepathy-glib/errors.h> #include <telepathy-glib/interfaces.h> -#include "extensions/extensions.h" - #include "call-channel.h" static void channel_manager_iface_init (gpointer, gpointer); @@ -356,28 +354,28 @@ new_channel (ExampleCallManager *self, static const gchar * const audio_fixed_properties[] = { TP_PROP_CHANNEL_CHANNEL_TYPE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, - FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL }; static const gchar * const video_fixed_properties[] = { TP_PROP_CHANNEL_CHANNEL_TYPE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, - FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL }; static const gchar * const audio_allowed_properties[] = { TP_PROP_CHANNEL_TARGET_HANDLE, TP_PROP_CHANNEL_TARGET_ID, - FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL }; static const gchar * const video_allowed_properties[] = { TP_PROP_CHANNEL_TARGET_HANDLE, TP_PROP_CHANNEL_TARGET_ID, - FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL }; @@ -388,15 +386,15 @@ example_call_manager_type_foreach_channel_class (GType type, { GHashTable *table = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, - G_TYPE_STRING, FUTURE_IFACE_CHANNEL_TYPE_CALL, + G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, - FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, TRUE, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, TRUE, NULL); func (type, table, audio_allowed_properties, user_data); - g_hash_table_remove (table, FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO); - tp_asv_set_boolean (table, FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, + g_hash_table_remove (table, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO); + tp_asv_set_boolean (table, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, TRUE); func (type, table, video_allowed_properties, user_data); @@ -416,7 +414,7 @@ example_call_manager_request (ExampleCallManager *self, if (tp_strdiff (tp_asv_get_string (request_properties, TP_PROP_CHANNEL_CHANNEL_TYPE), - FUTURE_IFACE_CHANNEL_TYPE_CALL)) + TP_IFACE_CHANNEL_TYPE_CALL)) { return FALSE; } @@ -432,9 +430,9 @@ example_call_manager_request (ExampleCallManager *self, g_assert (handle != 0); initial_audio = tp_asv_get_boolean (request_properties, - FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL); + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL); initial_video = tp_asv_get_boolean (request_properties, - FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL); + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL); if (!initial_audio && !initial_video) { diff --git a/examples/future/call-cm/call-stream.c b/examples/future/call-cm/call-stream.c index 1b3cb2ec1..19dd307eb 100644 --- a/examples/future/call-cm/call-stream.c +++ b/examples/future/call-cm/call-stream.c @@ -23,8 +23,7 @@ #include <telepathy-glib/base-connection.h> #include <telepathy-glib/gtypes.h> - -#include "extensions/extensions.h" +#include <telepathy-glib/svc-call.h> static void stream_iface_init (gpointer, gpointer); @@ -33,7 +32,7 @@ G_DEFINE_TYPE_WITH_CODE (ExampleCallStream, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); - G_IMPLEMENT_INTERFACE (FUTURE_TYPE_SVC_CALL_STREAM, stream_iface_init)) + G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_STREAM, stream_iface_init)) enum { @@ -62,8 +61,8 @@ struct _ExampleCallStreamPrivate gchar *object_path; TpBaseConnection *conn; TpHandle handle; - FutureSendingState local_sending_state; - FutureSendingState remote_sending_state; + TpSendingState local_sending_state; + TpSendingState remote_sending_state; guint simulation_delay; @@ -81,8 +80,8 @@ example_call_stream_init (ExampleCallStream *self) ExampleCallStreamPrivate); /* start off directionless */ - self->priv->local_sending_state = FUTURE_SENDING_STATE_NONE; - self->priv->remote_sending_state = FUTURE_SENDING_STATE_NONE; + self->priv->local_sending_state = TP_SENDING_STATE_NONE; + self->priv->remote_sending_state = TP_SENDING_STATE_NONE; } static void example_call_stream_receive_direction_request ( @@ -278,7 +277,7 @@ example_call_stream_class_init (ExampleCallStreamClass *klass) { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { - { FUTURE_IFACE_CALL_STREAM, + { TP_IFACE_CALL_STREAM, tp_dbus_properties_mixin_getter_gobject_properties, NULL, stream_props, @@ -337,7 +336,7 @@ example_call_stream_class_init (ExampleCallStreamClass *klass) param_spec = g_param_spec_boxed ("remote-members", "RemoteMembers", "Map from contact handles to their sending states", - FUTURE_HASH_TYPE_CONTACT_SENDING_STATE_MAP, + TP_HASH_TYPE_CONTACT_SENDING_STATE_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REMOTE_MEMBERS, param_spec); @@ -349,7 +348,7 @@ example_call_stream_class_init (ExampleCallStreamClass *klass) param_spec = g_param_spec_uint ("local-sending-state", "LocalSendingState", "Local sending state", - 0, NUM_FUTURE_SENDING_STATES, FUTURE_SENDING_STATE_NONE, + 0, NUM_TP_SENDING_STATES, TP_SENDING_STATE_NONE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCAL_SENDING_STATE, param_spec); @@ -392,20 +391,20 @@ example_call_stream_accept_proposed_direction (ExampleCallStream *self) GValueArray *reason; if (self->priv->removed || - self->priv->local_sending_state != FUTURE_SENDING_STATE_PENDING_SEND) + self->priv->local_sending_state != TP_SENDING_STATE_PENDING_SEND) return; g_message ("%s: SIGNALLING: Sending to server: OK, I'll send you media", self->priv->object_path); - self->priv->local_sending_state = FUTURE_SENDING_STATE_SENDING; + self->priv->local_sending_state = TP_SENDING_STATE_SENDING; reason = tp_value_array_build (4, G_TYPE_UINT, 0, - G_TYPE_UINT, FUTURE_CALL_STATE_CHANGE_REASON_UNKNOWN, + G_TYPE_UINT, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, G_TYPE_STRING, "", G_TYPE_STRING, "", G_TYPE_INVALID); - future_svc_call_stream_emit_local_sending_state_changed (self, + tp_svc_call_stream_emit_local_sending_state_changed (self, self->priv->local_sending_state, reason); g_value_array_free (reason); } @@ -419,7 +418,7 @@ example_call_stream_simulate_contact_agreed_to_send (ExampleCallStream *self) TpHandleRepoIface *contact_handles; if (self->priv->removed || - self->priv->remote_sending_state != FUTURE_SENDING_STATE_PENDING_SEND) + self->priv->remote_sending_state != TP_SENDING_STATE_PENDING_SEND) return; contact_handles = tp_base_connection_get_handles ( @@ -428,22 +427,22 @@ example_call_stream_simulate_contact_agreed_to_send (ExampleCallStream *self) g_message ("%s: SIGNALLING: received: OK, I'll send you media", self->priv->object_path); - self->priv->remote_sending_state = FUTURE_SENDING_STATE_SENDING; + self->priv->remote_sending_state = TP_SENDING_STATE_SENDING; updated_members = g_hash_table_new (NULL, NULL); removed_members = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0); identifiers = g_hash_table_new (NULL, NULL); g_hash_table_insert (updated_members, GUINT_TO_POINTER (self->priv->handle), - GUINT_TO_POINTER (FUTURE_SENDING_STATE_SENDING)); + GUINT_TO_POINTER (TP_SENDING_STATE_SENDING)); g_hash_table_insert (identifiers, GUINT_TO_POINTER (self->priv->handle), (gpointer) tp_handle_inspect (contact_handles, self->priv->handle)); reason = tp_value_array_build (4, G_TYPE_UINT, 0, - G_TYPE_UINT, FUTURE_CALL_STATE_CHANGE_REASON_UNKNOWN, + G_TYPE_UINT, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, G_TYPE_STRING, "", G_TYPE_STRING, "", G_TYPE_INVALID); - future_svc_call_stream_emit_remote_members_changed (self, updated_members, + tp_svc_call_stream_emit_remote_members_changed (self, updated_members, identifiers, removed_members, reason); g_hash_table_unref (updated_members); g_hash_table_unref (identifiers); @@ -466,7 +465,7 @@ example_call_stream_change_direction (ExampleCallStream *self, GHashTable *updated_member_identifiers = g_hash_table_new (NULL, NULL); GValueArray *reason = tp_value_array_build (4, G_TYPE_UINT, 0, - G_TYPE_UINT, FUTURE_CALL_STATE_CHANGE_REASON_UNKNOWN, + G_TYPE_UINT, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, G_TYPE_STRING, "", G_TYPE_STRING, "", G_TYPE_INVALID); @@ -475,10 +474,10 @@ example_call_stream_change_direction (ExampleCallStream *self, if (want_to_send) { - if (self->priv->local_sending_state != FUTURE_SENDING_STATE_SENDING) + if (self->priv->local_sending_state != TP_SENDING_STATE_SENDING) { if (self->priv->local_sending_state == - FUTURE_SENDING_STATE_PENDING_SEND) + TP_SENDING_STATE_PENDING_SEND) { g_message ("%s: SIGNALLING: send: I will now send you media", self->priv->object_path); @@ -486,48 +485,48 @@ example_call_stream_change_direction (ExampleCallStream *self, g_message ("%s: MEDIA: sending media to peer", self->priv->object_path); - self->priv->local_sending_state = FUTURE_SENDING_STATE_SENDING; - future_svc_call_stream_emit_local_sending_state_changed (self, + self->priv->local_sending_state = TP_SENDING_STATE_SENDING; + tp_svc_call_stream_emit_local_sending_state_changed (self, self->priv->local_sending_state, reason); } } else { - if (self->priv->local_sending_state == FUTURE_SENDING_STATE_SENDING) + if (self->priv->local_sending_state == TP_SENDING_STATE_SENDING) { g_message ("%s: SIGNALLING: send: I will no longer send you media", self->priv->object_path); g_message ("%s: MEDIA: no longer sending media to peer", self->priv->object_path); - self->priv->local_sending_state = FUTURE_SENDING_STATE_NONE; - future_svc_call_stream_emit_local_sending_state_changed (self, + self->priv->local_sending_state = TP_SENDING_STATE_NONE; + tp_svc_call_stream_emit_local_sending_state_changed (self, self->priv->local_sending_state, reason); } else if (self->priv->local_sending_state == - FUTURE_SENDING_STATE_PENDING_SEND) + TP_SENDING_STATE_PENDING_SEND) { g_message ("%s: SIGNALLING: send: refusing to send you media", self->priv->object_path); - self->priv->local_sending_state = FUTURE_SENDING_STATE_NONE; - future_svc_call_stream_emit_local_sending_state_changed (self, + self->priv->local_sending_state = TP_SENDING_STATE_NONE; + tp_svc_call_stream_emit_local_sending_state_changed (self, self->priv->local_sending_state, reason); } } if (want_to_receive) { - if (self->priv->remote_sending_state == FUTURE_SENDING_STATE_NONE) + if (self->priv->remote_sending_state == TP_SENDING_STATE_NONE) { g_message ("%s: SIGNALLING: send: send me media, please?", self->priv->object_path); - self->priv->remote_sending_state = FUTURE_SENDING_STATE_PENDING_SEND; + self->priv->remote_sending_state = TP_SENDING_STATE_PENDING_SEND; g_timeout_add_full (G_PRIORITY_DEFAULT, self->priv->simulation_delay, simulate_contact_agreed_to_send_cb, g_object_ref (self), g_object_unref); g_hash_table_insert (updated_members, GUINT_TO_POINTER (self->priv->handle), - GUINT_TO_POINTER (FUTURE_SENDING_STATE_PENDING_SEND)); + GUINT_TO_POINTER (TP_SENDING_STATE_PENDING_SEND)); g_hash_table_insert (updated_member_identifiers, GUINT_TO_POINTER (self->priv->handle), (gpointer) tp_handle_inspect (contact_repo, self->priv->handle)); @@ -535,17 +534,17 @@ example_call_stream_change_direction (ExampleCallStream *self, } else { - if (self->priv->remote_sending_state != FUTURE_SENDING_STATE_NONE) + if (self->priv->remote_sending_state != TP_SENDING_STATE_NONE) { g_message ("%s: SIGNALLING: send: Please stop sending me media", self->priv->object_path); g_message ("%s: MEDIA: suppressing output of stream", self->priv->object_path); - self->priv->remote_sending_state = FUTURE_SENDING_STATE_NONE; + self->priv->remote_sending_state = TP_SENDING_STATE_NONE; g_hash_table_insert (updated_members, GUINT_TO_POINTER (self->priv->handle), - GUINT_TO_POINTER (FUTURE_SENDING_STATE_NONE)); + GUINT_TO_POINTER (TP_SENDING_STATE_NONE)); g_hash_table_insert (updated_member_identifiers, GUINT_TO_POINTER (self->priv->handle), (gpointer) tp_handle_inspect (contact_repo, self->priv->handle)); @@ -557,7 +556,7 @@ example_call_stream_change_direction (ExampleCallStream *self, GArray *removed_members = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0); - future_svc_call_stream_emit_remote_members_changed (self, + tp_svc_call_stream_emit_remote_members_changed (self, updated_members, updated_member_identifiers, removed_members, reason); @@ -580,7 +579,7 @@ example_call_stream_receive_direction_request (ExampleCallStream *self, GHashTable *updated_member_identifiers = g_hash_table_new (NULL, NULL); GValueArray *reason = tp_value_array_build (4, G_TYPE_UINT, 0, - G_TYPE_UINT, FUTURE_CALL_STATE_CHANGE_REASON_UNKNOWN, + G_TYPE_UINT, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, G_TYPE_STRING, "", G_TYPE_STRING, "", G_TYPE_INVALID); @@ -599,11 +598,11 @@ example_call_stream_receive_direction_request (ExampleCallStream *self, g_message ("%s: SIGNALLING: send: Please start sending me media", self->priv->object_path); - if (self->priv->local_sending_state == FUTURE_SENDING_STATE_NONE) + if (self->priv->local_sending_state == TP_SENDING_STATE_NONE) { /* ask the user for permission */ - self->priv->local_sending_state = FUTURE_SENDING_STATE_PENDING_SEND; - future_svc_call_stream_emit_local_sending_state_changed (self, + self->priv->local_sending_state = TP_SENDING_STATE_PENDING_SEND; + tp_svc_call_stream_emit_local_sending_state_changed (self, self->priv->local_sending_state, reason); } else @@ -619,19 +618,19 @@ example_call_stream_receive_direction_request (ExampleCallStream *self, g_message ("%s: SIGNALLING: reply: OK!", self->priv->object_path); - if (self->priv->local_sending_state == FUTURE_SENDING_STATE_SENDING) + if (self->priv->local_sending_state == TP_SENDING_STATE_SENDING) { g_message ("%s: MEDIA: no longer sending media to peer", self->priv->object_path); - self->priv->local_sending_state = FUTURE_SENDING_STATE_NONE; - future_svc_call_stream_emit_local_sending_state_changed (self, + self->priv->local_sending_state = TP_SENDING_STATE_NONE; + tp_svc_call_stream_emit_local_sending_state_changed (self, self->priv->local_sending_state, reason); } else if (self->priv->local_sending_state == - FUTURE_SENDING_STATE_PENDING_SEND) + TP_SENDING_STATE_PENDING_SEND) { - self->priv->local_sending_state = FUTURE_SENDING_STATE_NONE; - future_svc_call_stream_emit_local_sending_state_changed (self, + self->priv->local_sending_state = TP_SENDING_STATE_NONE; + tp_svc_call_stream_emit_local_sending_state_changed (self, self->priv->local_sending_state, reason); } else @@ -645,13 +644,13 @@ example_call_stream_receive_direction_request (ExampleCallStream *self, g_message ("%s: SIGNALLING: receive: I will now send you media", self->priv->object_path); - if (self->priv->remote_sending_state != FUTURE_SENDING_STATE_SENDING) + if (self->priv->remote_sending_state != TP_SENDING_STATE_SENDING) { - self->priv->remote_sending_state = FUTURE_SENDING_STATE_SENDING; + self->priv->remote_sending_state = TP_SENDING_STATE_SENDING; g_hash_table_insert (updated_members, GUINT_TO_POINTER (self->priv->handle), - GUINT_TO_POINTER (FUTURE_SENDING_STATE_SENDING)); + GUINT_TO_POINTER (TP_SENDING_STATE_SENDING)); g_hash_table_insert (updated_member_identifiers, GUINT_TO_POINTER (self->priv->handle), (gpointer) tp_handle_inspect (contact_repo, self->priv->handle)); @@ -660,29 +659,29 @@ example_call_stream_receive_direction_request (ExampleCallStream *self, else { if (self->priv->remote_sending_state == - FUTURE_SENDING_STATE_PENDING_SEND) + TP_SENDING_STATE_PENDING_SEND) { g_message ("%s: SIGNALLING: receive: No, I refuse to send you media", self->priv->object_path); - self->priv->remote_sending_state = FUTURE_SENDING_STATE_NONE; + self->priv->remote_sending_state = TP_SENDING_STATE_NONE; g_hash_table_insert (updated_members, GUINT_TO_POINTER (self->priv->handle), - GUINT_TO_POINTER (FUTURE_SENDING_STATE_NONE)); + GUINT_TO_POINTER (TP_SENDING_STATE_NONE)); g_hash_table_insert (updated_member_identifiers, GUINT_TO_POINTER (self->priv->handle), (gpointer) tp_handle_inspect (contact_repo, self->priv->handle)); } else if (self->priv->remote_sending_state == - FUTURE_SENDING_STATE_SENDING) + TP_SENDING_STATE_SENDING) { g_message ("%s: SIGNALLING: receive: I will no longer send media", self->priv->object_path); - self->priv->remote_sending_state = FUTURE_SENDING_STATE_NONE; + self->priv->remote_sending_state = TP_SENDING_STATE_NONE; g_hash_table_insert (updated_members, GUINT_TO_POINTER (self->priv->handle), - GUINT_TO_POINTER (FUTURE_SENDING_STATE_NONE)); + GUINT_TO_POINTER (TP_SENDING_STATE_NONE)); g_hash_table_insert (updated_member_identifiers, GUINT_TO_POINTER (self->priv->handle), (gpointer) tp_handle_inspect (contact_repo, self->priv->handle)); @@ -694,7 +693,7 @@ example_call_stream_receive_direction_request (ExampleCallStream *self, GArray *removed_members = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0); - future_svc_call_stream_emit_remote_members_changed (self, + tp_svc_call_stream_emit_remote_members_changed (self, updated_members, updated_member_identifiers, removed_members, reason); @@ -707,20 +706,20 @@ example_call_stream_receive_direction_request (ExampleCallStream *self, } static void -stream_set_sending (FutureSvcCallStream *iface G_GNUC_UNUSED, +stream_set_sending (TpSvcCallStream *iface G_GNUC_UNUSED, gboolean sending, DBusGMethodInvocation *context) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (iface); example_call_stream_change_direction (self, sending, - (self->priv->remote_sending_state == FUTURE_SENDING_STATE_SENDING)); + (self->priv->remote_sending_state == TP_SENDING_STATE_SENDING)); - future_svc_call_stream_return_from_set_sending (context); + tp_svc_call_stream_return_from_set_sending (context); } static void -stream_request_receiving (FutureSvcCallStream *iface, +stream_request_receiving (TpSvcCallStream *iface, TpHandle contact, gboolean receive, DBusGMethodInvocation *context) @@ -744,13 +743,13 @@ stream_request_receiving (FutureSvcCallStream *iface, } example_call_stream_change_direction (self, - (self->priv->local_sending_state == FUTURE_SENDING_STATE_SENDING), + (self->priv->local_sending_state == TP_SENDING_STATE_SENDING), receive); finally: if (error == NULL) { - future_svc_call_stream_return_from_request_receiving (context); + tp_svc_call_stream_return_from_request_receiving (context); } else { @@ -763,10 +762,10 @@ static void stream_iface_init (gpointer iface, gpointer data) { - FutureSvcCallStreamClass *klass = iface; + TpSvcCallStreamClass *klass = iface; #define IMPLEMENT(x) \ - future_svc_call_stream_implement_##x (klass, stream_##x) + tp_svc_call_stream_implement_##x (klass, stream_##x) IMPLEMENT (set_sending); IMPLEMENT (request_receiving); #undef IMPLEMENT diff --git a/examples/future/call-cm/main.c b/examples/future/call-cm/main.c index f3db411ca..77526b3c0 100644 --- a/examples/future/call-cm/main.c +++ b/examples/future/call-cm/main.c @@ -24,8 +24,6 @@ #include <telepathy-glib/debug.h> #include <telepathy-glib/run.h> -#include "extensions/extensions.h" - #include "cm.h" static TpBaseConnectionManager * @@ -54,7 +52,6 @@ main (int argc, /* strictly speaking, this is only necessary for client code, but it's * harmless here */ g_type_init (); - future_cli_init (); return tp_run_connection_manager ("telepathy-example-cm-call", VERSION, construct_cm, argc, argv); diff --git a/extensions/Makefile.am b/extensions/Makefile.am deleted file mode 100644 index 3333eff9a..000000000 --- a/extensions/Makefile.am +++ /dev/null @@ -1,179 +0,0 @@ -# This directory re-uses telepathy-glib's code generation mechanisms to -# generate code for interfaces that aren't stable enough for telepathy-glib -# yet, so we can start to adapt example code to use them. - -tools_dir = $(top_srcdir)/tools - -AM_CFLAGS = \ - $(ERROR_CFLAGS) \ - $(DBUS_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(TP_GLIB_CFLAGS) -AM_LDFLAGS = \ - $(ERROR_LDFLAGS) \ - $(NULL) - -EXTRA_DIST = \ - all.xml \ - call-content.xml \ - call-stream.xml \ - channel.xml \ - misc.xml - -noinst_LTLIBRARIES = libfuture-extensions.la - -# In an external project you'd use $(TP_GLIB_LIBS) (obtained from -# pkg-config via autoconf) instead of the .la path -libfuture_extensions_la_LIBADD = \ - $(GLIB_LIBS) \ - $(DBUS_LIBS) \ - $(top_builddir)/telepathy-glib/libtelepathy-glib.la - -libfuture_extensions_la_SOURCES = \ - call-content.c \ - call-content.h \ - call-stream.c \ - call-stream.h \ - extensions.c \ - extensions-cli.c \ - extensions.h - -nodist_libfuture_extensions_la_SOURCES = \ - _gen/signals-marshal.c \ - _gen/signals-marshal.h \ - _gen/signals-marshal.list \ - _gen/register-dbus-glib-marshallers-body.h \ - _gen/enums.h \ - _gen/gtypes.h \ - _gen/gtypes-body.h \ - _gen/interfaces.h \ - _gen/interfaces-body.h \ - _gen/cli-call-content.h \ - _gen/cli-call-content-body.h \ - _gen/cli-call-stream.h \ - _gen/cli-call-stream-body.h \ - _gen/cli-channel.h \ - _gen/cli-channel-body.h \ - _gen/cli-misc.h \ - _gen/cli-misc-body.h \ - _gen/svc-call-content.h \ - _gen/svc-call-content.c \ - _gen/svc-call-stream.h \ - _gen/svc-call-stream.c \ - _gen/svc-channel.h \ - _gen/svc-channel.c \ - _gen/svc-misc.h \ - _gen/svc-misc.c - -BUILT_SOURCES = \ - _gen/all.xml \ - _gen/call-content.xml \ - _gen/call-stream.xml \ - _gen/channel.xml \ - _gen/misc.xml \ - $(nodist_libfuture_extensions_la_SOURCES) - -CLEANFILES = $(BUILT_SOURCES) - -clean-local: - rm -rf _gen - -XSLTPROCFLAGS = --nonet --novalid - -# Generated files which can be generated for all categories simultaneously - -_gen/all.xml: all.xml $(wildcard $(srcdir)/*.xml) $(wildcard $(top_srcdir)/spec/*.xml) $(tools_dir)/xincludator.py - $(mkdir_p) _gen - $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@ - -_gen/gtypes.h _gen/gtypes-body.h: _gen/all.xml \ - $(top_srcdir)/tools/glib-gtypes-generator.py - $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ - $< _gen/gtypes Future - -_gen/signals-marshal.list: _gen/all.xml \ - $(tools_dir)/glib-signals-marshal-gen.py - $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@ - -_gen/signals-marshal.h: _gen/signals-marshal.list Makefile.am - $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_future_ext_marshal $< > $@ - -_gen/signals-marshal.c: _gen/signals-marshal.list Makefile.am - $(AM_V_GEN){ echo '#include "_gen/signals-marshal.h"' && \ - $(GLIB_GENMARSHAL) --body --prefix=_future_ext_marshal $< ; } > $@ - -_gen/register-dbus-glib-marshallers-body.h: _gen/all.xml \ - $(tools_dir)/glib-client-marshaller-gen.py - $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \ - _future_ext > $@ - -_gen/enums.h: _gen/all.xml \ - $(tools_dir)/c-constants-gen.py - $(AM_V_GEN)$(PYTHON) $(tools_dir)/c-constants-gen.py \ - Future \ - $< _gen/enums - -_gen/interfaces-body.h _gen/interfaces.h: _gen/all.xml \ - $(tools_dir)/glib-interfaces-gen.py - $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-interfaces-gen.py \ - Future _gen/interfaces-body.h _gen/interfaces.h $< - -# Generated files which must be generated per "category". Each TpProxy -# subclass you want to use with --subclass will need to have its own category, -# although you can subdivide further if you want. - -_gen/%.xml: %.xml $(wildcard $(srcdir)/*.xml) $(wildcard $(top_srcdir)/spec/*.xml) $(tools_dir)/xincludator.py - $(mkdir_p) _gen - $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@ - -_gen/svc-%.c _gen/svc-%.h: _gen/%.xml \ - $(tools_dir)/glib-ginterface-gen.py - $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ - --filename=_gen/svc-$* \ - --signal-marshal-prefix=_future_ext \ - --include='<telepathy-glib/dbus.h>' \ - --include='"_gen/signals-marshal.h"' \ - --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ - --allow-unstable \ - $< Future_Svc_ - -_gen/cli-channel-body.h _gen/cli-channel.h: _gen/channel.xml \ - $(tools_dir)/glib-client-gen.py Makefile.am - $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \ - --group=channel \ - --subclass=TpChannel \ - --subclass-assert=TP_IS_CHANNEL \ - --iface-quark-prefix=FUTURE_IFACE_QUARK \ - --tp-proxy-api=0.7.6 \ - $< Future_Cli _gen/cli-channel - -_gen/cli-call-content-body.h _gen/cli-call-content.h: _gen/call-content.xml \ - $(tools_dir)/glib-client-gen.py Makefile.am - $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \ - --group=call_content \ - --subclass=FutureCallContent \ - --subclass-assert=FUTURE_IS_CALL_CONTENT \ - --iface-quark-prefix=FUTURE_IFACE_QUARK \ - --tp-proxy-api=0.7.6 \ - $< Future_Cli _gen/cli-call-content - -_gen/cli-call-stream-body.h _gen/cli-call-stream.h: _gen/call-stream.xml \ - $(tools_dir)/glib-client-gen.py Makefile.am - $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \ - --group=call_stream \ - --subclass=FutureCallStream \ - --subclass-assert=FUTURE_IS_CALL_STREAM \ - --iface-quark-prefix=FUTURE_IFACE_QUARK \ - --tp-proxy-api=0.7.6 \ - $< Future_Cli _gen/cli-call-stream - -# for now the Endpoint etc. interfaces are on every TpProxy - when we -# have a TpCallEndpoint etc., they should appear on that - -_gen/cli-misc-body.h _gen/cli-misc.h: _gen/misc.xml \ - $(tools_dir)/glib-client-gen.py Makefile.am - $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \ - --group=misc \ - --iface-quark-prefix=FUTURE_IFACE_QUARK \ - --tp-proxy-api=0.7.6 \ - $< Future_Cli _gen/cli-misc diff --git a/extensions/all.xml b/extensions/all.xml deleted file mode 100644 index 618cef7b0..000000000 --- a/extensions/all.xml +++ /dev/null @@ -1,12 +0,0 @@ -<tp:spec - xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" - xmlns:xi="http://www.w3.org/2001/XInclude"> - -<tp:title>Extensions from the future</tp:title> - -<xi:include href="call-content.xml"/> -<xi:include href="call-stream.xml"/> -<xi:include href="channel.xml"/> -<xi:include href="misc.xml"/> - -</tp:spec> diff --git a/extensions/call-content.c b/extensions/call-content.c deleted file mode 100644 index 29d10cec4..000000000 --- a/extensions/call-content.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * call-content.c - proxy for a Content in a Call channel - * - * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/> - * Copyright (C) 2009 Nokia Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "extensions/call-content.h" - -#include <telepathy-glib/proxy-subclass.h> -#include <telepathy-glib/telepathy-glib.h> - -#include "extensions/extensions.h" - -/* Generated code */ -#include "_gen/cli-call-content-body.h" - -/** - * SECTION:call-content - * @title: FutureCallContent - * @short_description: proxy for a Content in a Call channel - * @see_also: #TpChannel - * - * FIXME - * - * Since: FIXME - */ - -/** - * FutureCallContentClass: - * - * The class of a #FutureCallContent. - * - * Since: FIXME - */ -struct _FutureCallContentClass { - TpProxyClass parent_class; - /*<private>*/ - gpointer priv; -}; - -/** - * FutureCallContent: - * - * A proxy object for a Telepathy connection manager. - * - * Since: FIXME - */ -struct _FutureCallContent { - TpProxy parent; - /*<private>*/ - FutureCallContentPrivate *priv; -}; - -struct _FutureCallContentPrivate { - int dummy; -}; - -G_DEFINE_TYPE (FutureCallContent, - future_call_content, - TP_TYPE_PROXY); - -static void -future_call_content_init (FutureCallContent *self) -{ - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, FUTURE_TYPE_CALL_CONTENT, - FutureCallContentPrivate); -} - -static void -future_call_content_class_init (FutureCallContentClass *klass) -{ - TpProxyClass *proxy_class = (TpProxyClass *) klass; - - g_type_class_add_private (klass, sizeof (FutureCallContentPrivate)); - - proxy_class->must_have_unique_name = TRUE; - proxy_class->interface = FUTURE_IFACE_QUARK_CALL_CONTENT; - future_call_content_init_known_interfaces (); -} - -/** - * future_call_content_new: - * @channel: the Call channel - * @object_path: the object path of the content; may not be %NULL - * @error: used to indicate the error if %NULL is returned - * - * <!-- --> - * - * Returns: a new content proxy, or %NULL on invalid arguments - * - * Since: FIXME - */ -FutureCallContent * -future_call_content_new (TpChannel *channel, - const gchar *object_path, - GError **error) -{ - FutureCallContent *ret = NULL; - - g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL); - g_return_val_if_fail (object_path != NULL, NULL); - - if (!tp_dbus_check_valid_object_path (object_path, error)) - goto finally; - - ret = FUTURE_CALL_CONTENT (g_object_new (FUTURE_TYPE_CALL_CONTENT, - /* FIXME: pass in the Channel as a property? */ - "dbus-daemon", tp_proxy_get_dbus_daemon (channel), - "bus-name", tp_proxy_get_bus_name (channel), - "object-path", object_path, - NULL)); - -finally: - return ret; -} - -/** - * future_call_content_init_known_interfaces: - * - * Ensure that the known interfaces for FutureCallContent have been set up. - * This is done automatically when necessary, but for correct - * overriding of library interfaces by local extensions, you should - * call this function before calling - * tp_proxy_or_subclass_hook_on_interface_add() with first argument - * %FUTURE_TYPE_CALL_CONTENT. - * - * Since: 0.7.32 - */ -void -future_call_content_init_known_interfaces (void) -{ - static gsize once = 0; - - if (g_once_init_enter (&once)) - { - GType tp_type = FUTURE_TYPE_CALL_CONTENT; - - tp_proxy_init_known_interfaces (); - tp_proxy_or_subclass_hook_on_interface_add (tp_type, - future_cli_call_content_add_signals); - tp_proxy_subclass_add_error_mapping (tp_type, - TP_ERROR_PREFIX, TP_ERRORS, TP_TYPE_ERROR); - - g_once_init_leave (&once, 1); - } -} diff --git a/extensions/call-content.h b/extensions/call-content.h deleted file mode 100644 index 5f674f2e1..000000000 --- a/extensions/call-content.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * call-content.h - proxy for a Content in a Call channel - * - * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/> - * Copyright (C) 2009 Nokia Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef FUTURE_CALL_CONTENT_H -#define FUTURE_CALL_CONTENT_H - -#include <telepathy-glib/channel.h> -#include <telepathy-glib/proxy.h> - -G_BEGIN_DECLS - -typedef struct _FutureCallContent FutureCallContent; -typedef struct _FutureCallContentPrivate FutureCallContentPrivate; -typedef struct _FutureCallContentClass FutureCallContentClass; - -GType future_call_content_get_type (void); - -/* TYPE MACROS */ -#define FUTURE_TYPE_CALL_CONTENT \ - (future_call_content_get_type ()) -#define FUTURE_CALL_CONTENT(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), FUTURE_TYPE_CALL_CONTENT, \ - FutureCallContent)) -#define FUTURE_CALL_CONTENT_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), FUTURE_TYPE_CALL_CONTENT, \ - FutureCallContentClass)) -#define FUTURE_IS_CALL_CONTENT(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), FUTURE_TYPE_CALL_CONTENT)) -#define FUTURE_IS_CALL_CONTENT_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), FUTURE_TYPE_CALL_CONTENT)) -#define FUTURE_CALL_CONTENT_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), FUTURE_TYPE_CALL_CONTENT, \ - FutureCallContentClass)) - -FutureCallContent *future_call_content_new (TpChannel *channel, - const gchar *object_path, GError **error); - -void future_call_content_init_known_interfaces (void); - -G_END_DECLS - -#include "extensions/_gen/cli-call-content.h" - -#endif diff --git a/extensions/call-content.xml b/extensions/call-content.xml deleted file mode 100644 index b9b02af40..000000000 --- a/extensions/call-content.xml +++ /dev/null @@ -1,10 +0,0 @@ -<tp:spec - xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" - xmlns:xi="http://www.w3.org/2001/XInclude"> - -<tp:title>Call Content</tp:title> - -<xi:include href="../spec/Call_Content.xml"/> -<xi:include href="../spec/Call_Content_Interface_Media.xml"/> - -</tp:spec> diff --git a/extensions/call-stream.c b/extensions/call-stream.c deleted file mode 100644 index b99539896..000000000 --- a/extensions/call-stream.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * call-stream.c - proxy for a Stream in a Call channel - * - * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/> - * Copyright (C) 2009 Nokia Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "extensions/call-stream.h" - -#include <telepathy-glib/proxy-subclass.h> -#include <telepathy-glib/telepathy-glib.h> - -#include "extensions/extensions.h" - -/* Generated code */ -#include "_gen/cli-call-stream-body.h" - -/** - * SECTION:call-stream - * @title: FutureCallStream - * @short_description: proxy for a Stream in a Call channel - * @see_also: #TpChannel - * - * FIXME - * - * Since: FIXME - */ - -/** - * FutureCallStreamClass: - * - * The class of a #FutureCallStream. - * - * Since: FIXME - */ -struct _FutureCallStreamClass { - TpProxyClass parent_class; - /*<private>*/ - gpointer priv; -}; - -/** - * FutureCallStream: - * - * A proxy object for a Telepathy connection manager. - * - * Since: FIXME - */ -struct _FutureCallStream { - TpProxy parent; - /*<private>*/ - FutureCallStreamPrivate *priv; -}; - -struct _FutureCallStreamPrivate { - int dummy; -}; - -G_DEFINE_TYPE (FutureCallStream, - future_call_stream, - TP_TYPE_PROXY); - -static void -future_call_stream_init (FutureCallStream *self) -{ - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, FUTURE_TYPE_CALL_STREAM, - FutureCallStreamPrivate); -} - -static void -future_call_stream_class_init (FutureCallStreamClass *klass) -{ - TpProxyClass *proxy_class = (TpProxyClass *) klass; - - g_type_class_add_private (klass, sizeof (FutureCallStreamPrivate)); - - proxy_class->must_have_unique_name = TRUE; - proxy_class->interface = FUTURE_IFACE_QUARK_CALL_STREAM; - future_call_stream_init_known_interfaces (); -} - -/** - * future_call_stream_new: - * @channel: the Call channel - * @object_path: the object path of the stream; may not be %NULL - * @error: used to indicate the error if %NULL is returned - * - * <!-- --> - * - * Returns: a new stream proxy, or %NULL on invalid arguments - * - * Since: FIXME - */ -FutureCallStream * -future_call_stream_new (TpChannel *channel, - const gchar *object_path, - GError **error) -{ - FutureCallStream *ret = NULL; - - g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL); - g_return_val_if_fail (object_path != NULL, NULL); - - if (!tp_dbus_check_valid_object_path (object_path, error)) - goto finally; - - ret = FUTURE_CALL_STREAM (g_object_new (FUTURE_TYPE_CALL_STREAM, - /* FIXME: pass in the Channel as a property? */ - "dbus-daemon", tp_proxy_get_dbus_daemon (channel), - "bus-name", tp_proxy_get_bus_name (channel), - "object-path", object_path, - NULL)); - -finally: - return ret; -} - -/** - * future_call_stream_init_known_interfaces: - * - * Ensure that the known interfaces for FutureCallStream have been set up. - * This is done automatically when necessary, but for correct - * overriding of library interfaces by local extensions, you should - * call this function before calling - * tp_proxy_or_subclass_hook_on_interface_add() with first argument - * %FUTURE_TYPE_CALL_STREAM. - * - * Since: 0.7.32 - */ -void -future_call_stream_init_known_interfaces (void) -{ - static gsize once = 0; - - if (g_once_init_enter (&once)) - { - GType tp_type = FUTURE_TYPE_CALL_STREAM; - - tp_proxy_init_known_interfaces (); - tp_proxy_or_subclass_hook_on_interface_add (tp_type, - future_cli_call_stream_add_signals); - tp_proxy_subclass_add_error_mapping (tp_type, - TP_ERROR_PREFIX, TP_ERRORS, TP_TYPE_ERROR); - - g_once_init_leave (&once, 1); - } -} diff --git a/extensions/call-stream.h b/extensions/call-stream.h deleted file mode 100644 index 0a195bde0..000000000 --- a/extensions/call-stream.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * call-stream.h - proxy for a Stream in a Call channel - * - * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/> - * Copyright (C) 2009 Nokia Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef FUTURE_CALL_STREAM_H -#define FUTURE_CALL_STREAM_H - -#include <telepathy-glib/channel.h> -#include <telepathy-glib/proxy.h> - -G_BEGIN_DECLS - -typedef struct _FutureCallStream FutureCallStream; -typedef struct _FutureCallStreamPrivate FutureCallStreamPrivate; -typedef struct _FutureCallStreamClass FutureCallStreamClass; - -GType future_call_stream_get_type (void); - -/* TYPE MACROS */ -#define FUTURE_TYPE_CALL_STREAM \ - (future_call_stream_get_type ()) -#define FUTURE_CALL_STREAM(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), FUTURE_TYPE_CALL_STREAM, \ - FutureCallStream)) -#define FUTURE_CALL_STREAM_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), FUTURE_TYPE_CALL_STREAM, \ - FutureCallStreamClass)) -#define FUTURE_IS_CALL_STREAM(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), FUTURE_TYPE_CALL_STREAM)) -#define FUTURE_IS_CALL_STREAM_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), FUTURE_TYPE_CALL_STREAM)) -#define FUTURE_CALL_STREAM_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), FUTURE_TYPE_CALL_STREAM, \ - FutureCallStreamClass)) - -FutureCallStream *future_call_stream_new (TpChannel *channel, - const gchar *object_path, GError **error); - -void future_call_stream_init_known_interfaces (void); - -G_END_DECLS - -#include "extensions/_gen/cli-call-stream.h" - -#endif diff --git a/extensions/call-stream.xml b/extensions/call-stream.xml deleted file mode 100644 index 0f4dbf309..000000000 --- a/extensions/call-stream.xml +++ /dev/null @@ -1,10 +0,0 @@ -<tp:spec - xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" - xmlns:xi="http://www.w3.org/2001/XInclude"> - -<tp:title>Call Stream</tp:title> - -<xi:include href="../spec/Call_Stream.xml"/> -<xi:include href="../spec/Call_Stream_Interface_Media.xml"/> - -</tp:spec> diff --git a/extensions/channel.xml b/extensions/channel.xml deleted file mode 100644 index e10326ecb..000000000 --- a/extensions/channel.xml +++ /dev/null @@ -1,9 +0,0 @@ -<tp:spec - xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" - xmlns:xi="http://www.w3.org/2001/XInclude"> - -<tp:title>Channel extensions from the future</tp:title> - -<xi:include href="../spec/Channel_Type_Call.xml"/> - -</tp:spec> diff --git a/extensions/extensions-cli.c b/extensions/extensions-cli.c deleted file mode 100644 index d29c5ecbd..000000000 --- a/extensions/extensions-cli.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "extensions.h" - -#include <telepathy-glib/telepathy-glib.h> -#include <telepathy-glib/proxy-subclass.h> - -static void _future_ext_register_dbus_glib_marshallers (void); - -/* include auto-generated stubs for client-specific code */ -#include "_gen/signals-marshal.h" -#include "_gen/cli-channel-body.h" -#include "_gen/cli-misc-body.h" -#include "_gen/register-dbus-glib-marshallers-body.h" - -static gpointer -future_cli_once (gpointer data) -{ - _future_ext_register_dbus_glib_marshallers (); - - tp_channel_init_known_interfaces (); - - tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_PROXY, - future_cli_misc_add_signals); - tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_CHANNEL, - future_cli_channel_add_signals); - - return NULL; -} - -void -future_cli_init (void) -{ - static GOnce once = G_ONCE_INIT; - - g_once (&once, future_cli_once, NULL); -} diff --git a/extensions/extensions.c b/extensions/extensions.c deleted file mode 100644 index eeda4623c..000000000 --- a/extensions/extensions.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "extensions.h" - -/* include auto-generated stubs for things common to service and client */ -#include "_gen/gtypes-body.h" -#include "_gen/interfaces-body.h" -#include "_gen/signals-marshal.h" diff --git a/extensions/extensions.h b/extensions/extensions.h deleted file mode 100644 index 24d978748..000000000 --- a/extensions/extensions.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef FUTURE_EXTENSIONS_H -#define FUTURE_EXTENSIONS_H - -#include <glib-object.h> -#include <telepathy-glib/telepathy-glib.h> - -#include "extensions/_gen/enums.h" -#include "extensions/_gen/cli-channel.h" -#include "extensions/_gen/cli-misc.h" -#include "extensions/_gen/svc-call-content.h" -#include "extensions/_gen/svc-call-stream.h" -#include "extensions/_gen/svc-channel.h" -#include "extensions/_gen/svc-misc.h" - -#include "extensions/call-content.h" -#include "extensions/call-stream.h" - -G_BEGIN_DECLS - -#include "extensions/_gen/gtypes.h" -#include "extensions/_gen/interfaces.h" - -void future_cli_init (void); - -G_END_DECLS - -#endif diff --git a/extensions/misc.xml b/extensions/misc.xml deleted file mode 100644 index 217cedfb7..000000000 --- a/extensions/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ -<tp:spec - xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" - xmlns:xi="http://www.w3.org/2001/XInclude"> - -<tp:title>Miscellaneous extensions from the future</tp:title> - -<xi:include href="../spec/Call_Stream_Endpoint.xml"/> - -</tp:spec> diff --git a/tests/dbus/call-example.c b/tests/dbus/call-example.c index 905a14c2e..35554ce64 100644 --- a/tests/dbus/call-example.c +++ b/tests/dbus/call-example.c @@ -24,7 +24,6 @@ #include "examples/future/call-cm/conn.h" #include "examples/future/call-cm/call-channel.h" #include "examples/future/call-cm/call-stream.h" -#include "extensions/extensions.h" #include "tests/lib/util.h" @@ -56,11 +55,11 @@ typedef struct gulong members_changed_detailed_id; - FutureCallContent *added_content; - FutureCallContent *audio_content; - FutureCallContent *video_content; - FutureCallStream *audio_stream; - FutureCallStream *video_stream; + TpCallContent *added_content; + TpCallContent *audio_content; + TpCallContent *video_content; + TpCallStream *audio_stream; + TpCallStream *video_stream; } Test; static void @@ -136,6 +135,30 @@ setup (Test *test, g_free (object_path); } +static TpCallContent * +_tp_call_content_new (TpChannel *channel, + const gchar *object_path, + GError **error) +{ + return g_object_new (TP_TYPE_CALL_CONTENT, + "dbus-daemon", tp_proxy_get_dbus_daemon (channel), + "bus-name", tp_proxy_get_bus_name (channel), + "object-path", object_path, + NULL); +} + +static TpCallStream * +_tp_call_stream_new (TpChannel *channel, + const gchar *object_path, + GError **error) +{ + return g_object_new (TP_TYPE_CALL_STREAM, + "dbus-daemon", tp_proxy_get_dbus_daemon (channel), + "bus-name", tp_proxy_get_bus_name (channel), + "object-path", object_path, + NULL); +} + static void channel_created_cb (TpConnection *connection, const gchar *object_path, @@ -186,7 +209,7 @@ added_content_cb (TpChannel *chan G_GNUC_UNUSED, } else { - test->added_content = future_call_content_new (test->chan, object_path, + test->added_content = _tp_call_content_new (test->chan, object_path, NULL); g_assert (test->added_content != NULL); } @@ -248,7 +271,7 @@ got_members_cb (TpProxy *proxy, g_assert_no_error ((GError *) error); - g_assert (G_VALUE_HOLDS (value, FUTURE_HASH_TYPE_CONTACT_SENDING_STATE_MAP)); + g_assert (G_VALUE_HOLDS (value, TP_HASH_TYPE_CONTACT_SENDING_STATE_MAP)); test->get_members_return = g_value_dup_boxed (value); g_main_loop_quit (test->mainloop); @@ -303,12 +326,12 @@ outgoing_call (Test *test, { GHashTable *request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, - G_TYPE_STRING, FUTURE_IFACE_CHANNEL_TYPE_CALL, + G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, id, - FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, initial_audio, - FUTURE_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, G_TYPE_BOOLEAN, initial_video, NULL); @@ -328,11 +351,11 @@ outgoing_call (Test *test, static void assert_call_properties (GHashTable *get_all_return, - FutureCallState call_state, + TpCallState call_state, TpHandle actor, - FutureCallStateChangeReason reason, + TpCallStateChangeReason reason, const gchar *dbus_reason, - gboolean check_call_flags, FutureCallFlags call_flags, + gboolean check_call_flags, TpCallFlags call_flags, gboolean check_initials, gboolean initial_audio, gboolean initial_video) { gboolean valid; @@ -342,7 +365,7 @@ assert_call_properties (GHashTable *get_all_return, &valid), ==, call_state); g_assert (valid); state_reason = tp_asv_get_boxed (get_all_return, "CallStateReason", - FUTURE_STRUCT_TYPE_CALL_STATE_REASON); + TP_STRUCT_TYPE_CALL_STATE_REASON); g_assert (state_reason != NULL); g_assert_cmpuint (g_value_get_uint (state_reason->values + 0), ==, actor); @@ -359,7 +382,7 @@ assert_call_properties (GHashTable *get_all_return, "MutableContents", &valid), ==, TRUE); g_assert (valid); g_assert_cmpuint (tp_asv_get_uint32 (get_all_return, - "InitialTransport", &valid), ==, FUTURE_STREAM_TRANSPORT_TYPE_UNKNOWN); + "InitialTransport", &valid), ==, TP_STREAM_TRANSPORT_TYPE_UNKNOWN); g_assert (valid); if (check_call_flags) @@ -386,7 +409,7 @@ assert_call_properties (GHashTable *get_all_return, static void assert_content_properties (GHashTable *get_all_return, TpMediaStreamType type, - FutureCallContentDisposition disposition) + TpCallContentDisposition disposition) { gboolean valid; @@ -406,12 +429,12 @@ loop_until_ended (Test *test) while (1) { tp_cli_dbus_properties_call_get_all (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); + TP_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); if (tp_asv_get_uint32 (test->get_all_return, "CallState", - NULL) == FUTURE_CALL_STATE_ENDED) + NULL) == TP_CALL_STATE_ENDED) return; } } @@ -422,12 +445,12 @@ loop_until_answered (Test *test) while (1) { tp_cli_dbus_properties_call_get_all (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); + TP_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); if (tp_asv_get_uint32 (test->get_all_return, "CallState", - NULL) != FUTURE_CALL_STATE_RINGING) + NULL) != TP_CALL_STATE_RINGING) return; } } @@ -435,16 +458,16 @@ loop_until_answered (Test *test) static void assert_ended_and_run_close (Test *test, TpHandle expected_actor, - FutureCallStateChangeReason expected_reason, + TpCallStateChangeReason expected_reason, const gchar *expected_error) { /* In response to whatever we just did, the call ends... */ tp_cli_dbus_properties_call_get_all (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); + TP_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_call_properties (test->get_all_return, - FUTURE_CALL_STATE_ENDED, + TP_CALL_STATE_ENDED, expected_actor, expected_reason, expected_error, @@ -453,7 +476,7 @@ assert_ended_and_run_close (Test *test, /* ... which means there are no contents ... */ tp_cli_dbus_properties_call_get (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, "Contents", + TP_IFACE_CHANNEL_TYPE_CALL, "Contents", got_contents_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -482,20 +505,20 @@ test_basics (Test *test, /* Get initial state */ tp_cli_dbus_properties_call_get_all (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); + TP_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_call_properties (test->get_all_return, - FUTURE_CALL_STATE_PENDING_INITIATOR, 0, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_PENDING_INITIATOR, 0, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", TRUE, 0, /* call flags */ TRUE, TRUE, FALSE); /* initial audio/video must be what we said */ /* We have one audio content but it's not active just yet */ tp_cli_dbus_properties_call_get (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, "Contents", + TP_IFACE_CHANNEL_TYPE_CALL, "Contents", got_contents_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -503,17 +526,17 @@ test_basics (Test *test, g_assert_cmpuint (test->get_contents_return->len, ==, 1); g_assert (test->audio_content == NULL); - test->audio_content = future_call_content_new (test->chan, + test->audio_content = _tp_call_content_new (test->chan, g_ptr_array_index (test->get_contents_return, 0), NULL); g_assert (test->audio_content != NULL); tp_cli_dbus_properties_call_get_all (test->audio_content, -1, - FUTURE_IFACE_CALL_CONTENT, got_all_cb, test, NULL, NULL); + TP_IFACE_CALL_CONTENT, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_content_properties (test->get_all_return, TP_MEDIA_STREAM_TYPE_AUDIO, - FUTURE_CALL_CONTENT_DISPOSITION_INITIAL); + TP_CALL_CONTENT_DISPOSITION_INITIAL); stream_paths = tp_asv_get_boxed (test->get_all_return, "Streams", TP_ARRAY_TYPE_OBJECT_PATH_LIST); @@ -521,12 +544,12 @@ test_basics (Test *test, g_assert_cmpuint (stream_paths->len, ==, 1); g_assert (test->audio_stream == NULL); - test->audio_stream = future_call_stream_new (test->chan, + test->audio_stream = _tp_call_stream_new (test->chan, g_ptr_array_index (stream_paths, 0), NULL); g_assert (test->audio_stream != NULL); tp_cli_dbus_properties_call_get (test->audio_stream, -1, - FUTURE_IFACE_CALL_STREAM, "RemoteMembers", + TP_IFACE_CALL_STREAM, "RemoteMembers", got_members_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -540,23 +563,23 @@ test_basics (Test *test, GUINT_TO_POINTER (tp_channel_get_handle (test->chan, NULL)), NULL, &v)); g_assert_cmpuint (GPOINTER_TO_UINT (v), ==, - FUTURE_SENDING_STATE_PENDING_SEND); + TP_SENDING_STATE_PENDING_SEND); tp_cli_dbus_properties_call_get (test->audio_stream, -1, - FUTURE_IFACE_CALL_STREAM, "LocalSendingState", + TP_IFACE_CALL_STREAM, "LocalSendingState", got_uint_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); - g_assert_cmpuint (test->uint_return, ==, FUTURE_SENDING_STATE_SENDING); + g_assert_cmpuint (test->uint_return, ==, TP_SENDING_STATE_SENDING); /* OK, that looks good. Actually make the call */ - future_cli_channel_type_call_call_accept (test->chan, -1, void_cb, + tp_cli_channel_type_call_call_accept (test->chan, -1, void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Calling Accept again makes no sense, but mustn't crash */ - future_cli_channel_type_call_call_accept (test->chan, -1, void_cb, + tp_cli_channel_type_call_call_accept (test->chan, -1, void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE); @@ -567,7 +590,7 @@ test_basics (Test *test, loop_until_answered (test); /* Calling Accept again makes no sense, but mustn't crash */ - future_cli_channel_type_call_call_accept (test->chan, -1, void_cb, + tp_cli_channel_type_call_call_accept (test->chan, -1, void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE); @@ -576,13 +599,13 @@ test_basics (Test *test, /* Check the call state */ tp_cli_dbus_properties_call_get_all (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); + TP_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_call_properties (test->get_all_return, - FUTURE_CALL_STATE_ACCEPTED, tp_channel_get_handle (test->chan, NULL), - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_ACCEPTED, tp_channel_get_handle (test->chan, NULL), + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", TRUE, 0, /* call flags */ FALSE, FALSE, FALSE); /* don't care about initial audio/video */ @@ -598,7 +621,7 @@ test_basics (Test *test, /* Other contact is sending now */ tp_clear_pointer (&test->get_members_return, g_hash_table_unref); tp_cli_dbus_properties_call_get (test->audio_stream, -1, - FUTURE_IFACE_CALL_STREAM, "RemoteMembers", got_members_cb, test, + TP_IFACE_CALL_STREAM, "RemoteMembers", got_members_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -611,18 +634,18 @@ test_basics (Test *test, g_assert (g_hash_table_lookup_extended (test->get_members_return, GUINT_TO_POINTER (tp_channel_get_handle (test->chan, NULL)), NULL, &v)); - g_assert_cmpuint (GPOINTER_TO_UINT (v), ==, FUTURE_SENDING_STATE_SENDING); + g_assert_cmpuint (GPOINTER_TO_UINT (v), ==, TP_SENDING_STATE_SENDING); tp_cli_dbus_properties_call_get (test->audio_stream, -1, - FUTURE_IFACE_CALL_STREAM, "LocalSendingState", + TP_IFACE_CALL_STREAM, "LocalSendingState", got_uint_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); - g_assert_cmpuint (test->uint_return, ==, FUTURE_SENDING_STATE_SENDING); + g_assert_cmpuint (test->uint_return, ==, TP_SENDING_STATE_SENDING); /* AddContent with bad content-type must fail */ - future_cli_channel_type_call_call_add_content (test->chan, -1, + tp_cli_channel_type_call_call_add_content (test->chan, -1, "", 31337, added_content_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert (test->error != NULL); @@ -630,7 +653,7 @@ test_basics (Test *test, /* AddContent again, to add a video stream */ - future_cli_channel_type_call_call_add_content (test->chan, -1, + tp_cli_channel_type_call_call_add_content (test->chan, -1, "", TP_MEDIA_STREAM_TYPE_VIDEO, added_content_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); @@ -643,7 +666,7 @@ test_basics (Test *test, /* There are two Contents, because now we have the video content too */ tp_cli_dbus_properties_call_get (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, "Contents", + TP_IFACE_CHANNEL_TYPE_CALL, "Contents", got_contents_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -666,12 +689,12 @@ test_basics (Test *test, } tp_cli_dbus_properties_call_get_all (test->video_content, -1, - FUTURE_IFACE_CALL_CONTENT, got_all_cb, test, NULL, NULL); + TP_IFACE_CALL_CONTENT, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_content_properties (test->get_all_return, TP_MEDIA_STREAM_TYPE_VIDEO, - FUTURE_CALL_CONTENT_DISPOSITION_NONE); + TP_CALL_CONTENT_DISPOSITION_NONE); stream_paths = tp_asv_get_boxed (test->get_all_return, "Streams", TP_ARRAY_TYPE_OBJECT_PATH_LIST); @@ -679,19 +702,19 @@ test_basics (Test *test, g_assert_cmpuint (stream_paths->len, ==, 1); g_assert (test->video_stream == NULL); - test->video_stream = future_call_stream_new (test->chan, + test->video_stream = _tp_call_stream_new (test->chan, g_ptr_array_index (stream_paths, 0), NULL); g_assert (test->video_stream != NULL); tp_cli_dbus_properties_call_get (test->audio_stream, -1, - FUTURE_IFACE_CALL_STREAM, "LocalSendingState", + TP_IFACE_CALL_STREAM, "LocalSendingState", got_uint_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); - g_assert_cmpuint (test->uint_return, ==, FUTURE_SENDING_STATE_SENDING); + g_assert_cmpuint (test->uint_return, ==, TP_SENDING_STATE_SENDING); tp_cli_dbus_properties_call_get (test->video_stream, -1, - FUTURE_IFACE_CALL_STREAM, "RemoteMembers", got_members_cb, test, + TP_IFACE_CALL_STREAM, "RemoteMembers", got_members_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -709,9 +732,9 @@ test_basics (Test *test, * accepts our proposed direction change. These might happen in either * order, at least in this implementation. */ - if (GPOINTER_TO_UINT (v) != FUTURE_SENDING_STATE_SENDING) + if (GPOINTER_TO_UINT (v) != TP_SENDING_STATE_SENDING) g_assert_cmpuint (GPOINTER_TO_UINT (v), ==, - FUTURE_SENDING_STATE_PENDING_SEND); + TP_SENDING_STATE_PENDING_SEND); #if 0 /* FIXME: Call has no equivalent of RemoveStreams yet, afaics... */ @@ -740,7 +763,7 @@ test_basics (Test *test, /* Get contents again: now there's only the audio */ tp_cli_dbus_properties_call_get (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, "Contents", + TP_IFACE_CHANNEL_TYPE_CALL, "Contents", got_contents_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -752,13 +775,13 @@ test_basics (Test *test, /* Hang up the call in the recommended way */ - future_cli_channel_type_call_call_hangup (test->chan, - -1, FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", + tp_cli_channel_type_call_call_hangup (test->chan, + -1, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_ended_and_run_close (test, test->self_handle, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); /* FIXME: untested things include: @@ -777,7 +800,7 @@ test_no_answer (Test *test, * example will never answer. */ outgoing_call (test, "smcv (no answer)", TRUE, FALSE); - future_cli_channel_type_call_call_accept (test->chan, -1, void_cb, + tp_cli_channel_type_call_call_accept (test->chan, -1, void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -786,25 +809,25 @@ test_no_answer (Test *test, tp_tests_proxy_run_until_dbus_queue_processed (test->conn); tp_cli_dbus_properties_call_get_all (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); + TP_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_call_properties (test->get_all_return, - FUTURE_CALL_STATE_RINGING, test->self_handle, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_RINGING, test->self_handle, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", TRUE, 0, /* call flags */ TRUE, TRUE, FALSE); /* initial audio/video must be TRUE, FALSE */ /* assume we're never going to get an answer, and hang up */ - future_cli_channel_type_call_call_hangup (test->chan, - -1, FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", + tp_cli_channel_type_call_call_hangup (test->chan, + -1, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_ended_and_run_close (test, test->self_handle, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); } @@ -816,7 +839,7 @@ test_busy (Test *test, * will simulate rejection of the call as busy rather than accepting it. */ outgoing_call (test, "Robot101 (busy)", TRUE, FALSE); - future_cli_channel_type_call_call_accept (test->chan, -1, void_cb, + tp_cli_channel_type_call_call_accept (test->chan, -1, void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -824,7 +847,7 @@ test_busy (Test *test, /* Wait for the remote contact to end the call as busy */ loop_until_ended (test); assert_ended_and_run_close (test, tp_channel_get_handle (test->chan, NULL), - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, TP_ERROR_STR_BUSY); } @@ -836,7 +859,7 @@ test_terminated_by_peer (Test *test, * simulates answering the call but then terminating it */ outgoing_call (test, "The Governator (terminate)", TRUE, TRUE); - future_cli_channel_type_call_call_accept (test->chan, -1, void_cb, + tp_cli_channel_type_call_call_accept (test->chan, -1, void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -848,7 +871,7 @@ test_terminated_by_peer (Test *test, /* After that, the remote contact immediately ends the call */ loop_until_ended (test); assert_ended_and_run_close (test, tp_channel_get_handle (test->chan, NULL), - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); } @@ -858,7 +881,7 @@ test_terminate_via_close (Test *test, { outgoing_call (test, "basic-test", FALSE, TRUE); - future_cli_channel_type_call_call_accept (test->chan, -1, void_cb, + tp_cli_channel_type_call_call_accept (test->chan, -1, void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -868,13 +891,13 @@ test_terminate_via_close (Test *test, loop_until_answered (test); tp_cli_dbus_properties_call_get_all (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); + TP_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_call_properties (test->get_all_return, - FUTURE_CALL_STATE_ACCEPTED, test->peer_handle, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_ACCEPTED, test->peer_handle, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", TRUE, 0, /* call flags */ TRUE, FALSE, TRUE); /* initial audio/video must be FALSE, TRUE */ @@ -921,7 +944,7 @@ expect_incoming_call_cb (TpConnection *conn, channel_type = tp_asv_get_string (properties, TP_PROP_CHANNEL_CHANNEL_TYPE); - if (tp_strdiff (channel_type, FUTURE_IFACE_CHANNEL_TYPE_CALL)) + if (tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_CALL)) { /* don't care about this channel */ continue; @@ -990,19 +1013,19 @@ test_incoming (Test *test, /* ring, ring! */ tp_cli_dbus_properties_call_get_all (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); + TP_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_call_properties (test->get_all_return, - FUTURE_CALL_STATE_RINGING, test->peer_handle, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_RINGING, test->peer_handle, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", TRUE, 0, /* call flags */ TRUE, TRUE, FALSE); /* initial audio/video must be TRUE, FALSE */ /* Get Contents: we have an audio content (FIXME: assert that) */ tp_cli_dbus_properties_call_get (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, "Contents", + TP_IFACE_CHANNEL_TYPE_CALL, "Contents", got_contents_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); @@ -1012,32 +1035,32 @@ test_incoming (Test *test, /* FIXME: assert about the properties of the content and the stream */ /* Accept the call */ - future_cli_channel_type_call_call_accept (test->chan, -1, void_cb, + tp_cli_channel_type_call_call_accept (test->chan, -1, void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_cli_dbus_properties_call_get_all (test->chan, -1, - FUTURE_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); + TP_IFACE_CHANNEL_TYPE_CALL, got_all_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_call_properties (test->get_all_return, - FUTURE_CALL_STATE_ACCEPTED, test->self_handle, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", + TP_CALL_STATE_ACCEPTED, test->self_handle, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", TRUE, 0, /* call flags */ TRUE, TRUE, FALSE); /* initial audio/video are still TRUE, FALSE */ /* FIXME: check for stream directionality changes */ /* Hang up the call */ - future_cli_channel_type_call_call_hangup (test->chan, - -1, FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", + tp_cli_channel_type_call_call_hangup (test->chan, + -1, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", void_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_ended_and_run_close (test, test->self_handle, - FUTURE_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); } static void @@ -1089,8 +1112,6 @@ main (int argc, g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_set_prgname ("call-example"); - future_cli_init (); - g_test_add ("/call/basics", Test, NULL, setup, test_basics, teardown); g_test_add ("/call/busy", Test, NULL, setup, test_busy, teardown); g_test_add ("/call/no-answer", Test, NULL, setup, test_no_answer, |