From 9dfba7cec87582c73ffc4c5f0982b5c5787002a8 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 6 Mar 2012 18:42:24 +0000 Subject: [PATCH 06/10] Split TpConnection generated API into cli-connection.h A couple of hand-written functions went with it, because they're relatively low-level too. --- docs/reference/telepathy-glib-docs.sgml | 1 + docs/reference/telepathy-glib-sections.txt | 45 ++++++++++++--------- examples/client/extended-client.c | 1 + telepathy-glib/Makefile.am | 1 + telepathy-glib/cli-connection.h | 48 +++++++++++++++++++++++ telepathy-glib/connection-aliasing.c | 1 + telepathy-glib/connection-contact-info.c | 1 + telepathy-glib/connection-contact-list.c | 1 + telepathy-glib/connection-handles.c | 2 + telepathy-glib/connection.c | 1 + telepathy-glib/connection.h | 19 --------- telepathy-glib/contact-operations.c | 1 + telepathy-glib/contact.c | 1 + tests/dbus/call-channel.c | 1 + tests/dbus/channel-manager-request-properties.c | 1 + tests/dbus/cli-group.c | 1 + tests/dbus/connection-aliasing.c | 1 + tests/dbus/connection-balance.c | 1 + tests/dbus/connection-bug-18845.c | 1 + tests/dbus/connection-error.c | 1 + tests/dbus/connection-interests.c | 1 + tests/dbus/connection.c | 1 + tests/dbus/contact-list-client.c | 1 + tests/dbus/contact-lists.c | 1 + tests/dbus/contacts-mixin.c | 1 + tests/dbus/contacts.c | 1 + tests/dbus/example-no-protocols.c | 1 + tests/dbus/group-mixin.c | 1 + tests/dbus/invalidated-while-invoking-signals.c | 1 + tests/dbus/message-mixin.c | 1 + tests/dbus/params-cm.c | 1 + tests/dbus/proxy-preparation.c | 1 + tests/dbus/self-handle.c | 1 + tests/dbus/self-presence.c | 1 + tests/dbus/unsupported-interface.c | 1 + tests/lib/util.c | 1 + 36 files changed, 107 insertions(+), 39 deletions(-) create mode 100644 telepathy-glib/cli-connection.h diff --git a/docs/reference/telepathy-glib-docs.sgml b/docs/reference/telepathy-glib-docs.sgml index 3527752..03c3743 100644 --- a/docs/reference/telepathy-glib-docs.sgml +++ b/docs/reference/telepathy-glib-docs.sgml @@ -38,6 +38,7 @@ + diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt index e39b828..781abb3 100644 --- a/docs/reference/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib-sections.txt @@ -3204,7 +3204,7 @@ tp_cli_channel_type_room_list_signal_callback_listing_rooms
cli-anonymity cli-anonymity -telepathy-glib/telepathy-glib.h,telepathy-glib/cli-channel.h +telepathy-glib/cli-connection.h,telepathy-glib/cli-channel.h tp_cli_connection_interface_anonymity_connect_to_anonymity_modes_changed tp_cli_connection_interface_anonymity_signal_callback_anonymity_modes_changed
@@ -3212,7 +3212,7 @@ tp_cli_connection_interface_anonymity_signal_callback_anonymity_modes_changed
cli-service-point cli-service-point -telepathy-glib/telepathy-glib.h,telepathy-glib/cli-channel.h +telepathy-glib/cli-connection.h,telepathy-glib/cli-channel.h tp_cli_channel_interface_service_point_connect_to_service_point_changed tp_cli_channel_interface_service_point_signal_callback_service_point_changed tp_cli_connection_interface_service_point_connect_to_service_points_changed @@ -3249,8 +3249,6 @@ tp_connection_get_self_contact tp_connection_get_self_handle TpConnectionRequestHandlesCb tp_connection_request_handles -tp_connection_get_contact_attributes -tp_connection_get_contact_list_attributes tp_connection_init_known_interfaces tp_connection_presence_type_cmp_availability tp_connection_parse_object_path @@ -3355,7 +3353,14 @@ tp_connection_can_report_abusive tp_connection_get_blocked_contacts tp_connection_can_set_contact_alias - +
+ +
+cli-connection +cli-connection +telepathy-glib/cli-connection.h +tp_connection_get_contact_attributes +tp_connection_get_contact_list_attributes tp_cli_connection_callback_for_connect tp_cli_connection_call_connect tp_cli_connection_callback_for_disconnect @@ -3379,7 +3384,7 @@ tp_cli_connection_callback_for_remove_client_interest
connection-aliasing connection-aliasing -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_aliasing_call_get_alias_flags tp_cli_connection_interface_aliasing_call_request_aliases tp_cli_connection_interface_aliasing_call_get_aliases @@ -3395,7 +3400,7 @@ tp_cli_connection_interface_aliasing_signal_callback_aliases_changed
connection-avatars connection-avatars -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_avatars_call_clear_avatar tp_cli_connection_interface_avatars_call_get_known_avatar_tokens tp_cli_connection_interface_avatars_call_request_avatars @@ -3413,7 +3418,7 @@ tp_cli_connection_interface_avatars_signal_callback_avatar_updated
connection-balance connection-balance -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_balance_connect_to_balance_changed tp_cli_connection_interface_balance_signal_callback_balance_changed
@@ -3421,7 +3426,7 @@ tp_cli_connection_interface_balance_signal_callback_balance_changed
connection-caps connection-caps -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_contact_capabilities_callback_for_get_contact_capabilities tp_cli_connection_interface_contact_capabilities_call_get_contact_capabilities tp_cli_connection_interface_contact_capabilities_callback_for_update_capabilities @@ -3433,7 +3438,7 @@ tp_cli_connection_interface_contact_capabilities_connect_to_contact_capabilities
connection-contact-list connection-contact-list -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_contact_blocking_call_block_contacts tp_cli_connection_interface_contact_blocking_call_request_blocked_contacts tp_cli_connection_interface_contact_blocking_call_unblock_contacts @@ -3488,7 +3493,7 @@ tp_cli_connection_interface_contact_list_callback_for_get_contact_list_attribute
connection-cellular connection-cellular -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_cellular_connect_to_imsi_changed tp_cli_connection_interface_cellular_signal_callback_imsi_changed
@@ -3496,7 +3501,7 @@ tp_cli_connection_interface_cellular_signal_callback_imsi_changed
connection-contacts connection-contacts -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_contacts_call_get_contact_attributes tp_cli_connection_interface_contacts_callback_for_get_contact_attributes
@@ -3504,7 +3509,7 @@ tp_cli_connection_interface_contacts_callback_for_get_contact_attributes
connection-contact-info connection-contact-info -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_contact_info_call_get_contact_info tp_cli_connection_interface_contact_info_call_refresh_contact_info tp_cli_connection_interface_contact_info_call_request_contact_info @@ -3520,7 +3525,7 @@ tp_cli_connection_interface_contact_info_signal_callback_contact_info_changed
connection-requests connection-requests -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_requests_call_create_channel tp_cli_connection_interface_requests_call_ensure_channel tp_cli_connection_interface_requests_callback_for_create_channel @@ -3534,7 +3539,7 @@ tp_cli_connection_interface_requests_signal_callback_new_channels
connection-presence connection-presence -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_presence_call_get_presences tp_cli_connection_interface_presence_call_set_presence tp_cli_connection_interface_presence_callback_for_get_presences @@ -3546,7 +3551,7 @@ tp_cli_connection_interface_presence_signal_callback_presences_changed
connection-location connection-location -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_location_connect_to_location_updated tp_cli_connection_interface_location_signal_callback_location_updated tp_cli_connection_interface_location_call_get_locations @@ -3562,7 +3567,7 @@ tp_cli_connection_interface_location_callback_for_set_location
connection-powersaving connection-powersaving -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_power_saving_call_set_power_saving tp_cli_connection_interface_power_saving_callback_for_set_power_saving tp_cli_connection_interface_power_saving_connect_to_power_saving_changed @@ -3572,7 +3577,7 @@ tp_cli_connection_interface_power_saving_signal_callback_power_saving_changed
connection-client-types connection-client-types -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_client_types_call_get_client_types tp_cli_connection_interface_client_types_call_request_client_types tp_cli_connection_interface_client_types_callback_for_get_client_types @@ -3584,7 +3589,7 @@ tp_cli_connection_interface_client_types_signal_callback_client_types_updated
connection-mail connection-mail -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_mail_notification_call_request_inbox_url tp_cli_connection_interface_mail_notification_call_request_mail_url tp_cli_connection_interface_mail_notification_callback_for_request_inbox_url @@ -3598,7 +3603,7 @@ tp_cli_connection_interface_mail_notification_signal_callback_unread_mails_chang
connection-addressing connection-addressing -telepathy-glib/connection.h +telepathy-glib/cli-connection.h tp_cli_connection_interface_addressing_call_get_contacts_by_uri tp_cli_connection_interface_addressing_call_get_contacts_by_vcard_field tp_cli_connection_interface_addressing_callback_for_get_contacts_by_uri diff --git a/examples/client/extended-client.c b/examples/client/extended-client.c index 724ff2c..7399533 100644 --- a/examples/client/extended-client.c +++ b/examples/client/extended-client.c @@ -17,6 +17,7 @@ #include +#include #include /* Usually this'd be a top-level extensions/ directory in practice */ diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am index f89a712..6b8a0d1 100644 --- a/telepathy-glib/Makefile.am +++ b/telepathy-glib/Makefile.am @@ -71,6 +71,7 @@ our_headers = \ channel-manager.h \ channel-request.h \ cli-channel.h \ + cli-connection.h \ cli-misc.h \ client.h \ client-channel-factory.h \ diff --git a/telepathy-glib/cli-connection.h b/telepathy-glib/cli-connection.h new file mode 100644 index 0000000..16d5efd --- /dev/null +++ b/telepathy-glib/cli-connection.h @@ -0,0 +1,48 @@ +/* + * cli-connection.h - auto-generated client API for a Telepathy connection + * + * Copyright © 2007-2012 Collabora Ltd. + * Copyright © 2007 Nokia Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef TELEPATHY_GLIB_CLI_CONNECTION_H +#define TELEPATHY_GLIB_CLI_CONNECTION_H + +#include + +#include + +G_BEGIN_DECLS + +/* connection-handles.c - this has to come after the auto-generated + * stuff because it uses an auto-generated typedef */ + +void tp_connection_get_contact_attributes (TpConnection *self, + gint timeout_ms, guint n_handles, const TpHandle *handles, + const gchar * const *interfaces, + tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback, + gpointer user_data, GDestroyNotify destroy, GObject *weak_object); + +void tp_connection_get_contact_list_attributes (TpConnection *self, + gint timeout_ms, const gchar * const *interfaces, + tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback, + gpointer user_data, GDestroyNotify destroy, GObject *weak_object); + +G_END_DECLS + +#endif + diff --git a/telepathy-glib/connection-aliasing.c b/telepathy-glib/connection-aliasing.c index 5e0eec3..f5e5f3b 100644 --- a/telepathy-glib/connection-aliasing.c +++ b/telepathy-glib/connection-aliasing.c @@ -22,6 +22,7 @@ #include "telepathy-glib/connection.h" +#include #include #include diff --git a/telepathy-glib/connection-contact-info.c b/telepathy-glib/connection-contact-info.c index ea0a427..eb5fb79 100644 --- a/telepathy-glib/connection-contact-info.c +++ b/telepathy-glib/connection-contact-info.c @@ -26,6 +26,7 @@ #include +#include #include #include #include diff --git a/telepathy-glib/connection-contact-list.c b/telepathy-glib/connection-contact-list.c index b3e0f01..c39fb04 100644 --- a/telepathy-glib/connection-contact-list.c +++ b/telepathy-glib/connection-contact-list.c @@ -22,6 +22,7 @@ #include "telepathy-glib/connection-contact-list.h" +#include #include #include #include diff --git a/telepathy-glib/connection-handles.c b/telepathy-glib/connection-handles.c index 80c1574..a48433a 100644 --- a/telepathy-glib/connection-handles.c +++ b/telepathy-glib/connection-handles.c @@ -22,6 +22,8 @@ #include "telepathy-glib/connection-internal.h" +#include + #include #include diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index 818d275..5e890d2 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -27,6 +27,7 @@ #include +#include #include #include #include diff --git a/telepathy-glib/connection.h b/telepathy-glib/connection.h index 6d285cc..d6a6a52 100644 --- a/telepathy-glib/connection.h +++ b/telepathy-glib/connection.h @@ -271,25 +271,6 @@ gboolean tp_connection_disconnect_finish (TpConnection *self, GAsyncResult *result, GError **error); -G_END_DECLS - -#include - -G_BEGIN_DECLS - -/* connection-handles.c again - this has to come after the auto-generated - * stuff because it uses an auto-generated typedef */ - -void tp_connection_get_contact_attributes (TpConnection *self, - gint timeout_ms, guint n_handles, const TpHandle *handles, - const gchar * const *interfaces, - tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback, - gpointer user_data, GDestroyNotify destroy, GObject *weak_object); - -void tp_connection_get_contact_list_attributes (TpConnection *self, - gint timeout_ms, const gchar * const *interfaces, - tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback, - gpointer user_data, GDestroyNotify destroy, GObject *weak_object); GBinding *tp_connection_bind_connection_status_to_property (TpConnection *self, gpointer target, const char *target_property, gboolean invert); diff --git a/telepathy-glib/contact-operations.c b/telepathy-glib/contact-operations.c index fb9187a..70f917f 100644 --- a/telepathy-glib/contact-operations.c +++ b/telepathy-glib/contact-operations.c @@ -21,6 +21,7 @@ #include +#include #include #define DEBUG_FLAG TP_DEBUG_CONTACTS diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c index 8ec6dbf..11007ef 100644 --- a/telepathy-glib/contact.c +++ b/telepathy-glib/contact.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/tests/dbus/call-channel.c b/tests/dbus/call-channel.c index 1df101e..47ec35d 100644 --- a/tests/dbus/call-channel.c +++ b/tests/dbus/call-channel.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include diff --git a/tests/dbus/channel-manager-request-properties.c b/tests/dbus/channel-manager-request-properties.c index 6c5705a..9c3fa26 100644 --- a/tests/dbus/channel-manager-request-properties.c +++ b/tests/dbus/channel-manager-request-properties.c @@ -10,6 +10,7 @@ #include "config.h" #include +#include #include #include #include diff --git a/tests/dbus/cli-group.c b/tests/dbus/cli-group.c index 4065752..6697a2e 100644 --- a/tests/dbus/cli-group.c +++ b/tests/dbus/cli-group.c @@ -14,6 +14,7 @@ #include #include +#include #include #include #include diff --git a/tests/dbus/connection-aliasing.c b/tests/dbus/connection-aliasing.c index eb340a1..5ec87a8 100644 --- a/tests/dbus/connection-aliasing.c +++ b/tests/dbus/connection-aliasing.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/dbus/connection-balance.c b/tests/dbus/connection-balance.c index 9d6f7b9..eefd41c 100644 --- a/tests/dbus/connection-balance.c +++ b/tests/dbus/connection-balance.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/dbus/connection-bug-18845.c b/tests/dbus/connection-bug-18845.c index 7ec479a..8d06d6e 100644 --- a/tests/dbus/connection-bug-18845.c +++ b/tests/dbus/connection-bug-18845.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/dbus/connection-error.c b/tests/dbus/connection-error.c index 9916040..dadb177 100644 --- a/tests/dbus/connection-error.c +++ b/tests/dbus/connection-error.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/dbus/connection-interests.c b/tests/dbus/connection-interests.c index a6b3231..4973b4a 100644 --- a/tests/dbus/connection-interests.c +++ b/tests/dbus/connection-interests.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/dbus/connection.c b/tests/dbus/connection.c index 68a3f03..f9b1821 100644 --- a/tests/dbus/connection.c +++ b/tests/dbus/connection.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/dbus/contact-list-client.c b/tests/dbus/contact-list-client.c index 943645c..e6efd46 100644 --- a/tests/dbus/contact-list-client.c +++ b/tests/dbus/contact-list-client.c @@ -12,6 +12,7 @@ #include #include +#include #include #include "examples/cm/contactlist/conn.h" diff --git a/tests/dbus/contact-lists.c b/tests/dbus/contact-lists.c index d71f347..d418c1e 100644 --- a/tests/dbus/contact-lists.c +++ b/tests/dbus/contact-lists.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include "telepathy-glib/reentrants.h" diff --git a/tests/dbus/contacts-mixin.c b/tests/dbus/contacts-mixin.c index ae9965b..0f410a8 100644 --- a/tests/dbus/contacts-mixin.c +++ b/tests/dbus/contacts-mixin.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/dbus/contacts.c b/tests/dbus/contacts.c index 20d4b97..9eb7199 100644 --- a/tests/dbus/contacts.c +++ b/tests/dbus/contacts.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/tests/dbus/example-no-protocols.c b/tests/dbus/example-no-protocols.c index 7ae7d9f..32c871b 100644 --- a/tests/dbus/example-no-protocols.c +++ b/tests/dbus/example-no-protocols.c @@ -1,6 +1,7 @@ #include "config.h" #include +#include #include #include #include diff --git a/tests/dbus/group-mixin.c b/tests/dbus/group-mixin.c index d305dd7..3c0178c 100644 --- a/tests/dbus/group-mixin.c +++ b/tests/dbus/group-mixin.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include diff --git a/tests/dbus/invalidated-while-invoking-signals.c b/tests/dbus/invalidated-while-invoking-signals.c index 1cce014..5143254 100644 --- a/tests/dbus/invalidated-while-invoking-signals.c +++ b/tests/dbus/invalidated-while-invoking-signals.c @@ -11,6 +11,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/dbus/message-mixin.c b/tests/dbus/message-mixin.c index 66c8429..4f1e4a5 100644 --- a/tests/dbus/message-mixin.c +++ b/tests/dbus/message-mixin.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include diff --git a/tests/dbus/params-cm.c b/tests/dbus/params-cm.c index bf05193..45dd1f6 100644 --- a/tests/dbus/params-cm.c +++ b/tests/dbus/params-cm.c @@ -21,6 +21,7 @@ #include "config.h" #include +#include #include #include #include diff --git a/tests/dbus/proxy-preparation.c b/tests/dbus/proxy-preparation.c index 1817540..b70c529 100644 --- a/tests/dbus/proxy-preparation.c +++ b/tests/dbus/proxy-preparation.c @@ -9,6 +9,7 @@ #include "config.h" +#include #include #include "tests/lib/util.h" diff --git a/tests/dbus/self-handle.c b/tests/dbus/self-handle.c index d0d1105..974976e 100644 --- a/tests/dbus/self-handle.c +++ b/tests/dbus/self-handle.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/dbus/self-presence.c b/tests/dbus/self-presence.c index c448394..a90b4cb 100644 --- a/tests/dbus/self-presence.c +++ b/tests/dbus/self-presence.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/dbus/unsupported-interface.c b/tests/dbus/unsupported-interface.c index 0b8febb..6c1d3dc 100644 --- a/tests/dbus/unsupported-interface.c +++ b/tests/dbus/unsupported-interface.c @@ -10,6 +10,7 @@ #include "config.h" +#include #include #include #include diff --git a/tests/lib/util.c b/tests/lib/util.c index c0d3332..42c9302 100644 --- a/tests/lib/util.c +++ b/tests/lib/util.c @@ -12,6 +12,7 @@ #include "tests/lib/util.h" +#include #include #include -- 1.7.9.1