diff options
25 files changed, 217 insertions, 589 deletions
diff --git a/docs/reference/telepathy-glib/telepathy-glib-docs.sgml b/docs/reference/telepathy-glib/telepathy-glib-docs.sgml index 9a0d3a1d1..253e68f4a 100644 --- a/docs/reference/telepathy-glib/telepathy-glib-docs.sgml +++ b/docs/reference/telepathy-glib/telepathy-glib-docs.sgml @@ -29,7 +29,6 @@ <xi:include href="xml/handle.xml"/> <xi:include href="xml/enums.xml"/> <xi:include href="xml/errors.xml"/> - <xi:include href="xml/channel-iface.xml"/> </chapter> <chapter id="ch-client"> <title>Client-side proxies</title> @@ -80,7 +79,6 @@ <xi:include href="xml/channel-manager-request.xml"/> <xi:include href="xml/base-contact-list.xml"/> <xi:include href="xml/dbus-properties-mixin.xml"/> - <xi:include href="xml/exportable-channel.xml"/> <xi:include href="xml/base-channel.xml"/> <xi:include href="xml/presence-mixin.xml"/> <xi:include href="xml/base-room-config.xml"/> diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt index 4ff2d28ac..e6b7cd611 100644 --- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt @@ -1,21 +1,5 @@ <SECTION> <INCLUDE>telepathy-glib/telepathy-glib.h</INCLUDE> -<FILE>channel-iface</FILE> -TpChannelFunc -<TITLE>TpChannelIface</TITLE> -TpChannelIface -TpChannelIfaceClass -<SUBSECTION Standard> -TP_CHANNEL_IFACE -TP_IS_CHANNEL_IFACE -TP_TYPE_CHANNEL_IFACE -tp_channel_iface_get_type -TP_CHANNEL_IFACE_GET_CLASS -TpChannelPrivate -</SECTION> - -<SECTION> -<INCLUDE>telepathy-glib/telepathy-glib.h</INCLUDE> <FILE>version</FILE> <TITLE>version</TITLE> TP_MAJOR_VERSION @@ -158,21 +142,6 @@ TpChannelManagerRequestMethod <SECTION> <INCLUDE>telepathy-glib/telepathy-glib.h</INCLUDE> -<FILE>exportable-channel</FILE> -TpExportableChannelFunc -<TITLE>TpExportableChannel</TITLE> -TpExportableChannel -TpExportableChannelIface -<SUBSECTION Standard> -TP_EXPORTABLE_CHANNEL -TP_IS_EXPORTABLE_CHANNEL -TP_TYPE_EXPORTABLE_CHANNEL -tp_exportable_channel_get_type -TP_EXPORTABLE_CHANNEL_GET_INTERFACE -</SECTION> - -<SECTION> -<INCLUDE>telepathy-glib/telepathy-glib.h</INCLUDE> <FILE>base-channel</FILE> <TITLE>TpBaseChannel</TITLE> TpBaseChannel @@ -181,6 +150,7 @@ TpBaseChannelFillPropertiesFunc TpBaseChannelCloseFunc TpBaseChannelGetPathFunc TpBaseChannelGetInterfacesFunc +TpBaseChannelFunc tp_base_channel_register tp_base_channel_close tp_base_channel_destroyed @@ -2973,6 +2943,7 @@ tp_channel_close_finish tp_channel_destroy_async tp_channel_destroy_finish <SUBSECTION Private> +TpChannelPrivate tp_channel_get_feature_quark_core tp_channel_get_feature_quark_group tp_channel_get_feature_quark_password diff --git a/examples/cm/call/call-manager.c b/examples/cm/call/call-manager.c index 9ffa40d95..f5def1318 100644 --- a/examples/cm/call/call-manager.c +++ b/examples/cm/call/call-manager.c @@ -285,7 +285,7 @@ example_call_manager_class_init (ExampleCallManagerClass *klass) static void example_call_manager_foreach_channel (TpChannelManager *iface, - TpExportableChannelFunc callback, + TpBaseChannelFunc callback, gpointer user_data) { ExampleCallManager *self = EXAMPLE_CALL_MANAGER (iface); @@ -309,7 +309,7 @@ channel_closed_cb (ExampleCallChannel *chan, g_hash_table_remove (self->priv->channels, chan); tp_channel_manager_emit_channel_closed_for_object ( - TP_CHANNEL_MANAGER (self), TP_EXPORTABLE_CHANNEL (chan)); + TP_CHANNEL_MANAGER (self), TP_BASE_CHANNEL (chan)); } static ExampleCallChannel * @@ -353,7 +353,7 @@ new_channel (ExampleCallManager *self, requests = g_slist_prepend (requests, request); tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self), - TP_EXPORTABLE_CHANNEL (chan), requests); + TP_BASE_CHANNEL (chan), requests); g_slist_free (requests); return chan; @@ -490,7 +490,7 @@ example_call_manager_request (ExampleCallManager *self, { tp_channel_manager_emit_request_already_satisfied ( TP_CHANNEL_MANAGER (self), request, - TP_EXPORTABLE_CHANNEL (chan)); + TP_BASE_CHANNEL (chan)); return TRUE; } } diff --git a/examples/cm/channelspecific/room-manager.c b/examples/cm/channelspecific/room-manager.c index 5127dd8bf..86dc09418 100644 --- a/examples/cm/channelspecific/room-manager.c +++ b/examples/cm/channelspecific/room-manager.c @@ -191,7 +191,7 @@ example_csh_room_manager_close_all (ExampleCSHRoomManager *self) static void example_csh_room_manager_foreach_channel (TpChannelManager *manager, - TpExportableChannelFunc callback, + TpBaseChannelFunc callback, gpointer user_data) { ExampleCSHRoomManager *self = EXAMPLE_CSH_ROOM_MANAGER (manager); @@ -202,7 +202,7 @@ example_csh_room_manager_foreach_channel (TpChannelManager *manager, while (g_hash_table_iter_next (&iter, &handle, &channel)) { - callback (TP_EXPORTABLE_CHANNEL (channel), user_data); + callback (TP_BASE_CHANNEL (channel), user_data); } } @@ -222,7 +222,7 @@ channel_closed_cb (ExampleCSHRoomChannel *chan, } tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (self), - TP_EXPORTABLE_CHANNEL (chan)); + TP_BASE_CHANNEL (chan)); } static void @@ -255,7 +255,7 @@ new_channel (ExampleCSHRoomManager *self, requests = g_slist_prepend (requests, request); tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self), - TP_EXPORTABLE_CHANNEL (chan), requests); + TP_BASE_CHANNEL (chan), requests); g_slist_free (requests); } @@ -337,7 +337,7 @@ example_csh_room_manager_request (ExampleCSHRoomManager *self, else { tp_channel_manager_emit_request_already_satisfied ( - TP_CHANNEL_MANAGER (self), request, TP_EXPORTABLE_CHANNEL (chan)); + TP_CHANNEL_MANAGER (self), request, TP_BASE_CHANNEL (chan)); } return TRUE; diff --git a/examples/cm/echo-message-parts/im-manager.c b/examples/cm/echo-message-parts/im-manager.c index 07cef8224..42b3f2396 100644 --- a/examples/cm/echo-message-parts/im-manager.c +++ b/examples/cm/echo-message-parts/im-manager.c @@ -174,7 +174,7 @@ example_echo_2_im_manager_close_all (ExampleEcho2ImManager *self) static void example_echo_2_im_manager_foreach_channel (TpChannelManager *iface, - TpExportableChannelFunc callback, + TpBaseChannelFunc callback, gpointer user_data) { ExampleEcho2ImManager *self = EXAMPLE_ECHO_2_IM_MANAGER (iface); @@ -185,7 +185,7 @@ example_echo_2_im_manager_foreach_channel (TpChannelManager *iface, while (g_hash_table_iter_next (&iter, &handle, &channel)) { - callback (TP_EXPORTABLE_CHANNEL (channel), user_data); + callback (TP_BASE_CHANNEL (channel), user_data); } } @@ -213,12 +213,12 @@ channel_closed_cb (ExampleEcho2Channel *chan, else { tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self), - TP_EXPORTABLE_CHANNEL (chan), NULL); + TP_BASE_CHANNEL (chan), NULL); } } tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (self), - TP_EXPORTABLE_CHANNEL (chan)); + TP_BASE_CHANNEL (chan)); } static void @@ -251,7 +251,7 @@ new_channel (ExampleEcho2ImManager *self, requests = g_slist_prepend (requests, request); tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self), - TP_EXPORTABLE_CHANNEL (chan), requests); + TP_BASE_CHANNEL (chan), requests); g_slist_free (requests); } @@ -332,7 +332,7 @@ example_echo_2_im_manager_request (ExampleEcho2ImManager *self, else { tp_channel_manager_emit_request_already_satisfied ( - TP_CHANNEL_MANAGER (self), request, TP_EXPORTABLE_CHANNEL (chan)); + TP_CHANNEL_MANAGER (self), request, TP_BASE_CHANNEL (chan)); } return TRUE; diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am index 5cb146c51..aefcfef36 100644 --- a/telepathy-glib/Makefile.am +++ b/telepathy-glib/Makefile.am @@ -63,7 +63,6 @@ tpginclude_HEADERS = \ call-stream.h \ call-stream-endpoint.h \ channel.h \ - channel-iface.h \ channel-dispatcher.h \ channel-dispatch-operation.h \ channel-filter.h \ @@ -94,7 +93,6 @@ tpginclude_HEADERS = \ dtmf.h \ enums.h \ errors.h \ - exportable-channel.h \ file-transfer-channel.h \ gnio-unix.h \ group-mixin.h \ @@ -292,7 +290,6 @@ libtelepathy_glib_main_internal_handwritten_source = \ dtmf.c \ debug-internal.h \ errors.c \ - exportable-channel.c \ file-transfer-channel.c \ gnio-unix.c \ group-mixin.c \ @@ -306,7 +303,6 @@ libtelepathy_glib_main_internal_handwritten_source = \ handle-set.c \ heap.c \ intset.c \ - channel-iface.c \ logger.c \ message.c \ message-internal.h \ diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c index 8d4af7e52..20ea4cc17 100644 --- a/telepathy-glib/base-call-channel.c +++ b/telepathy-glib/base-call-channel.c @@ -109,11 +109,9 @@ #include "telepathy-glib/base-call-internal.h" #include "telepathy-glib/base-media-call-stream.h" #include "telepathy-glib/base-connection.h" -#include "telepathy-glib/channel-iface.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/dbus.h" #include "telepathy-glib/enums.h" -#include "telepathy-glib/exportable-channel.h" #include "telepathy-glib/gtypes.h" #include "telepathy-glib/interfaces.h" #include "telepathy-glib/svc-call.h" diff --git a/telepathy-glib/base-channel.c b/telepathy-glib/base-channel.c index e8eecb89b..e65a07010 100644 --- a/telepathy-glib/base-channel.c +++ b/telepathy-glib/base-channel.c @@ -22,10 +22,10 @@ /** * SECTION:base-channel * @title: TpBaseChannel - * @short_description: base class for #TpExportableChannel implementations + * @short_description: base class for all channel implementations * @see_also: #TpSvcChannel * - * This base class makes it easier to write #TpExportableChannel + * This base class makes it easier to write channels * implementations by implementing some of its properties, and defining other * relevant properties. * @@ -38,7 +38,7 @@ * D-Bus properties besides those on the Channel interface, the subclass should * implement the #TpBaseChannelClass.fill_immutable_properties virtual function. * - * If the #TpExportableChannel:object-path property is not set at construct + * If the #TpBaseChannel:object-path property is not set at construct * time, the #TpBaseChannelClass.get_object_path_suffix virtual function will * be called to determine the channel's path, whose default implementation * simply generates a unique path based on the object's address in memory. @@ -67,7 +67,7 @@ * if (tp_base_channel_is_registered (chan)) * { * tp_channel_manager_emit_channel_closed (manager, - * TP_EXPORTABLE_CHANNEL (chan)); + * TP_BASE_CHANNEL (chan)); * } * * if (tp_base_channel_is_destroyed (chan)) @@ -78,7 +78,7 @@ * else if (tp_base_channel_is_respawning (chan)) * { * // reopened_with_requested() must have been called; re-announce the channel - * tp_channel_manager_emit_new_channel (manager, TP_EXPORTABLE_CHANNEL (chan)); + * tp_channel_manager_emit_new_channel (manager, TP_BASE_CHANNEL (chan)); * } * else * { @@ -104,7 +104,7 @@ * while (g_hash_table_iter_next (&iter, NULL, &chan)) * { * if (tp_base_channel_is_registered (TP_BASE_CHANNEL (chan))) - * func (TP_EXPORTABLE_CHANNEL (chan), user_data); + * func (TP_BASE_CHANNEL (chan), user_data); * } * } * ]| @@ -137,7 +137,7 @@ * @get_object_path_suffix: Returns a string that will be appended to the * Connection objects's object path to get the Channel's object path. This * function will only be called as a fallback if the - * #TpExportableChannel:object-path property is not set. The default + * #TpBaseChannel:object-path property is not set. The default * implementation simply generates a unique path based on the object's address * in memory. The returned string will be freed automatically. * @get_interfaces: Extra interfaces provided by this channel (this SHOULD NOT @@ -298,6 +298,15 @@ * Since: 0.17.5 */ +/** + * TpBaseChannelFunc: + * @channel: A #TpBaseChannel + * @user_data: Arbitrary user-supplied data + * + * A callback for functions which act on base channels. + */ + + #include "config.h" #include "base-channel.h" @@ -305,9 +314,8 @@ #include <dbus/dbus-glib-lowlevel.h> #include <telepathy-glib/asv.h> -#include <telepathy-glib/channel-iface.h> +#include <telepathy-glib/base-connection.h> #include <telepathy-glib/dbus.h> -#include <telepathy-glib/exportable-channel.h> #include "telepathy-glib/group-mixin.h" #include <telepathy-glib/interfaces.h> #include <telepathy-glib/svc-channel.h> @@ -358,15 +366,13 @@ static void channel_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (TpBaseChannel, tp_base_channel, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init); - G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL); - G_IMPLEMENT_INTERFACE (TP_TYPE_EXPORTABLE_CHANNEL, NULL); ) /** * tp_base_channel_register: * @chan: a channel * - * Make the channel appear on the bus. #TpExportableChannel:object-path must have been set + * Make the channel appear on the bus. #TpBaseChannel:object-path must have been set * to a valid path, which must not already be in use as another object's path. * * Since: 0.11.14 @@ -390,7 +396,7 @@ tp_base_channel_register (TpBaseChannel *chan) * * Called by subclasses to indicate that this channel was destroyed and can be * removed from the bus. The "Closed" signal will be emitted and the - * #TpExportableChannel:channel-destroyed property will be set. + * #TpBaseChannel:channel-destroyed property will be set. * * Since: 0.11.14 */ @@ -444,7 +450,7 @@ tp_base_channel_reopened (TpBaseChannel *chan, TpHandle initiator) * Called by subclasses to indicate that this channel is closing and * should be unregistered from the bus, but the actual object * shouldn't be destroyed. The "Closed" signal will be emitted, - * the #TpExportableChannel:channel-destroyed property will not be + * the #TpBaseChannel:channel-destroyed property will not be * set, and the channel will be unregistered from the bus. * * Since: 0.19.7 @@ -482,7 +488,7 @@ tp_base_channel_disappear (TpBaseChannel *chan) * Called by subclasses to indicate that this channel was closed but * was re-opened, either due to pending messages or from having * disappeared (with tp_base_channel_disappear()). The "Closed" signal - * will be emitted, but the #TpExportableChannel:channel-destroyed + * will be emitted, but the #TpBaseChannel:channel-destroyed * property will not be set. The channel's * #TpBaseChannel:initiator-handle property will be set to @initiator, * and the #TpBaseChannel:requested property will be set to @@ -520,7 +526,7 @@ tp_base_channel_reopened_with_requested (TpBaseChannel *chan, * @chan: a channel * * Asks @chan to close, just as if the Close D-Bus method had been called. If - * #TpExportableChannel:channel-destroyed is TRUE, this is a no-op. + * #TpBaseChannel:channel-destroyed is TRUE, this is a no-op. * * Note that, depending on the subclass's implementation of * #TpBaseChannelClass.close and internal behaviour, this may or may not be a @@ -547,7 +553,7 @@ tp_base_channel_close (TpBaseChannel *chan) * @chan: a channel * * Returns @chan's object path, as a shortcut for retrieving the - * #TpChannelIface:object-path property. + * #TpBaseChannel:object-path property. * * Returns: (transfer none): @chan's object path * @@ -613,7 +619,7 @@ tp_base_channel_get_self_handle (TpBaseChannel *chan) * Returns the target handle of @chan (without a reference), which will be 0 * if #TpBaseChannelClass.target_entity_type is #TP_ENTITY_TYPE_NONE for this * class, and non-zero otherwise. This is a shortcut for retrieving the - * #TpChannelIface:handle property. + * #TpBaseChannel:handle property. * * Returns: the target handle of @chan * @@ -689,7 +695,7 @@ tp_base_channel_is_registered (TpBaseChannel *chan) * tp_base_channel_is_destroyed: * @chan: a channel * - * Returns the value of the #TpExportableChannel:channel-destroyed property, + * Returns the value of the #TpBaseChannel:channel-destroyed property, * which is TRUE if tp_base_channel_destroyed() has been called (and thus the * channel has been removed from the bus). * @@ -1004,17 +1010,136 @@ tp_base_channel_class_init (TpBaseChannelClass *tp_base_channel_class) object_class->dispose = tp_base_channel_dispose; object_class->finalize = tp_base_channel_finalize; - g_object_class_override_property (object_class, PROP_OBJECT_PATH, - "object-path"); - g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, - "channel-type"); - g_object_class_override_property (object_class, PROP_ENTITY_TYPE, - "entity-type"); - g_object_class_override_property (object_class, PROP_HANDLE, "handle"); - g_object_class_override_property (object_class, PROP_CHANNEL_DESTROYED, - "channel-destroyed"); - g_object_class_override_property (object_class, PROP_CHANNEL_PROPERTIES, - "channel-properties"); + /** + * TpBaseChannel:object-path: + * + * The D-Bus object path used for this object on the bus. Read-only + * except during construction. + */ + param_spec = g_param_spec_string ("object-path", "D-Bus object path", + "The D-Bus object path used for this object on the bus.", NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + g_object_class_install_property (object_class, PROP_OBJECT_PATH, param_spec); + + /** + * TpBaseChannel:channel-type: + * + * The D-Bus interface representing the type of this channel. Read-only + * except during construction. + * + * In connection manager implementations, attempts to set this property + * during construction will usually be ignored or treated as an + * error. + */ + param_spec = g_param_spec_string ("channel-type", "Telepathy channel type", + "The D-Bus interface representing the type of this channel.", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + g_object_class_install_property (object_class, PROP_CHANNEL_TYPE, param_spec); + + /** + * TpBaseChannel:entity-type: + * + * The #TpEntityType of this channel's associated handle, or + * %TP_ENTITY_TYPE_NONE (which is numerically 0) if no handle. + * + * In connection manager implementations, attempts to set this during + * construction might be ignored. + */ + param_spec = g_param_spec_uint ("entity-type", "Entity type", + "The TpEntityType of this channel's associated handle.", + 0, G_MAXUINT32, TP_UNKNOWN_ENTITY_TYPE, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + g_object_class_install_property (object_class, PROP_ENTITY_TYPE, param_spec); + + /** + * TpBaseChannel:handle: + * + * This channel's associated handle, or 0 if no handle or unknown. + * Read-only except during construction. + * + * In connection manager implementations, attempts to set this during + * construction might be ignored, depending on the channel type. + */ + param_spec = g_param_spec_uint ("handle", "Handle", + "The TpHandle representing the contact, group, etc. with which " + "this channel communicates, whose type is given by the entity-type " + "property.", + 0, G_MAXUINT32, 0, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + g_object_class_install_property (object_class, PROP_HANDLE, param_spec); + + /** + * TpBaseChannel:channel-properties: + * + * The D-Bus properties to be announced in the NewChannels signal + * and in the Channels property, as a map from + * interface.name.propertyname to variant. + * + * A channel's immutable properties are constant for its lifetime on the + * bus, so this property should only change when the closed signal is + * emitted (so that respawned channels can reappear on the bus with + * different properties). All of the D-Bus properties mentioned here + * should be exposed through the D-Bus properties interface; additional + * (possibly mutable) properties not included here may also be exposed + * via the D-Bus properties interface. + * + * If the channel implementation uses + * <link linkend="telepathy-glib-dbus-properties-mixin">TpDBusPropertiesMixin</link>, + * this property can implemented using + * tp_dbus_properties_mixin_make_properties_hash() as follows: + * + * <informalexample><programlisting> + * case PROP_CHANNEL_PROPERTIES: + * { + * GHashTable *hash = tp_dbus_properties_mixin_make_properties_hash (object, + * // The spec says these properties MUST be included: + * TP_IFACE_CHANNEL, "TargetHandle", + * TP_IFACE_CHANNEL, "TargetEntityType", + * TP_IFACE_CHANNEL, "ChannelType", + * TP_IFACE_CHANNEL, "TargetID", + * TP_IFACE_CHANNEL, "Requested", + * TP_IFACE_CHANNEL, "InitiatorHandle", + * TP_IFACE_CHANNEL, "InitiatorID", + * TP_IFACE_CHANNEL, "Interfaces", + * // Perhaps your channel has some other immutable properties: + * TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "SupportedContentTypes", + * // etc. + * NULL)); + * + * g_value_set_variant (value, tp_asv_to_vardict (hash)); + * g_hash_table_unref (hash); + * } + * break; + * </programlisting></informalexample> + */ + param_spec = g_param_spec_variant ("channel-properties", + "Channel properties", + "The channel's immutable properties", + G_VARIANT_TYPE_VARDICT, NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + g_object_class_install_property (object_class, PROP_CHANNEL_PROPERTIES, + param_spec); + + /** + * TpBaseChannel:channel-destroyed: + * + * If true, the closed signal on the Channel interface indicates that + * the channel can go away. + * + * If false, the closed signal indicates to the channel manager that the + * channel should appear to go away and be re-created, by emitting Closed + * followed by NewChannel. (This is to support the "respawning" of Text + * channels which are closed with unacknowledged messages.) + */ + param_spec = g_param_spec_boolean ("channel-destroyed", + "Destroyed?", + "If true, the channel has *really* closed, rather than just " + "appearing to do so", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + g_object_class_install_property (object_class, PROP_CHANNEL_DESTROYED, + param_spec); param_spec = g_param_spec_object ("connection", "TpBaseConnection object", "Connection object that owns this channel.", diff --git a/telepathy-glib/base-channel.h b/telepathy-glib/base-channel.h index 51788493f..01fb13252 100644 --- a/telepathy-glib/base-channel.h +++ b/telepathy-glib/base-channel.h @@ -29,13 +29,15 @@ #include <glib-object.h> #include <telepathy-glib/dbus-properties-mixin.h> -#include <telepathy-glib/base-connection.h> #include <telepathy-glib/defs.h> #include "connection.h" G_BEGIN_DECLS +/* forward declaration to avoid include cycle */ +typedef struct _TpBaseConnection TpBaseConnection; + typedef struct _TpBaseChannel TpBaseChannel; typedef struct _TpBaseChannelClass TpBaseChannelClass; typedef struct _TpBaseChannelPrivate TpBaseChannelPrivate; @@ -45,6 +47,8 @@ typedef void (*TpBaseChannelFillPropertiesFunc) (TpBaseChannel *chan, GHashTable *properties); typedef gchar *(*TpBaseChannelGetPathFunc) (TpBaseChannel *chan); typedef GPtrArray *(*TpBaseChannelGetInterfacesFunc) (TpBaseChannel *chan); +typedef void (*TpBaseChannelFunc) (TpBaseChannel *channel, + gpointer user_data); struct _TpBaseChannelClass { diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c index 7528eefc4..886cb74bc 100644 --- a/telepathy-glib/base-connection.c +++ b/telepathy-glib/base-connection.c @@ -208,7 +208,6 @@ #include <telepathy-glib/connection-manager.h> #include <telepathy-glib/dbus.h> #include <telepathy-glib/dbus-internal.h> -#include <telepathy-glib/exportable-channel.h> #include <telepathy-glib/gtypes.h> #include <telepathy-glib/interfaces.h> #include <telepathy-glib/sliced-gvalue.h> @@ -520,7 +519,7 @@ tp_base_connection_finalize (GObject *object) static void satisfy_request (TpBaseConnection *conn, TpChannelManagerRequest *request, - TpExportableChannel *channel) + TpBaseChannel *channel) { TpBaseConnectionPrivate *priv = conn->priv; @@ -543,7 +542,7 @@ fail_channel_request (TpBaseConnection *conn, static void manager_new_channel (TpBaseConnection *self, - TpExportableChannel *channel, + TpBaseChannel *channel, GSList *request_tokens) { gchar *object_path; @@ -589,7 +588,7 @@ break_loop_early: for (iter = request_tokens; iter != NULL; iter = iter->next) { - satisfy_request (self, iter->data, TP_EXPORTABLE_CHANNEL (channel)); + satisfy_request (self, iter->data, TP_BASE_CHANNEL (channel)); } g_free (object_path); @@ -598,7 +597,7 @@ break_loop_early: static void manager_new_channel_cb (TpChannelManager *manager, - TpExportableChannel *channel, + TpBaseChannel *channel, GSList *requests, TpBaseConnection *self) { @@ -628,20 +627,20 @@ manager_new_channel_cb (TpChannelManager *manager, static void manager_request_already_satisfied_cb (TpChannelManager *manager, gpointer request_token, - TpExportableChannel *channel, + TpBaseChannel *channel, TpBaseConnection *self) { gchar *object_path; g_assert (TP_IS_CHANNEL_MANAGER (manager)); - g_assert (TP_IS_EXPORTABLE_CHANNEL (channel)); + g_assert (TP_IS_BASE_CHANNEL (channel)); g_assert (TP_IS_BASE_CONNECTION (self)); g_object_get (channel, "object-path", &object_path, NULL); - satisfy_request (self, request_token, TP_EXPORTABLE_CHANNEL (channel)); + satisfy_request (self, request_token, TP_BASE_CHANNEL (channel)); g_free (object_path); } @@ -859,7 +858,7 @@ tp_base_connection_add_possible_client_interest (TpBaseConnection *self, /* D-Bus properties for the Requests interface */ static void -manager_get_channel_details_foreach (TpExportableChannel *chan, +manager_get_channel_details_foreach (TpBaseChannel *chan, gpointer user_data) { GVariantBuilder *builder = user_data; diff --git a/telepathy-glib/base-media-call-channel.c b/telepathy-glib/base-media-call-channel.c index ee093d8ea..d4a4f8c5f 100644 --- a/telepathy-glib/base-media-call-channel.c +++ b/telepathy-glib/base-media-call-channel.c @@ -80,7 +80,6 @@ #include "telepathy-glib/base-call-internal.h" #include "telepathy-glib/base-media-call-stream.h" #include "telepathy-glib/base-connection.h" -#include "telepathy-glib/channel-iface.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/dbus.h" #include "telepathy-glib/enums.h" diff --git a/telepathy-glib/channel-iface.c b/telepathy-glib/channel-iface.c deleted file mode 100644 index d9774e7af..000000000 --- a/telepathy-glib/channel-iface.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * tp-channel-iface.c - Stubs for Telepathy Channel interface - * - * Copyright (C) 2006 Collabora Ltd. - * Copyright (C) 2006 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 - */ - -/** - * SECTION:channel-iface - * @title: TpChannelIface - * @short_description: interface representing basic channel properties - * @see_also: #TpSvcChannel, #TpChannelFactoryIface - * - * This interface defines a basic set of channel properties. It's mainly - * used in #TpChannelFactoryIface to represent the returned channel objects. - */ - -#include "config.h" - -#include <telepathy-glib/channel-iface.h> -#include <telepathy-glib/handle.h> - -static void -tp_channel_iface_base_init (gpointer klass) -{ - static gboolean initialized = FALSE; - - if (!initialized) { - GParamSpec *param_spec; - - initialized = TRUE; - - /** - * TpChannelIface:object-path: - * - * The D-Bus object path used for this object on the bus. Read-only - * except during construction. - */ - param_spec = g_param_spec_string ("object-path", "D-Bus object path", - "The D-Bus object path used for this object on the bus.", NULL, - G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - g_object_interface_install_property (klass, param_spec); - - /** - * TpChannelIface:channel-type: - * - * The D-Bus interface representing the type of this channel. Read-only - * except during construction. - * - * In connection manager implementations, attempts to set this property - * during construction will usually be ignored or treated as an - * error. - */ - param_spec = g_param_spec_string ("channel-type", "Telepathy channel type", - "The D-Bus interface representing the type of this channel.", - NULL, - G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - g_object_interface_install_property (klass, param_spec); - - /** - * TpChannelIface:entity-type: - * - * The #TpEntityType of this channel's associated handle, or - * %TP_ENTITY_TYPE_NONE (which is numerically 0) if no handle. - * - * In connection manager implementations, attempts to set this during - * construction might be ignored. - */ - param_spec = g_param_spec_uint ("entity-type", "Entity type", - "The TpEntityType of this channel's associated handle.", - 0, G_MAXUINT32, TP_UNKNOWN_ENTITY_TYPE, - G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - g_object_interface_install_property (klass, param_spec); - - /** - * TpChannelIface:handle: - * - * This channel's associated handle, or 0 if no handle or unknown. - * Read-only except during construction. - * - * In connection manager implementations, attempts to set this during - * construction might be ignored, depending on the channel type. - */ - param_spec = g_param_spec_uint ("handle", "Handle", - "The TpHandle representing the contact, group, etc. with which " - "this channel communicates, whose type is given by the entity-type " - "property.", - 0, G_MAXUINT32, 0, - G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - g_object_interface_install_property (klass, param_spec); - } -} - -GType -tp_channel_iface_get_type (void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof (TpChannelIfaceClass), - tp_channel_iface_base_init, /* base_init */ - NULL, /* base_finalize */ - NULL, /* class_init */ - NULL, /* class_finalize */ - NULL, /* class_data */ - 0, - 0, /* n_preallocs */ - NULL /* instance_init */ - }; - - type = g_type_register_static (G_TYPE_INTERFACE, "TpChannelIface", &info, - 0); - } - - return type; -} diff --git a/telepathy-glib/channel-iface.h b/telepathy-glib/channel-iface.h deleted file mode 100644 index b227644db..000000000 --- a/telepathy-glib/channel-iface.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * tp-channel-iface.h - Headers for Telepathy Channel interface - * - * Copyright (C) 2006 Collabora Ltd. - * Copyright (C) 2006 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 - */ - -#if !defined (_TP_GLIB_H_INSIDE) && !defined (_TP_COMPILATION) -#error "Only <telepathy-glib/telepathy-glib.h> can be included directly." -#endif - -#ifndef __TP_CHANNEL_IFACE_H__ -#define __TP_CHANNEL_IFACE_H__ - -#include <glib-object.h> - -G_BEGIN_DECLS - -#define TP_TYPE_CHANNEL_IFACE (tp_channel_iface_get_type ()) - -#define TP_CHANNEL_IFACE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TP_TYPE_CHANNEL_IFACE, TpChannelIface)) - -#define TP_IS_CHANNEL_IFACE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - TP_TYPE_CHANNEL_IFACE)) - -#define TP_CHANNEL_IFACE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ - TP_TYPE_CHANNEL_IFACE, TpChannelIfaceClass)) - -/** - * TpChannelIface: - * - * Opaque typedef representing a channel. - */ -typedef struct _TpChannelIface TpChannelIface; - -typedef struct _TpChannelIfaceClass TpChannelIfaceClass; - -/** - * TpChannelFunc: - * @self: An object implementing the channel interface - * @userdata: Arbitrary user-supplied data - * - * A callback for functions which act on channels. - */ -typedef void (* TpChannelFunc) (TpChannelIface *self, gpointer userdata); - -/** - * TpChannelIfaceClass: - * @parent_class: The parent interface - * - * The class of the #TpChannelIface interface. - */ -struct _TpChannelIfaceClass { - GTypeInterface parent_class; -}; - -GType tp_channel_iface_get_type (void); - -G_END_DECLS - -#endif /* __TP_CHANNEL_IFACE_H__ */ diff --git a/telepathy-glib/channel-manager-request-internal.h b/telepathy-glib/channel-manager-request-internal.h index d0c3dcfa6..b3306a0b8 100644 --- a/telepathy-glib/channel-manager-request-internal.h +++ b/telepathy-glib/channel-manager-request-internal.h @@ -96,7 +96,7 @@ TpChannelManagerRequest * _tp_channel_manager_request_new ( void _tp_channel_manager_request_cancel (TpChannelManagerRequest *self); void _tp_channel_manager_request_satisfy (TpChannelManagerRequest *self, - TpExportableChannel *channel); + TpBaseChannel *channel); void _tp_channel_manager_request_fail (TpChannelManagerRequest *self, GError *error); diff --git a/telepathy-glib/channel-manager-request.c b/telepathy-glib/channel-manager-request.c index 9776b53d2..a442461d1 100644 --- a/telepathy-glib/channel-manager-request.c +++ b/telepathy-glib/channel-manager-request.c @@ -143,12 +143,12 @@ _tp_channel_manager_request_cancel (TpChannelManagerRequest *self) void _tp_channel_manager_request_satisfy (TpChannelManagerRequest *self, - TpExportableChannel *channel) + TpBaseChannel *channel) { gchar *object_path; GVariant *properties; - g_return_if_fail (TP_IS_EXPORTABLE_CHANNEL (channel)); + g_return_if_fail (TP_IS_BASE_CHANNEL (channel)); g_return_if_fail (self->context != NULL); DEBUG ("completing queued request %p with success, " diff --git a/telepathy-glib/channel-manager.c b/telepathy-glib/channel-manager.c index cd7edea3c..b3bd907b0 100644 --- a/telepathy-glib/channel-manager.c +++ b/telepathy-glib/channel-manager.c @@ -198,7 +198,6 @@ #include <telepathy-glib/channel-manager-request-internal.h> #include <telepathy-glib/dbus.h> #include <telepathy-glib/errors.h> -#include <telepathy-glib/exportable-channel.h> #include <telepathy-glib/util.h> enum { @@ -224,7 +223,7 @@ channel_manager_base_init (gpointer klass) /** * TpChannelManager::new-channel: * @self: the channel manager - * @channel: a object implementing #TpExportableChannel + * @channel: a object implementing #TpBaseChannel * @channels: (type GLib.SList) (element-type TelepathyGLib.ChannelManagerRequest): * a #GSList of #TpChannelManagerRequest satisfied by @channel * @@ -245,7 +244,7 @@ channel_manager_base_init (gpointer klass) * @self: the channel manager * @request: a #TpChannelManagerRequest supplied by the requester, * representing a request - * @channel: the existing #TpExportableChannel that satisfies the + * @channel: the existing #TpBaseChannel that satisfies the * request * * Emitted when a channel request is satisfied by an existing channel. @@ -334,7 +333,7 @@ tp_channel_manager_get_type (void) /** * tp_channel_manager_emit_new_channel: * @self: An object implementing #TpChannelManager - * @channel: A #TpExportableChannel + * @channel: A #TpBaseChannel * @requests: (element-type TelepathyGLib.ChannelManagerRequest) * the #TpChannelManagerRequest objects satisfied by this channel * @@ -345,11 +344,11 @@ tp_channel_manager_get_type (void) */ void tp_channel_manager_emit_new_channel (TpChannelManager *self, - TpExportableChannel *channel, + TpBaseChannel *channel, GSList *requests) { g_return_if_fail (TP_IS_CHANNEL_MANAGER (self)); - g_return_if_fail (TP_IS_EXPORTABLE_CHANNEL (channel)); + g_return_if_fail (TP_IS_BASE_CHANNEL (channel)); g_signal_emit (self, signals[S_NEW_CHANNEL], 0, channel, requests); } @@ -379,22 +378,22 @@ tp_channel_manager_emit_channel_closed (TpChannelManager *self, /** * tp_channel_manager_emit_channel_closed_for_object: * @self: An object implementing #TpChannelManager - * @channel: A #TpExportableChannel + * @channel: A #TpBaseChannel * * Emit the #TpChannelManager::channel-closed signal indicating that * the given channel has been closed. (This is a convenient shortcut for * calling tp_channel_manager_emit_channel_closed() with the - * #TpExportableChannel:object-path property of @channel.) + * #TpBaseChannel:object-path property of @channel.) * * Since: 0.7.15 */ void tp_channel_manager_emit_channel_closed_for_object (TpChannelManager *self, - TpExportableChannel *channel) + TpBaseChannel *channel) { gchar *path; - g_return_if_fail (TP_IS_EXPORTABLE_CHANNEL (channel)); + g_return_if_fail (TP_IS_BASE_CHANNEL (channel)); g_object_get (channel, "object-path", &path, NULL); @@ -415,9 +414,9 @@ tp_channel_manager_emit_channel_closed_for_object (TpChannelManager *self, void tp_channel_manager_emit_request_already_satisfied (TpChannelManager *self, TpChannelManagerRequest *request, - TpExportableChannel *channel) + TpBaseChannel *channel) { - g_return_if_fail (TP_IS_EXPORTABLE_CHANNEL (channel)); + g_return_if_fail (TP_IS_BASE_CHANNEL (channel)); g_return_if_fail (TP_IS_CHANNEL_MANAGER (self)); g_signal_emit (self, signals[S_REQUEST_ALREADY_SATISFIED], 0, @@ -501,7 +500,7 @@ tp_channel_manager_emit_request_failed_printf (TpChannelManager *self, */ void tp_channel_manager_foreach_channel (TpChannelManager *manager, - TpExportableChannelFunc func, + TpBaseChannelFunc func, gpointer user_data) { TpChannelManagerIface *iface = TP_CHANNEL_MANAGER_GET_INTERFACE ( diff --git a/telepathy-glib/channel-manager.h b/telepathy-glib/channel-manager.h index 1fc97e851..0baabb6f4 100644 --- a/telepathy-glib/channel-manager.h +++ b/telepathy-glib/channel-manager.h @@ -30,8 +30,8 @@ #include <glib-object.h> #include <telepathy-glib/defs.h> -#include <telepathy-glib/exportable-channel.h> #include <telepathy-glib/channel-manager-request.h> +#include <telepathy-glib/base-channel.h> G_BEGIN_DECLS @@ -56,11 +56,11 @@ typedef struct _TpChannelManagerIface TpChannelManagerIface; /* virtual methods */ typedef void (*TpChannelManagerForeachChannelFunc) ( - TpChannelManager *manager, TpExportableChannelFunc func, + TpChannelManager *manager, TpBaseChannelFunc func, gpointer user_data); void tp_channel_manager_foreach_channel (TpChannelManager *manager, - TpExportableChannelFunc func, gpointer user_data); + TpBaseChannelFunc func, gpointer user_data); typedef void (*TpChannelManagerChannelClassFunc) ( @@ -132,16 +132,16 @@ GType tp_channel_manager_get_type (void); /* signal emission */ void tp_channel_manager_emit_new_channel (TpChannelManager *self, - TpExportableChannel *channel, GSList *requests); + TpBaseChannel *channel, GSList *requests); void tp_channel_manager_emit_channel_closed (TpChannelManager *self, const gchar *path); void tp_channel_manager_emit_channel_closed_for_object (TpChannelManager *self, - TpExportableChannel *channel); + TpBaseChannel *channel); void tp_channel_manager_emit_request_already_satisfied (TpChannelManager *self, TpChannelManagerRequest *request, - TpExportableChannel *channel); + TpBaseChannel *channel); void tp_channel_manager_emit_request_failed (TpChannelManager *self, TpChannelManagerRequest *request, diff --git a/telepathy-glib/channel.c b/telepathy-glib/channel.c index c18c305ed..a35b4372e 100644 --- a/telepathy-glib/channel.c +++ b/telepathy-glib/channel.c @@ -26,7 +26,6 @@ #include <dbus/dbus-glib.h> #include <telepathy-glib/asv.h> -#include <telepathy-glib/channel-iface.h> #include <telepathy-glib/cli-channel.h> #include <telepathy-glib/cli-misc.h> #include <telepathy-glib/dbus.h> diff --git a/telepathy-glib/exportable-channel.c b/telepathy-glib/exportable-channel.c deleted file mode 100644 index a765595f8..000000000 --- a/telepathy-glib/exportable-channel.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - * exportable-channel.c - A channel usable with the Channel Manager - * - * Copyright (C) 2008 Collabora Ltd. - * Copyright (C) 2008 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 - */ - -/** - * SECTION:exportable-channel - * @title: TpExportableChannel - * @short_description: interface representing channels with several standard - * properties - * @see_also: #TpChannelIface, #TpChannelManager, #TpSvcChannel - * - * This interface defines a set of channel properties on top of those of - * #TpChannelIface. It's mainly used by #TpChannelManager to represent the - * returned and managed channel objects. - */ - -/** - * TpExportableChannel: - * - * Opaque typedef representing a channel with several standard properties. - */ - -/** - * TpExportableChannelFunc: - * @channel: An object implementing the exportable channel interface - * @user_data: Arbitrary user-supplied data - * - * A callback for functions which act on exportable channels. - */ - -/** - * TpExportableChannelIface: - * @parent: The parent interface - * - * The interface for #TpExportableChannel objects. - */ - -#include "config.h" - -#include "exportable-channel.h" - -#include <telepathy-glib/gtypes.h> -#include <telepathy-glib/svc-channel.h> -#include <telepathy-glib/util.h> - - -static void -exportable_channel_base_init (gpointer klass) -{ - static gboolean initialized = FALSE; - - if (!initialized) - { - GParamSpec *param_spec; - - initialized = TRUE; - - /** - * TpExportableChannel:object-path: - * - * The D-Bus object path used for this object on the bus. Read-only - * except during construction. - */ - param_spec = g_param_spec_string ("object-path", "D-Bus object path", - "The D-Bus object path used for this object on the bus.", NULL, - G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - g_object_interface_install_property (klass, param_spec); - - /** - * TpExportableChannel:channel-properties: - * - * The D-Bus properties to be announced in the NewChannels signal - * and in the Channels property, as a map from - * interface.name.propertyname to variant. - * - * A channel's immutable properties are constant for its lifetime on the - * bus, so this property should only change when the closed signal is - * emitted (so that respawned channels can reappear on the bus with - * different properties). All of the D-Bus properties mentioned here - * should be exposed through the D-Bus properties interface; additional - * (possibly mutable) properties not included here may also be exposed - * via the D-Bus properties interface. - * - * If the channel implementation uses - * <link linkend="telepathy-glib-dbus-properties-mixin">TpDBusPropertiesMixin</link>, - * this property can implemented using - * tp_dbus_properties_mixin_make_properties_hash() as follows: - * - * <informalexample><programlisting> - * case PROP_CHANNEL_PROPERTIES: - * { - * GHashTable *hash = tp_dbus_properties_mixin_make_properties_hash (object, - * // The spec says these properties MUST be included: - * TP_IFACE_CHANNEL, "TargetHandle", - * TP_IFACE_CHANNEL, "TargetEntityType", - * TP_IFACE_CHANNEL, "ChannelType", - * TP_IFACE_CHANNEL, "TargetID", - * TP_IFACE_CHANNEL, "Requested", - * TP_IFACE_CHANNEL, "InitiatorHandle", - * TP_IFACE_CHANNEL, "InitiatorID", - * TP_IFACE_CHANNEL, "Interfaces", - * // Perhaps your channel has some other immutable properties: - * TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "SupportedContentTypes", - * // etc. - * NULL)); - * - * g_value_set_variant (value, tp_asv_to_vardict (hash)); - * g_hash_table_unref (hash); - * } - * break; - * </programlisting></informalexample> - */ - param_spec = g_param_spec_variant ("channel-properties", - "Channel properties", - "The channel's immutable properties", - G_VARIANT_TYPE_VARDICT, NULL, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); - g_object_interface_install_property (klass, param_spec); - - /** - * TpExportableChannel:channel-destroyed: - * - * If true, the closed signal on the Channel interface indicates that - * the channel can go away. - * - * If false, the closed signal indicates to the channel manager that the - * channel should appear to go away and be re-created, by emitting Closed - * followed by NewChannel. (This is to support the "respawning" of Text - * channels which are closed with unacknowledged messages.) - */ - param_spec = g_param_spec_boolean ("channel-destroyed", - "Destroyed?", - "If true, the channel has *really* closed, rather than just " - "appearing to do so", - FALSE, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); - g_object_interface_install_property (klass, param_spec); - } -} - -GType -tp_exportable_channel_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - static const GTypeInfo info = { - sizeof (TpExportableChannelIface), - exportable_channel_base_init, /* base_init */ - NULL, /* base_finalize */ - NULL, /* class_init */ - NULL, /* class_finalize */ - NULL, /* class_data */ - 0, - 0, /* n_preallocs */ - NULL /* instance_init */ - }; - - type = g_type_register_static (G_TYPE_INTERFACE, - "TpExportableChannel", &info, 0); - - g_type_interface_add_prerequisite (type, TP_TYPE_SVC_CHANNEL); - } - - return type; -} diff --git a/telepathy-glib/exportable-channel.h b/telepathy-glib/exportable-channel.h deleted file mode 100644 index 9f2dd457b..000000000 --- a/telepathy-glib/exportable-channel.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * exportable-channel.h - A channel usable with the Channel Manager - * - * Copyright (C) 2008 Collabora Ltd. - * Copyright (C) 2008 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 - */ - -#if !defined (_TP_GLIB_H_INSIDE) && !defined (_TP_COMPILATION) -#error "Only <telepathy-glib/telepathy-glib.h> can be included directly." -#endif - -#ifndef TP_EXPORTABLE_CHANNEL_H -#define TP_EXPORTABLE_CHANNEL_H - -#include <glib-object.h> - -G_BEGIN_DECLS - -#define TP_TYPE_EXPORTABLE_CHANNEL (tp_exportable_channel_get_type ()) - -#define TP_EXPORTABLE_CHANNEL(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TP_TYPE_EXPORTABLE_CHANNEL, TpExportableChannel)) - -#define TP_IS_EXPORTABLE_CHANNEL(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - TP_TYPE_EXPORTABLE_CHANNEL)) - -#define TP_EXPORTABLE_CHANNEL_GET_INTERFACE(obj) \ - (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ - TP_TYPE_EXPORTABLE_CHANNEL, TpExportableChannelIface)) - -typedef struct _TpExportableChannel TpExportableChannel; -typedef struct _TpExportableChannelIface TpExportableChannelIface; - - -typedef void (*TpExportableChannelFunc) (TpExportableChannel *channel, - gpointer user_data); - -struct _TpExportableChannelIface { - GTypeInterface parent; -}; - -GType tp_exportable_channel_get_type (void); - -G_END_DECLS - -#endif diff --git a/telepathy-glib/simple-password-manager.c b/telepathy-glib/simple-password-manager.c index 3d38cfdf3..975b87066 100644 --- a/telepathy-glib/simple-password-manager.c +++ b/telepathy-glib/simple-password-manager.c @@ -250,7 +250,7 @@ tp_simple_password_manager_constructed (GObject *object) static void tp_simple_password_manager_foreach_channel (TpChannelManager *manager, - TpExportableChannelFunc foreach, + TpBaseChannelFunc foreach, gpointer user_data) { TpSimplePasswordManager *self = TP_SIMPLE_PASSWORD_MANAGER (manager); @@ -259,7 +259,7 @@ tp_simple_password_manager_foreach_channel (TpChannelManager *manager, if (priv->channel != NULL && !tp_base_channel_is_destroyed (TP_BASE_CHANNEL (priv->channel))) { - foreach (TP_EXPORTABLE_CHANNEL (priv->channel), user_data); + foreach (TP_BASE_CHANNEL (priv->channel), user_data); } } @@ -303,7 +303,7 @@ tp_simple_password_manager_channel_closed_cb (GObject *chan, tp_clear_object (&manager->priv->channel); tp_channel_manager_emit_channel_closed_for_object ( - TP_CHANNEL_MANAGER (manager), TP_EXPORTABLE_CHANNEL (chan)); + TP_CHANNEL_MANAGER (manager), TP_BASE_CHANNEL (chan)); } static void @@ -363,7 +363,7 @@ tp_simple_password_manager_prompt_common_async ( tp_base_channel_register ((TpBaseChannel *) priv->channel); tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self), - TP_EXPORTABLE_CHANNEL (priv->channel), NULL); + TP_BASE_CHANNEL (priv->channel), NULL); } /** diff --git a/telepathy-glib/telepathy-glib.h b/telepathy-glib/telepathy-glib.h index c6a670070..6e8303c11 100644 --- a/telepathy-glib/telepathy-glib.h +++ b/telepathy-glib/telepathy-glib.h @@ -60,7 +60,6 @@ #include <telepathy-glib/channel-dispatch-operation.h> #include <telepathy-glib/channel-dispatcher.h> #include <telepathy-glib/channel-filter.h> -#include <telepathy-glib/channel-iface.h> #include <telepathy-glib/channel-manager.h> #include <telepathy-glib/channel-request.h> #include <telepathy-glib/channel.h> @@ -82,7 +81,6 @@ #include <telepathy-glib/debug-sender.h> #include <telepathy-glib/debug.h> #include <telepathy-glib/dtmf.h> -#include <telepathy-glib/exportable-channel.h> #include <telepathy-glib/file-transfer-channel.h> #include <telepathy-glib/group-mixin.h> #include <telepathy-glib/handle-channel-context.h> diff --git a/telepathy-glib/versions/main-1.0.abi b/telepathy-glib/versions/main-1.0.abi index c24dfbed3..8ee544304 100644 --- a/telepathy-glib/versions/main-1.0.abi +++ b/telepathy-glib/versions/main-1.0.abi @@ -483,7 +483,6 @@ tp_channel_group_get_contact_owner tp_channel_group_get_flags tp_channel_group_get_local_pending_info tp_channel_group_get_self_contact -tp_channel_iface_get_type tp_channel_join_async tp_channel_join_finish tp_channel_leave_async @@ -820,7 +819,6 @@ tp_error_quark tp_errors_disconnected_quark tp_errors_removed_from_group_quark tp_escape_as_identifier -tp_exportable_channel_get_type tp_external_group_mixin_finalize tp_external_group_mixin_get_dbus_property tp_external_group_mixin_iface_init diff --git a/tests/lib/echo-im-manager.c b/tests/lib/echo-im-manager.c index 6b9ebe407..e6082dfdb 100644 --- a/tests/lib/echo-im-manager.c +++ b/tests/lib/echo-im-manager.c @@ -176,7 +176,7 @@ tp_tests_echo_im_manager_close_all (TpTestsEchoImManager *self) static void tp_tests_echo_im_manager_foreach_channel (TpChannelManager *iface, - TpExportableChannelFunc callback, + TpBaseChannelFunc callback, gpointer user_data) { TpTestsEchoImManager *self = TP_TESTS_ECHO_IM_MANAGER (iface); @@ -187,7 +187,7 @@ tp_tests_echo_im_manager_foreach_channel (TpChannelManager *iface, while (g_hash_table_iter_next (&iter, &handle, &channel)) { - callback (TP_EXPORTABLE_CHANNEL (channel), user_data); + callback (TP_BASE_CHANNEL (channel), user_data); } } @@ -215,12 +215,12 @@ channel_closed_cb (TpTestsEchoChannel *chan, else { tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self), - TP_EXPORTABLE_CHANNEL (chan), NULL); + TP_BASE_CHANNEL (chan), NULL); } } tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (self), - TP_EXPORTABLE_CHANNEL (chan)); + TP_BASE_CHANNEL (chan)); } static void @@ -254,7 +254,7 @@ new_channel (TpTestsEchoImManager *self, requests = g_slist_prepend (requests, request); tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self), - TP_EXPORTABLE_CHANNEL (chan), + TP_BASE_CHANNEL (chan), requests); g_slist_free (requests); } @@ -338,7 +338,7 @@ tp_tests_echo_im_manager_request (TpTestsEchoImManager *self, else { tp_channel_manager_emit_request_already_satisfied ( - TP_CHANNEL_MANAGER (self), request, TP_EXPORTABLE_CHANNEL (chan)); + TP_CHANNEL_MANAGER (self), request, TP_BASE_CHANNEL (chan)); } return TRUE; diff --git a/tests/lib/simple-channel-manager.c b/tests/lib/simple-channel-manager.c index 500728dd6..136f8cee8 100644 --- a/tests/lib/simple-channel-manager.c +++ b/tests/lib/simple-channel-manager.c @@ -55,7 +55,7 @@ tp_tests_simple_channel_manager_request (TpChannelManager *manager, TpTestsSimpleChannelManager *self = TP_TESTS_SIMPLE_CHANNEL_MANAGER (manager); GSList *tokens; - TpExportableChannel *channel; + TpBaseChannel *channel; TpHandle handle = tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE, NULL); gchar *path; |