diff options
| author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-04-17 16:06:29 +0200 |
|---|---|---|
| committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-04-30 11:47:19 +0200 |
| commit | 87222101f944e535c43a934d0c507be0e9c98967 (patch) | |
| tree | f1ba5819afcc0ac1812bbdf8dd9a7dc6d5d4fc45 | |
| parent | 36dabfbf9f770e83bfd10e082435d24dd79aa2c3 (diff) | |
Rename TpRoomListChannel to TpRoomList
It's not a TpChannel any more.
| -rw-r--r-- | docs/reference/telepathy-glib-docs.sgml | 2 | ||||
| -rw-r--r-- | docs/reference/telepathy-glib-sections.txt | 44 | ||||
| -rw-r--r-- | telepathy-glib/Makefile.am | 4 | ||||
| -rw-r--r-- | telepathy-glib/introspection.am | 2 | ||||
| -rw-r--r-- | telepathy-glib/room-list-channel.h | 80 | ||||
| -rw-r--r-- | telepathy-glib/room-list.c (renamed from telepathy-glib/room-list-channel.c) | 162 | ||||
| -rw-r--r-- | telepathy-glib/room-list.h | 80 | ||||
| -rw-r--r-- | telepathy-glib/telepathy-glib.h | 2 | ||||
| -rw-r--r-- | tests/dbus/Makefile.am | 10 | ||||
| -rw-r--r-- | tests/dbus/room-list.c (renamed from tests/dbus/room-list-channel.c) | 24 |
10 files changed, 202 insertions, 208 deletions
diff --git a/docs/reference/telepathy-glib-docs.sgml b/docs/reference/telepathy-glib-docs.sgml index 703a815fb..6a6aea656 100644 --- a/docs/reference/telepathy-glib-docs.sgml +++ b/docs/reference/telepathy-glib-docs.sgml @@ -100,7 +100,7 @@ <xi:include href="xml/call-misc.xml"/> <xi:include href="xml/debug-client.xml"/> <xi:include href="xml/debug-message.xml"/> - <xi:include href="xml/room-list-channel.xml"/> + <xi:include href="xml/room-list.xml"/> <xi:include href="xml/room-info.xml"/> </chapter> diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt index a69efa711..2f5716bec 100644 --- a/docs/reference/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib-sections.txt @@ -7233,29 +7233,31 @@ TpDebugMessagePriv </SECTION> <SECTION> -<FILE>room-list-channel</FILE> -<TITLE>room-list-channel</TITLE> +<FILE>room-list</FILE> +<TITLE>room-list</TITLE> <INCLUDE>telepathy-glib/telepathy-glib.h</INCLUDE> <SUBSECTION> -TpRoomListChannel -TpRoomListChannelClass -tp_room_list_channel_new_async -tp_room_list_channel_new_finish -tp_room_list_channel_get_listing -tp_room_list_channel_get_server -tp_room_list_channel_get_account -<SUBSECTION Standard> -TP_IS_ROOM_LIST_CHANNEL -TP_IS_ROOM_LIST_CHANNEL_CLASS -TP_ROOM_LIST_CHANNEL -TP_ROOM_LIST_CHANNEL_CLASS -TP_ROOM_LIST_CHANNEL_FEATURE_LISTING -TP_ROOM_LIST_CHANNEL_GET_CLASS -TP_TYPE_ROOM_LIST_CHANNEL -tp_room_list_channel_get_type +TpRoomList +TpRoomListClass +tp_room_list_new_async +tp_room_list_new_finish +tp_room_list_get_listing +tp_room_list_get_server +tp_room_list_get_account +tp_room_list_start_listing_async +tp_room_list_start_listing_finish +<SUBSECTION Standard> +TP_IS_ROOM_LIST +TP_IS_ROOM_LIST_CLASS +TP_ROOM_LIST +TP_ROOM_LIST_CLASS +TP_ROOM_LIST_FEATURE_LISTING +TP_ROOM_LIST_GET_CLASS +TP_TYPE_ROOM_LIST +tp_room_list_get_type <SUBSECTION Private> -TpRoomListChannelPrivate -tp_room_list_channel_get_feature_quark_listing +TpRoomListPrivate +tp_room_list_get_feature_quark_listing </SECTION> <SECTION> @@ -7276,8 +7278,6 @@ tp_room_info_get_requires_password tp_room_info_get_room_id tp_room_info_get_server tp_room_info_get_subject -tp_room_list_channel_start_listing_async -tp_room_list_channel_start_listing_finish <SUBSECTION Standard> TP_IS_ROOM_INFO TP_IS_ROOM_INFO_CLASS diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am index e20b59401..8c504f219 100644 --- a/telepathy-glib/Makefile.am +++ b/telepathy-glib/Makefile.am @@ -106,7 +106,7 @@ our_headers = \ proxy.h \ proxy-subclass.h \ room-info.h \ - room-list-channel.h \ + room-list.h \ run.h \ signalled-message.h \ simple-approver.h \ @@ -281,7 +281,7 @@ libtelepathy_glib_internal_la_SOURCES = \ proxy-signals.c \ room-info.c \ room-info-internal.h \ - room-list-channel.c \ + room-list.c \ run.c \ signalled-message.c \ signalled-message-internal.h \ diff --git a/telepathy-glib/introspection.am b/telepathy-glib/introspection.am index 1ac594e67..f55520f04 100644 --- a/telepathy-glib/introspection.am +++ b/telepathy-glib/introspection.am @@ -74,7 +74,7 @@ TelepathyGLib_0_12_gir_FILES = \ $(srcdir)/debug-client.c $(srcdir)/debug-client.h \ $(srcdir)/debug-message.c $(srcdir)/debug-message.h \ $(srcdir)/errors.c $(srcdir)/errors.h \ - $(srcdir)/room-list-channel.c $(srcdir)/room-list-channel.h \ + $(srcdir)/room-list.c $(srcdir)/room-list.h \ $(srcdir)/room-info.c $(srcdir)/room-info.h \ _gen/telepathy-enums.h _gen/telepathy-enums-gtk-doc.h \ _gen/telepathy-interfaces.h \ diff --git a/telepathy-glib/room-list-channel.h b/telepathy-glib/room-list-channel.h deleted file mode 100644 index be4a446d4..000000000 --- a/telepathy-glib/room-list-channel.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * room-list-channel.h - High level API for RoomList channels - * - * Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/> - * - * 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_ROOM_LIST_CHANNEL_H__ -#define __TP_ROOM_LIST_CHANNEL_H__ - -#include <telepathy-glib/channel.h> -#include <telepathy-glib/room-info.h> - -G_BEGIN_DECLS - -#define TP_TYPE_ROOM_LIST_CHANNEL (tp_room_list_channel_get_type ()) -#define TP_ROOM_LIST_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_ROOM_LIST_CHANNEL, TpRoomListChannel)) -#define TP_ROOM_LIST_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_ROOM_LIST_CHANNEL, TpRoomListChannelClass)) -#define TP_IS_ROOM_LIST_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_ROOM_LIST_CHANNEL)) -#define TP_IS_ROOM_LIST_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_ROOM_LIST_CHANNEL)) -#define TP_ROOM_LIST_CHANNEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_ROOM_LIST_CHANNEL, TpRoomListChannelClass)) - -typedef struct _TpRoomListChannel TpRoomListChannel; -typedef struct _TpRoomListChannelClass TpRoomListChannelClass; -typedef struct _TpRoomListChannelPrivate TpRoomListChannelPrivate; - -struct _TpRoomListChannel -{ - /*<private>*/ - GObject parent; - TpRoomListChannelPrivate *priv; -}; - -struct _TpRoomListChannelClass -{ - /*<private>*/ - GObjectClass parent_class; - GCallback _padding[7]; -}; - -GType tp_room_list_channel_get_type (void); - -void tp_room_list_channel_new_async (TpAccount *account, - const gchar *server, - GAsyncReadyCallback callback, - gpointer user_data); - -TpRoomListChannel * tp_room_list_channel_new_finish (GAsyncResult *result, - GError **error); - -TpAccount * tp_room_list_channel_get_account (TpRoomListChannel *self); - -const gchar * tp_room_list_channel_get_server (TpRoomListChannel *self); - -gboolean tp_room_list_channel_get_listing (TpRoomListChannel *self); - -void tp_room_list_channel_start_listing_async (TpRoomListChannel *self, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean tp_room_list_channel_start_listing_finish (TpRoomListChannel *self, - GAsyncResult *result, - GError **error); - -G_END_DECLS - -#endif diff --git a/telepathy-glib/room-list-channel.c b/telepathy-glib/room-list.c index 0f6c3175e..46a033849 100644 --- a/telepathy-glib/room-list-channel.c +++ b/telepathy-glib/room-list.c @@ -1,5 +1,5 @@ /* - * room-list-channel.c - High level API for RoomList channels + * room-list.c - High level API for listing room channels * * Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/> * @@ -19,33 +19,33 @@ */ /** - * SECTION:room-list-channel - * @title: TpRoomListChannel + * SECTION:room-list + * @title: TpRoomList * @short_description: proxy object for a room list channel * - * #TpRoomListChannel is a sub-class of #TpChannel providing convenient API + * #TpRoomList is a sub-class of #TpChannel providing convenient API * to list rooms. */ /** - * TpRoomListChannel: + * TpRoomList: * - * Data structure representing a #TpRoomListChannel. + * Data structure representing a #TpRoomList. * * Since: UNRELEASED */ /** - * TpRoomListChannelClass: + * TpRoomListClass: * - * The class of a #TpRoomListChannel. + * The class of a #TpRoomList. * * Since: UNRELEASED */ #include <config.h> -#include "telepathy-glib/room-list-channel.h" +#include "telepathy-glib/room-list.h" #include <telepathy-glib/room-info-internal.h> #include <telepathy-glib/telepathy-glib.h> @@ -59,10 +59,10 @@ static void async_initable_iface_init (GAsyncInitableIface *iface); -G_DEFINE_TYPE_WITH_CODE (TpRoomListChannel, tp_room_list_channel, G_TYPE_OBJECT, +G_DEFINE_TYPE_WITH_CODE (TpRoomList, tp_room_list, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init)) -struct _TpRoomListChannelPrivate +struct _TpRoomListPrivate { TpAccount *account; gchar *server; @@ -88,21 +88,21 @@ enum { static guint signals[LAST_SIGNAL]; static void -tp_room_list_channel_get_property (GObject *object, +tp_room_list_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { - TpRoomListChannel *self = (TpRoomListChannel *) object; + TpRoomList *self = (TpRoomList *) object; switch (property_id) { case PROP_ACCOUNT: - g_value_set_object (value, tp_room_list_channel_get_account (self)); + g_value_set_object (value, tp_room_list_get_account (self)); break; case PROP_SERVER: - g_value_set_string (value, tp_room_list_channel_get_server (self)); + g_value_set_string (value, tp_room_list_get_server (self)); break; case PROP_LISTING: @@ -116,12 +116,12 @@ tp_room_list_channel_get_property (GObject *object, } static void -tp_room_list_channel_set_property (GObject *object, +tp_room_list_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { - TpRoomListChannel *self = (TpRoomListChannel *) object; + TpRoomList *self = (TpRoomList *) object; switch (property_id) { @@ -147,7 +147,7 @@ got_rooms_cb (TpChannel *channel, gpointer user_data, GObject *weak_object) { - TpRoomListChannel *self = TP_ROOM_LIST_CHANNEL (weak_object); + TpRoomList *self = TP_ROOM_LIST (weak_object); guint i; for (i = 0; i < rooms->len; i++) @@ -166,7 +166,7 @@ listing_rooms_cb (TpChannel *proxy, gpointer user_data, GObject *weak_object) { - TpRoomListChannel *self = TP_ROOM_LIST_CHANNEL (weak_object); + TpRoomList *self = TP_ROOM_LIST (weak_object); if (self->priv->listing == listing) return; @@ -176,7 +176,7 @@ listing_rooms_cb (TpChannel *proxy, } static void -destroy_channel (TpRoomListChannel *self) +destroy_channel (TpRoomList *self) { if (self->priv->channel == NULL) return; @@ -188,11 +188,11 @@ destroy_channel (TpRoomListChannel *self) } static void -tp_room_list_channel_dispose (GObject *object) +tp_room_list_dispose (GObject *object) { - TpRoomListChannel *self = TP_ROOM_LIST_CHANNEL (object); + TpRoomList *self = TP_ROOM_LIST (object); void (*chain_up) (GObject *) = - ((GObjectClass *) tp_room_list_channel_parent_class)->dispose; + ((GObjectClass *) tp_room_list_parent_class)->dispose; destroy_channel (self); g_clear_object (&self->priv->account); @@ -202,11 +202,11 @@ tp_room_list_channel_dispose (GObject *object) } static void -tp_room_list_channel_finalize (GObject *object) +tp_room_list_finalize (GObject *object) { - TpRoomListChannel *self = TP_ROOM_LIST_CHANNEL (object); + TpRoomList *self = TP_ROOM_LIST (object); void (*chain_up) (GObject *) = - ((GObjectClass *) tp_room_list_channel_parent_class)->finalize; + ((GObjectClass *) tp_room_list_parent_class)->finalize; g_free (self->priv->server); @@ -215,18 +215,18 @@ tp_room_list_channel_finalize (GObject *object) } static void -tp_room_list_channel_class_init (TpRoomListChannelClass *klass) +tp_room_list_class_init (TpRoomListClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; - gobject_class->get_property = tp_room_list_channel_get_property; - gobject_class->set_property = tp_room_list_channel_set_property; - gobject_class->dispose = tp_room_list_channel_dispose; - gobject_class->finalize = tp_room_list_channel_finalize; + gobject_class->get_property = tp_room_list_get_property; + gobject_class->set_property = tp_room_list_set_property; + gobject_class->dispose = tp_room_list_dispose; + gobject_class->finalize = tp_room_list_finalize; /** - * TpRoomListChannel:account: + * TpRoomList:account: * * The #TpAccount to use for the room listing. * @@ -239,7 +239,7 @@ tp_room_list_channel_class_init (TpRoomListChannelClass *klass) g_object_class_install_property (gobject_class, PROP_ACCOUNT, param_spec); /** - * TpRoomListChannel:server: + * TpRoomList:server: * * The DNS name of the server whose rooms are listed by this channel, or * %NULL. @@ -253,12 +253,12 @@ tp_room_list_channel_class_init (TpRoomListChannelClass *klass) g_object_class_install_property (gobject_class, PROP_SERVER, param_spec); /** - * TpRoomListChannel:listing: + * TpRoomList:listing: * * %TRUE if the channel is currently listing rooms. * * This property is meaningless until the - * %TP_ROOM_LIST_CHANNEL_FEATURE_LISTING feature has been prepared. + * %TP_ROOM_LIST_FEATURE_LISTING feature has been prepared. * * Since: 0.UNRELEASED */ @@ -270,8 +270,8 @@ tp_room_list_channel_class_init (TpRoomListChannelClass *klass) /** - * TpRoomListChannel::got-rooms: - * @self: a #TpRoomListChannel + * TpRoomList::got-rooms: + * @self: a #TpRoomList * * TODO * @@ -284,60 +284,60 @@ tp_room_list_channel_class_init (TpRoomListChannelClass *klass) G_TYPE_NONE, 1, TP_TYPE_ROOM_INFO); - g_type_class_add_private (gobject_class, sizeof (TpRoomListChannelPrivate)); + g_type_class_add_private (gobject_class, sizeof (TpRoomListPrivate)); } static void -tp_room_list_channel_init (TpRoomListChannel *self) +tp_room_list_init (TpRoomList *self) { - self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_ROOM_LIST_CHANNEL, - TpRoomListChannelPrivate); + self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_ROOM_LIST, + TpRoomListPrivate); } /** - * tp_room_list_channel_get_account: - * @self: a #TpRoomListChannel + * tp_room_list_get_account: + * @self: a #TpRoomList * - * Return the #TpRoomListChannel:account property + * Return the #TpRoomList:account property * - * Returns: (transfer none): the value of #TpRoomListChannel:account property + * Returns: (transfer none): the value of #TpRoomList:account property * * Since: UNRELEASED */ TpAccount * -tp_room_list_channel_get_account (TpRoomListChannel *self) +tp_room_list_get_account (TpRoomList *self) { return self->priv->account; } /** - * tp_room_list_channel_get_server: - * @self: a #TpRoomListChannel + * tp_room_list_get_server: + * @self: a #TpRoomList * - * Return the #TpRoomListChannel:server property + * Return the #TpRoomList:server property * - * Returns: the value of #TpRoomListChannel:server property + * Returns: the value of #TpRoomList:server property * * Since: UNRELEASED */ const gchar * -tp_room_list_channel_get_server (TpRoomListChannel *self) +tp_room_list_get_server (TpRoomList *self) { return self->priv->server; } /** - * tp_room_list_channel_get_listing: - * @self: a #TpRoomListChannel + * tp_room_list_get_listing: + * @self: a #TpRoomList * - * Return the #TpRoomListChannel:listing property + * Return the #TpRoomList:listing property * - * Returns: the value of #TpRoomListChannel:listing property + * Returns: the value of #TpRoomList:listing property * * Since: UNRELEASED */ gboolean -tp_room_list_channel_get_listing (TpRoomListChannel *self) +tp_room_list_get_listing (TpRoomList *self) { return self->priv->listing; } @@ -359,18 +359,18 @@ list_rooms_cb (TpChannel *channel, } /** - * tp_room_list_channel_start_listing_async: - * @self: a #TpRoomListChannel + * tp_room_list_start_listing_async: + * @self: a #TpRoomList * @callback: a callback to call when room listing have been started * @user_data: data to pass to @callback * - * Start listing rooms using @self. Use the TpRoomListChannel::got-rooms + * Start listing rooms using @self. Use the TpRoomList::got-rooms * signal to get the rooms found. * * Since: UNRELEASED */ void -tp_room_list_channel_start_listing_async (TpRoomListChannel *self, +tp_room_list_start_listing_async (TpRoomList *self, GAsyncReadyCallback callback, gpointer user_data) { @@ -379,15 +379,15 @@ tp_room_list_channel_start_listing_async (TpRoomListChannel *self, g_return_if_fail (self->priv->channel != NULL); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, - tp_room_list_channel_start_listing_async); + tp_room_list_start_listing_async); tp_cli_channel_type_room_list_call_list_rooms (self->priv->channel, -1, list_rooms_cb, result, g_object_unref, G_OBJECT (self)); } /** - * tp_room_list_channel_start_listing_finish: - * @self: a #TpRoomListChannel + * tp_room_list_start_listing_finish: + * @self: a #TpRoomList * @result: a #GAsyncResult * @error: a #GError to fill * @@ -399,11 +399,11 @@ tp_room_list_channel_start_listing_async (TpRoomListChannel *self, * Since: UNRELEASED */ gboolean -tp_room_list_channel_start_listing_finish (TpRoomListChannel *self, +tp_room_list_start_listing_finish (TpRoomList *self, GAsyncResult *result, GError **error) { - _tp_implement_finish_void (self, tp_room_list_channel_start_listing_async) + _tp_implement_finish_void (self, tp_room_list_start_listing_async) } static void @@ -413,7 +413,7 @@ create_channel_cb (GObject *source_object, { TpAccountChannelRequest *channel_request = TP_ACCOUNT_CHANNEL_REQUEST ( source_object); - TpRoomListChannel *self = user_data; + TpRoomList *self = user_data; GHashTable *properties; GError *error = NULL; const gchar *server; @@ -473,7 +473,7 @@ create_channel_cb (GObject *source_object, } static void -open_new_channel (TpRoomListChannel *self) +open_new_channel (TpRoomList *self) { GHashTable *request; TpAccountChannelRequest *channel_request; @@ -500,22 +500,22 @@ open_new_channel (TpRoomListChannel *self) } static void -room_list_channel_init_async (GAsyncInitable *initable, +room_list_init_async (GAsyncInitable *initable, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { - TpRoomListChannel *self = TP_ROOM_LIST_CHANNEL (initable); + TpRoomList *self = TP_ROOM_LIST (initable); self->priv->async_res = g_simple_async_result_new (G_OBJECT (self), - callback, user_data, tp_room_list_channel_new_async); + callback, user_data, tp_room_list_new_async); open_new_channel (self); } static gboolean -room_list_channel_init_finish (GAsyncInitable *initable, +room_list_init_finish (GAsyncInitable *initable, GAsyncResult *res, GError **error) { @@ -529,12 +529,12 @@ room_list_channel_init_finish (GAsyncInitable *initable, static void async_initable_iface_init (GAsyncInitableIface *iface) { - iface->init_async = room_list_channel_init_async; - iface->init_finish = room_list_channel_init_finish; + iface->init_async = room_list_init_async; + iface->init_finish = room_list_init_finish; } /** - * tp_room_list_channel_new_async: + * tp_room_list_new_async: * @account: a #TpAccount for the room listing * @server: the DNS name of the server whose rooms should listed * @callback: a #GAsyncReadyCallback to call when the initialization @@ -546,14 +546,14 @@ async_initable_iface_init (GAsyncInitableIface *iface) * Since: UNRELEASED */ void -tp_room_list_channel_new_async (TpAccount *account, +tp_room_list_new_async (TpAccount *account, const gchar *server, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_ACCOUNT (account)); - g_async_initable_new_async (TP_TYPE_ROOM_LIST_CHANNEL, + g_async_initable_new_async (TP_TYPE_ROOM_LIST, G_PRIORITY_DEFAULT, NULL, callback, user_data, "account", account, "server", server, @@ -561,19 +561,19 @@ tp_room_list_channel_new_async (TpAccount *account, } /** - * tp_room_list_channel_new_finish: + * tp_room_list_new_finish: * @result: the #GAsyncResult from the callback * @error: a #GError location to store an error, or %NULL * * <!-- --> * - * Returns: (transfer full): a new #TpRoomListChannel object, or %NULL + * Returns: (transfer full): a new #TpRoomList object, or %NULL * in case of error. * * Since: UNRELEASED */ -TpRoomListChannel * -tp_room_list_channel_new_finish (GAsyncResult *result, +TpRoomList * +tp_room_list_new_finish (GAsyncResult *result, GError **error) { GObject *object, *source_object; @@ -585,7 +585,7 @@ tp_room_list_channel_new_finish (GAsyncResult *result, g_object_unref (source_object); if (object != NULL) - return TP_ROOM_LIST_CHANNEL (object); + return TP_ROOM_LIST (object); else return NULL; } diff --git a/telepathy-glib/room-list.h b/telepathy-glib/room-list.h new file mode 100644 index 000000000..2cb9cc5b8 --- /dev/null +++ b/telepathy-glib/room-list.h @@ -0,0 +1,80 @@ +/* + * room-list-channel.h - High level API for RoomList channels + * + * Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/> + * + * 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_ROOM_LIST_H__ +#define __TP_ROOM_LIST_H__ + +#include <telepathy-glib/channel.h> +#include <telepathy-glib/room-info.h> + +G_BEGIN_DECLS + +#define TP_TYPE_ROOM_LIST (tp_room_list_get_type ()) +#define TP_ROOM_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_ROOM_LIST, TpRoomList)) +#define TP_ROOM_LIST_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_ROOM_LIST, TpRoomListClass)) +#define TP_IS_ROOM_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_ROOM_LIST)) +#define TP_IS_ROOM_LIST_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_ROOM_LIST)) +#define TP_ROOM_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_ROOM_LIST, TpRoomListClass)) + +typedef struct _TpRoomList TpRoomList; +typedef struct _TpRoomListClass TpRoomListClass; +typedef struct _TpRoomListPrivate TpRoomListPrivate; + +struct _TpRoomList +{ + /*<private>*/ + GObject parent; + TpRoomListPrivate *priv; +}; + +struct _TpRoomListClass +{ + /*<private>*/ + GObjectClass parent_class; + GCallback _padding[7]; +}; + +GType tp_room_list_get_type (void); + +void tp_room_list_new_async (TpAccount *account, + const gchar *server, + GAsyncReadyCallback callback, + gpointer user_data); + +TpRoomList * tp_room_list_new_finish (GAsyncResult *result, + GError **error); + +TpAccount * tp_room_list_get_account (TpRoomList *self); + +const gchar * tp_room_list_get_server (TpRoomList *self); + +gboolean tp_room_list_get_listing (TpRoomList *self); + +void tp_room_list_start_listing_async (TpRoomList *self, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean tp_room_list_start_listing_finish (TpRoomList *self, + GAsyncResult *result, + GError **error); + +G_END_DECLS + +#endif diff --git a/telepathy-glib/telepathy-glib.h b/telepathy-glib/telepathy-glib.h index c27edeaa1..2af1f72f9 100644 --- a/telepathy-glib/telepathy-glib.h +++ b/telepathy-glib/telepathy-glib.h @@ -70,7 +70,7 @@ #include <telepathy-glib/stream-tube-channel.h> #include <telepathy-glib/stream-tube-connection.h> #include <telepathy-glib/text-channel.h> -#include <telepathy-glib/room-list-channel.h> +#include <telepathy-glib/room-list.h> #include <telepathy-glib/svc-generic.h> #include <telepathy-glib/svc-client.h> diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am index 5dc675d97..b1c77a941 100644 --- a/tests/dbus/Makefile.am +++ b/tests/dbus/Makefile.am @@ -50,7 +50,7 @@ tests_list = \ test-properties \ test-protocol-objects \ test-proxy-preparation \ - test-room-list-channel \ + test-room-list \ test-self-handle \ test-self-presence \ test-simple-approver \ @@ -255,13 +255,7 @@ test_text_channel_LDADD = \ test_debug_client_SOURCES = debug-client.c -# this one uses internal ABI -test_room_list_channel_SOURCES = room-list-channel.c - -test_room_list_channel_LDADD = \ - $(LDADD) \ - $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la +test_room_list_SOURCES = room-list.c check_c_sources = *.c include $(top_srcdir)/tools/check-coding-style.mk diff --git a/tests/dbus/room-list-channel.c b/tests/dbus/room-list.c index 0834f452e..8d5cb4eb5 100644 --- a/tests/dbus/room-list-channel.c +++ b/tests/dbus/room-list.c @@ -30,7 +30,7 @@ typedef struct { /* Client side objects */ TpAccount *account; TpConnection *connection; - TpRoomListChannel *room_list; + TpRoomList *room_list; GPtrArray *rooms; /* reffed TpRoomInfo */ GError *error /* initialized where needed */; @@ -46,7 +46,7 @@ new_async_cb (GObject *source, { Test *test = user_data; - test->room_list = tp_room_list_channel_new_finish (result, &test->error); + test->room_list = tp_room_list_new_finish (result, &test->error); test->wait--; if (test->wait <= 0) @@ -59,7 +59,7 @@ create_room_list (Test *test, { tp_clear_object (&test->room_list); - tp_room_list_channel_new_async (test->account, server, + tp_room_list_new_async (test->account, server, new_async_cb, test); test->wait = 1; @@ -131,7 +131,7 @@ static void test_creation (Test *test, gconstpointer data G_GNUC_UNUSED) { - g_assert (TP_IS_ROOM_LIST_CHANNEL (test->room_list)); + g_assert (TP_IS_ROOM_LIST (test->room_list)); } static void @@ -147,11 +147,11 @@ test_properties (Test *test, NULL); g_assert_cmpstr (server, ==, SERVER); - g_assert_cmpstr (tp_room_list_channel_get_server (test->room_list), ==, + g_assert_cmpstr (tp_room_list_get_server (test->room_list), ==, SERVER); g_assert (!listing); - g_assert (!tp_room_list_channel_get_listing (test->room_list)); + g_assert (!tp_room_list_get_listing (test->room_list)); /* Create new one without server */ tp_clear_object (&test->room_list); @@ -159,7 +159,7 @@ test_properties (Test *test, create_room_list (test, NULL); g_assert_no_error (test->error); - g_assert_cmpstr (tp_room_list_channel_get_server (test->room_list), ==, + g_assert_cmpstr (tp_room_list_get_server (test->room_list), ==, NULL); } @@ -170,7 +170,7 @@ start_listing_cb (GObject *source, { Test *test = user_data; - tp_room_list_channel_start_listing_finish (TP_ROOM_LIST_CHANNEL (source), + tp_room_list_start_listing_finish (TP_ROOM_LIST (source), result, &test->error); test->wait--; @@ -189,7 +189,7 @@ notify_cb (GObject *object, } static void -got_rooms_cb (TpRoomListChannel *channel, +got_rooms_cb (TpRoomList *channel, TpRoomInfo *room, Test *test) { @@ -207,7 +207,7 @@ test_listing (Test *test, TpRoomInfo *room; gboolean known; - g_assert (!tp_room_list_channel_get_listing (test->room_list)); + g_assert (!tp_room_list_get_listing (test->room_list)); g_signal_connect (test->room_list, "notify::listing", G_CALLBACK (notify_cb), test); @@ -215,14 +215,14 @@ test_listing (Test *test, g_signal_connect (test->room_list, "got-rooms", G_CALLBACK (got_rooms_cb), test); - tp_room_list_channel_start_listing_async (test->room_list, start_listing_cb, + tp_room_list_start_listing_async (test->room_list, start_listing_cb, test); test->wait = 5; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); - g_assert (tp_room_list_channel_get_listing (test->room_list)); + g_assert (tp_room_list_get_listing (test->room_list)); g_assert_cmpuint (test->rooms->len, ==, 3); |
