From 0b0bb0f621d8e1cda1508d9062a279459fc3b955 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 30 Aug 2007 16:49:52 +0000 Subject: Completely reworked ContactList API. Fixes bug #471611, bug #467280, bug #459540 and bug #462907. svn path=/trunk/; revision=280 --- python/README | 19 + python/pyempathy/pyempathy.defs | 819 ++++++++++++++++------------------ python/pyempathy/pyempathy.override | 30 +- python/pyempathygtk/pyempathygtk.defs | 51 +-- 4 files changed, 418 insertions(+), 501 deletions(-) create mode 100644 python/README (limited to 'python') diff --git a/python/README b/python/README new file mode 100644 index 000000000..f9c121b5f --- /dev/null +++ b/python/README @@ -0,0 +1,19 @@ +To update python binding: +1) + $ make distclean + $ python /usr/share/pygtk/2.0/codegen/h2def.py libempathy/*.h > python/pyempathy/pyempathy.defs + $ python /usr/share/pygtk/2.0/codegen/h2def.py libempathy-gtk/*.h > python/pyempathygtk/pyempathygtk.defs + +2) +Manually modify pyempathy.defs, ContactList is not an object but an interface: +(define-interface ContactList + (in-module "Empathy") + (c-name "EmpathyContactList") + (gtype-id "EMPATHY_TYPE_CONTACT_LIST") +) + +ContactManager, TpChatroom and TpContactList implements ContactList interface: + (implements "EmpathyContactList") + +3) +Manually update headers in pyempathy.override and pyempathygtk.override. diff --git a/python/pyempathy/pyempathy.defs b/python/pyempathy/pyempathy.defs index eea0b76d3..97f7b6ac9 100644 --- a/python/pyempathy/pyempathy.defs +++ b/python/pyempathy/pyempathy.defs @@ -43,6 +43,13 @@ (gtype-id "EMPATHY_TYPE_CONTACT") ) +(define-object ContactFactory + (in-module "Empathy") + (parent "GObject") + (c-name "EmpathyContactFactory") + (gtype-id "EMPATHY_TYPE_CONTACT_FACTORY") +) + (define-object ContactManager (in-module "Empathy") (parent "GObject") @@ -116,20 +123,15 @@ (gtype-id "EMPATHY_TYPE_TP_GROUP") ) -;; Enumerations and flags ... - -(define-flags Subscription +(define-object TpRoomlist (in-module "Empathy") - (c-name "EmpathySubscription") - (gtype-id "EMPATHY_TYPE_SUBSCRIPTION") - (values - '("none" "EMPATHY_SUBSCRIPTION_NONE") - '("to" "EMPATHY_SUBSCRIPTION_TO") - '("from" "EMPATHY_SUBSCRIPTION_FROM") - '("both" "EMPATHY_SUBSCRIPTION_BOTH") - ) + (parent "GObject") + (c-name "EmpathyTpRoomlist") + (gtype-id "EMPATHY_TYPE_TP_ROOMLIST") ) +;; Enumerations and flags ... + (define-enum MessageType (in-module "Empathy") (c-name "EmpathyMessageType") @@ -159,8 +161,8 @@ ;; From empathy-avatar.h -(define-function empathy_avatar_get_gtype - (c-name "empathy_avatar_get_gtype") +(define-function empathy_avatar_get_type + (c-name "empathy_avatar_get_type") (return-type "GType") ) @@ -189,23 +191,6 @@ -;; From empathy-chandler-glue.h - -(define-function dbus_glib_marshal_empathy_chandler_BOOLEAN__STRING_BOXED_STRING_BOXED_UINT_UINT_POINTER - (c-name "dbus_glib_marshal_empathy_chandler_BOOLEAN__STRING_BOXED_STRING_BOXED_UINT_UINT_POINTER") - (return-type "none") - (parameters - '("GClosure*" "closure") - '("GValue*" "return_value") - '("guint" "n_param_values") - '("const-GValue*" "param_values") - '("gpointer" "invocation_hint") - '("gpointer" "marshal_data") - ) -) - - - ;; From empathy-chandler.h (define-function empathy_chandler_get_type @@ -225,73 +210,6 @@ -;; From empathy-chatroom-manager.h - -(define-function empathy_chatroom_manager_get_type - (c-name "empathy_chatroom_manager_get_type") - (return-type "GType") -) - -(define-function empathy_chatroom_manager_new - (c-name "empathy_chatroom_manager_new") - (is-constructor-of "EmpathyChatroomManager") - (return-type "EmpathyChatroomManager*") -) - -(define-method add - (of-object "EmpathyChatroomManager") - (c-name "empathy_chatroom_manager_add") - (return-type "gboolean") - (parameters - '("EmpathyChatroom*" "chatroom") - ) -) - -(define-method remove - (of-object "EmpathyChatroomManager") - (c-name "empathy_chatroom_manager_remove") - (return-type "none") - (parameters - '("EmpathyChatroom*" "chatroom") - ) -) - -(define-method find - (of-object "EmpathyChatroomManager") - (c-name "empathy_chatroom_manager_find") - (return-type "EmpathyChatroom*") - (parameters - '("McAccount*" "account") - '("const-gchar*" "room") - ) -) - -(define-method get_chatrooms - (of-object "EmpathyChatroomManager") - (c-name "empathy_chatroom_manager_get_chatrooms") - (return-type "GList*") - (parameters - '("McAccount*" "account") - ) -) - -(define-method get_count - (of-object "EmpathyChatroomManager") - (c-name "empathy_chatroom_manager_get_count") - (return-type "guint") - (parameters - '("McAccount*" "account") - ) -) - -(define-method store - (of-object "EmpathyChatroomManager") - (c-name "empathy_chatroom_manager_store") - (return-type "none") -) - - - ;; From empathy-chatroom.h (define-function empathy_chatroom_get_type @@ -391,6 +309,73 @@ +;; From empathy-chatroom-manager.h + +(define-function empathy_chatroom_manager_get_type + (c-name "empathy_chatroom_manager_get_type") + (return-type "GType") +) + +(define-function empathy_chatroom_manager_new + (c-name "empathy_chatroom_manager_new") + (is-constructor-of "EmpathyChatroomManager") + (return-type "EmpathyChatroomManager*") +) + +(define-method add + (of-object "EmpathyChatroomManager") + (c-name "empathy_chatroom_manager_add") + (return-type "gboolean") + (parameters + '("EmpathyChatroom*" "chatroom") + ) +) + +(define-method remove + (of-object "EmpathyChatroomManager") + (c-name "empathy_chatroom_manager_remove") + (return-type "none") + (parameters + '("EmpathyChatroom*" "chatroom") + ) +) + +(define-method find + (of-object "EmpathyChatroomManager") + (c-name "empathy_chatroom_manager_find") + (return-type "EmpathyChatroom*") + (parameters + '("McAccount*" "account") + '("const-gchar*" "room") + ) +) + +(define-method get_chatrooms + (of-object "EmpathyChatroomManager") + (c-name "empathy_chatroom_manager_get_chatrooms") + (return-type "GList*") + (parameters + '("McAccount*" "account") + ) +) + +(define-method get_count + (of-object "EmpathyChatroomManager") + (c-name "empathy_chatroom_manager_get_count") + (return-type "guint") + (parameters + '("McAccount*" "account") + ) +) + +(define-method store + (of-object "EmpathyChatroomManager") + (c-name "empathy_chatroom_manager_store") + (return-type "none") +) + + + ;; From empathy-conf.h (define-function empathy_conf_get_type @@ -510,198 +495,74 @@ -;; From empathy-contact-list.h +;; From empathy-contact-factory.h -(define-function contact_list_get_type - (c-name "empathy_contact_list_get_type") +(define-function empathy_contact_factory_get_type + (c-name "empathy_contact_factory_get_type") (return-type "GType") ) -(define-method list_info_new - (of-object "EmpathyContact") - (c-name "empathy_contact_list_info_new") - (return-type "EmpathyContactListInfo*") - (parameters - '("const-gchar*" "message") - ) -) - -(define-method free - (of-object "EmpathyContactListInfo") - (c-name "empathy_contact_list_info_free") - (return-type "none") -) - -(define-method setup - (of-object "EmpathyContactList") - (c-name "empathy_contact_list_setup") - (return-type "none") +(define-function empathy_contact_factory_new + (c-name "empathy_contact_factory_new") + (is-constructor-of "EmpathyContactFactory") + (return-type "EmpathyContactFactory*") ) -(define-method find - (of-object "EmpathyContactList") - (c-name "empathy_contact_list_find") +(define-method get_user + (of-object "EmpathyContactFactory") + (c-name "empathy_contact_factory_get_user") (return-type "EmpathyContact*") (parameters - '("const-gchar*" "id") - ) -) - -(define-method add - (of-object "EmpathyContactList") - (c-name "empathy_contact_list_add") - (return-type "none") - (parameters - '("EmpathyContact*" "contact") - '("const-gchar*" "message") - ) -) - -(define-method remove - (of-object "EmpathyContactList") - (c-name "empathy_contact_list_remove") - (return-type "none") - (parameters - '("EmpathyContact*" "contact") - '("const-gchar*" "message") - ) -) - -(define-method get_members - (of-object "EmpathyContactList") - (c-name "empathy_contact_list_get_members") - (return-type "GList*") -) - -(define-method get_local_pending - (of-object "EmpathyContactList") - (c-name "empathy_contact_list_get_local_pending") - (return-type "GList*") -) - -(define-method process_pending - (of-object "EmpathyContactList") - (c-name "empathy_contact_list_process_pending") - (return-type "none") - (parameters - '("EmpathyContact*" "contact") - '("gboolean" "accept") + '("McAccount*" "account") ) ) -(define-virtual setup - (of-object "EmpathyContactList") - (return-type "none") -) - -(define-virtual find - (of-object "EmpathyContactList") +(define-method get_from_id + (of-object "EmpathyContactFactory") + (c-name "empathy_contact_factory_get_from_id") (return-type "EmpathyContact*") - (parameters - '("const-gchar*" "id") - ) -) - -(define-virtual add - (of-object "EmpathyContactList") - (return-type "none") - (parameters - '("EmpathyContact*" "contact") - '("const-gchar*" "message") - ) -) - -(define-virtual remove - (of-object "EmpathyContactList") - (return-type "none") - (parameters - '("EmpathyContact*" "contact") - '("const-gchar*" "message") - ) -) - -(define-virtual get_members - (of-object "EmpathyContactList") - (return-type "GList*") -) - -(define-virtual get_local_pending - (of-object "EmpathyContactList") - (return-type "GList*") -) - -(define-virtual process_pending - (of-object "EmpathyContactList") - (return-type "none") - (parameters - '("EmpathyContact*" "contact") - '("gboolean" "accept") - ) -) - -;; From empathy-contact-manager.h - -(define-function empathy_contact_manager_get_type - (c-name "empathy_contact_manager_get_type") - (return-type "GType") -) - -(define-function empathy_contact_manager_new - (c-name "empathy_contact_manager_new") - (is-constructor-of "EmpathyContactManager") - (return-type "EmpathyContactManager*") -) - -(define-method get_list - (of-object "EmpathyContactManager") - (c-name "empathy_contact_manager_get_list") - (return-type "EmpathyTpContactList*") (parameters '("McAccount*" "account") + '("const-gchar*" "id") ) ) -(define-method get_user - (of-object "EmpathyContactManager") - (c-name "empathy_contact_manager_get_user") +(define-method get_from_handle + (of-object "EmpathyContactFactory") + (c-name "empathy_contact_factory_get_from_handle") (return-type "EmpathyContact*") (parameters '("McAccount*" "account") + '("guint" "handle") ) ) -(define-method create - (of-object "EmpathyContactManager") - (c-name "empathy_contact_manager_create") - (return-type "EmpathyContact*") +(define-method get_from_handles + (of-object "EmpathyContactFactory") + (c-name "empathy_contact_factory_get_from_handles") + (return-type "GList*") (parameters '("McAccount*" "account") - '("const-gchar*" "id") + '("GArray*" "handles") ) ) -(define-method rename_group - (of-object "EmpathyContactManager") - (c-name "empathy_contact_manager_rename_group") +(define-method set_name + (of-object "EmpathyContactFactory") + (c-name "empathy_contact_factory_set_name") (return-type "none") (parameters - '("const-gchar*" "old_group") - '("const-gchar*" "new_group") + '("EmpathyContact*" "contact") + '("const-gchar*" "name") ) ) -(define-method get_groups - (of-object "EmpathyContactManager") - (c-name "empathy_contact_manager_get_groups") - (return-type "GList*") -) - ;; From empathy-contact.h -(define-function empathy_contact_get_gtype - (c-name "empathy_contact_get_gtype") +(define-function empathy_contact_get_type + (c-name "empathy_contact_get_type") (return-type "GType") ) @@ -730,40 +591,73 @@ (return-type "const-gchar*") ) +(define-method set_id + (of-object "EmpathyContact") + (c-name "empathy_contact_set_id") + (return-type "none") + (parameters + '("const-gchar*" "id") + ) +) + (define-method get_name (of-object "EmpathyContact") (c-name "empathy_contact_get_name") (return-type "const-gchar*") ) +(define-method set_name + (of-object "EmpathyContact") + (c-name "empathy_contact_set_name") + (return-type "none") + (parameters + '("const-gchar*" "name") + ) +) + (define-method get_avatar (of-object "EmpathyContact") (c-name "empathy_contact_get_avatar") (return-type "EmpathyAvatar*") ) +(define-method set_avatar + (of-object "EmpathyContact") + (c-name "empathy_contact_set_avatar") + (return-type "none") + (parameters + '("EmpathyAvatar*" "avatar") + ) +) + (define-method get_account (of-object "EmpathyContact") (c-name "empathy_contact_get_account") (return-type "McAccount*") ) -(define-method get_presence +(define-method set_account (of-object "EmpathyContact") - (c-name "empathy_contact_get_presence") - (return-type "EmpathyPresence*") + (c-name "empathy_contact_set_account") + (return-type "none") + (parameters + '("McAccount*" "account") + ) ) -(define-method get_groups +(define-method get_presence (of-object "EmpathyContact") - (c-name "empathy_contact_get_groups") - (return-type "GList*") + (c-name "empathy_contact_get_presence") + (return-type "EmpathyPresence*") ) -(define-method get_subscription +(define-method set_presence (of-object "EmpathyContact") - (c-name "empathy_contact_get_subscription") - (return-type "EmpathySubscription") + (c-name "empathy_contact_set_presence") + (return-type "none") + (parameters + '("EmpathyPresence*" "presence") + ) ) (define-method get_handle @@ -772,146 +666,166 @@ (return-type "guint") ) +(define-method set_handle + (of-object "EmpathyContact") + (c-name "empathy_contact_set_handle") + (return-type "none") + (parameters + '("guint" "handle") + ) +) + (define-method is_user (of-object "EmpathyContact") (c-name "empathy_contact_is_user") (return-type "gboolean") ) -(define-method set_id +(define-method set_is_user (of-object "EmpathyContact") - (c-name "empathy_contact_set_id") + (c-name "empathy_contact_set_is_user") (return-type "none") (parameters - '("const-gchar*" "id") + '("gboolean" "is_user") ) ) -(define-method set_name +(define-method is_online (of-object "EmpathyContact") - (c-name "empathy_contact_set_name") - (return-type "none") + (c-name "empathy_contact_is_online") + (return-type "gboolean") +) + +(define-method get_status + (of-object "EmpathyContact") + (c-name "empathy_contact_get_status") + (return-type "const-gchar*") +) + +(define-function empathy_contact_equal + (c-name "empathy_contact_equal") + (return-type "gboolean") (parameters - '("const-gchar*" "name") + '("gconstpointer" "v1") + '("gconstpointer" "v2") ) ) -(define-method set_avatar - (of-object "EmpathyContact") - (c-name "empathy_contact_set_avatar") - (return-type "none") +(define-function empathy_contact_hash + (c-name "empathy_contact_hash") + (return-type "guint") (parameters - '("EmpathyAvatar*" "avatar") + '("gconstpointer" "key") ) ) -(define-method set_account - (of-object "EmpathyContact") - (c-name "empathy_contact_set_account") - (return-type "none") - (parameters - '("McAccount*" "account") - ) + + +;; From empathy-contact-list.h + +(define-function empathy_contact_list_get_type + (c-name "empathy_contact_list_get_type") + (return-type "GType") ) -(define-method set_presence - (of-object "EmpathyContact") - (c-name "empathy_contact_set_presence") +(define-method add + (of-object "EmpathyContactList") + (c-name "empathy_contact_list_add") (return-type "none") (parameters - '("EmpathyPresence*" "presence") + '("EmpathyContact*" "contact") + '("const-gchar*" "message") ) ) -(define-method set_groups - (of-object "EmpathyContact") - (c-name "empathy_contact_set_groups") +(define-method remove + (of-object "EmpathyContactList") + (c-name "empathy_contact_list_remove") (return-type "none") (parameters - '("GList*" "categories") + '("EmpathyContact*" "contact") + '("const-gchar*" "message") ) ) -(define-method set_subscription - (of-object "EmpathyContact") - (c-name "empathy_contact_set_subscription") - (return-type "none") - (parameters - '("EmpathySubscription" "subscription") - ) +(define-method get_members + (of-object "EmpathyContactList") + (c-name "empathy_contact_list_get_members") + (return-type "GList*") ) -(define-method set_handle - (of-object "EmpathyContact") - (c-name "empathy_contact_set_handle") - (return-type "none") - (parameters - '("guint" "handle") - ) +(define-method get_pendings + (of-object "EmpathyContactList") + (c-name "empathy_contact_list_get_pendings") + (return-type "GList*") ) -(define-method set_is_user - (of-object "EmpathyContact") - (c-name "empathy_contact_set_is_user") - (return-type "none") +(define-method get_all_groups + (of-object "EmpathyContactList") + (c-name "empathy_contact_list_get_all_groups") + (return-type "GList*") +) + +(define-method get_groups + (of-object "EmpathyContactList") + (c-name "empathy_contact_list_get_groups") + (return-type "GList*") (parameters - '("gboolean" "is_user") + '("EmpathyContact*" "contact") ) ) -(define-method add_group - (of-object "EmpathyContact") - (c-name "empathy_contact_add_group") +(define-method add_to_group + (of-object "EmpathyContactList") + (c-name "empathy_contact_list_add_to_group") (return-type "none") (parameters + '("EmpathyContact*" "contact") '("const-gchar*" "group") ) ) -(define-method remove_group - (of-object "EmpathyContact") - (c-name "empathy_contact_remove_group") +(define-method remove_from_group + (of-object "EmpathyContactList") + (c-name "empathy_contact_list_remove_from_group") (return-type "none") (parameters + '("EmpathyContact*" "contact") '("const-gchar*" "group") ) ) -(define-method is_online - (of-object "EmpathyContact") - (c-name "empathy_contact_is_online") - (return-type "gboolean") -) - -(define-method is_in_group - (of-object "EmpathyContact") - (c-name "empathy_contact_is_in_group") - (return-type "gboolean") +(define-method rename_group + (of-object "EmpathyContactList") + (c-name "empathy_contact_list_rename_group") + (return-type "none") (parameters - '("const-gchar*" "group") + '("const-gchar*" "old_group") + '("const-gchar*" "new_group") ) ) -(define-method get_status - (of-object "EmpathyContact") - (c-name "empathy_contact_get_status") - (return-type "const-gchar*") + + +;; From empathy-contact-manager.h + +(define-function empathy_contact_manager_get_type + (c-name "empathy_contact_manager_get_type") + (return-type "GType") ) -(define-function empathy_contact_equal - (c-name "empathy_contact_equal") - (return-type "gboolean") - (parameters - '("gconstpointer" "v1") - '("gconstpointer" "v2") - ) +(define-function empathy_contact_manager_new + (c-name "empathy_contact_manager_new") + (is-constructor-of "EmpathyContactManager") + (return-type "EmpathyContactManager*") ) -(define-function empathy_contact_hash - (c-name "empathy_contact_hash") - (return-type "guint") +(define-method get_list + (of-object "EmpathyContactManager") + (c-name "empathy_contact_manager_get_list") + (return-type "EmpathyTpContactList*") (parameters - '("gconstpointer" "key") + '("McAccount*" "account") ) ) @@ -929,21 +843,9 @@ (varargs #t) ) - - -;; From empathy-filter-glue.h - -(define-function dbus_glib_marshal_empathy_filter_BOOLEAN__STRING_BOXED_STRING_BOXED_UINT_UINT_UINT_POINTER - (c-name "dbus_glib_marshal_empathy_filter_BOOLEAN__STRING_BOXED_STRING_BOXED_UINT_UINT_UINT_POINTER") +(define-function empathy_debug_set_log_file_from_env + (c-name "empathy_debug_set_log_file_from_env") (return-type "none") - (parameters - '("GClosure*" "closure") - '("GValue*" "return_value") - '("guint" "n_param_values") - '("const-GValue*" "param_values") - '("gpointer" "invocation_hint") - '("gpointer" "marshal_data") - ) ) @@ -1096,6 +998,15 @@ ) ) +(define-method get_messages_for_file + (of-object "EmpathyLogManager") + (c-name "empathy_log_manager_get_messages_for_file") + (return-type "GList*") + (parameters + '("const-gchar*" "filename") + ) +) + (define-method get_messages_for_date (of-object "EmpathyLogManager") (c-name "empathy_log_manager_get_messages_for_date") @@ -1119,6 +1030,15 @@ ) ) +(define-method get_messages_for_file + (of-object "EmpathyLogManager") + (c-name "empathy_log_manager_get_messages_for_file") + (return-type "GList*") + (parameters + '("const-gchar*" "filename") + ) +) + (define-method get_chats (of-object "EmpathyLogManager") (c-name "empathy_log_manager_get_chats") @@ -1155,10 +1075,6 @@ -;; From empathy-marshal.h - - - ;; From empathy-message.h (define-function empathy_message_get_gtype @@ -1250,6 +1166,20 @@ ) ) +(define-function empathy_message_type_from_str + (c-name "empathy_message_type_from_str") + (return-type "EmpathyMessageType") + (parameters + '("const-gchar*" "type_str") + ) +) + +(define-method to_str + (of-object "EmpathyMessageType") + (c-name "empathy_message_type_to_str") + (return-type "const-gchar*") +) + ;; From empathy-presence.h @@ -1535,55 +1465,6 @@ (return-type "McAccount*") ) -(define-method get_user - (of-object "EmpathyTpContactList") - (c-name "empathy_tp_contact_list_get_user") - (return-type "EmpathyContact*") -) - -(define-method get_from_id - (of-object "EmpathyTpContactList") - (c-name "empathy_tp_contact_list_get_from_id") - (return-type "EmpathyContact*") - (parameters - '("const-gchar*" "id") - ) -) - -(define-method get_from_handle - (of-object "EmpathyTpContactList") - (c-name "empathy_tp_contact_list_get_from_handle") - (return-type "EmpathyContact*") - (parameters - '("guint" "handle") - ) -) - -(define-method get_from_handles - (of-object "EmpathyTpContactList") - (c-name "empathy_tp_contact_list_get_from_handles") - (return-type "GList*") - (parameters - '("GArray*" "handles") - ) -) - -(define-method rename_group - (of-object "EmpathyTpContactList") - (c-name "empathy_tp_contact_list_rename_group") - (return-type "none") - (parameters - '("const-gchar*" "old_group") - '("const-gchar*" "new_group") - ) -) - -(define-method get_groups - (of-object "EmpathyTpContactList") - (c-name "empathy_tp_contact_list_get_groups") - (return-type "GList*") -) - ;; From empathy-tp-group.h @@ -1598,17 +1479,23 @@ (is-constructor-of "EmpathyTpGroup") (return-type "EmpathyTpGroup*") (parameters + '("McAccount*" "account") '("TpChan*" "tp_chan") - '("TpConn*" "tp_conn") ) ) +(define-method close + (of-object "EmpathyTpGroup") + (c-name "empathy_tp_group_close") + (return-type "none") +) + (define-method add_members (of-object "EmpathyTpGroup") (c-name "empathy_tp_group_add_members") (return-type "none") (parameters - '("GArray*" "handles") + '("GList*" "contacts") '("const-gchar*" "message") ) ) @@ -1618,7 +1505,7 @@ (c-name "empathy_tp_group_add_member") (return-type "none") (parameters - '("guint" "handle") + '("EmpathyContact*" "contact") '("const-gchar*" "message") ) ) @@ -1628,7 +1515,7 @@ (c-name "empathy_tp_group_remove_members") (return-type "none") (parameters - '("GArray*" "handle") + '("GList*" "contacts") '("const-gchar*" "message") ) ) @@ -1638,7 +1525,7 @@ (c-name "empathy_tp_group_remove_member") (return-type "none") (parameters - '("guint" "handle") + '("EmpathyContact*" "contact") '("const-gchar*" "message") ) ) @@ -1646,44 +1533,31 @@ (define-method get_members (of-object "EmpathyTpGroup") (c-name "empathy_tp_group_get_members") - (return-type "GArray*") + (return-type "GList*") ) -(define-method get_all_members +(define-method get_local_pendings (of-object "EmpathyTpGroup") - (c-name "empathy_tp_group_get_all_members") - (return-type "none") - (parameters - '("GArray**" "members") - '("GArray**" "local_pending") - '("GArray**" "remote_pending") - ) + (c-name "empathy_tp_group_get_local_pendings") + (return-type "GList*") ) -(define-method get_local_pending_members_with_info +(define-method get_remote_pendings (of-object "EmpathyTpGroup") - (c-name "empathy_tp_group_get_local_pending_members_with_info") + (c-name "empathy_tp_group_get_remote_pendings") (return-type "GList*") ) -(define-function empathy_tp_group_info_list_free - (c-name "empathy_tp_group_info_list_free") - (return-type "none") - (parameters - '("GList*" "infos") - ) -) - (define-method get_name (of-object "EmpathyTpGroup") (c-name "empathy_tp_group_get_name") (return-type "const-gchar*") ) -(define-method get_self_handle +(define-method get_self_contact (of-object "EmpathyTpGroup") - (c-name "empathy_tp_group_get_self_handle") - (return-type "guint") + (c-name "empathy_tp_group_get_self_contact") + (return-type "EmpathyContact*") ) (define-method get_object_path @@ -1697,10 +1571,63 @@ (c-name "empathy_tp_group_is_member") (return-type "gboolean") (parameters - '("guint" "handle") + '("EmpathyContact*" "contact") + ) +) + +(define-function empathy_pending_info_new + (c-name "empathy_pending_info_new") + (is-constructor-of "EmpathyPendingInfo") + (return-type "EmpathyPendingInfo*") + (parameters + '("EmpathyContact*" "member") + '("EmpathyContact*" "actor") + '("const-gchar*" "message") + ) +) + +(define-method free + (of-object "EmpathyPendingInfo") + (c-name "empathy_pending_info_free") + (return-type "none") +) + + + +;; From empathy-tp-roomlist.h + +(define-function empathy_tp_roomlist_get_type + (c-name "empathy_tp_roomlist_get_type") + (return-type "GType") +) + +(define-function empathy_tp_roomlist_new + (c-name "empathy_tp_roomlist_new") + (is-constructor-of "EmpathyTpRoomlist") + (return-type "EmpathyTpRoomlist*") + (parameters + '("McAccount*" "account") ) ) +(define-method is_listing + (of-object "EmpathyTpRoomlist") + (c-name "empathy_tp_roomlist_is_listing") + (return-type "gboolean") +) + +(define-method start + (of-object "EmpathyTpRoomlist") + (c-name "empathy_tp_roomlist_start") + (return-type "none") +) + +(define-method stop + (of-object "EmpathyTpRoomlist") + (c-name "empathy_tp_roomlist_stop") + (return-type "none") +) + ;; From empathy-utils.h @@ -1805,8 +1732,18 @@ (return-type "MissionControl*") ) -(define-function empathy_get_channel_id - (c-name "empathy_get_channel_id") +(define-function empathy_inspect_handle + (c-name "empathy_inspect_handle") + (return-type "gchar*") + (parameters + '("McAccount*" "account") + '("guint" "handle") + '("guint" "handle_type") + ) +) + +(define-function empathy_inspect_channel + (c-name "empathy_inspect_channel") (return-type "gchar*") (parameters '("McAccount*" "account") @@ -1814,3 +1751,13 @@ ) ) +(define-function empathy_strdiff + (c-name "empathy_strdiff") + (return-type "gboolean") + (parameters + '("const-gchar*" "left") + '("const-gchar*" "right") + ) +) + + diff --git a/python/pyempathy/pyempathy.override b/python/pyempathy/pyempathy.override index 607a9e520..dd816e23a 100644 --- a/python/pyempathy/pyempathy.override +++ b/python/pyempathy/pyempathy.override @@ -21,15 +21,10 @@ headers #include "empathy-tp-chatroom.h" #include "empathy-tp-contact-list.h" #include "empathy-tp-group.h" +#include "empathy-tp-roomlist.h" #include "empathy-utils.h" - - -/* FIXME */ -#define MC_TYPE_PRESENCE 1 -#define EMPATHY_TYPE_SUBSCRIPTION 2 -#define EMPATHY_TYPE_MESSAGE_TYPE 3 -#define EMPATHY_TYPE_REG_EX_TYPE 4 - +#include "empathy-contact-factory.h" +#include "empathy-enum-types.h" void empathy_add_constants(PyObject *module, const gchar *strip_prefix); void empathy_register_classes(PyObject *d); @@ -62,22 +57,3 @@ _wrap_empathy_contact_list_get_members(PyGObject *self, PyObject *args, PyObject } %% -override empathy_contact_get_groups kwargs -static PyObject * -_wrap_empathy_contact_get_groups(PyGObject *self, PyObject *args, PyObject *kwargs) -{ - - GList *groups = empathy_contact_get_groups(EMPATHY_CONTACT(self->obj)); - PyObject *py_groups = PyList_New(0); - GList *l; - - for(l = groups; l; l = l->next) { - const gchar *group; - group = l->data; - PyList_Append(py_groups, PyString_FromString(group)); - } - - return py_groups; - -} -%% diff --git a/python/pyempathygtk/pyempathygtk.defs b/python/pyempathygtk/pyempathygtk.defs index c41ea45c7..71a4437b6 100644 --- a/python/pyempathygtk/pyempathygtk.defs +++ b/python/pyempathygtk/pyempathygtk.defs @@ -306,6 +306,19 @@ +;; From empathy-account-widget-salut.h + +(define-function empathy_account_widget_salut_new + (c-name "empathy_account_widget_salut_new") + (is-constructor-of "EmpathyAccountWidgetSalut") + (return-type "GtkWidget*") + (parameters + '("McAccount*" "account") + ) +) + + + ;; From empathy-cell-renderer-expander.h (define-function empathy_cell_renderer_expander_get_type @@ -957,25 +970,6 @@ ) ) -(define-method set_contact_groups_func - (of-object "EmpathyContactListStore") - (c-name "empathy_contact_list_store_set_contact_groups_func") - (return-type "none") - (parameters - '("EmpathyContactGroupsFunc" "func") - '("gpointer" "user_data") - ) -) - -(define-method update_contact_groups - (of-object "EmpathyContactListStore") - (c-name "empathy_contact_list_store_update_contact_groups") - (return-type "none") - (parameters - '("EmpathyContact*" "contact") - ) -) - ;; From empathy-contact-list-view.h @@ -1021,25 +1015,6 @@ (return-type "GtkWidget*") ) -(define-method set_filter - (of-object "EmpathyContactListView") - (c-name "empathy_contact_list_view_set_filter") - (return-type "none") - (parameters - '("const-gchar*" "filter") - ) -) - -(define-method set_drag_received_func - (of-object "EmpathyContactListView") - (c-name "empathy_contact_list_view_set_drag_received_func") - (return-type "none") - (parameters - '("EmpathyContactListViewDragReceivedFunc" "func") - '("gpointer" "user_data") - ) -) - ;; From empathy-contact-widget.h -- cgit v1.2.3