changeset 1520:7216f4a45698

added pane_notify_selection to pane API
author nadvornik
date Mon, 06 Apr 2009 19:53:59 +0000
parents 2c25cb0eca57
children 68b73d524ca3
files src/bar.c src/bar.h src/layout_util.c
diffstat 3 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/bar.c	Mon Apr 06 19:13:35 2009 +0000
+++ b/src/bar.c	Mon Apr 06 19:53:59 2009 +0000
@@ -304,7 +304,7 @@
 } 
 
 
-void bar_pane_set_fd_cb(GtkWidget *expander, gpointer data)
+static void bar_pane_set_fd_cb(GtkWidget *expander, gpointer data)
 {
 	GtkWidget *widget = gtk_bin_get_child(GTK_BIN(expander));
 	PaneData *pd = g_object_get_data(G_OBJECT(widget), "pane_data");
@@ -327,6 +327,23 @@
 
 }
 
+static void bar_pane_notify_selection_cb(GtkWidget *expander, gpointer data)
+{
+	GtkWidget *widget = gtk_bin_get_child(GTK_BIN(expander));
+	PaneData *pd = g_object_get_data(G_OBJECT(widget), "pane_data");
+	if (!pd) return;
+	if (pd->pane_notify_selection) pd->pane_notify_selection(widget, GPOINTER_TO_INT(data));
+}
+
+void bar_notify_selection(GtkWidget *bar, gint count)
+{
+	BarData *bd;
+	bd = g_object_get_data(G_OBJECT(bar), "bar_data");
+	if (!bd) return;
+
+	gtk_container_foreach(GTK_CONTAINER(bd->vbox), bar_pane_notify_selection_cb, GINT_TO_POINTER(count));
+}
+
 gboolean bar_event(GtkWidget *bar, GdkEvent *event)
 {
 	BarData *bd;
--- a/src/bar.h	Mon Apr 06 19:13:35 2009 +0000
+++ b/src/bar.h	Mon Apr 06 19:53:59 2009 +0000
@@ -27,6 +27,7 @@
 struct _PaneData {
 	/* filled in by pane */
 	void (*pane_set_fd)(GtkWidget *pane, FileData *fd);
+	void (*pane_notify_selection)(GtkWidget *pane, gint count);
 	gint (*pane_event)(GtkWidget *pane, GdkEvent *event);
 	void (*pane_write_config)(GtkWidget *pane, GString *outstr, gint indent);
 	GtkWidget *title;
@@ -58,6 +59,7 @@
 void bar_clear(GtkWidget *bar);
 
 void bar_set_fd(GtkWidget *bar, FileData *fd);
+void bar_notify_selection(GtkWidget *bar, gint count);
 gboolean bar_event(GtkWidget *bar, GdkEvent *event);
 
 gint bar_get_width(GtkWidget *bar);
--- a/src/layout_util.c	Mon Apr 06 19:13:35 2009 +0000
+++ b/src/layout_util.c	Mon Apr 06 19:53:59 2009 +0000
@@ -2063,7 +2063,7 @@
 {
 	if (!layout_bar_enabled(lw)) return;
 
-//	bar_info_selection(lw->bar_info, count - 1);
+	bar_notify_selection(lw->bar, count);
 }
 
 static gboolean layout_bar_sort_enabled(LayoutWindow *lw)