| 139 static GdkVisibilityState gtk_blist_visibility = GDK_VISIBILITY_UNOBSCURED; |
139 static GdkVisibilityState gtk_blist_visibility = GDK_VISIBILITY_UNOBSCURED; |
| 140 static gboolean gtk_blist_focused = FALSE; |
140 static gboolean gtk_blist_focused = FALSE; |
| 141 static gboolean editing_blist = FALSE; |
141 static gboolean editing_blist = FALSE; |
| 142 |
142 |
| 143 static GList *pidgin_blist_sort_methods = NULL; |
143 static GList *pidgin_blist_sort_methods = NULL; |
| 144 static struct pidgin_blist_sort_method *current_sort_method = NULL; |
144 static struct _PidginBlistSortMethod *current_sort_method = NULL; |
| 145 static void sort_method_none(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
145 static void sort_method_none(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
| 146 |
146 |
| 147 static void sort_method_alphabetical(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
147 static void sort_method_alphabetical(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
| 148 static void sort_method_status(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
148 static void sort_method_status(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
| 149 static void sort_method_log_activity(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
149 static void sort_method_log_activity(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
| 7762 return pidgin_blist_sort_methods; |
7762 return pidgin_blist_sort_methods; |
| 7763 } |
7763 } |
| 7764 |
7764 |
| 7765 void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func) |
7765 void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func) |
| 7766 { |
7766 { |
| 7767 struct pidgin_blist_sort_method *method; |
7767 struct _PidginBlistSortMethod *method; |
| 7768 |
7768 |
| 7769 g_return_if_fail(id != NULL); |
7769 g_return_if_fail(id != NULL); |
| 7770 g_return_if_fail(name != NULL); |
7770 g_return_if_fail(name != NULL); |
| 7771 g_return_if_fail(func != NULL); |
7771 g_return_if_fail(func != NULL); |
| 7772 |
7772 |
| 7773 method = g_new0(struct pidgin_blist_sort_method, 1); |
7773 method = g_new0(struct _PidginBlistSortMethod, 1); |
| 7774 method->id = g_strdup(id); |
7774 method->id = g_strdup(id); |
| 7775 method->name = g_strdup(name); |
7775 method->name = g_strdup(name); |
| 7776 method->func = func; |
7776 method->func = func; |
| 7777 pidgin_blist_sort_methods = g_list_append(pidgin_blist_sort_methods, method); |
7777 pidgin_blist_sort_methods = g_list_append(pidgin_blist_sort_methods, method); |
| 7778 pidgin_blist_update_sort_methods(); |
7778 pidgin_blist_update_sort_methods(); |
| 7783 GList *l = pidgin_blist_sort_methods; |
7783 GList *l = pidgin_blist_sort_methods; |
| 7784 |
7784 |
| 7785 g_return_if_fail(id != NULL); |
7785 g_return_if_fail(id != NULL); |
| 7786 |
7786 |
| 7787 while(l) { |
7787 while(l) { |
| 7788 struct pidgin_blist_sort_method *method = l->data; |
7788 struct _PidginBlistSortMethod *method = l->data; |
| 7789 if(!strcmp(method->id, id)) { |
7789 if(!strcmp(method->id, id)) { |
| 7790 pidgin_blist_sort_methods = g_list_delete_link(pidgin_blist_sort_methods, l); |
7790 pidgin_blist_sort_methods = g_list_delete_link(pidgin_blist_sort_methods, l); |
| 7791 g_free(method->id); |
7791 g_free(method->id); |
| 7792 g_free(method->name); |
7792 g_free(method->name); |
| 7793 g_free(method); |
7793 g_free(method); |