# HG changeset patch
# Node ID 6864bb59a566
# Parent  293ee44d15a7
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -773,6 +773,7 @@
 		* pidgin_blist_draw_tooltip
 		* pidgin_blist_get_theme
 		* pidgin_blist_layout_get_type
+		* pidgin_blist_set_headline
 		* pidgin_blist_set_theme
 		* pidgin_blist_theme_get_background_color
 		* pidgin_blist_theme_get_collapsed_background_color
@@ -808,8 +809,13 @@
 		* pidgin_blist_theme_set_status_text_info
 		* pidgin_blist_theme_set_unread_message_nick_said_text_info
 		* pidgin_blist_theme_set_unread_message_text_info
+		* pidgin_blist_toggle_visibility
 		* pidgin_blist_tooltip_destroy
 		* pidgin_blist_update_account_error_state
+		* pidgin_blist_update_accounts_menu
+		* pidgin_blist_update_columns
+		* pidgin_blist_update_plugin_actions
+		* pidgin_blist_update_refresh_timeout
 		* pidgin_blist_visibility_manager_add
 		* pidgin_blist_visibility_manager_remove
 		* PidginBlistLayout
diff --git a/pidgin/gtkblist.h b/pidgin/gtkblist.h
--- a/pidgin/gtkblist.h
+++ b/pidgin/gtkblist.h
@@ -95,12 +95,6 @@
 	PurpleBlistNode *selected_node;
 
 	GtkWidget *scrollbook;
-	GtkWidget *headline;
-	GtkWidget *headline_label;
-	GtkWidget *headline_image;
-	GCallback headline_callback;
-	gpointer headline_data;
-	GDestroyNotify headline_destroy;
 };
 
 G_BEGIN_DECLS
@@ -167,9 +161,6 @@
  */
 void pidgin_blist_refresh(PurpleBuddyList *list);
 
-void pidgin_blist_update_columns(void);
-void pidgin_blist_update_refresh_timeout(void);
-
 /**
  * pidgin_blist_get_emblem:
  * @node:   The node to return an emblem for
@@ -208,15 +199,6 @@
 gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node);
 
 /**
- * pidgin_blist_toggle_visibility:
- *
- * Intelligently toggles the visibility of the buddy list. If the buddy
- * list is obscured, it is brought to the front. If it is not obscured,
- * it is hidden. If it is hidden it is shown.
- */
-void pidgin_blist_toggle_visibility(void);
-
-/**
  * pidgin_blist_add_alert:
  * @widget:   The widget to add
  *
@@ -281,20 +263,6 @@
 void pidgin_blist_setup_sort_methods(void);
 
 /**
- * pidgin_blist_update_accounts_menu:
- *
- * Updates the accounts menu on the GTK buddy list window.
- */
-void pidgin_blist_update_accounts_menu(void);
-
-/**
- * pidgin_blist_update_plugin_actions:
- *
- * Updates the plugin actions menu on the GTK buddy list window.
- */
-void pidgin_blist_update_plugin_actions(void);
-
-/**
  * pidgin_blist_update_sort_methods:
  *
  * Updates the Sorting menu on the GTK buddy list window.
@@ -343,22 +311,6 @@
 void pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node);
 
 /**
- * pidgin_blist_set_headline:
- * @text:	    Pango Markup for the label text
- * @icon_name: The icon name from the #GtkIconTheme
- * @callback:  The callback to call when headline is clicked
- * @user_data: The userdata to include in the callback
- * @destroy:   The callback to call when headline is closed or replaced by another headline.
- *
- * Sets a headline notification
- *
- * This is currently used for mail notification, but could theoretically be used for anything.
- * Only the most recent headline will be shown.
- */
-void pidgin_blist_set_headline(const char *text, const gchar *icon_name,
-		GCallback callback, gpointer user_data, GDestroyNotify destroy);
-
-/**
  * pidgin_blist_get_name_markup:
  * @buddy: The buddy to return markup from
  * @selected:  Whether this buddy is selected. If TRUE, the markup will not change the color.
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -3850,64 +3850,6 @@
 		pidgin_blist_sort_method_set(val);
 }
 
-static void
-reset_headline(PidginBuddyList *gtkblist)
-{
-	gtkblist->headline_callback = NULL;
-	gtkblist->headline_data = NULL;
-	gtkblist->headline_destroy = NULL;
-
-	gtk_window_set_urgency_hint(GTK_WINDOW(gtkblist->window), FALSE);
-}
-
-static gboolean
-headline_click_callback(gpointer unused)
-{
-	if (gtkblist->headline_callback)
-		((GSourceFunc) gtkblist->headline_callback)(gtkblist->headline_data);
-	reset_headline(gtkblist);
-	return FALSE;
-}
-
-static gboolean
-headline_response_cb(GtkInfoBar *infobar, int resp, PidginBuddyList *gtkblist)
-{
-	gtk_widget_hide(gtkblist->headline);
-
-	if (resp == GTK_RESPONSE_OK) {
-		if (gtkblist->headline_callback)
-			g_idle_add(headline_click_callback, NULL);
-		else {
-			if (gtkblist->headline_destroy)
-				gtkblist->headline_destroy(gtkblist->headline_data);
-			reset_headline(gtkblist);
-		}
-	} else {
-		if (gtkblist->headline_destroy)
-			gtkblist->headline_destroy(gtkblist->headline_data);
-		reset_headline(gtkblist);
-	}
-
-	return FALSE;
-}
-
-static void
-headline_realize_cb(GtkWidget *widget, gpointer data)
-{
-	GdkWindow *window = gtk_widget_get_window(widget);
-	GdkDisplay *display = gdk_window_get_display(window);
-	GdkCursor *hand_cursor = gdk_cursor_new_for_display(display, GDK_HAND2);
-	gdk_window_set_cursor(window, hand_cursor);
-	g_object_unref(hand_cursor);
-}
-
-static gboolean
-headline_press_cb(GtkWidget *widget, GdkEventButton *event, GtkInfoBar *infobar)
-{
-	gtk_info_bar_response(infobar, GTK_RESPONSE_OK);
-	return TRUE;
-}
-
 /***********************************/
 /* Connection error handling stuff */
 /***********************************/
@@ -4576,9 +4518,6 @@
 	void *handle;
 	GtkTreeViewColumn *column;
 	GtkWidget *sep;
-	GtkWidget *infobar;
-	GtkWidget *content_area;
-	GtkWidget *close;
 	GtkTreeSelection *selection;
 	GtkTargetEntry dte[] = {{"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW},
 				{"application/x-im-contact", 0, DRAG_BUDDY},
@@ -4616,40 +4555,6 @@
 	g_signal_connect(G_OBJECT(gtkblist->window), "window_state_event", G_CALLBACK(gtk_blist_window_state_cb), NULL);
 	gtk_widget_add_events(gtkblist->window, GDK_VISIBILITY_NOTIFY_MASK);
 
-	/****************************** Headline **********************************/
-
-	gtkblist->headline = gtk_event_box_new();
-	gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->headline,
-	                   FALSE, FALSE, 0);
-	infobar = gtk_info_bar_new();
-	gtk_container_add(GTK_CONTAINER(gtkblist->headline), infobar);
-	gtk_info_bar_set_default_response(GTK_INFO_BAR(infobar), GTK_RESPONSE_OK);
-	gtk_info_bar_set_message_type(GTK_INFO_BAR(infobar), GTK_MESSAGE_INFO);
-
-	content_area = gtk_info_bar_get_content_area(GTK_INFO_BAR(infobar));
-	gtkblist->headline_image = gtk_image_new_from_pixbuf(NULL);
-	gtk_widget_set_halign(gtkblist->headline_image, GTK_ALIGN_CENTER);
-	gtk_widget_set_valign(gtkblist->headline_image, GTK_ALIGN_CENTER);
-	gtkblist->headline_label = gtk_label_new(NULL);
-	gtk_label_set_line_wrap(GTK_LABEL(gtkblist->headline_label), TRUE);
-	gtk_box_pack_start(GTK_BOX(content_area), gtkblist->headline_image,
-	                   FALSE, FALSE, 0);
-	gtk_box_pack_start(GTK_BOX(content_area), gtkblist->headline_label,
-	                   TRUE, TRUE, 0);
-
-	close = pidgin_close_button_new();
-	gtk_info_bar_add_action_widget(GTK_INFO_BAR(infobar), close,
-	                               GTK_RESPONSE_CLOSE);
-
-	g_signal_connect(infobar, "response", G_CALLBACK(headline_response_cb),
-	                 gtkblist);
-	g_signal_connect(infobar, "close", G_CALLBACK(gtk_info_bar_response),
-	                 GINT_TO_POINTER(GTK_RESPONSE_CLOSE));
-	g_signal_connect(gtkblist->headline, "realize",
-	                 G_CALLBACK(headline_realize_cb), NULL);
-	g_signal_connect(gtkblist->headline, "button-press-event",
-	                 G_CALLBACK(headline_press_cb), infobar);
-
 	/****************************** GtkTreeView **********************************/
 	gtkblist->treemodel = gtk_tree_store_new(BLIST_COLUMNS,
 						 GDK_TYPE_PIXBUF, /* Status icon */
@@ -4793,8 +4698,6 @@
 	                      PURPLE_CALLBACK(conversation_created_cb),
 	                      gtkblist);
 
-	gtk_widget_hide(gtkblist->headline);
-
 	show_initial_account_errors(gtkblist);
 
 	/* emit our created signal */
@@ -4836,18 +4739,6 @@
 	redo_buddy_list(list, FALSE, TRUE);
 }
 
-void
-pidgin_blist_update_refresh_timeout()
-{
-	PurpleBuddyList *blist;
-	PidginBuddyList *gtkblist;
-
-	blist = purple_blist_get_default();
-	gtkblist = PIDGIN_BUDDY_LIST(blist);
-
-	gtkblist->refresh_timer = g_timeout_add_seconds(30,(GSourceFunc)pidgin_blist_refresh_timer, blist);
-}
-
 static gboolean get_iter_from_node(PurpleBlistNode *node, GtkTreeIter *iter) {
 	PidginBlistNode *gtknode = g_object_get_data(G_OBJECT(node), UI_DATA);
 	GtkTreePath *path;
@@ -5838,56 +5729,12 @@
 					   NULL, NULL);
 }
 
-void
-pidgin_blist_toggle_visibility()
-{
-	if (gtkblist && gtkblist->window) {
-		if (gtk_widget_get_visible(gtkblist->window)) {
-			/* make the buddy list visible if it is iconified or if it is
-			 * obscured and not currently focused (the focus part ensures
-			 * that we do something reasonable if the buddy list is obscured
-			 * by a window set to always be on top), otherwise hide the
-			 * buddy list
-			 */
-			purple_blist_set_visible(PIDGIN_WINDOW_ICONIFIED(gtkblist->window) ||
-					((gtk_blist_visibility != GDK_VISIBILITY_UNOBSCURED) &&
-					!gtk_blist_focused));
-		} else {
-			purple_blist_set_visible(TRUE);
-		}
-	}
-}
-
 void pidgin_blist_add_alert(GtkWidget *widget)
 {
 	gtk_container_add(GTK_CONTAINER(gtkblist->scrollbook), widget);
 	set_urgent();
 }
 
-void
-pidgin_blist_set_headline(const char *text, const gchar *icon_name,
-		GCallback callback, gpointer user_data, GDestroyNotify destroy)
-{
-	/* Destroy any existing headline first */
-	if (gtkblist->headline_destroy)
-		gtkblist->headline_destroy(gtkblist->headline_data);
-
-	gtk_label_set_markup(GTK_LABEL(gtkblist->headline_label), text);
-	gtk_image_set_from_icon_name(GTK_IMAGE(gtkblist->headline_image),
-			icon_name, GTK_ICON_SIZE_SMALL_TOOLBAR);
-
-	gtkblist->headline_callback = callback;
-	gtkblist->headline_data = user_data;
-	gtkblist->headline_destroy = destroy;
-	if (text != NULL || icon_name != NULL) {
-		set_urgent();
-		gtk_widget_show_all(gtkblist->headline);
-	} else {
-		gtk_widget_hide(gtkblist->headline);
-	}
-}
-
-
 static void
 set_urgent(void) {
 	if(gtkblist->window && !gtk_widget_has_focus(gtkblist->window)) {
