pidgin.next.minor: 9bbceaf1: Added purple_blist_get_ui_data, purple_b...
grim at pidgin.im
grim at pidgin.im
Sun Nov 2 23:50:30 EST 2008
-----------------------------------------------------------------
Revision: 9bbceaf1cc2b52d2c3d76014a8360d86f5c1ba68
Ancestor: 630d527d30e73cde8890b20ebe106919b990cc69
Author: grim at pidgin.im
Date: 2008-11-03T04:48:23
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/9bbceaf1cc2b52d2c3d76014a8360d86f5c1ba68
Modified files:
ChangeLog.API libpurple/blist.c libpurple/blist.h
ChangeLog:
Added purple_blist_get_ui_data, purple_blist_set_ui_data, purple_blist_node_get_ui_data, and purple_blist_node_set_ui_data functions.
Added PURPLE_BLIST_NODE, PURPLE_GROUP, PURPLE_CONTACT, PURPLE_BUDDY, and PURPLE_CHAT type casting macros. These will be later replaced with the gobject type checking and casting macros, so please try to convert all existing explicit typecasts that you see
-------------- next part --------------
============================================================
--- ChangeLog.API 72e9b15915c8e1ab3f8f10649359a12ffa70ad29
+++ ChangeLog.API 35b5a6bb65c152fcc2be752b53e7d41d1099c951
@@ -9,6 +9,15 @@ version 2.6.0 (??/??/????):
* purple_connection_set_protocol_data
* purple_buddy_get_local_buddy_alias
* purple_blist_get_buddies
+ * purple_blist_get_ui_data
+ * purple_blist_set_ui_data
+ * purple_blist_node_get_ui_data
+ * purple_blist_node_set_ui_data
+ * PURPLE_BLIST_NODE
+ * PURPLE_GROUP
+ * PURPLE_CONTACT
+ * PURPLE_BUDDY
+ * PURPLE_CHAT
Deprecated:
* purple_buddy_get_local_alias
============================================================
--- libpurple/blist.c 10804e926f6d777e15db74976d5c1dd4df193098
+++ libpurple/blist.c f707cb7a5c085ae1a30ff055bc60b25f19b2bf27
@@ -705,6 +705,18 @@ purple_blist_get_buddies()
return purplebuddylist ? purplebuddylist->buddies : NULL;
}
+void *
+purple_blist_get_ui_data()
+{
+ return purplebuddylist->ui_data;
+}
+
+void
+purple_blist_set_ui_data(void *ui_data)
+{
+ purplebuddylist->ui_data = ui_data;
+}
+
void purple_blist_show()
{
PurpleBlistUiOps *ops = purple_blist_get_ui_ops();
@@ -780,7 +792,22 @@ PurpleBlistNode *purple_blist_node_get_s
return node? node->prev : NULL;
}
+void *
+purple_blist_node_get_ui_data(const PurpleBlistNode *node)
+{
+ g_return_val_if_fail(node, NULL);
+
+ return node->ui_data;
+}
+
void
+purple_blist_node_set_ui_data(PurpleBlistNode *node, void *ui_data) {
+ g_return_if_fail(node);
+
+ node->ui_data = ui_data;
+}
+
+void
purple_blist_update_buddy_status(PurpleBuddy *buddy, PurpleStatus *old_status)
{
PurpleBlistUiOps *ops = purple_blist_get_ui_ops();
============================================================
--- libpurple/blist.h a656482580a13fb55e7b1b4d381d439e68b0476e
+++ libpurple/blist.h 11091b10010eca4e5b3936e0baba2b59339e74ec
@@ -75,12 +75,19 @@ typedef enum
} PurpleBlistNodeFlags;
+#define PURPLE_BLIST_NODE(obj) ((PurpleBlistNode *)(obj))
+
#define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (purple_blist_node_get_flags((PurpleBlistNode*)(b)) & (f))
#define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, PURPLE_BLIST_NODE_FLAG_NO_SAVE))
#define PURPLE_BLIST_NODE_NAME(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \
purple_blist_node_get_type(n) == PURPLE_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL)
+#define PURPLE_GROUP(obj) ((PurpleGroup *)(obj))
+#define PURPLE_CONTACT(obj) ((PurpleContact *)(obj))
+#define PURPLE_BUDDY(obj) ((PurpleBuddy *)(obj))
+#define PURPLE_CHAT(obj) ((PurpleChat *)(obj))
+
#include "account.h"
#include "buddyicon.h"
#include "status.h"
@@ -243,6 +250,22 @@ GHashTable *purple_blist_get_buddies(voi
GHashTable *purple_blist_get_buddies(void);
/**
+ * Returns the UI data for the list.
+ *
+ * @return The UI data for the list.
+ * @since 2.6.0
+ */
+void *purple_blist_get_ui_data(void);
+
+/**
+ * Sets the UI data for the list.
+ *
+ * @param ui_data The UI data for the list.
+ * @since 2.6.0
+ */
+void purple_blist_set_ui_data(void *ui_data);
+
+/**
* Returns the next node of a given node. This function is to be used to iterate
* over the tree returned by purple_get_blist.
*
@@ -309,6 +332,24 @@ PurpleBlistNode *purple_blist_node_get_s
PurpleBlistNode *purple_blist_node_get_sibling_prev(PurpleBlistNode *node);
/**
+ * Returns the UI data of a given node.
+ *
+ * @param node The node.
+ * @return The UI data.
+ * @since 2.6.0
+ */
+void *purple_blist_node_get_ui_data(const PurpleBlistNode *node);
+
+/**
+ * Sets the UI data of a given node.
+ *
+ * @param node The node.
+ * @param ui_data The UI data.
+ * @since 2.6.0
+ */
+void purple_blist_node_set_ui_data(PurpleBlistNode *node, void *ui_data);
+
+/**
* Shows the buddy list, creating a new one if necessary.
*/
void purple_blist_show(void);
More information about the Commits
mailing list