# HG changeset patch # User Evan Schoenberg # Date 1211851147 0 # Node ID 84693a70ea3aeafa2aa4fad9430f4d5b4c88a1f4 # Parent aa639590770295a7c4cd78ad1def711308d9f26b Added prepend functions for notify_user_info section headers and breaks diff -r aa6395907702 -r 84693a70ea3a libpurple/notify.c --- a/libpurple/notify.c Mon May 26 14:30:00 2008 +0000 +++ b/libpurple/notify.c Tue May 27 01:19:07 2008 +0000 @@ -629,6 +629,17 @@ } void +purple_notify_user_info_prepend_section_header(PurpleNotifyUserInfo *user_info, const char *label) +{ + PurpleNotifyUserInfoEntry *entry; + + entry = purple_notify_user_info_entry_new(label, NULL); + entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER; + + user_info->user_info_entries = g_list_prepend(user_info->user_info_entries, entry); +} + +void purple_notify_user_info_add_section_break(PurpleNotifyUserInfo *user_info) { PurpleNotifyUserInfoEntry *entry; @@ -640,6 +651,17 @@ } void +purple_notify_user_info_prepend_section_break(PurpleNotifyUserInfo *user_info) +{ + PurpleNotifyUserInfoEntry *entry; + + entry = purple_notify_user_info_entry_new(NULL, NULL); + entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK; + + user_info->user_info_entries = g_list_prepend(user_info->user_info_entries, entry); +} + +void purple_notify_user_info_remove_last_item(PurpleNotifyUserInfo *user_info) { GList *last = g_list_last(user_info->user_info_entries); diff -r aa6395907702 -r 84693a70ea3a libpurple/notify.h --- a/libpurple/notify.h Mon May 26 14:30:00 2008 +0000 +++ b/libpurple/notify.h Tue May 27 01:19:07 2008 +0000 @@ -577,13 +577,28 @@ void purple_notify_user_info_add_section_break(PurpleNotifyUserInfo *user_info); /** + * Prepend a section break. A UI might display this as a horizontal line. + * + * @param user_info The PurpleNotifyUserInfo + */ +void purple_notify_user_info_prepend_section_break(PurpleNotifyUserInfo *user_info); + +/** * Add a section header. A UI might display this in a different font from other text. * * @param user_info The PurpleNotifyUserInfo * @param label The name of the section */ void purple_notify_user_info_add_section_header(PurpleNotifyUserInfo *user_info, const char *label); - + +/** + * Prepend a section header. A UI might display this in a different font from other text. + * + * @param user_info The PurpleNotifyUserInfo + * @param label The name of the section + */ +void purple_notify_user_info_prepend_section_header(PurpleNotifyUserInfo *user_info, const char *label); + /** * Remove the last item which was added to a PurpleNotifyUserInfo. This could be used to remove a section header which is not needed. */