diff options
51 files changed, 585 insertions, 597 deletions
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am index e9211ab65..44e1b32f1 100644 --- a/docs/reference/Makefile.am +++ b/docs/reference/Makefile.am @@ -72,6 +72,7 @@ IGNORE_HFILES=\ call-internal.h \ channel-dispatch-operation-internal.h \ channel-internal.h \ + client-factory-internal.h \ client-message-internal.h \ cm-message-internal.h \ connection-internal.h \ @@ -88,7 +89,6 @@ IGNORE_HFILES=\ proxy-introspectable.h \ reentrants.h \ signalled-message-internal.h \ - simple-client-factory-internal.h \ util-internal.h # Images to copy into HTML directory. diff --git a/docs/reference/telepathy-glib-docs.sgml b/docs/reference/telepathy-glib-docs.sgml index b5cc6cb51..ab9d75f3b 100644 --- a/docs/reference/telepathy-glib-docs.sgml +++ b/docs/reference/telepathy-glib-docs.sgml @@ -90,7 +90,7 @@ <xi:include href="xml/client-channel-factory.xml"/> <xi:include href="xml/basic-proxy-factory.xml"/> <xi:include href="xml/automatic-proxy-factory.xml"/> - <xi:include href="xml/simple-client-factory.xml"/> + <xi:include href="xml/client-factory.xml"/> <xi:include href="xml/automatic-client-factory.xml"/> <xi:include href="xml/client-message.xml"/> <xi:include href="xml/signalled-message.xml"/> diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt index 9b149c8e9..be8be12d3 100644 --- a/docs/reference/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib-sections.txt @@ -5681,42 +5681,42 @@ tp_call_stream_endpoint_init_known_interfaces </SECTION> <SECTION> -<FILE>simple-client-factory</FILE> -<TITLE>simple-client-factory</TITLE> +<FILE>client-factory</FILE> +<TITLE>client-factory</TITLE> <INCLUDE>telepathy-glib/telepathy-glib.h</INCLUDE> -TpSimpleClientFactory -TpSimpleClientFactoryClass -tp_simple_client_factory_new -tp_simple_client_factory_get_dbus_daemon -<SUBSECTION> -tp_simple_client_factory_ensure_account -tp_simple_client_factory_dup_account_features -tp_simple_client_factory_add_account_features -tp_simple_client_factory_add_account_features_varargs -<SUBSECTION> -tp_simple_client_factory_ensure_connection -tp_simple_client_factory_dup_connection_features -tp_simple_client_factory_add_connection_features -tp_simple_client_factory_add_connection_features_varargs -<SUBSECTION> -tp_simple_client_factory_ensure_channel -tp_simple_client_factory_dup_channel_features -tp_simple_client_factory_add_channel_features -tp_simple_client_factory_add_channel_features_varargs -<SUBSECTION> -tp_simple_client_factory_ensure_contact -tp_simple_client_factory_dup_contact_features -tp_simple_client_factory_add_contact_features -tp_simple_client_factory_add_contact_features_varargs -<SUBSECTION Standard> -TP_IS_SIMPLE_CLIENT_FACTORY -TP_IS_SIMPLE_CLIENT_FACTORY_CLASS -TP_SIMPLE_CLIENT_FACTORY -TP_SIMPLE_CLIENT_FACTORY_CLASS -TP_SIMPLE_CLIENT_FACTORY_GET_CLASS -TP_TYPE_SIMPLE_CLIENT_FACTORY -tp_simple_client_factory_get_type -TpSimpleClientFactoryPrivate +TpClientFactory +TpClientFactoryClass +tp_client_factory_new +tp_client_factory_get_dbus_daemon +<SUBSECTION> +tp_client_factory_ensure_account +tp_client_factory_dup_account_features +tp_client_factory_add_account_features +tp_client_factory_add_account_features_varargs +<SUBSECTION> +tp_client_factory_ensure_connection +tp_client_factory_dup_connection_features +tp_client_factory_add_connection_features +tp_client_factory_add_connection_features_varargs +<SUBSECTION> +tp_client_factory_ensure_channel +tp_client_factory_dup_channel_features +tp_client_factory_add_channel_features +tp_client_factory_add_channel_features_varargs +<SUBSECTION> +tp_client_factory_ensure_contact +tp_client_factory_dup_contact_features +tp_client_factory_add_contact_features +tp_client_factory_add_contact_features_varargs +<SUBSECTION Standard> +TP_IS_CLIENT_FACTORY +TP_IS_CLIENT_FACTORY_CLASS +TP_CLIENT_FACTORY +TP_CLIENT_FACTORY_CLASS +TP_CLIENT_FACTORY_GET_CLASS +TP_TYPE_CLIENT_FACTORY +tp_client_factory_get_type +TpClientFactoryPrivate </SECTION> <SECTION> diff --git a/examples/client/contact-list.c b/examples/client/contact-list.c index 75bd86ef9..a82e5a0ed 100644 --- a/examples/client/contact-list.c +++ b/examples/client/contact-list.c @@ -71,7 +71,7 @@ main (int argc, char **argv) { TpAccountManager *manager; - TpSimpleClientFactory *factory; + TpClientFactory *factory; GMainLoop *loop; g_type_init (); @@ -81,13 +81,13 @@ main (int argc, manager = tp_account_manager_dup (); factory = tp_proxy_get_factory (manager); - tp_simple_client_factory_add_account_features_varargs (factory, + tp_client_factory_add_account_features_varargs (factory, TP_ACCOUNT_FEATURE_CONNECTION, 0); - tp_simple_client_factory_add_connection_features_varargs (factory, + tp_client_factory_add_connection_features_varargs (factory, TP_CONNECTION_FEATURE_CONTACT_LIST, 0); - tp_simple_client_factory_add_contact_features_varargs (factory, + tp_client_factory_add_contact_features_varargs (factory, TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_CONTACT_GROUPS, 0); diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am index f14c2e6d4..e357809a8 100644 --- a/telepathy-glib/Makefile.am +++ b/telepathy-glib/Makefile.am @@ -76,6 +76,7 @@ our_headers = \ cli-misc.h \ client.h \ client-channel-factory.h \ + client-factory.h \ client-message.h \ cm-message.h \ connection.h \ @@ -123,7 +124,6 @@ our_headers = \ run.h \ signalled-message.h \ simple-approver.h \ - simple-client-factory.h \ simple-handler.h \ simple-observer.h \ simple-password-manager.h \ @@ -242,6 +242,8 @@ libtelepathy_glib_main_internal_la_SOURCES = \ channel-request.c \ client.c \ client-channel-factory.c \ + client-factory.c \ + client-factory-internal.h \ client-message.c \ client-message-internal.h \ connection.c \ @@ -309,8 +311,6 @@ libtelepathy_glib_main_internal_la_SOURCES = \ signalled-message.c \ signalled-message-internal.h \ simple-approver.c \ - simple-client-factory.c \ - simple-client-factory-internal.h \ simple-handler.c \ simple-observer.c \ simple-password-manager.c \ diff --git a/telepathy-glib/account-channel-request.c b/telepathy-glib/account-channel-request.c index cc3c7b8df..ae73776f2 100644 --- a/telepathy-glib/account-channel-request.c +++ b/telepathy-glib/account-channel-request.c @@ -87,7 +87,7 @@ #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/deprecated-internal.h" -#include "telepathy-glib/simple-client-factory-internal.h" +#include "telepathy-glib/client-factory-internal.h" struct _TpAccountChannelRequestClass { /*<private>*/ @@ -729,7 +729,7 @@ acr_channel_request_succeeded (TpChannelRequest *chan_req, features = tp_client_channel_factory_dup_channel_features ( self->priv->factory, self->priv->channel); else - features = tp_simple_client_factory_dup_channel_features ( + features = tp_client_factory_dup_channel_features ( tp_proxy_get_factory (self->priv->account), self->priv->channel); g_assert (features != NULL); @@ -800,7 +800,7 @@ acr_request_cb (TpChannelDispatcher *cd, DEBUG ("Got ChannelRequest: %s", channel_request_path); - self->priv->chan_request = _tp_simple_client_factory_ensure_channel_request ( + self->priv->chan_request = _tp_client_factory_ensure_channel_request ( tp_proxy_get_factory (self->priv->account), channel_request_path, NULL, &err); if (self->priv->chan_request == NULL) diff --git a/telepathy-glib/account-manager.c b/telepathy-glib/account-manager.c index fa8900b70..58df9456b 100644 --- a/telepathy-glib/account-manager.c +++ b/telepathy-glib/account-manager.c @@ -38,7 +38,7 @@ #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" -#include "telepathy-glib/simple-client-factory-internal.h" +#include "telepathy-glib/client-factory-internal.h" #include "telepathy-glib/_gen/tp-cli-account-manager-body.h" @@ -301,7 +301,7 @@ _tp_account_manager_usability_changed_cb (TpAccountManager *proxy, return; } - account = tp_simple_client_factory_ensure_account ( + account = tp_client_factory_ensure_account ( tp_proxy_get_factory (manager), path, NULL, &error); if (account == NULL) { @@ -311,7 +311,7 @@ _tp_account_manager_usability_changed_cb (TpAccountManager *proxy, } /* Delay signal emission until until account is prepared */ - features = tp_simple_client_factory_dup_account_features ( + features = tp_client_factory_dup_account_features ( tp_proxy_get_factory (manager), account); tp_proxy_prepare_async (account, (GQuark *) features->data, @@ -474,7 +474,7 @@ _tp_account_manager_got_all_cb (TpProxy *proxy, GArray *features; GError *e = NULL; - account = tp_simple_client_factory_ensure_account ( + account = tp_client_factory_ensure_account ( tp_proxy_get_factory (manager), path, NULL, &e); if (account == NULL) { @@ -483,7 +483,7 @@ _tp_account_manager_got_all_cb (TpProxy *proxy, continue; } - features = tp_simple_client_factory_dup_account_features ( + features = tp_client_factory_dup_account_features ( tp_proxy_get_factory (manager), account); manager->priv->n_preparing_accounts++; @@ -592,7 +592,7 @@ tp_account_manager_class_init (TpAccountManagerClass *klass) * * @account is guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along * with all features previously passed to - * tp_simple_client_factory_add_account_features(). + * tp_client_factory_add_account_features(). * * Since: 0.9.0 */ @@ -630,7 +630,7 @@ tp_account_manager_class_init (TpAccountManagerClass *klass) * * @account is guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along * with all features previously passed to - * tp_simple_client_factory_add_account_features(). + * tp_client_factory_add_account_features(). * * Since: 0.9.0 */ @@ -714,7 +714,7 @@ tp_account_manager_init_known_interfaces (void) } static TpAccountManager * -_tp_account_manager_new_internal (TpSimpleClientFactory *factory, +_tp_account_manager_new_internal (TpClientFactory *factory, TpDBusDaemon *bus_daemon) { return TP_ACCOUNT_MANAGER (g_object_new (TP_TYPE_ACCOUNT_MANAGER, @@ -749,12 +749,12 @@ tp_account_manager_new (TpDBusDaemon *bus_daemon) /** * tp_account_manager_new_with_factory: - * @factory: a #TpSimpleClientFactory + * @factory: a #TpClientFactory * * Convenience function to create a new account manager proxy. The returned * #TpAccountManager is not guaranteed to be ready on return. * - * Should be used only by applications having their own #TpSimpleClientFactory + * Should be used only by applications having their own #TpClientFactory * subclass. Usually this should be done at application startup and followed by * a call to tp_account_manager_set_default() to ensure other libraries/plugins * will use this custom factory as well. @@ -762,12 +762,12 @@ tp_account_manager_new (TpDBusDaemon *bus_daemon) * Returns: a new reference to an account manager proxy */ TpAccountManager * -tp_account_manager_new_with_factory (TpSimpleClientFactory *factory) +tp_account_manager_new_with_factory (TpClientFactory *factory) { - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (factory), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (factory), NULL); return _tp_account_manager_new_internal (factory, - tp_simple_client_factory_get_dbus_daemon (factory)); + tp_client_factory_get_dbus_daemon (factory)); } static gpointer starter_account_manager_proxy = NULL; @@ -781,7 +781,7 @@ static gpointer starter_account_manager_proxy = NULL; * * This function may only be called before the first call to * tp_account_manager_dup(), and may not be called more than once. Applications - * which use a custom #TpSimpleClientFactory and want the default + * which use a custom #TpClientFactory and want the default * #TpAccountManager to use that factory should call this after calling * tp_account_manager_new_with_factory(). * @@ -1003,7 +1003,7 @@ insert_account (TpAccountManager *self, * not a valid account path. * * Since: 0.9.0 - * Deprecated: New code should use tp_simple_client_factory_ensure_account() + * Deprecated: New code should use tp_client_factory_ensure_account() * instead. */ TpAccount * @@ -1020,7 +1020,7 @@ tp_account_manager_ensure_account (TpAccountManager *self, if (account != NULL) return account; - account = tp_simple_client_factory_ensure_account ( + account = tp_client_factory_ensure_account ( tp_proxy_get_factory (self), path, NULL, &error); if (account == NULL) { @@ -1061,7 +1061,7 @@ tp_account_manager_ensure_account (TpAccountManager *self, * * The returned #TpAccount<!-- -->s are guaranteed to have * %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed - * to tp_simple_client_factory_add_account_features(). + * to tp_client_factory_add_account_features(). * * The list of usable accounts returned is not guaranteed to have been retrieved * until %TP_ACCOUNT_MANAGER_FEATURE_CORE is prepared @@ -1246,7 +1246,7 @@ _tp_account_manager_created_cb (TpAccountManager *proxy, return; } - account = tp_simple_client_factory_ensure_account ( + account = tp_client_factory_ensure_account ( tp_proxy_get_factory (manager), account_path, NULL, &e); if (account == NULL) { @@ -1258,7 +1258,7 @@ _tp_account_manager_created_cb (TpAccountManager *proxy, /* Give account's ref to the result */ g_simple_async_result_set_op_res_gpointer (my_res, account, g_object_unref); - features = tp_simple_client_factory_dup_account_features ( + features = tp_client_factory_dup_account_features ( tp_proxy_get_factory (manager), account); tp_proxy_prepare_async (account, (GQuark *) features->data, diff --git a/telepathy-glib/account-manager.h b/telepathy-glib/account-manager.h index 692633505..e1d88e3cb 100644 --- a/telepathy-glib/account-manager.h +++ b/telepathy-glib/account-manager.h @@ -74,7 +74,7 @@ TpAccountManager *tp_account_manager_new (TpDBusDaemon *bus_daemon) G_GNUC_WARN_UNUSED_RESULT; TpAccountManager *tp_account_manager_new_with_factory ( - TpSimpleClientFactory *factory) G_GNUC_WARN_UNUSED_RESULT; + TpClientFactory *factory) G_GNUC_WARN_UNUSED_RESULT; void tp_account_manager_set_default (TpAccountManager *manager); TpAccountManager *tp_account_manager_dup (void) G_GNUC_WARN_UNUSED_RESULT; @@ -83,7 +83,7 @@ void tp_account_manager_init_known_interfaces (void); TpAccount *tp_account_manager_ensure_account (TpAccountManager *manager, const gchar *path) - _TP_GNUC_DEPRECATED_FOR (tp_simple_client_factory_ensure_account); + _TP_GNUC_DEPRECATED_FOR (tp_client_factory_ensure_account); GList *tp_account_manager_get_usable_accounts (TpAccountManager *manager) G_GNUC_WARN_UNUSED_RESULT; diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c index 7977948ee..6d3dea413 100644 --- a/telepathy-glib/account.c +++ b/telepathy-glib/account.c @@ -40,7 +40,7 @@ #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" -#include "telepathy-glib/simple-client-factory-internal.h" +#include "telepathy-glib/client-factory-internal.h" #include <telepathy-glib/util-internal.h> #include "telepathy-glib/_gen/tp-cli-account-body.h" @@ -230,11 +230,11 @@ connection_is_internal (TpAccount *self) * * When this feature is prepared, it is guaranteed that #TpAccount:connection * will always be either %NULL or prepared. If the account was created using a - * #TpSimpleClientFactory, the same factory will be used to create #TpConnection + * #TpClientFactory, the same factory will be used to create #TpConnection * object and to determine desired connection features. Change notification of * #TpAccount:connection property will be delayed until all features (at least * %TP_CONNECTION_FEATURE_CORE) are prepared. See - * tp_simple_client_factory_add_account_features() to define which features + * tp_client_factory_add_account_features() to define which features * needs to be prepared. * * One can ask for a feature to be prepared using the @@ -505,7 +505,7 @@ _tp_account_set_connection (TpAccount *account, return; } - priv->connection = tp_simple_client_factory_ensure_connection ( + priv->connection = tp_client_factory_ensure_connection ( tp_proxy_get_factory (account), path, NULL, &error); if (priv->connection == NULL) @@ -521,7 +521,7 @@ _tp_account_set_connection (TpAccount *account, { GArray *features; - features = tp_simple_client_factory_dup_connection_features ( + features = tp_client_factory_dup_connection_features ( tp_proxy_get_factory (account), priv->connection); tp_proxy_prepare_async (priv->connection, (GQuark *) features->data, @@ -2068,7 +2068,7 @@ tp_account_new (TpDBusDaemon *bus_daemon, } TpAccount * -_tp_account_new_with_factory (TpSimpleClientFactory *factory, +_tp_account_new_with_factory (TpClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GError **error) @@ -4031,7 +4031,7 @@ tp_account_prepare_connection_async (TpProxy *proxy, return; } - features = tp_simple_client_factory_dup_connection_features ( + features = tp_client_factory_dup_connection_features ( tp_proxy_get_factory (self), self->priv->connection); tp_proxy_prepare_async (self->priv->connection, (GQuark *) features->data, diff --git a/telepathy-glib/automatic-client-factory-internal.h b/telepathy-glib/automatic-client-factory-internal.h index f69319b34..60fda5cdf 100644 --- a/telepathy-glib/automatic-client-factory-internal.h +++ b/telepathy-glib/automatic-client-factory-internal.h @@ -26,35 +26,35 @@ G_BEGIN_DECLS TpTextChannel *_tp_text_channel_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); TpStreamTubeChannel *_tp_stream_tube_channel_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); TpDBusTubeChannel *_tp_dbus_tube_channel_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); TpFileTransferChannel *_tp_file_transfer_channel_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); TpCallChannel *_tp_call_channel_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, diff --git a/telepathy-glib/automatic-client-factory.c b/telepathy-glib/automatic-client-factory.c index 6c1fcc583..f776f1c8c 100644 --- a/telepathy-glib/automatic-client-factory.c +++ b/telepathy-glib/automatic-client-factory.c @@ -22,9 +22,9 @@ * SECTION:automatic-client-factory * @title: TpAutomaticClientFactory * @short_description: Factory for specialized #TpChannel subclasses. - * @see_also: #TpSimpleClientFactory + * @see_also: #TpClientFactory * - * This factory overrides some #TpSimpleClientFactory virtual methods to + * This factory overrides some #TpClientFactory virtual methods to * create specialized #TpChannel subclasses. * * #TpAutomaticClientFactory will currently create #TpChannel objects @@ -119,9 +119,9 @@ #include "telepathy-glib/automatic-client-factory-internal.h" G_DEFINE_TYPE (TpAutomaticClientFactory, tp_automatic_client_factory, - TP_TYPE_SIMPLE_CLIENT_FACTORY) + TP_TYPE_CLIENT_FACTORY) -#define chainup ((TpSimpleClientFactoryClass *) \ +#define chainup ((TpClientFactoryClass *) \ tp_automatic_client_factory_parent_class) typedef gboolean (*CheckPropertiesFunc) ( @@ -129,7 +129,7 @@ typedef gboolean (*CheckPropertiesFunc) ( const GHashTable *properties); typedef TpChannel *(*NewFunc) ( - TpSimpleClientFactory *client, + TpClientFactory *client, TpConnection *conn, const gchar *object_path, const GHashTable *properties, @@ -194,7 +194,7 @@ build_channel_type_mapping (void) } static TpChannel * -create_channel_impl (TpSimpleClientFactory *self, +create_channel_impl (TpClientFactory *self, TpConnection *conn, const gchar *object_path, const GHashTable *properties, @@ -222,7 +222,7 @@ create_channel_impl (TpSimpleClientFactory *self, } static GArray * -dup_channel_features_impl (TpSimpleClientFactory *self, +dup_channel_features_impl (TpClientFactory *self, TpChannel *channel) { GArray *features; @@ -257,12 +257,12 @@ tp_automatic_client_factory_init (TpAutomaticClientFactory *self) } static void -tp_automatic_client_factory_class_init (TpAutomaticClientFactoryClass *cls) +tp_automatic_client_factory_class_init (TpAutomaticClientFactoryClass *klass) { - TpSimpleClientFactoryClass *simple_class = (TpSimpleClientFactoryClass *) cls; + TpClientFactoryClass *base_class = (TpClientFactoryClass *) klass; - simple_class->create_channel = create_channel_impl; - simple_class->dup_channel_features = dup_channel_features_impl; + base_class->create_channel = create_channel_impl; + base_class->dup_channel_features = dup_channel_features_impl; build_channel_type_mapping (); } @@ -277,7 +277,7 @@ tp_automatic_client_factory_class_init (TpAutomaticClientFactoryClass *cls) * * Since: 0.15.5 */ -TpSimpleClientFactory * +TpClientFactory * tp_automatic_client_factory_new (TpDBusDaemon *dbus) { return g_object_new (TP_TYPE_AUTOMATIC_CLIENT_FACTORY, diff --git a/telepathy-glib/automatic-client-factory.h b/telepathy-glib/automatic-client-factory.h index 8601adea6..81b437ede 100644 --- a/telepathy-glib/automatic-client-factory.h +++ b/telepathy-glib/automatic-client-factory.h @@ -24,7 +24,7 @@ #include <telepathy-glib/call-channel.h> #include <telepathy-glib/dbus-tube-channel.h> #include <telepathy-glib/file-transfer-channel.h> -#include <telepathy-glib/simple-client-factory.h> +#include <telepathy-glib/client-factory.h> #include <telepathy-glib/stream-tube-channel.h> #include <telepathy-glib/text-channel.h> @@ -35,12 +35,12 @@ typedef struct _TpAutomaticClientFactoryClass TpAutomaticClientFactoryClass; struct _TpAutomaticClientFactoryClass { /*<public>*/ - TpSimpleClientFactoryClass parent_class; + TpClientFactoryClass parent_class; }; struct _TpAutomaticClientFactory { /*<private>*/ - TpSimpleClientFactory parent; + TpClientFactory parent; }; GType tp_automatic_client_factory_get_type (void); @@ -61,7 +61,7 @@ GType tp_automatic_client_factory_get_type (void); (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_AUTOMATIC_CLIENT_FACTORY, \ TpAutomaticClientFactoryClass)) -TpSimpleClientFactory *tp_automatic_client_factory_new (TpDBusDaemon *dbus); +TpClientFactory *tp_automatic_client_factory_new (TpDBusDaemon *dbus); G_END_DECLS diff --git a/telepathy-glib/base-client.c b/telepathy-glib/base-client.c index 029ec1f28..57ca1449b 100644 --- a/telepathy-glib/base-client.c +++ b/telepathy-glib/base-client.c @@ -68,15 +68,15 @@ * @client: a #TpBaseClient instance * @account: a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other * features added via tp_base_client_add_account_features() or - * tp_simple_client_factory_add_account_features(), prepared if + * tp_client_factory_add_account_features(), prepared if * possible * @connection: a #TpConnection with %TP_CONNECTION_FEATURE_CORE, * and any other features added via tp_base_client_add_connection_features(), - * or tp_simple_client_factory_add_connection_features(), prepared if possible + * or tp_client_factory_add_connection_features(), prepared if possible * @channels: (element-type TelepathyGLib.Channel): a #GList of #TpChannel, * each with %TP_CHANNEL_FEATURE_CORE, and any other features added via * tp_base_client_add_channel_features() or - * tp_simple_client_factory_add_channel_features(), prepared if possible + * tp_client_factory_add_channel_features(), prepared if possible * @dispatch_operation: (allow-none): a #TpChannelDispatchOperation or %NULL; * the dispatch_operation is not guaranteed to be prepared * @requests: (element-type TelepathyGLib.ChannelRequest): a #GList of @@ -99,15 +99,15 @@ * @client: a #TpBaseClient instance * @account: a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other * features added via tp_base_client_add_account_features() or - * tp_simple_client_factory_add_account_features(), prepared if + * tp_client_factory_add_account_features(), prepared if * possible * @connection: a #TpConnection with %TP_CONNECTION_FEATURE_CORE, * and any other features added via tp_base_client_add_connection_features(), - * or tp_simple_client_factory_add_connection_features(), prepared if possible + * or tp_client_factory_add_connection_features(), prepared if possible * @channels: (element-type TelepathyGLib.Channel): a #GList of #TpChannel, * each with %TP_CHANNEL_FEATURE_CORE, and any other features added via * tp_base_client_add_channel_features() or - * tp_simple_client_factory_add_channel_features(), prepared if possible + * tp_client_factory_add_channel_features(), prepared if possible * @dispatch_operation: a #TpChannelDispatchOperation having * %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE prepared if possible * @context: a #TpObserveChannelsContext representing the context of this @@ -132,15 +132,15 @@ * @client: a #TpBaseClient instance * @account: a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other * features added via tp_base_client_add_account_features() or - * tp_simple_client_factory_add_account_features(), prepared if + * tp_client_factory_add_account_features(), prepared if * possible * @connection: a #TpConnection with %TP_CONNECTION_FEATURE_CORE, * and any other features added via tp_base_client_add_connection_features(), - * or tp_simple_client_factory_add_connection_features(), prepared if possible + * or tp_client_factory_add_connection_features(), prepared if possible * @channels: (element-type TelepathyGLib.Channel): a #GList of #TpChannel, * each with %TP_CHANNEL_FEATURE_CORE, and any other features added via * tp_base_client_add_channel_features() or - * tp_simple_client_factory_add_channel_features(), prepared if possible + * tp_client_factory_add_channel_features(), prepared if possible * @requests_satisfied: (element-type TelepathyGLib.ChannelRequest): a #GList of * #TpChannelRequest having their object-path defined but are not guaranteed * to be prepared. @@ -203,7 +203,7 @@ #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/deprecated-internal.h" -#include "telepathy-glib/simple-client-factory-internal.h" +#include "telepathy-glib/client-factory-internal.h" #include "telepathy-glib/util-internal.h" static void observer_iface_init (gpointer, gpointer); @@ -253,7 +253,7 @@ typedef enum { struct _TpBaseClientPrivate { - TpSimpleClientFactory *factory; + TpClientFactory *factory; TpDBusDaemon *dbus; gchar *name; gboolean uniquify_name; @@ -332,7 +332,7 @@ tp_base_client_dup_account (TpBaseClient *self, return g_object_ref (self->priv->only_for_account); } - return tp_simple_client_factory_ensure_account (self->priv->factory, + return tp_client_factory_ensure_account (self->priv->factory, path, NULL, error); } @@ -1165,10 +1165,10 @@ tp_base_client_constructed (GObject *object) if (self->priv->dbus == NULL) { self->priv->dbus = g_object_ref ( - tp_simple_client_factory_get_dbus_daemon (self->priv->factory)); + tp_client_factory_get_dbus_daemon (self->priv->factory)); } - g_assert (tp_simple_client_factory_get_dbus_daemon (self->priv->factory) == + g_assert (tp_client_factory_get_dbus_daemon (self->priv->factory) == self->priv->dbus); /* Bus name */ @@ -1397,7 +1397,7 @@ tp_base_client_class_init (TpBaseClientClass *cls) * * Since: 0.11.14 * Deprecated: New code should not use this property, it may be %NULL in - * the case @self was constructed with a #TpSimpleClientFactory. + * the case @self was constructed with a #TpClientFactory. */ param_spec = g_param_spec_object ("account-manager", "TpAccountManager", "The TpAccountManager used look up or create TpAccount objects", @@ -1414,9 +1414,9 @@ tp_base_client_class_init (TpBaseClientClass *cls) * * Since: 0.15.5 */ - param_spec = g_param_spec_object ("factory", "TpSimpleClientFactory", - "The TpSimpleClientFactory used look up or create TpAccount objects", - TP_TYPE_SIMPLE_CLIENT_FACTORY, + param_spec = g_param_spec_object ("factory", "TpClientFactory", + "The TpClientFactory used look up or create TpAccount objects", + TP_TYPE_CLIENT_FACTORY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FACTORY, param_spec); @@ -1479,7 +1479,7 @@ tp_base_client_class_init (TpBaseClientClass *cls) * @account: the #TpAccount on which the request was made, * with %TP_ACCOUNT_FEATURE_CORE, and any other features added via * tp_base_client_add_account_features() or - * tp_simple_client_factory_add_account_features(), prepared if possible + * tp_client_factory_add_account_features(), prepared if possible * @request: a #TpChannelRequest having its object-path defined but * is not guaranteed to be prepared. * @@ -1589,7 +1589,7 @@ dup_features_for_account (TpBaseClient *self, { GArray *features; - features = tp_simple_client_factory_dup_account_features (self->priv->factory, + features = tp_client_factory_dup_account_features (self->priv->factory, account); g_assert (features != NULL); @@ -1608,7 +1608,7 @@ dup_features_for_connection (TpBaseClient *self, { GArray *features; - features = tp_simple_client_factory_dup_connection_features ( + features = tp_client_factory_dup_connection_features ( self->priv->factory, connection); g_assert (features != NULL); @@ -1632,7 +1632,7 @@ dup_features_for_channel (TpBaseClient *self, features = tp_client_channel_factory_dup_channel_features ( self->priv->channel_factory, channel); else - features = tp_simple_client_factory_dup_channel_features ( + features = tp_client_factory_dup_channel_features ( self->priv->factory, channel); g_assert (features != NULL); @@ -1657,7 +1657,7 @@ ensure_channel (TpBaseClient *self, return tp_client_channel_factory_create_channel ( self->priv->channel_factory, connection, chan_path, chan_props, error); - return tp_simple_client_factory_ensure_channel (self->priv->factory, + return tp_client_factory_ensure_channel (self->priv->factory, connection, chan_path, chan_props, error); } @@ -1752,7 +1752,7 @@ _tp_base_client_observe_channels (TpSvcClientObserver *iface, else { dispatch_operation = - _tp_simple_client_factory_ensure_channel_dispatch_operation ( + _tp_client_factory_ensure_channel_dispatch_operation ( self->priv->factory, dispatch_operation_path, NULL, &error); if (dispatch_operation == NULL) { @@ -1768,7 +1768,7 @@ _tp_base_client_observe_channels (TpSvcClientObserver *iface, const gchar *req_path = g_ptr_array_index (requests_arr, i); TpChannelRequest *request; - request = _tp_simple_client_factory_ensure_channel_request ( + request = _tp_client_factory_ensure_channel_request ( self->priv->factory, req_path, NULL, &error); if (request == NULL) { @@ -1971,7 +1971,7 @@ _tp_base_client_add_dispatch_operation (TpSvcClientApprover *iface, } dispatch_operation = - _tp_simple_client_factory_ensure_channel_dispatch_operation ( + _tp_client_factory_ensure_channel_dispatch_operation ( self->priv->factory, dispatch_operation_path, properties, &error); if (dispatch_operation == NULL) { @@ -2338,7 +2338,7 @@ _tp_base_client_handle_channels (TpSvcClientHandler *iface, } else { - request = _tp_simple_client_factory_ensure_channel_request ( + request = _tp_client_factory_ensure_channel_request ( self->priv->factory, req_path, NULL, &error); if (request == NULL) { @@ -2455,7 +2455,7 @@ _tp_base_client_add_request (TpSvcClientInterfaceRequests *iface, channel_request_prepare_account_ctx *ctx; GArray *account_features; - request = _tp_simple_client_factory_ensure_channel_request ( + request = _tp_client_factory_ensure_channel_request ( self->priv->factory, path, properties, &error); if (request == NULL) { @@ -2671,7 +2671,7 @@ tp_base_client_get_dbus_daemon (TpBaseClient *self) * Returns: (transfer none): the value of #TpBaseClient:account-manager * Since: 0.11.14 * Deprecated: New code should not use this function, it may return %NULL in - * the case @self was constructed with a #TpSimpleClientFactory. + * the case @self was constructed with a #TpClientFactory. */ TpAccountManager * tp_base_client_get_account_manager (TpBaseClient *self) @@ -2791,7 +2791,7 @@ tp_base_client_unregister (TpBaseClient *self) * * Since: 0.11.14 * Deprecated: New code should use - * tp_simple_client_factory_add_account_features_varargs() instead. + * tp_client_factory_add_account_features_varargs() instead. */ void tp_base_client_add_account_features_varargs (TpBaseClient *self, @@ -2819,7 +2819,7 @@ tp_base_client_add_account_features_varargs (TpBaseClient *self, * * Since: 0.11.14 * Deprecated: New code should use - * tp_simple_client_factory_add_connection_features_varargs() instead. + * tp_client_factory_add_connection_features_varargs() instead. */ void tp_base_client_add_connection_features_varargs (TpBaseClient *self, @@ -2847,7 +2847,7 @@ tp_base_client_add_connection_features_varargs (TpBaseClient *self, * * Since: 0.11.14 * Deprecated: New code should use - * tp_simple_client_factory_add_channel_features_varargs() instead. + * tp_client_factory_add_channel_features_varargs() instead. */ void tp_base_client_add_channel_features_varargs (TpBaseClient *self, @@ -2879,7 +2879,7 @@ tp_base_client_add_channel_features_varargs (TpBaseClient *self, * * Since: 0.11.14 * Deprecated: New code should use - * tp_simple_client_factory_add_account_features() instead. + * tp_client_factory_add_account_features() instead. */ void tp_base_client_add_account_features (TpBaseClient *self, @@ -2907,7 +2907,7 @@ tp_base_client_add_account_features (TpBaseClient *self, * * Since: 0.11.14 * Deprecated: New code should use - * tp_simple_client_factory_add_channel_features() instead. + * tp_client_factory_add_channel_features() instead. */ void tp_base_client_add_channel_features (TpBaseClient *self, @@ -2934,7 +2934,7 @@ tp_base_client_add_channel_features (TpBaseClient *self, * * Since: 0.11.14 * Deprecated: New code should use - * tp_simple_client_factory_add_connection_features() instead. + * tp_client_factory_add_connection_features() instead. */ void tp_base_client_add_connection_features (TpBaseClient *self, diff --git a/telepathy-glib/base-client.h b/telepathy-glib/base-client.h index 823a1e818..809b9ab0e 100644 --- a/telepathy-glib/base-client.h +++ b/telepathy-glib/base-client.h @@ -141,26 +141,26 @@ void tp_base_client_add_handler_capabilities_varargs (TpBaseClient *self, void tp_base_client_add_account_features (TpBaseClient *self, const GQuark *features, gssize n) - _TP_GNUC_DEPRECATED_FOR (tp_simple_client_factory_add_account_features); + _TP_GNUC_DEPRECATED_FOR (tp_client_factory_add_account_features); void tp_base_client_add_account_features_varargs (TpBaseClient *self, GQuark feature, ...) - _TP_GNUC_DEPRECATED_FOR (tp_simple_client_factory_add_account_features_varargs); + _TP_GNUC_DEPRECATED_FOR (tp_client_factory_add_account_features_varargs); void tp_base_client_add_channel_features (TpBaseClient *self, const GQuark *features, gssize n) - _TP_GNUC_DEPRECATED_FOR (tp_simple_client_factory_add_channel_features); + _TP_GNUC_DEPRECATED_FOR (tp_client_factory_add_channel_features); void tp_base_client_add_channel_features_varargs (TpBaseClient *self, GQuark feature, ...) - _TP_GNUC_DEPRECATED_FOR (tp_simple_client_factory_add_channel_features_varargs); + _TP_GNUC_DEPRECATED_FOR (tp_client_factory_add_channel_features_varargs); void tp_base_client_add_connection_features (TpBaseClient *self, const GQuark *features, gssize n) - _TP_GNUC_DEPRECATED_FOR (tp_simple_client_factory_add_connection_features); + _TP_GNUC_DEPRECATED_FOR (tp_client_factory_add_connection_features); void tp_base_client_add_connection_features_varargs (TpBaseClient *self, GQuark feature, ...) - _TP_GNUC_DEPRECATED_FOR (tp_simple_client_factory_add_connection_features_varargs); + _TP_GNUC_DEPRECATED_FOR (tp_client_factory_add_connection_features_varargs); void tp_base_client_set_channel_factory (TpBaseClient *self, diff --git a/telepathy-glib/basic-proxy-factory.c b/telepathy-glib/basic-proxy-factory.c index 6f98799a3..7ed34db8b 100644 --- a/telepathy-glib/basic-proxy-factory.c +++ b/telepathy-glib/basic-proxy-factory.c @@ -82,7 +82,7 @@ tp_basic_proxy_factory_class_init (TpBasicProxyFactoryClass *cls) * Returns: a new #TpBasicProxyFactory * * Since: 0.13.2 - * Deprecated: New code should use #TpSimpleClientFactory instead + * Deprecated: New code should use #TpClientFactory instead */ static TpBasicProxyFactory * _tp_basic_proxy_factory_new (void) @@ -107,7 +107,7 @@ tp_basic_proxy_factory_new (void) * Returns: (transfer full): a #TpBasicProxyFactory * * Since: 0.13.2 - * Deprecated: New code should use #TpSimpleClientFactory instead + * Deprecated: New code should use #TpClientFactory instead */ TpBasicProxyFactory * tp_basic_proxy_factory_dup (void) diff --git a/telepathy-glib/basic-proxy-factory.h b/telepathy-glib/basic-proxy-factory.h index a4e5797ca..5544cca40 100644 --- a/telepathy-glib/basic-proxy-factory.h +++ b/telepathy-glib/basic-proxy-factory.h @@ -59,11 +59,11 @@ GType tp_basic_proxy_factory_get_type (void); TpBasicProxyFactoryClass)) TpBasicProxyFactory * tp_basic_proxy_factory_new (void) - _TP_GNUC_DEPRECATED_FOR (tp_simple_client_factory_new); + _TP_GNUC_DEPRECATED_FOR (tp_client_factory_new); TpBasicProxyFactory * tp_basic_proxy_factory_dup (void) - _TP_GNUC_DEPRECATED_FOR (tp_simple_client_factory_new); + _TP_GNUC_DEPRECATED_FOR (tp_client_factory_new); G_END_DECLS diff --git a/telepathy-glib/call-channel.c b/telepathy-glib/call-channel.c index dd2cff890..b582675f6 100644 --- a/telepathy-glib/call-channel.c +++ b/telepathy-glib/call-channel.c @@ -1123,7 +1123,7 @@ tp_call_channel_class_init (TpCallChannelClass *klass) * changes. * * The #TpContact objects are guaranteed to have all of the features - * previously passed to tp_simple_client_factory_add_contact_features() + * previously passed to tp_client_factory_add_contact_features() * prepared. * * Since: 0.17.5 @@ -1148,7 +1148,7 @@ tp_call_channel_init (TpCallChannel *self) } TpCallChannel * -_tp_call_channel_new_with_factory (TpSimpleClientFactory *factory, +_tp_call_channel_new_with_factory (TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, @@ -1327,7 +1327,7 @@ tp_call_channel_has_mutable_contents (TpCallChannel *self) * Get the members of this call. * * The #TpContact objects are guaranteed to have all of the features - * previously passed to tp_simple_client_factory_add_contact_features() + * previously passed to tp_client_factory_add_contact_features() * prepared. * * Returns: (transfer none) (type GLib.HashTable) (element-type TelepathyGLib.Contact uint): diff --git a/telepathy-glib/channel-contacts.c b/telepathy-glib/channel-contacts.c index 8bb987d7c..c9d1a48f0 100644 --- a/telepathy-glib/channel-contacts.c +++ b/telepathy-glib/channel-contacts.c @@ -24,7 +24,7 @@ #include <telepathy-glib/gtypes.h> #include <telepathy-glib/proxy.h> -#include <telepathy-glib/simple-client-factory.h> +#include <telepathy-glib/client-factory.h> #include <telepathy-glib/util.h> #define DEBUG_FLAG TP_DEBUG_GROUPS @@ -60,7 +60,7 @@ dup_contact (TpChannel *self, return NULL; } - return tp_simple_client_factory_ensure_contact ( + return tp_client_factory_ensure_contact ( tp_proxy_get_factory (self->priv->connection), self->priv->connection, handle, id); } @@ -164,7 +164,7 @@ _tp_channel_contacts_init (TpChannel *self) if (self->priv->handle != 0 && self->priv->identifier != NULL && self->priv->handle_type == TP_HANDLE_TYPE_CONTACT) { - self->priv->target_contact = tp_simple_client_factory_ensure_contact ( + self->priv->target_contact = tp_client_factory_ensure_contact ( tp_proxy_get_factory (self->priv->connection), self->priv->connection, self->priv->handle, self->priv->identifier); } @@ -172,7 +172,7 @@ _tp_channel_contacts_init (TpChannel *self) if (tp_channel_get_initiator_handle (self) != 0 && !tp_str_empty (tp_channel_get_initiator_identifier (self))) { - self->priv->initiator_contact = tp_simple_client_factory_ensure_contact ( + self->priv->initiator_contact = tp_client_factory_ensure_contact ( tp_proxy_get_factory (self->priv->connection), self->priv->connection, tp_channel_get_initiator_handle (self), tp_channel_get_initiator_identifier (self)); @@ -364,7 +364,7 @@ process_contacts_queue (TpChannel *self) self->priv->current_contacts_queue_result = result; item = g_simple_async_result_get_op_res_gpointer (result); - features = tp_simple_client_factory_dup_contact_features ( + features = tp_client_factory_dup_contact_features ( tp_proxy_get_factory (self->priv->connection), self->priv->connection); if (item->contacts != NULL && item->contacts->len > 0) @@ -745,7 +745,7 @@ _tp_channel_contacts_self_contact_changed (TpChannel *self, GPtrArray *contacts; contacts = g_ptr_array_new_with_free_func (g_object_unref); - contact = tp_simple_client_factory_ensure_contact ( + contact = tp_client_factory_ensure_contact ( tp_proxy_get_factory (self->priv->connection), self->priv->connection, self_handle, identifier); g_ptr_array_add (contacts, g_object_ref (contact)); diff --git a/telepathy-glib/channel-dispatch-operation.c b/telepathy-glib/channel-dispatch-operation.c index 5cb9ec63c..ec9ef70ce 100644 --- a/telepathy-glib/channel-dispatch-operation.c +++ b/telepathy-glib/channel-dispatch-operation.c @@ -39,7 +39,7 @@ #define DEBUG_FLAG TP_DEBUG_DISPATCHER #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" -#include "telepathy-glib/simple-client-factory-internal.h" +#include "telepathy-glib/client-factory-internal.h" #include "telepathy-glib/_gen/tp-cli-channel-dispatch-operation-body.h" @@ -253,7 +253,7 @@ maybe_set_connection (TpChannelDispatchOperation *self, if (path == NULL) return; - self->priv->connection = tp_simple_client_factory_ensure_connection ( + self->priv->connection = tp_client_factory_ensure_connection ( tp_proxy_get_factory (self), path, NULL, &error); if (self->priv->connection == NULL) { @@ -285,7 +285,7 @@ maybe_set_account (TpChannelDispatchOperation *self, if (path == NULL) return; - self->priv->account = tp_simple_client_factory_ensure_account ( + self->priv->account = tp_client_factory_ensure_account ( tp_proxy_get_factory (self), path, NULL, &error); if (self->priv->account == NULL) { @@ -538,7 +538,7 @@ update_channels_array (TpChannelDispatchOperation *self, } else { - channel = tp_simple_client_factory_ensure_channel ( + channel = tp_client_factory_ensure_channel ( tp_proxy_get_factory (self), self->priv->connection, path, chan_props, &err); @@ -898,7 +898,7 @@ tp_channel_dispatch_operation_new (TpDBusDaemon *bus_daemon, } TpChannelDispatchOperation * -_tp_channel_dispatch_operation_new_with_factory (TpSimpleClientFactory *factory, +_tp_channel_dispatch_operation_new_with_factory (TpClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, @@ -1235,7 +1235,7 @@ tp_channel_dispatch_operation_claim_finish ( } /* FIXME: This is temporary solution to share TpChannel objects until - * TpSimpleClientFactory can be used for that */ + * TpClientFactory can be used for that */ void _tp_channel_dispatch_operation_ensure_channels (TpChannelDispatchOperation *self, GPtrArray *channels) diff --git a/telepathy-glib/channel-request.c b/telepathy-glib/channel-request.c index e31354e1a..2ee433a7b 100644 --- a/telepathy-glib/channel-request.c +++ b/telepathy-glib/channel-request.c @@ -40,7 +40,7 @@ #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/deprecated-internal.h" #include "telepathy-glib/proxy-internal.h" -#include "telepathy-glib/simple-client-factory-internal.h" +#include "telepathy-glib/client-factory-internal.h" #include "telepathy-glib/_gen/tp-cli-channel-request-body.h" /** @@ -225,7 +225,7 @@ tp_channel_request_succeeded_cb (TpChannelRequest *self, GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED, "ChannelRequest succeeded and was removed" }; - connection = tp_simple_client_factory_ensure_connection ( + connection = tp_client_factory_ensure_connection ( tp_proxy_get_factory (self), conn_path, NULL, &error); if (connection == NULL) { @@ -238,7 +238,7 @@ tp_channel_request_succeeded_cb (TpChannelRequest *self, channel = tp_client_channel_factory_create_channel ( self->priv->channel_factory, connection, chan_path, chan_props, &error); else - channel = tp_simple_client_factory_ensure_channel (tp_proxy_get_factory (self), + channel = tp_client_factory_ensure_channel (tp_proxy_get_factory (self), connection, chan_path, chan_props, &error); if (channel == NULL) { @@ -454,7 +454,7 @@ tp_channel_request_class_init (TpChannelRequestClass *klass) * The #TpChannel is created using #TpChannelRequest:channel-factory or * #TpProxy:factory but the features of the factory are NOT prepared. * It's up to the user to prepare the features returned by - * tp_simple_client_factory_dup_channel_features() himself. + * tp_client_factory_dup_channel_features() himself. * * Since: 0.13.14 */ @@ -527,7 +527,7 @@ tp_channel_request_new (TpDBusDaemon *bus_daemon, } TpChannelRequest * -_tp_channel_request_new_with_factory (TpSimpleClientFactory *factory, +_tp_channel_request_new_with_factory (TpClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, @@ -648,7 +648,7 @@ tp_channel_request_get_account (TpChannelRequest *self) if (path == NULL) return NULL; - self->priv->account = tp_simple_client_factory_ensure_account ( + self->priv->account = tp_client_factory_ensure_account ( tp_proxy_get_factory (self), path, NULL, NULL); } diff --git a/telepathy-glib/channel.c b/telepathy-glib/channel.c index a404624d8..a943e588e 100644 --- a/telepathy-glib/channel.c +++ b/telepathy-glib/channel.c @@ -36,7 +36,7 @@ #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" -#include "telepathy-glib/simple-client-factory-internal.h" +#include "telepathy-glib/client-factory-internal.h" #include "_gen/tp-cli-channel-body.h" @@ -189,7 +189,7 @@ tp_channel_get_feature_quark_group (void) * * When this feature is prepared, the #TpContact objects of this channel are * guaranteed to have all of the features previously passed to - * tp_simple_client_factory_add_contact_features() prepared. + * tp_client_factory_add_contact_features() prepared. * * On older connection managers, this feature may fail to prepare. * @@ -1606,7 +1606,7 @@ tp_channel_new_from_properties (TpConnection *conn, } TpChannel * -_tp_channel_new_with_factory (TpSimpleClientFactory *factory, +_tp_channel_new_with_factory (TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, diff --git a/telepathy-glib/simple-client-factory-internal.h b/telepathy-glib/client-factory-internal.h index 61f81d8c6..8c529d637 100644 --- a/telepathy-glib/simple-client-factory-internal.h +++ b/telepathy-glib/client-factory-internal.h @@ -1,5 +1,5 @@ /* - * Internal methods of TpSimpleClientFactory + * Internal methods of TpClientFactory * * Copyright © 2011 Collabora Ltd. * @@ -18,48 +18,47 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TP_SIMPLE_CLIENT_FACTORY_INTERNAL_H__ -#define __TP_SIMPLE_CLIENT_FACTORY_INTERNAL_H__ +#ifndef __TP_CLIENT_FACTORY_INTERNAL_H__ +#define __TP_CLIENT_FACTORY_INTERNAL_H__ -#include <telepathy-glib/simple-client-factory.h> +#include <telepathy-glib/client-factory.h> G_BEGIN_DECLS -void _tp_simple_client_factory_insert_proxy (TpSimpleClientFactory *self, +void _tp_client_factory_insert_proxy (TpClientFactory *self, gpointer proxy); -TpChannelRequest *_tp_simple_client_factory_ensure_channel_request ( - TpSimpleClientFactory *self, +TpChannelRequest *_tp_client_factory_ensure_channel_request ( + TpClientFactory *self, const gchar *object_path, GHashTable *immutable_properties, GError **error); TpChannelDispatchOperation * -_tp_simple_client_factory_ensure_channel_dispatch_operation ( - TpSimpleClientFactory *self, +_tp_client_factory_ensure_channel_dispatch_operation (TpClientFactory *self, const gchar *object_path, GHashTable *immutable_properties, GError **error); -TpAccount *_tp_account_new_with_factory (TpSimpleClientFactory *factory, +TpAccount *_tp_account_new_with_factory (TpClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GError **error); -TpConnection *_tp_connection_new_with_factory (TpSimpleClientFactory *factory, +TpConnection *_tp_connection_new_with_factory (TpClientFactory *factory, TpDBusDaemon *dbus, const gchar *bus_name, const gchar *object_path, GError **error); -TpChannel *_tp_channel_new_with_factory (TpSimpleClientFactory *factory, +TpChannel *_tp_channel_new_with_factory (TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); TpChannelRequest *_tp_channel_request_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, @@ -68,7 +67,7 @@ void _tp_channel_request_ensure_immutable_properties (TpChannelRequest *self, GHashTable *immutable_properties); TpChannelDispatchOperation *_tp_channel_dispatch_operation_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, diff --git a/telepathy-glib/simple-client-factory.c b/telepathy-glib/client-factory.c index d0e088e62..06fd7de47 100644 --- a/telepathy-glib/simple-client-factory.c +++ b/telepathy-glib/client-factory.c @@ -19,8 +19,8 @@ */ /** - * SECTION:simple-client-factory - * @title: TpSimpleClientFactory + * SECTION:client-factory + * @title: TpClientFactory * @short_description: a factory for #TpContact<!-- -->s and plain subclasses * of #TpProxy * @see_also: #TpAutomaticClientFactory @@ -38,7 +38,7 @@ * #TpChannel and #TpContact. Those objects should always be acquired through a * factory, rather than being constructed directly. * - * One can subclass #TpSimpleClientFactory and override some of its virtual + * One can subclass #TpClientFactory and override some of its virtual * methods to construct more specialized objects. See #TpAutomaticClientFactory * for a subclass which automatically constructs subclasses of #TpChannel for * common channel types. @@ -47,7 +47,7 @@ * |[ * int main(int argc, char *argv[]) * { - * TpSimpleClientFactory *factory; + * TpClientFactory *factory; * TpAccountManager *manager; * * g_type_init (); @@ -70,33 +70,33 @@ */ /** - * TpSimpleClientFactory: + * TpClientFactory: * - * Data structure representing a #TpSimpleClientFactory + * Data structure representing a #TpClientFactory * * Since: 0.15.5 */ /** - * TpSimpleClientFactoryClass: + * TpClientFactoryClass: * @parent_class: the parent * @create_account: create a #TpAccount; - * see tp_simple_client_factory_ensure_account() - * @dup_account_features: implementation of tp_simple_client_factory_dup_account_features() + * see tp_client_factory_ensure_account() + * @dup_account_features: implementation of tp_client_factory_dup_account_features() * @create_connection: create a #TpConnection; - * see tp_simple_client_factory_ensure_connection() + * see tp_client_factory_ensure_connection() * @dup_connection_features: implementation of - * tp_simple_client_factory_dup_connection_features() + * tp_client_factory_dup_connection_features() * @create_channel: create a #TpChannel; - * see tp_simple_client_factory_ensure_channel() - * @dup_channel_features: implementation of tp_simple_client_factory_dup_channel_features() + * see tp_client_factory_ensure_channel() + * @dup_channel_features: implementation of tp_client_factory_dup_channel_features() * @create_contact: create a #TpContact; - * see tp_simple_client_factory_ensure_contact() - * @dup_contact_features: implementation of tp_simple_client_factory_dup_contact_features() + * see tp_client_factory_ensure_contact() + * @dup_contact_features: implementation of tp_client_factory_dup_contact_features() * - * The class structure for #TpSimpleClientFactory. + * The class structure for #TpClientFactory. * - * #TpSimpleClientFactory maintains a cache of previously-constructed proxy + * #TpClientFactory maintains a cache of previously-constructed proxy * objects, so the implementations of @create_account, * @create_connection, @create_channel, and @create_contact may assume that a * new object should be created when they are called. The default @@ -106,7 +106,7 @@ * * The default implementation of @dup_channel_features returns * #TP_CHANNEL_FEATURE_CORE, plus all features passed to - * tp_simple_client_factory_add_channel_features() by the application. + * tp_client_factory_add_channel_features() by the application. * Subclasses may override this method to prepare more interesting features * from subclasses of #TpChannel, for instance. The default implementations of * the other <function>dup_x_features</function> methods behave similarly. @@ -116,7 +116,7 @@ #include "config.h" -#include "telepathy-glib/simple-client-factory.h" +#include "telepathy-glib/client-factory.h" #include <telepathy-glib/util.h> @@ -124,10 +124,10 @@ #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/contact-internal.h" #include "telepathy-glib/debug-internal.h" -#include "telepathy-glib/simple-client-factory-internal.h" +#include "telepathy-glib/client-factory-internal.h" #include "telepathy-glib/util-internal.h" -struct _TpSimpleClientFactoryPrivate +struct _TpClientFactoryPrivate { TpDBusDaemon *dbus; /* Owned object-path -> weakref to TpProxy */ @@ -144,21 +144,21 @@ enum N_PROPS }; -G_DEFINE_TYPE (TpSimpleClientFactory, tp_simple_client_factory, G_TYPE_OBJECT) +G_DEFINE_TYPE (TpClientFactory, tp_client_factory, G_TYPE_OBJECT) static void proxy_invalidated_cb (TpProxy *proxy, guint domain, gint code, gchar *message, - TpSimpleClientFactory *self) + TpClientFactory *self) { g_hash_table_remove (self->priv->proxy_cache, tp_proxy_get_object_path (proxy)); } static void -insert_proxy (TpSimpleClientFactory *self, +insert_proxy (TpClientFactory *self, gpointer proxy) { if (proxy == NULL) @@ -174,14 +174,14 @@ insert_proxy (TpSimpleClientFactory *self, } static gpointer -lookup_proxy (TpSimpleClientFactory *self, +lookup_proxy (TpClientFactory *self, const gchar *object_path) { return g_hash_table_lookup (self->priv->proxy_cache, object_path); } void -_tp_simple_client_factory_insert_proxy (TpSimpleClientFactory *self, +_tp_client_factory_insert_proxy (TpClientFactory *self, gpointer proxy) { g_return_if_fail (lookup_proxy (self, @@ -191,7 +191,7 @@ _tp_simple_client_factory_insert_proxy (TpSimpleClientFactory *self, } static TpAccount * -create_account_impl (TpSimpleClientFactory *self, +create_account_impl (TpClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties G_GNUC_UNUSED, GError **error) @@ -201,7 +201,7 @@ create_account_impl (TpSimpleClientFactory *self, } static GArray * -dup_account_features_impl (TpSimpleClientFactory *self, +dup_account_features_impl (TpClientFactory *self, TpAccount *account) { return _tp_quark_array_copy ( @@ -209,7 +209,7 @@ dup_account_features_impl (TpSimpleClientFactory *self, } static TpConnection * -create_connection_impl (TpSimpleClientFactory *self, +create_connection_impl (TpClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties G_GNUC_UNUSED, GError **error) @@ -219,7 +219,7 @@ create_connection_impl (TpSimpleClientFactory *self, } static GArray * -dup_connection_features_impl (TpSimpleClientFactory *self, +dup_connection_features_impl (TpClientFactory *self, TpConnection *connection) { return _tp_quark_array_copy ( @@ -227,7 +227,7 @@ dup_connection_features_impl (TpSimpleClientFactory *self, } static TpChannel * -create_channel_impl (TpSimpleClientFactory *self, +create_channel_impl (TpClientFactory *self, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, @@ -238,7 +238,7 @@ create_channel_impl (TpSimpleClientFactory *self, } static GArray * -dup_channel_features_impl (TpSimpleClientFactory *self, +dup_channel_features_impl (TpClientFactory *self, TpChannel *channel) { return _tp_quark_array_copy ( @@ -246,7 +246,7 @@ dup_channel_features_impl (TpSimpleClientFactory *self, } static TpContact * -create_contact_impl (TpSimpleClientFactory *self, +create_contact_impl (TpClientFactory *self, TpConnection *connection, TpHandle handle, const gchar *identifier) @@ -255,7 +255,7 @@ create_contact_impl (TpSimpleClientFactory *self, } static GArray * -dup_contact_features_impl (TpSimpleClientFactory *self, +dup_contact_features_impl (TpClientFactory *self, TpConnection *connection) { return _tp_quark_array_copy ( @@ -263,12 +263,12 @@ dup_contact_features_impl (TpSimpleClientFactory *self, } static void -tp_simple_client_factory_get_property (GObject *object, +tp_client_factory_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { - TpSimpleClientFactory *self = (TpSimpleClientFactory *) object; + TpClientFactory *self = (TpClientFactory *) object; switch (property_id) { @@ -282,12 +282,12 @@ tp_simple_client_factory_get_property (GObject *object, } static void -tp_simple_client_factory_set_property (GObject *object, +tp_client_factory_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { - TpSimpleClientFactory *self = (TpSimpleClientFactory *) object; + TpClientFactory *self = (TpClientFactory *) object; switch (property_id) { @@ -302,19 +302,19 @@ tp_simple_client_factory_set_property (GObject *object, } static void -tp_simple_client_factory_constructed (GObject *object) +tp_client_factory_constructed (GObject *object) { - TpSimpleClientFactory *self = (TpSimpleClientFactory *) object; + TpClientFactory *self = (TpClientFactory *) object; g_assert (TP_IS_DBUS_DAEMON (self->priv->dbus)); - G_OBJECT_CLASS (tp_simple_client_factory_parent_class)->constructed (object); + G_OBJECT_CLASS (tp_client_factory_parent_class)->constructed (object); } static void -tp_simple_client_factory_finalize (GObject *object) +tp_client_factory_finalize (GObject *object) { - TpSimpleClientFactory *self = (TpSimpleClientFactory *) object; + TpClientFactory *self = (TpClientFactory *) object; g_clear_object (&self->priv->dbus); tp_clear_pointer (&self->priv->proxy_cache, g_hash_table_unref); @@ -323,16 +323,16 @@ tp_simple_client_factory_finalize (GObject *object) tp_clear_pointer (&self->priv->desired_channel_features, g_array_unref); tp_clear_pointer (&self->priv->desired_contact_features, g_array_unref); - G_OBJECT_CLASS (tp_simple_client_factory_parent_class)->finalize (object); + G_OBJECT_CLASS (tp_client_factory_parent_class)->finalize (object); } static void -tp_simple_client_factory_init (TpSimpleClientFactory *self) +tp_client_factory_init (TpClientFactory *self) { GQuark feature; - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_SIMPLE_CLIENT_FACTORY, - TpSimpleClientFactoryPrivate); + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CLIENT_FACTORY, + TpClientFactoryPrivate); self->priv->proxy_cache = g_hash_table_new (g_str_hash, g_str_equal); @@ -356,17 +356,17 @@ tp_simple_client_factory_init (TpSimpleClientFactory *self) } static void -tp_simple_client_factory_class_init (TpSimpleClientFactoryClass *klass) +tp_client_factory_class_init (TpClientFactoryClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; - g_type_class_add_private (klass, sizeof (TpSimpleClientFactoryPrivate)); + g_type_class_add_private (klass, sizeof (TpClientFactoryPrivate)); - object_class->get_property = tp_simple_client_factory_get_property; - object_class->set_property = tp_simple_client_factory_set_property; - object_class->constructed = tp_simple_client_factory_constructed; - object_class->finalize = tp_simple_client_factory_finalize; + object_class->get_property = tp_client_factory_get_property; + object_class->set_property = tp_client_factory_set_property; + object_class->constructed = tp_client_factory_constructed; + object_class->finalize = tp_client_factory_finalize; klass->create_account = create_account_impl; klass->dup_account_features = dup_account_features_impl; @@ -378,7 +378,7 @@ tp_simple_client_factory_class_init (TpSimpleClientFactoryClass *klass) klass->dup_contact_features = dup_contact_features_impl; /** - * TpSimpleClientFactory:dbus-daemon: + * TpClientFactory:dbus-daemon: * * The D-Bus daemon for this object. */ @@ -391,45 +391,45 @@ tp_simple_client_factory_class_init (TpSimpleClientFactoryClass *klass) } /** - * tp_simple_client_factory_new: + * tp_client_factory_new: * @dbus: a #TpDBusDaemon * - * Creates a new #TpSimpleClientFactory instance. + * Creates a new #TpClientFactory instance. * - * Returns: a new #TpSimpleClientFactory + * Returns: a new #TpClientFactory * * Since: 0.15.5 */ -TpSimpleClientFactory * -tp_simple_client_factory_new (TpDBusDaemon *dbus) +TpClientFactory * +tp_client_factory_new (TpDBusDaemon *dbus) { - return g_object_new (TP_TYPE_SIMPLE_CLIENT_FACTORY, + return g_object_new (TP_TYPE_CLIENT_FACTORY, "dbus-daemon", dbus, NULL); } /** - * tp_simple_client_factory_get_dbus_daemon: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_get_dbus_daemon: + * @self: a #TpClientFactory object * * <!-- --> * - * Returns: (transfer none): the value of the #TpSimpleClientFactory:dbus-daemon + * Returns: (transfer none): the value of the #TpClientFactory:dbus-daemon * property * * Since: 0.15.5 */ TpDBusDaemon * -tp_simple_client_factory_get_dbus_daemon (TpSimpleClientFactory *self) +tp_client_factory_get_dbus_daemon (TpClientFactory *self) { - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); return self->priv->dbus; } /** - * tp_simple_client_factory_ensure_account: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_ensure_account: + * @self: a #TpClientFactory object * @object_path: the object path of an account * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the account, or %NULL. @@ -441,7 +441,7 @@ tp_simple_client_factory_get_dbus_daemon (TpSimpleClientFactory *self) * * Note that the returned #TpAccount is not guaranteed to be ready; the caller * is responsible for calling tp_proxy_prepare_async() with the desired - * features (as given by tp_simple_client_factory_dup_account_features()). + * features (as given by tp_client_factory_dup_account_features()). * * Returns: (transfer full): a reference to a #TpAccount; * see tp_account_new(). @@ -449,21 +449,21 @@ tp_simple_client_factory_get_dbus_daemon (TpSimpleClientFactory *self) * Since: 0.15.5 */ TpAccount * -tp_simple_client_factory_ensure_account (TpSimpleClientFactory *self, +tp_client_factory_ensure_account (TpClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpAccount *account; - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); account = lookup_proxy (self, object_path); if (account != NULL) return g_object_ref (account); - account = TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->create_account (self, + account = TP_CLIENT_FACTORY_GET_CLASS (self)->create_account (self, object_path, immutable_properties, error); insert_proxy (self, account); @@ -471,8 +471,8 @@ tp_simple_client_factory_ensure_account (TpSimpleClientFactory *self, } /** - * tp_simple_client_factory_dup_account_features: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_dup_account_features: + * @self: a #TpClientFactory object * @account: a #TpAccount * * Return a zero-terminated #GArray containing the #TpAccount features that @@ -484,27 +484,27 @@ tp_simple_client_factory_ensure_account (TpSimpleClientFactory *self, * Since: 0.15.5 */ GArray * -tp_simple_client_factory_dup_account_features (TpSimpleClientFactory *self, +tp_client_factory_dup_account_features (TpClientFactory *self, TpAccount *account) { - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); g_return_val_if_fail (tp_proxy_get_factory (account) == self, NULL); - return TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->dup_account_features (self, + return TP_CLIENT_FACTORY_GET_CLASS (self)->dup_account_features (self, account); } /** - * tp_simple_client_factory_add_account_features: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_add_account_features: + * @self: a #TpClientFactory object * @features: (transfer none) (array zero-terminated=1) (allow-none): an array * of desired features, ending with 0; %NULL is equivalent to an array * containing only 0 * * Add @features to the desired features to be prepared on #TpAccount * objects. Those features will be added to the features already returned be - * tp_simple_client_factory_dup_account_features(). + * tp_client_factory_dup_account_features(). * * It is not necessary to add %TP_ACCOUNT_FEATURE_CORE as it is already * included by default. @@ -515,35 +515,35 @@ tp_simple_client_factory_dup_account_features (TpSimpleClientFactory *self, * Since: 0.15.5 */ void -tp_simple_client_factory_add_account_features ( - TpSimpleClientFactory *self, +tp_client_factory_add_account_features ( + TpClientFactory *self, const GQuark *features) { - g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); + g_return_if_fail (TP_IS_CLIENT_FACTORY (self)); _tp_quark_array_merge (self->priv->desired_account_features, features, -1); } /** - * tp_simple_client_factory_add_account_features_varargs: (skip) - * @self: a #TpSimpleClientFactory + * tp_client_factory_add_account_features_varargs: (skip) + * @self: a #TpClientFactory * @feature: the first feature * @...: the second and subsequent features, if any, ending with 0 * - * The same as tp_simple_client_factory_add_account_features(), but with a more + * The same as tp_client_factory_add_account_features(), but with a more * convenient calling convention from C. * * Since: 0.15.5 */ void -tp_simple_client_factory_add_account_features_varargs ( - TpSimpleClientFactory *self, +tp_client_factory_add_account_features_varargs ( + TpClientFactory *self, GQuark feature, ...) { va_list var_args; - g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); + g_return_if_fail (TP_IS_CLIENT_FACTORY (self)); va_start (var_args, feature); _tp_quark_array_merge_valist (self->priv->desired_account_features, feature, @@ -552,8 +552,8 @@ tp_simple_client_factory_add_account_features_varargs ( } /** - * tp_simple_client_factory_ensure_connection: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_ensure_connection: + * @self: a #TpClientFactory object * @object_path: the object path of a connection * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the connection. @@ -566,7 +566,7 @@ tp_simple_client_factory_add_account_features_varargs ( * * Note that the returned #TpConnection is not guaranteed to be ready; the * caller is responsible for calling tp_proxy_prepare_async() with the desired - * features (as given by tp_simple_client_factory_dup_connection_features()). + * features (as given by tp_client_factory_dup_connection_features()). * * Returns: (transfer full): a reference to a #TpConnection; * see tp_connection_new(). @@ -574,21 +574,21 @@ tp_simple_client_factory_add_account_features_varargs ( * Since: 0.15.5 */ TpConnection * -tp_simple_client_factory_ensure_connection (TpSimpleClientFactory *self, +tp_client_factory_ensure_connection (TpClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpConnection *connection; - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); connection = lookup_proxy (self, object_path); if (connection != NULL) return g_object_ref (connection); - connection = TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->create_connection ( + connection = TP_CLIENT_FACTORY_GET_CLASS (self)->create_connection ( self, object_path, immutable_properties, error); insert_proxy (self, connection); @@ -596,8 +596,8 @@ tp_simple_client_factory_ensure_connection (TpSimpleClientFactory *self, } /** - * tp_simple_client_factory_dup_connection_features: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_dup_connection_features: + * @self: a #TpClientFactory object * @connection: a #TpConnection * * Return a zero-terminated #GArray containing the #TpConnection features that @@ -609,27 +609,27 @@ tp_simple_client_factory_ensure_connection (TpSimpleClientFactory *self, * Since: 0.15.5 */ GArray * -tp_simple_client_factory_dup_connection_features (TpSimpleClientFactory *self, +tp_client_factory_dup_connection_features (TpClientFactory *self, TpConnection *connection) { - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CONNECTION (connection), NULL); g_return_val_if_fail (tp_proxy_get_factory (connection) == self, NULL); - return TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->dup_connection_features ( + return TP_CLIENT_FACTORY_GET_CLASS (self)->dup_connection_features ( self, connection); } /** - * tp_simple_client_factory_add_connection_features: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_add_connection_features: + * @self: a #TpClientFactory object * @features: (transfer none) (array zero-terminated=1) (allow-none): an array * of desired features, ending with 0; %NULL is equivalent to an array * containing only 0 * * Add @features to the desired features to be prepared on #TpConnection * objects. Those features will be added to the features already returned be - * tp_simple_client_factory_dup_connection_features(). + * tp_client_factory_dup_connection_features(). * * It is not necessary to add %TP_CONNECTION_FEATURE_CORE as it is already * included by default. @@ -640,35 +640,35 @@ tp_simple_client_factory_dup_connection_features (TpSimpleClientFactory *self, * Since: 0.15.5 */ void -tp_simple_client_factory_add_connection_features ( - TpSimpleClientFactory *self, +tp_client_factory_add_connection_features ( + TpClientFactory *self, const GQuark *features) { - g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); + g_return_if_fail (TP_IS_CLIENT_FACTORY (self)); _tp_quark_array_merge (self->priv->desired_connection_features, features, -1); } /** - * tp_simple_client_factory_add_connection_features_varargs: (skip) - * @self: a #TpSimpleClientFactory + * tp_client_factory_add_connection_features_varargs: (skip) + * @self: a #TpClientFactory * @feature: the first feature * @...: the second and subsequent features, if any, ending with 0 * - * The same as tp_simple_client_factory_add_connection_features(), but with a + * The same as tp_client_factory_add_connection_features(), but with a * more convenient calling convention from C. * * Since: 0.15.5 */ void -tp_simple_client_factory_add_connection_features_varargs ( - TpSimpleClientFactory *self, +tp_client_factory_add_connection_features_varargs ( + TpClientFactory *self, GQuark feature, ...) { va_list var_args; - g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); + g_return_if_fail (TP_IS_CLIENT_FACTORY (self)); va_start (var_args, feature); _tp_quark_array_merge_valist (self->priv->desired_connection_features, @@ -677,8 +677,8 @@ tp_simple_client_factory_add_connection_features_varargs ( } /** - * tp_simple_client_factory_ensure_channel: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_ensure_channel: + * @self: a #TpClientFactory object * @connection: a #TpConnection * @object_path: the object path of a channel on @connection * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): @@ -692,7 +692,7 @@ tp_simple_client_factory_add_connection_features_varargs ( * * Note that the returned #TpChannel is not guaranteed to be ready; the * caller is responsible for calling tp_proxy_prepare_async() with the desired - * features (as given by tp_simple_client_factory_dup_channel_features()). + * features (as given by tp_client_factory_dup_channel_features()). * * Returns: (transfer full): a reference to a #TpChannel; * see tp_channel_new_from_properties(). @@ -700,7 +700,7 @@ tp_simple_client_factory_add_connection_features_varargs ( * Since: 0.15.5 */ TpChannel * -tp_simple_client_factory_ensure_channel (TpSimpleClientFactory *self, +tp_client_factory_ensure_channel (TpClientFactory *self, TpConnection *connection, const gchar *object_path, const GHashTable *immutable_properties, @@ -708,7 +708,7 @@ tp_simple_client_factory_ensure_channel (TpSimpleClientFactory *self, { TpChannel *channel; - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CONNECTION (connection), NULL); g_return_val_if_fail (tp_proxy_get_factory (connection) == self, NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); @@ -717,7 +717,7 @@ tp_simple_client_factory_ensure_channel (TpSimpleClientFactory *self, if (channel != NULL) return g_object_ref (channel); - channel = TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->create_channel (self, + channel = TP_CLIENT_FACTORY_GET_CLASS (self)->create_channel (self, connection, object_path, immutable_properties, error); insert_proxy (self, channel); @@ -725,8 +725,8 @@ tp_simple_client_factory_ensure_channel (TpSimpleClientFactory *self, } /** - * tp_simple_client_factory_dup_channel_features: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_dup_channel_features: + * @self: a #TpClientFactory object * @channel: a #TpChannel * * Return a zero-terminated #GArray containing the #TpChannel features that @@ -738,27 +738,27 @@ tp_simple_client_factory_ensure_channel (TpSimpleClientFactory *self, * Since: 0.15.5 */ GArray * -tp_simple_client_factory_dup_channel_features (TpSimpleClientFactory *self, +tp_client_factory_dup_channel_features (TpClientFactory *self, TpChannel *channel) { - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL); g_return_val_if_fail (tp_proxy_get_factory (channel) == self, NULL); - return TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->dup_channel_features ( + return TP_CLIENT_FACTORY_GET_CLASS (self)->dup_channel_features ( self, channel); } /** - * tp_simple_client_factory_add_channel_features: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_add_channel_features: + * @self: a #TpClientFactory object * @features: (transfer none) (array zero-terminated=1) (allow-none): an array * of desired features, ending with 0; %NULL is equivalent to an array * containing only 0 * * Add @features to the desired features to be prepared on #TpChannel * objects. Those features will be added to the features already returned be - * tp_simple_client_factory_dup_channel_features(). + * tp_client_factory_dup_channel_features(). * * It is not necessary to add %TP_CHANNEL_FEATURE_CORE as it is already * included by default. @@ -769,35 +769,35 @@ tp_simple_client_factory_dup_channel_features (TpSimpleClientFactory *self, * Since: 0.15.5 */ void -tp_simple_client_factory_add_channel_features ( - TpSimpleClientFactory *self, +tp_client_factory_add_channel_features ( + TpClientFactory *self, const GQuark *features) { - g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); + g_return_if_fail (TP_IS_CLIENT_FACTORY (self)); _tp_quark_array_merge (self->priv->desired_channel_features, features, -1); } /** - * tp_simple_client_factory_add_channel_features_varargs: (skip) - * @self: a #TpSimpleClientFactory + * tp_client_factory_add_channel_features_varargs: (skip) + * @self: a #TpClientFactory * @feature: the first feature * @...: the second and subsequent features, if any, ending with 0 * - * The same as tp_simple_client_factory_add_channel_features(), but with a + * The same as tp_client_factory_add_channel_features(), but with a * more convenient calling convention from C. * * Since: 0.15.5 */ void -tp_simple_client_factory_add_channel_features_varargs ( - TpSimpleClientFactory *self, +tp_client_factory_add_channel_features_varargs ( + TpClientFactory *self, GQuark feature, ...) { va_list var_args; - g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); + g_return_if_fail (TP_IS_CLIENT_FACTORY (self)); va_start (var_args, feature); _tp_quark_array_merge_valist (self->priv->desired_channel_features, @@ -806,8 +806,8 @@ tp_simple_client_factory_add_channel_features_varargs ( } /** - * tp_simple_client_factory_ensure_contact: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_ensure_contact: + * @self: a #TpClientFactory object * @connection: a #TpConnection * @handle: a #TpHandle * @identifier: a string representing the contact's identifier @@ -819,21 +819,21 @@ tp_simple_client_factory_add_channel_features_varargs ( * * Note that the returned #TpContact is not guaranteed to be ready; the caller * is responsible for calling tp_connection_upgrade_contacts() with the desired - * features (as given by tp_simple_client_factory_dup_contact_features()). + * features (as given by tp_client_factory_dup_contact_features()). * * Returns: (transfer full): a reference to a #TpContact. * * Since: 0.15.5 */ TpContact * -tp_simple_client_factory_ensure_contact (TpSimpleClientFactory *self, +tp_client_factory_ensure_contact (TpClientFactory *self, TpConnection *connection, TpHandle handle, const gchar *identifier) { TpContact *contact; - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CONNECTION (connection), NULL); g_return_val_if_fail (tp_proxy_get_factory (connection) == self, NULL); g_return_val_if_fail (handle != 0, NULL); @@ -844,7 +844,7 @@ tp_simple_client_factory_ensure_contact (TpSimpleClientFactory *self, if (contact != NULL) return contact; - contact = TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->create_contact (self, + contact = TP_CLIENT_FACTORY_GET_CLASS (self)->create_contact (self, connection, handle, identifier); _tp_connection_add_contact (connection, handle, contact); @@ -852,8 +852,8 @@ tp_simple_client_factory_ensure_contact (TpSimpleClientFactory *self, } /** - * tp_simple_client_factory_dup_contact_features: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_dup_contact_features: + * @self: a #TpClientFactory object * @connection: a #TpConnection * * Return a #GArray containing the contact feature #GQuark<!-- -->s @@ -865,26 +865,26 @@ tp_simple_client_factory_ensure_contact (TpSimpleClientFactory *self, * Since: 0.15.5 */ GArray * -tp_simple_client_factory_dup_contact_features (TpSimpleClientFactory *self, +tp_client_factory_dup_contact_features (TpClientFactory *self, TpConnection *connection) { - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CONNECTION (connection), NULL); g_return_val_if_fail (tp_proxy_get_factory (connection) == self, NULL); - return TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->dup_contact_features ( + return TP_CLIENT_FACTORY_GET_CLASS (self)->dup_contact_features ( self, connection); } /** - * tp_simple_client_factory_add_contact_features: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_add_contact_features: + * @self: a #TpClientFactory object * @features: (transfer none) (array zero-terminated=1) (allow-none): * an array of desired features * * Add @features to the desired features to be prepared on #TpContact * objects. Those features will be added to the features already returned be - * tp_simple_client_factory_dup_contact_features(). + * tp_client_factory_dup_contact_features(). * * Note that these features will not be added to existing #TpContact * objects; the user must call tp_connection_upgrade_contacts() themself. @@ -892,12 +892,12 @@ tp_simple_client_factory_dup_contact_features (TpSimpleClientFactory *self, * Since: 0.15.5 */ void -tp_simple_client_factory_add_contact_features (TpSimpleClientFactory *self, +tp_client_factory_add_contact_features (TpClientFactory *self, const GQuark *features) { guint i; - g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); + g_return_if_fail (TP_IS_CLIENT_FACTORY (self)); g_return_if_fail (features != NULL); /* Add features into desired_contact_features avoiding dups */ @@ -922,19 +922,19 @@ tp_simple_client_factory_add_contact_features (TpSimpleClientFactory *self, } /** - * tp_simple_client_factory_add_contact_features_varargs: (skip) - * @self: a #TpSimpleClientFactory + * tp_client_factory_add_contact_features_varargs: (skip) + * @self: a #TpClientFactory * @feature: the first feature * @...: the second and subsequent features, if any, ending with 0 * - * The same as tp_simple_client_factory_add_contact_features(), but with a + * The same as tp_client_factory_add_contact_features(), but with a * more convenient calling convention from C. * * Since: 0.15.5 */ void -tp_simple_client_factory_add_contact_features_varargs ( - TpSimpleClientFactory *self, +tp_client_factory_add_contact_features_varargs ( + TpClientFactory *self, GQuark feature, ...) { @@ -942,7 +942,7 @@ tp_simple_client_factory_add_contact_features_varargs ( GArray *features; GQuark f; - g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); + g_return_if_fail (TP_IS_CLIENT_FACTORY (self)); va_start (var_args, feature); features = g_array_new (TRUE, FALSE, sizeof (GQuark)); @@ -951,7 +951,7 @@ tp_simple_client_factory_add_contact_features_varargs ( f = va_arg (var_args, GQuark)) g_array_append_val (features, f); - tp_simple_client_factory_add_contact_features (self, + tp_client_factory_add_contact_features (self, (const GQuark *) features->data); g_array_unref (features); @@ -959,8 +959,8 @@ tp_simple_client_factory_add_contact_features_varargs ( } /** - * tp_simple_client_factory_ensure_channel_request: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_ensure_channel_request: + * @self: a #TpClientFactory object * @object_path: the object path of a channel request * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the channel request @@ -980,14 +980,14 @@ tp_simple_client_factory_add_contact_features_varargs ( * Since: 0.15.5 */ TpChannelRequest * -_tp_simple_client_factory_ensure_channel_request (TpSimpleClientFactory *self, +_tp_client_factory_ensure_channel_request (TpClientFactory *self, const gchar *object_path, GHashTable *immutable_properties, GError **error) { TpChannelRequest *request; - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); request = lookup_proxy (self, object_path); @@ -1011,8 +1011,8 @@ _tp_simple_client_factory_ensure_channel_request (TpSimpleClientFactory *self, } /** - * tp_simple_client_factory_ensure_channel_dispatch_operation: - * @self: a #TpSimpleClientFactory object + * tp_client_factory_ensure_channel_dispatch_operation: + * @self: a #TpClientFactory object * @object_path: the object path of a channel dispatch operation * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the channel dispatch operation @@ -1032,15 +1032,15 @@ _tp_simple_client_factory_ensure_channel_request (TpSimpleClientFactory *self, * Since: 0.15.5 */ TpChannelDispatchOperation * -_tp_simple_client_factory_ensure_channel_dispatch_operation ( - TpSimpleClientFactory *self, +_tp_client_factory_ensure_channel_dispatch_operation ( + TpClientFactory *self, const gchar *object_path, GHashTable *immutable_properties, GError **error) { TpChannelDispatchOperation *dispatch; - g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); + g_return_val_if_fail (TP_IS_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); dispatch = lookup_proxy (self, object_path); diff --git a/telepathy-glib/client-factory.h b/telepathy-glib/client-factory.h new file mode 100644 index 000000000..58c88d6c6 --- /dev/null +++ b/telepathy-glib/client-factory.h @@ -0,0 +1,162 @@ +/* + * A factory for TpContacts and plain subclasses of TpProxy + * + * Copyright © 2011 Collabora Ltd. + * + * 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 __TP_CLIENT_FACTORY_H__ +#define __TP_CLIENT_FACTORY_H__ + +#include <telepathy-glib/account.h> +#include <telepathy-glib/channel.h> +#include <telepathy-glib/channel-dispatch-operation.h> +#include <telepathy-glib/channel-request.h> +#include <telepathy-glib/connection.h> +#include <telepathy-glib/contact.h> +#include <telepathy-glib/dbus-daemon.h> + +G_BEGIN_DECLS + +/* TpClientFactory is typedef'd in proxy.h */ +typedef struct _TpClientFactoryPrivate TpClientFactoryPrivate; +typedef struct _TpClientFactoryClass TpClientFactoryClass; + +struct _TpClientFactoryClass { + /*<public>*/ + GObjectClass parent_class; + + /* TpAccount */ + TpAccount * (*create_account) (TpClientFactory *self, + const gchar *object_path, + const GHashTable *immutable_properties, + GError **error); + GArray * (*dup_account_features) (TpClientFactory *self, + TpAccount *account); + + /* TpConnection */ + TpConnection * (*create_connection) (TpClientFactory *self, + const gchar *object_path, + const GHashTable *immutable_properties, + GError **error); + GArray * (*dup_connection_features) (TpClientFactory *self, + TpConnection *connection); + + /* TpChannel */ + TpChannel * (*create_channel) (TpClientFactory *self, + TpConnection *conn, + const gchar *object_path, + const GHashTable *immutable_properties, + GError **error); + GArray * (*dup_channel_features) (TpClientFactory *self, + TpChannel *channel); + + /* TpContact */ + TpContact * (*create_contact) (TpClientFactory *self, + TpConnection *connection, + TpHandle handle, + const gchar *identifier); + GArray * (*dup_contact_features) (TpClientFactory *self, + TpConnection *connection); + + /*<private>*/ + GCallback padding[20]; +}; + +struct _TpClientFactory { + /*<private>*/ + GObject parent; + TpClientFactoryPrivate *priv; +}; + +GType tp_client_factory_get_type (void); + +#define TP_TYPE_CLIENT_FACTORY \ + (tp_client_factory_get_type ()) +#define TP_CLIENT_FACTORY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CLIENT_FACTORY, \ + TpClientFactory)) +#define TP_CLIENT_FACTORY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CLIENT_FACTORY, \ + TpClientFactoryClass)) +#define TP_IS_CLIENT_FACTORY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CLIENT_FACTORY)) +#define TP_IS_CLIENT_FACTORY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CLIENT_FACTORY)) +#define TP_CLIENT_FACTORY_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CLIENT_FACTORY, \ + TpClientFactoryClass)) + +TpClientFactory * tp_client_factory_new (TpDBusDaemon *dbus); + +TpDBusDaemon *tp_client_factory_get_dbus_daemon (TpClientFactory *self); + +/* TpAccount */ +TpAccount *tp_client_factory_ensure_account (TpClientFactory *self, + const gchar *object_path, + const GHashTable *immutable_properties, + GError **error); +GArray *tp_client_factory_dup_account_features (TpClientFactory *self, + TpAccount *account); +void tp_client_factory_add_account_features (TpClientFactory *self, + const GQuark *features); +void tp_client_factory_add_account_features_varargs (TpClientFactory *self, + GQuark feature, + ...); + +/* TpConnection */ +TpConnection *tp_client_factory_ensure_connection (TpClientFactory *self, + const gchar *object_path, + const GHashTable *immutable_properties, + GError **error); +GArray *tp_client_factory_dup_connection_features (TpClientFactory *self, + TpConnection *connection); +void tp_client_factory_add_connection_features (TpClientFactory *self, + const GQuark *features); +void tp_client_factory_add_connection_features_varargs (TpClientFactory *self, + GQuark feature, + ...); + +/* TpChannel */ +TpChannel *tp_client_factory_ensure_channel (TpClientFactory *self, + TpConnection *connection, + const gchar *object_path, + const GHashTable *immutable_properties, + GError **error); +GArray *tp_client_factory_dup_channel_features (TpClientFactory *self, + TpChannel *channel); +void tp_client_factory_add_channel_features (TpClientFactory *self, + const GQuark *features); +void tp_client_factory_add_channel_features_varargs (TpClientFactory *self, + GQuark feature, + ...); + +/* TpContact */ +TpContact *tp_client_factory_ensure_contact (TpClientFactory *self, + TpConnection *connection, + TpHandle handle, + const gchar *identifier); +GArray *tp_client_factory_dup_contact_features (TpClientFactory *self, + TpConnection *connection); +void tp_client_factory_add_contact_features (TpClientFactory *self, + const GQuark *features); +void tp_client_factory_add_contact_features_varargs (TpClientFactory *self, + GQuark feature, + ...); + +G_END_DECLS + +#endif diff --git a/telepathy-glib/connection-contact-list.c b/telepathy-glib/connection-contact-list.c index 0a550127d..965632beb 100644 --- a/telepathy-glib/connection-contact-list.c +++ b/telepathy-glib/connection-contact-list.c @@ -26,7 +26,7 @@ #include <telepathy-glib/cli-misc.h> #include <telepathy-glib/dbus.h> #include <telepathy-glib/interfaces.h> -#include <telepathy-glib/simple-client-factory.h> +#include <telepathy-glib/client-factory.h> #include <telepathy-glib/util.h> #define DEBUG_FLAG TP_DEBUG_CONNECTION @@ -176,7 +176,7 @@ process_queued_contacts_changed (TpConnection *self) if (contact != NULL) continue; - contact = tp_simple_client_factory_ensure_contact ( + contact = tp_client_factory_ensure_contact ( tp_proxy_get_factory (self), self, handle, identifier); _tp_contact_set_subscription_states (contact, value); g_ptr_array_add (item->new_contacts, contact); @@ -188,7 +188,7 @@ process_queued_contacts_changed (TpConnection *self) return; } - features = tp_simple_client_factory_dup_contact_features ( + features = tp_client_factory_dup_contact_features ( tp_proxy_get_factory (self), self); tp_connection_upgrade_contacts (self, @@ -259,7 +259,7 @@ got_contact_list_attributes_cb (TpConnection *self, TpContact *contact; GError *e = NULL; - contact = tp_simple_client_factory_ensure_contact ( + contact = tp_client_factory_ensure_contact ( tp_proxy_get_factory (self), self, handle, id); if (!_tp_contact_set_attributes (contact, value, (const GQuark *) features->data, &e)) @@ -309,7 +309,7 @@ prepare_roster (TpConnection *self, tp_cli_connection_interface_contact_list_connect_to_contacts_changed ( self, contacts_changed_cb, NULL, NULL, NULL, NULL); - features = tp_simple_client_factory_dup_contact_features ( + features = tp_client_factory_dup_contact_features ( tp_proxy_get_factory (self), self); supported_interfaces = _tp_contacts_bind_to_signals (self, @@ -656,7 +656,7 @@ _tp_connection_prepare_contact_groups_async (TpProxy *proxy, * %TP_CONTACT_LIST_STATE_SUCCESS, all #TpContact objects will also be created * and prepared with the desired features. See tp_connection_dup_contact_list() * to get the list of contacts, and - * tp_simple_client_factory_add_contact_features() to define which features + * tp_client_factory_add_contact_features() to define which features * needs to be prepared on them. * * This feature will fail to prepare when using obsolete Telepathy connection @@ -753,7 +753,7 @@ tp_connection_get_request_uses_message (TpConnection *self) * Retrieves the user's contact list. In general, blocked contacts are not * included in this list. The #TpContact objects returned are guaranteed to * have all of the features previously passed to - * tp_simple_client_factory_add_contact_features() prepared. + * tp_client_factory_add_contact_features() prepared. * * Before calling this method, you must first call tp_proxy_prepare_async() with * the %TP_CONNECTION_FEATURE_CONTACT_LIST feature, and verify that @@ -1749,7 +1749,7 @@ process_queued_blocked_changed (TpConnection *self) const gchar *identifier = value; TpContact *contact; - contact = tp_simple_client_factory_ensure_contact ( + contact = tp_client_factory_ensure_contact ( tp_proxy_get_factory (self), self, handle, identifier); g_ptr_array_add (item->added_contacts, contact); @@ -1765,7 +1765,7 @@ process_queued_blocked_changed (TpConnection *self) const gchar *identifier = value; TpContact *contact; - contact = tp_simple_client_factory_ensure_contact ( + contact = tp_client_factory_ensure_contact ( tp_proxy_get_factory (self), self, handle, identifier); g_ptr_array_add (item->removed_contacts, contact); @@ -1781,7 +1781,7 @@ process_queued_blocked_changed (TpConnection *self) return; } - features = tp_simple_client_factory_dup_contact_features ( + features = tp_client_factory_dup_contact_features ( tp_proxy_get_factory (self), self); tp_connection_upgrade_contacts (self, diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index ba615748c..392380a19 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -47,7 +47,7 @@ #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" -#include "telepathy-glib/simple-client-factory-internal.h" +#include "telepathy-glib/client-factory-internal.h" #include "telepathy-glib/util-internal.h" #include "_gen/tp-cli-connection-body.h" @@ -850,13 +850,13 @@ tp_connection_got_self_contact_cb (TpConnection *self, static void get_self_contact (TpConnection *self) { - TpSimpleClientFactory *factory; + TpClientFactory *factory; GArray *features; factory = tp_proxy_get_factory (self); - features = tp_simple_client_factory_dup_contact_features (factory, self); + features = tp_client_factory_dup_contact_features (factory, self); - /* FIXME: We should use tp_simple_client_factory_ensure_contact(), but that would + /* FIXME: We should use tp_client_factory_ensure_contact(), but that would * require immortal-handles and spec change to give the self identifier. */ /* This relies on the special case in tp_connection_get_contacts_by_handle() * which makes it start working slightly early. */ @@ -1656,7 +1656,7 @@ tp_connection_class_init (TpConnectionClass *klass) * representing the new identifier, and #GObject::notify will be emitted. * * The #TpContact object is guaranteed to have all of the features previously - * passed to tp_simple_client_factory_add_contact_features() prepared. + * passed to tp_client_factory_add_contact_features() prepared. * * To wait for a non-%NULL self-contact (and other properties), call * tp_proxy_prepare_async() with the feature @@ -1977,7 +1977,7 @@ tp_connection_class_init (TpConnectionClass *klass) * #TpConnection::blocked-contacts-changed signal. * * These TpContact objects have been prepared with the desired features. - * See tp_simple_client_factory_add_contact_features() to define which + * See tp_client_factory_add_contact_features() to define which * features needs to be prepared on them. * * For this property to be valid, you must first call @@ -2087,7 +2087,7 @@ tp_connection_class_init (TpConnectionClass *klass) * Notify of changes in the list of contacts as returned by * tp_connection_dup_contact_list(). It is guaranteed that all contacts have * desired features prepared. See - * tp_simple_client_factory_add_contact_features() to define which features + * tp_client_factory_add_contact_features() to define which features * needs to be prepared. * * This signal is also emitted for the initial set of contacts once retrieved. @@ -2116,7 +2116,7 @@ tp_connection_class_init (TpConnectionClass *klass) * * Notify of changes in #TpConnection:blocked-contacts. * It is guaranteed that all contacts have desired features prepared. See - * tp_simple_client_factory_add_contact_features() to define which features + * tp_client_factory_add_contact_features() to define which features * needs to be prepared. * * This signal is also emitted for the initial set of blocked contacts once @@ -2168,7 +2168,7 @@ tp_connection_new (TpDBusDaemon *dbus, } TpConnection * -_tp_connection_new_with_factory (TpSimpleClientFactory *factory, +_tp_connection_new_with_factory (TpClientFactory *factory, TpDBusDaemon *dbus, const gchar *bus_name, const gchar *object_path, diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c index ea7ae3e3e..9c84c58c7 100644 --- a/telepathy-glib/contact.c +++ b/telepathy-glib/contact.c @@ -1607,7 +1607,7 @@ _tp_contact_new (TpConnection *connection, /* FIXME: Ideally this should be replaced with * - * tp_simple_client_factory_ensure_contact (tp_proxy_get_factory (connection), + * tp_client_factory_ensure_contact (tp_proxy_get_factory (connection), * handle, identifier); * * but we cannot assert CM has immortal handles (yet). That means we cannot diff --git a/telepathy-glib/dbus-tube-channel.c b/telepathy-glib/dbus-tube-channel.c index d5491f429..8e9228477 100644 --- a/telepathy-glib/dbus-tube-channel.c +++ b/telepathy-glib/dbus-tube-channel.c @@ -449,7 +449,7 @@ tp_dbus_tube_channel_init (TpDBusTubeChannel *self) TpDBusTubeChannel * _tp_dbus_tube_channel_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, diff --git a/telepathy-glib/file-transfer-channel.c b/telepathy-glib/file-transfer-channel.c index f5f40948c..6d5cc81a4 100644 --- a/telepathy-glib/file-transfer-channel.c +++ b/telepathy-glib/file-transfer-channel.c @@ -1073,7 +1073,7 @@ tp_file_transfer_channel_new (TpConnection *conn, TpFileTransferChannel * _tp_file_transfer_channel_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, diff --git a/telepathy-glib/introspection.am b/telepathy-glib/introspection.am index 282e3d0b5..29a5ffb0e 100644 --- a/telepathy-glib/introspection.am +++ b/telepathy-glib/introspection.am @@ -47,7 +47,7 @@ TelepathyGLib_1_gir_FILES = \ $(srcdir)/debug.c $(srcdir)/debug.h \ $(srcdir)/base-client.c $(srcdir)/base-client.h \ $(srcdir)/simple-approver.c $(srcdir)/simple-approver.h \ - $(srcdir)/simple-client-factory.c $(srcdir)/simple-client-factory.h \ + $(srcdir)/client-factory.c $(srcdir)/client-factory.h \ $(srcdir)/simple-handler.c $(srcdir)/simple-handler.h \ $(srcdir)/simple-observer.c $(srcdir)/simple-observer.h \ $(srcdir)/dbus-properties-mixin.c $(srcdir)/dbus-properties-mixin.h \ diff --git a/telepathy-glib/proxy-internal.h b/telepathy-glib/proxy-internal.h index 04400367c..a01d02118 100644 --- a/telepathy-glib/proxy-internal.h +++ b/telepathy-glib/proxy-internal.h @@ -44,6 +44,6 @@ gboolean _tp_proxy_will_announce_connected_finish (TpProxy *self, GError **error); void _tp_proxy_ensure_factory (gpointer self, - TpSimpleClientFactory *factory); + TpClientFactory *factory); #endif diff --git a/telepathy-glib/proxy.c b/telepathy-glib/proxy.c index a359bdbbb..c9097dde0 100644 --- a/telepathy-glib/proxy.c +++ b/telepathy-glib/proxy.c @@ -34,7 +34,7 @@ #include "dbus-internal.h" #define DEBUG_FLAG TP_DEBUG_PROXY #include "debug-internal.h" -#include "simple-client-factory-internal.h" +#include "client-factory-internal.h" #include "util-internal.h" @@ -376,7 +376,7 @@ struct _TpProxyPrivate { gboolean dispose_has_run; - TpSimpleClientFactory *factory; + TpClientFactory *factory; }; G_DEFINE_TYPE (TpProxy, tp_proxy, G_TYPE_OBJECT) @@ -1313,12 +1313,12 @@ tp_proxy_class_init (TpProxyClass *klass) /** * TpProxy:factory: * - * The #TpSimpleClientFactory used to create this proxy, + * The #TpClientFactory used to create this proxy, * or %NULL if this proxy was not created through a factory. */ param_spec = g_param_spec_object ("factory", "Simple Client Factory", - "The TpSimpleClientFactory used to create this proxy", - TP_TYPE_SIMPLE_CLIENT_FACTORY, + "The TpClientFactory used to create this proxy", + TP_TYPE_CLIENT_FACTORY, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FACTORY, param_spec); @@ -1381,7 +1381,7 @@ tp_proxy_class_init (TpProxyClass *klass) * * Since: 0.15.5 */ -TpSimpleClientFactory * +TpClientFactory * tp_proxy_get_factory (gpointer self) { TpProxy *proxy = self; @@ -1393,7 +1393,7 @@ tp_proxy_get_factory (gpointer self) void _tp_proxy_ensure_factory (gpointer proxy, - TpSimpleClientFactory *factory) + TpClientFactory *factory) { TpProxy *self = TP_PROXY (proxy); @@ -1409,7 +1409,7 @@ _tp_proxy_ensure_factory (gpointer proxy, self->priv->factory = tp_automatic_client_factory_new (self->dbus_daemon); } - _tp_simple_client_factory_insert_proxy (self->priv->factory, self); + _tp_client_factory_insert_proxy (self->priv->factory, self); } /** diff --git a/telepathy-glib/proxy.h b/telepathy-glib/proxy.h index 18a1de53c..87c917bd3 100644 --- a/telepathy-glib/proxy.h +++ b/telepathy-glib/proxy.h @@ -32,8 +32,8 @@ G_BEGIN_DECLS /* Forward declaration of a subclass - from dbus.h */ typedef struct _TpDBusDaemon TpDBusDaemon; -/* Forward declaration - from simple-client-factory.h */ -typedef struct _TpSimpleClientFactory TpSimpleClientFactory; +/* Forward declaration - from client-factory.h */ +typedef struct _TpClientFactory TpClientFactory; typedef struct _TpProxyPrivate TpProxyPrivate; @@ -156,7 +156,7 @@ GType tp_proxy_get_type (void); gboolean tp_proxy_has_interface_by_id (gpointer self, GQuark iface); gboolean tp_proxy_has_interface (gpointer self, const gchar *iface); -TpSimpleClientFactory *tp_proxy_get_factory (gpointer self); +TpClientFactory *tp_proxy_get_factory (gpointer self); TpDBusDaemon *tp_proxy_get_dbus_daemon (gpointer self); diff --git a/telepathy-glib/simple-approver.c b/telepathy-glib/simple-approver.c index 093b1049c..c8a408a13 100644 --- a/telepathy-glib/simple-approver.c +++ b/telepathy-glib/simple-approver.c @@ -279,7 +279,7 @@ tp_simple_approver_class_init (TpSimpleApproverClass *cls) * * Since 0.UNRELEASED this won't create a #TpAccountManager anymore, but will * instead create a new #TpAutomaticClientFactory. If user already has a - * #TpAccountManager or #TpSimpleClientFactory it is recommended to use + * #TpAccountManager or #TpClientFactory it is recommended to use * tp_simple_approver_new_with_am() or tp_simple_approver_new_with_factory() * instead. * @@ -345,7 +345,7 @@ tp_simple_approver_new_with_am (TpAccountManager *account_manager, /** * tp_simple_approver_new_with_factory: - * @factory: an #TpSimpleClientFactory, which may not be %NULL + * @factory: an #TpClientFactory, which may not be %NULL * @name: the name of the Approver (see #TpBaseClient:name for details) * @uniquify: the value of the #TpBaseClient:uniquify-name property * @callback: the function called when AddDispatchOperation is called @@ -354,14 +354,14 @@ tp_simple_approver_new_with_am (TpAccountManager *account_manager, * is destroyed * * Convenient function to create a new #TpSimpleApprover instance with a - * specified #TpSimpleClientFactory. + * specified #TpClientFactory. * * Returns: (type TelepathyGLib.SimpleApprover): a new #TpSimpleApprover * * Since: 0.15.5 */ TpBaseClient * -tp_simple_approver_new_with_factory (TpSimpleClientFactory *factory, +tp_simple_approver_new_with_factory (TpClientFactory *factory, const gchar *name, gboolean uniquify, TpSimpleApproverAddDispatchOperationImpl callback, diff --git a/telepathy-glib/simple-approver.h b/telepathy-glib/simple-approver.h index a75a80e46..c312b26cb 100644 --- a/telepathy-glib/simple-approver.h +++ b/telepathy-glib/simple-approver.h @@ -88,7 +88,7 @@ TpBaseClient *tp_simple_approver_new_with_am ( GDestroyNotify destroy); TpBaseClient *tp_simple_approver_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, const gchar *name, gboolean uniquify, TpSimpleApproverAddDispatchOperationImpl callback, diff --git a/telepathy-glib/simple-client-factory.h b/telepathy-glib/simple-client-factory.h deleted file mode 100644 index 375fb05b8..000000000 --- a/telepathy-glib/simple-client-factory.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * A factory for TpContacts and plain subclasses of TpProxy - * - * Copyright © 2011 Collabora Ltd. - * - * 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 __TP_SIMPLE_CLIENT_FACTORY_H__ -#define __TP_SIMPLE_CLIENT_FACTORY_H__ - -#include <telepathy-glib/account.h> -#include <telepathy-glib/channel.h> -#include <telepathy-glib/channel-dispatch-operation.h> -#include <telepathy-glib/channel-request.h> -#include <telepathy-glib/connection.h> -#include <telepathy-glib/contact.h> -#include <telepathy-glib/dbus-daemon.h> - -G_BEGIN_DECLS - -/* TpSimpleClientFactory is typedef'd in proxy.h */ -typedef struct _TpSimpleClientFactoryPrivate TpSimpleClientFactoryPrivate; -typedef struct _TpSimpleClientFactoryClass TpSimpleClientFactoryClass; - -struct _TpSimpleClientFactoryClass { - /*<public>*/ - GObjectClass parent_class; - - /* TpAccount */ - TpAccount * (*create_account) (TpSimpleClientFactory *self, - const gchar *object_path, - const GHashTable *immutable_properties, - GError **error); - GArray * (*dup_account_features) (TpSimpleClientFactory *self, - TpAccount *account); - - /* TpConnection */ - TpConnection * (*create_connection) (TpSimpleClientFactory *self, - const gchar *object_path, - const GHashTable *immutable_properties, - GError **error); - GArray * (*dup_connection_features) (TpSimpleClientFactory *self, - TpConnection *connection); - - /* TpChannel */ - TpChannel * (*create_channel) (TpSimpleClientFactory *self, - TpConnection *conn, - const gchar *object_path, - const GHashTable *immutable_properties, - GError **error); - GArray * (*dup_channel_features) (TpSimpleClientFactory *self, - TpChannel *channel); - - /* TpContact */ - TpContact * (*create_contact) (TpSimpleClientFactory *self, - TpConnection *connection, - TpHandle handle, - const gchar *identifier); - GArray * (*dup_contact_features) (TpSimpleClientFactory *self, - TpConnection *connection); - - /*<private>*/ - GCallback padding[20]; -}; - -struct _TpSimpleClientFactory { - /*<private>*/ - GObject parent; - TpSimpleClientFactoryPrivate *priv; -}; - -GType tp_simple_client_factory_get_type (void); - -#define TP_TYPE_SIMPLE_CLIENT_FACTORY \ - (tp_simple_client_factory_get_type ()) -#define TP_SIMPLE_CLIENT_FACTORY(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_SIMPLE_CLIENT_FACTORY, \ - TpSimpleClientFactory)) -#define TP_SIMPLE_CLIENT_FACTORY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_SIMPLE_CLIENT_FACTORY, \ - TpSimpleClientFactoryClass)) -#define TP_IS_SIMPLE_CLIENT_FACTORY(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_SIMPLE_CLIENT_FACTORY)) -#define TP_IS_SIMPLE_CLIENT_FACTORY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_SIMPLE_CLIENT_FACTORY)) -#define TP_SIMPLE_CLIENT_FACTORY_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_SIMPLE_CLIENT_FACTORY, \ - TpSimpleClientFactoryClass)) - -TpSimpleClientFactory * tp_simple_client_factory_new (TpDBusDaemon *dbus); - -TpDBusDaemon *tp_simple_client_factory_get_dbus_daemon ( - TpSimpleClientFactory *self); - -/* TpAccount */ -TpAccount *tp_simple_client_factory_ensure_account (TpSimpleClientFactory *self, - const gchar *object_path, - const GHashTable *immutable_properties, - GError **error); -GArray *tp_simple_client_factory_dup_account_features ( - TpSimpleClientFactory *self, - TpAccount *account); -void tp_simple_client_factory_add_account_features (TpSimpleClientFactory *self, - const GQuark *features); -void tp_simple_client_factory_add_account_features_varargs ( - TpSimpleClientFactory *self, - GQuark feature, - ...); - -/* TpConnection */ -TpConnection *tp_simple_client_factory_ensure_connection ( - TpSimpleClientFactory *self, - const gchar *object_path, - const GHashTable *immutable_properties, - GError **error); -GArray *tp_simple_client_factory_dup_connection_features ( - TpSimpleClientFactory *self, - TpConnection *connection); -void tp_simple_client_factory_add_connection_features ( - TpSimpleClientFactory *self, - const GQuark *features); -void tp_simple_client_factory_add_connection_features_varargs ( - TpSimpleClientFactory *self, - GQuark feature, - ...); - -/* TpChannel */ -TpChannel *tp_simple_client_factory_ensure_channel (TpSimpleClientFactory *self, - TpConnection *connection, - const gchar *object_path, - const GHashTable *immutable_properties, - GError **error); -GArray *tp_simple_client_factory_dup_channel_features ( - TpSimpleClientFactory *self, - TpChannel *channel); -void tp_simple_client_factory_add_channel_features (TpSimpleClientFactory *self, - const GQuark *features); -void tp_simple_client_factory_add_channel_features_varargs ( - TpSimpleClientFactory *self, - GQuark feature, - ...); - -/* TpContact */ -TpContact *tp_simple_client_factory_ensure_contact (TpSimpleClientFactory *self, - TpConnection *connection, - TpHandle handle, - const gchar *identifier); -GArray *tp_simple_client_factory_dup_contact_features ( - TpSimpleClientFactory *self, - TpConnection *connection); -void tp_simple_client_factory_add_contact_features (TpSimpleClientFactory *self, - const GQuark *features); -void tp_simple_client_factory_add_contact_features_varargs ( - TpSimpleClientFactory *self, - GQuark feature, - ...); - -G_END_DECLS - -#endif diff --git a/telepathy-glib/simple-handler.c b/telepathy-glib/simple-handler.c index 729a2c492..c50d28867 100644 --- a/telepathy-glib/simple-handler.c +++ b/telepathy-glib/simple-handler.c @@ -333,7 +333,7 @@ tp_simple_handler_class_init (TpSimpleHandlerClass *cls) * * Since 0.UNRELEASED this won't create a #TpAccountManager anymore, but will * instead create a new #TpAutomaticClientFactory. If user already has a - * #TpAccountManager or #TpSimpleClientFactory it is recommended to use + * #TpAccountManager or #TpClientFactory it is recommended to use * tp_simple_handle_new_with_am() or tp_simple_handle_new_with_factory() * instead. * @@ -411,7 +411,7 @@ tp_simple_handler_new_with_am (TpAccountManager *account_manager, /** * tp_simple_handler_new_with_factory: - * @factory: a #TpSimpleClientFactory, which may not be %NULL + * @factory: a #TpClientFactory, which may not be %NULL * @bypass_approval: the value of the Handler.BypassApproval D-Bus property * (see tp_base_client_set_handler_bypass_approval() for details) * @requests: whether this handler should implement Requests (see @@ -424,14 +424,14 @@ tp_simple_handler_new_with_am (TpAccountManager *account_manager, * is destroyed * * Convenient function to create a new #TpSimpleHandler instance with a - * specified #TpSimpleClientFactory. + * specified #TpClientFactory. * * Returns: (type TelepathyGLib.SimpleHandler): a new #TpSimpleHandler * * Since: 0.15.5 */ TpBaseClient * -tp_simple_handler_new_with_factory (TpSimpleClientFactory *factory, +tp_simple_handler_new_with_factory (TpClientFactory *factory, gboolean bypass_approval, gboolean requests, const gchar *name, diff --git a/telepathy-glib/simple-handler.h b/telepathy-glib/simple-handler.h index 5ff9654af..fbbbd7bd6 100644 --- a/telepathy-glib/simple-handler.h +++ b/telepathy-glib/simple-handler.h @@ -93,7 +93,7 @@ TpBaseClient *tp_simple_handler_new_with_am (TpAccountManager *account_manager, GDestroyNotify destroy); TpBaseClient *tp_simple_handler_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, gboolean bypass_approval, gboolean requests, const gchar *name, diff --git a/telepathy-glib/simple-observer.c b/telepathy-glib/simple-observer.c index fd2a20511..9382d0ceb 100644 --- a/telepathy-glib/simple-observer.c +++ b/telepathy-glib/simple-observer.c @@ -305,7 +305,7 @@ tp_simple_observer_class_init (TpSimpleObserverClass *cls) * * Since 0.UNRELEASED this won't create a #TpAccountManager anymore, but will * instead create a new #TpAutomaticClientFactory. If user already has a - * #TpAccountManager or #TpSimpleClientFactory it is recommended to use + * #TpAccountManager or #TpClientFactory it is recommended to use * tp_simple_observer_new_with_am() or tp_simple_observer_new_with_factory() * instead. * @@ -376,7 +376,7 @@ tp_simple_observer_new_with_am (TpAccountManager *account_manager, /** * tp_simple_observer_new_with_factory: - * @factory: a #TpSimpleClientFactory, which may not be %NULL + * @factory: a #TpClientFactory, which may not be %NULL * @recover: the value of the Observer.Recover D-Bus property * @name: the name of the Observer (see #TpBaseClient:name: for details) * @uniquify: the value of the #TpBaseClient:uniquify-name: property @@ -386,14 +386,14 @@ tp_simple_observer_new_with_am (TpAccountManager *account_manager, * is destroyed * * Convenient function to create a new #TpSimpleObserver instance with a - * specified #TpSimpleClientFactory. + * specified #TpClientFactory. * * Returns: (type TelepathyGLib.SimpleObserver): a new #TpSimpleObserver * * Since: 0.15.5 */ TpBaseClient * -tp_simple_observer_new_with_factory (TpSimpleClientFactory *factory, +tp_simple_observer_new_with_factory (TpClientFactory *factory, gboolean recover, const gchar *name, gboolean uniquify, diff --git a/telepathy-glib/simple-observer.h b/telepathy-glib/simple-observer.h index 9dc7f4c34..7e9f00b7c 100644 --- a/telepathy-glib/simple-observer.h +++ b/telepathy-glib/simple-observer.h @@ -92,7 +92,7 @@ TpBaseClient *tp_simple_observer_new_with_am ( GDestroyNotify destroy); TpBaseClient *tp_simple_observer_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, gboolean recover, const gchar *name, gboolean uniquify, diff --git a/telepathy-glib/stream-tube-channel.c b/telepathy-glib/stream-tube-channel.c index 1dfa50e15..d56155d14 100644 --- a/telepathy-glib/stream-tube-channel.c +++ b/telepathy-glib/stream-tube-channel.c @@ -502,7 +502,7 @@ tp_stream_tube_channel_new (TpConnection *conn, TpStreamTubeChannel * _tp_stream_tube_channel_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, @@ -604,7 +604,7 @@ new_local_connection_identified (TpStreamTubeChannel *self, connection = tp_channel_borrow_connection (TP_CHANNEL (self)); - features = tp_simple_client_factory_dup_contact_features ( + features = tp_client_factory_dup_contact_features ( tp_proxy_get_factory (connection), connection); /* Pass ownership of tube_conn to the function */ @@ -1075,7 +1075,7 @@ connection_identified (TpStreamTubeChannel *self, GArray *features; connection = tp_channel_borrow_connection (TP_CHANNEL (self)); - features = tp_simple_client_factory_dup_contact_features ( + features = tp_client_factory_dup_contact_features ( tp_proxy_get_factory (connection), connection); /* Pass the ref on tube_conn to the function */ diff --git a/telepathy-glib/stream-tube-connection.c b/telepathy-glib/stream-tube-connection.c index 03ea60dc1..efa3149be 100644 --- a/telepathy-glib/stream-tube-connection.c +++ b/telepathy-glib/stream-tube-connection.c @@ -228,7 +228,7 @@ tp_stream_tube_connection_class_init (TpStreamTubeConnectionClass *cls) * * If not %NULL, the #TpContact objects is guaranteed to have all of the * features previously passed to - * tp_simple_client_factory_add_contact_features() prepared. + * tp_client_factory_add_contact_features() prepared. * * Since: 0.13.2 */ diff --git a/telepathy-glib/telepathy-glib.h b/telepathy-glib/telepathy-glib.h index 4f06d6957..5b7dd17c6 100644 --- a/telepathy-glib/telepathy-glib.h +++ b/telepathy-glib/telepathy-glib.h @@ -64,7 +64,7 @@ #include <telepathy-glib/proxy.h> #include <telepathy-glib/signalled-message.h> #include <telepathy-glib/simple-approver.h> -#include <telepathy-glib/simple-client-factory.h> +#include <telepathy-glib/client-factory.h> #include <telepathy-glib/simple-handler.h> #include <telepathy-glib/simple-observer.h> #include <telepathy-glib/stream-tube-channel.h> diff --git a/telepathy-glib/text-channel.c b/telepathy-glib/text-channel.c index 808c56436..e27bb1e4c 100644 --- a/telepathy-glib/text-channel.c +++ b/telepathy-glib/text-channel.c @@ -946,7 +946,7 @@ tp_text_channel_class_init (TpTextChannelClass *klass) * * It is guaranteed that @message's #TpSignalledMessage:sender has all of the * features previously passed to - * tp_simple_client_factory_add_contact_features() prepared. + * tp_client_factory_add_contact_features() prepared. * * Since: 0.13.10 */ @@ -970,7 +970,7 @@ tp_text_channel_class_init (TpTextChannelClass *klass) * * It is guaranteed that @message's #TpSignalledMessage:sender has all of the * features previously passed to - * tp_simple_client_factory_add_contact_features() prepared. + * tp_client_factory_add_contact_features() prepared. * * Since: 0.13.10 */ @@ -996,7 +996,7 @@ tp_text_channel_class_init (TpTextChannelClass *klass) * * It is guaranteed that @message's #TpSignalledMessage:sender has all of the * features previously passed to - * tp_simple_client_factory_add_contact_features() prepared. + * tp_client_factory_add_contact_features() prepared. * * Since: 0.13.10 */ @@ -1050,7 +1050,7 @@ tp_text_channel_new (TpConnection *conn, TpTextChannel * _tp_text_channel_new_with_factory ( - TpSimpleClientFactory *factory, + TpClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, @@ -1165,7 +1165,7 @@ tp_text_channel_get_feature_quark_incoming_messages (void) * * It is guaranteed that the #TpSignalledMessage:sender of each * #TpSignalledMessage has all of the features previously passed to - * tp_simple_client_factory_add_contact_features() prepared. + * tp_client_factory_add_contact_features() prepared. * * Returns: (transfer container) (element-type TelepathyGLib.SignalledMessage): * a #GList of borrowed #TpSignalledMessage diff --git a/telepathy-glib/util-internal.h b/telepathy-glib/util-internal.h index d85110b19..9cd86ac50 100644 --- a/telepathy-glib/util-internal.h +++ b/telepathy-glib/util-internal.h @@ -41,7 +41,7 @@ GSocketAddress * _tp_create_temp_unix_socket (GSocketService *service, GError **error); #endif /* HAVE_GIO_UNIX */ -GList * _tp_create_channel_request_list (TpSimpleClientFactory *factory, +GList * _tp_create_channel_request_list (TpClientFactory *factory, GHashTable *request_props); /* Copied from wocky/wocky-utils.h */ diff --git a/telepathy-glib/util.c b/telepathy-glib/util.c index 857b2aca8..2c1a0a872 100644 --- a/telepathy-glib/util.c +++ b/telepathy-glib/util.c @@ -48,7 +48,7 @@ #define DEBUG_FLAG TP_DEBUG_MISC #include "debug-internal.h" -#include "simple-client-factory-internal.h" +#include "client-factory-internal.h" /** * tp_g_ptr_array_contains: @@ -1530,7 +1530,7 @@ _tp_create_temp_unix_socket (GSocketService *service, #endif /* HAVE_GIO_UNIX */ GList * -_tp_create_channel_request_list (TpSimpleClientFactory *factory, +_tp_create_channel_request_list (TpClientFactory *factory, GHashTable *request_props) { GHashTableIter iter; @@ -1545,7 +1545,7 @@ _tp_create_channel_request_list (TpSimpleClientFactory *factory, GHashTable *props = value; GError *error = NULL; - req = _tp_simple_client_factory_ensure_channel_request (factory, path, + req = _tp_client_factory_ensure_channel_request (factory, path, props, &error); if (req == NULL) { diff --git a/tests/dbus/call-channel.c b/tests/dbus/call-channel.c index 71c53b7ae..f21339346 100644 --- a/tests/dbus/call-channel.c +++ b/tests/dbus/call-channel.c @@ -42,7 +42,7 @@ typedef struct ExampleCallConnectionManager *service_cm; - TpSimpleClientFactory *factory; + TpClientFactory *factory; TpConnectionManager *cm; TpConnection *conn; TpChannel *chan; @@ -108,11 +108,11 @@ setup (Test *test, g_assert_no_error (test->error); test->factory = tp_automatic_client_factory_new (test->dbus); - tp_simple_client_factory_add_channel_features_varargs (test->factory, + tp_client_factory_add_channel_features_varargs (test->factory, TP_CHANNEL_FEATURE_CONTACTS, 0); - test->conn = tp_simple_client_factory_ensure_connection (test->factory, + test->conn = tp_client_factory_ensure_connection (test->factory, object_path, NULL, &test->error); g_assert_no_error (test->error); g_assert (test->conn != NULL); @@ -151,7 +151,7 @@ channel_created_cb (TpConnection *connection, g_assert_no_error ((GError *) error); - test->chan = tp_simple_client_factory_ensure_channel (test->factory, + test->chan = tp_client_factory_ensure_channel (test->factory, connection, object_path, immutable_properties, &new_error); g_assert_no_error (new_error); @@ -874,7 +874,7 @@ expect_incoming_call_cb (TpConnection *conn, /* we only expect to receive one call */ g_assert (test->chan == NULL); - test->chan = tp_simple_client_factory_ensure_channel (test->factory, + test->chan = tp_client_factory_ensure_channel (test->factory, conn, object_path, properties, &error); g_assert_no_error (error); diff --git a/tests/dbus/channel.c b/tests/dbus/channel.c index 3f2aa29ec..87af988b8 100644 --- a/tests/dbus/channel.c +++ b/tests/dbus/channel.c @@ -595,7 +595,7 @@ static void test_contacts (Test *test, gconstpointer data G_GNUC_UNUSED) { - TpSimpleClientFactory *factory; + TpClientFactory *factory; const gchar *id = "badger"; const gchar *alias1 = "Alias 1"; const gchar *alias2 = "Alias 2"; @@ -607,7 +607,7 @@ test_contacts (Test *test, /* Tell factory we want to prepare ALIAS feature on TpContact objects */ factory = tp_proxy_get_factory (test->connection); - tp_simple_client_factory_add_contact_features_varargs (factory, + tp_client_factory_add_contact_features_varargs (factory, TP_CONTACT_FEATURE_ALIAS, 0); diff --git a/tests/dbus/contacts.c b/tests/dbus/contacts.c index 5a013d6be..6e62a8b84 100644 --- a/tests/dbus/contacts.c +++ b/tests/dbus/contacts.c @@ -2481,7 +2481,7 @@ test_contact_list (Fixture *f, const GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONTACT_LIST, 0 }; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpTestsContactListManager *manager; - TpSimpleClientFactory *factory; + TpClientFactory *factory; const gchar *id = "contact-list-id"; const gchar *alias = "Contact List Alias"; const gchar *message = "I'm your best friend"; @@ -2509,7 +2509,7 @@ test_contact_list (Fixture *f, /* Tell connection's factory contact features we want */ factory = tp_proxy_get_factory (f->client_conn); - tp_simple_client_factory_add_contact_features_varargs (factory, + tp_client_factory_add_contact_features_varargs (factory, TP_CONTACT_FEATURE_ALIAS, 0); @@ -2546,11 +2546,11 @@ test_self_contact (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { const GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; - TpSimpleClientFactory *factory; + TpClientFactory *factory; TpContact *contact; factory = tp_proxy_get_factory (f->client_conn); - tp_simple_client_factory_add_contact_features_varargs (factory, + tp_client_factory_add_contact_features_varargs (factory, TP_CONTACT_FEATURE_ALIAS, 0); diff --git a/tests/dbus/dbus-tube.c b/tests/dbus/dbus-tube.c index d9492c654..7d2a5a9ac 100644 --- a/tests/dbus/dbus-tube.c +++ b/tests/dbus/dbus-tube.c @@ -87,7 +87,7 @@ create_tube_service (Test *test, TpHandle handle, alf_handle; GHashTable *props; GType type; - TpSimpleClientFactory *factory; + TpClientFactory *factory; /* If previous tube is still preparing, refs are kept on it. We want it to be * destroyed now otherwise it will get reused by the factory. */ @@ -138,7 +138,7 @@ create_tube_service (Test *test, g_object_get (test->tube_chan_service, "channel-properties", &props, NULL); factory = tp_proxy_get_factory (test->connection); - test->tube = (TpDBusTubeChannel *) tp_simple_client_factory_ensure_channel ( + test->tube = (TpDBusTubeChannel *) tp_client_factory_ensure_channel ( factory, test->connection, chan_path, props, &test->error); g_assert (TP_IS_DBUS_TUBE_CHANNEL (test->tube)); diff --git a/tests/dbus/text-channel.c b/tests/dbus/text-channel.c index 92603e521..0512bd24d 100644 --- a/tests/dbus/text-channel.c +++ b/tests/dbus/text-channel.c @@ -837,7 +837,7 @@ test_sender_prepared (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, 0 }; - TpSimpleClientFactory *factory; + TpClientFactory *factory; TpHandle admin; TpContact *sender; TpMessage *msg; @@ -863,7 +863,7 @@ test_sender_prepared (Test *test, /* Now ask to prepare ALIAS, on next msg it will be prepared */ factory = tp_proxy_get_factory (test->connection); - tp_simple_client_factory_add_contact_features_varargs (factory, + tp_client_factory_add_contact_features_varargs (factory, TP_CONTACT_FEATURE_ALIAS, 0); |