Mercurial > pidgin
changeset 25821:2b8c85f74ede
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
author | Gary Kramlich <grim@reaperworld.com> |
---|---|
date | Mon, 03 Nov 2008 04:48:23 +0000 |
parents | 43aeab2bb50e |
children | 12e258fb6f3c |
files | ChangeLog.API libpurple/blist.c libpurple/blist.h |
diffstat | 3 files changed, 77 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog.API Mon Nov 03 02:30:38 2008 +0000 +++ b/ChangeLog.API Mon Nov 03 04:48:23 2008 +0000 @@ -9,6 +9,15 @@ * 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
--- a/libpurple/blist.c Mon Nov 03 02:30:38 2008 +0000 +++ b/libpurple/blist.c Mon Nov 03 04:48:23 2008 +0000 @@ -705,6 +705,18 @@ 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,6 +792,21 @@ 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) {
--- a/libpurple/blist.h Mon Nov 03 02:30:38 2008 +0000 +++ b/libpurple/blist.h Mon Nov 03 04:48:23 2008 +0000 @@ -75,12 +75,19 @@ } 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(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_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);