Mercurial > pidgin.yaz
changeset 23207:84693a70ea3a
Added prepend functions for notify_user_info section headers and breaks
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Tue, 27 May 2008 01:19:07 +0000 |
parents | aa6395907702 |
children | 646e96069fcd |
files | libpurple/notify.c libpurple/notify.h |
diffstat | 2 files changed, 38 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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. */