Index: demos/gtk-demo/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/demos/gtk-demo/Makefile.am,v
retrieving revision 1.38
diff -u -p -r1.38 Makefile.am
--- demos/gtk-demo/Makefile.am	29 Jan 2006 04:00:39 -0000	1.38
+++ demos/gtk-demo/Makefile.am	10 Feb 2006 16:43:18 -0000
@@ -27,6 +27,7 @@ demos =						\
 	pickers.c				\
 	pixbufs.c				\
 	rotated_text.c				\
+	sidebar.c				\
 	sizegroup.c				\
 	stock_browser.c				\
 	textview.c				\
Index: gtk/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/Makefile.am,v
retrieving revision 1.293
diff -u -p -r1.293 Makefile.am
--- gtk/Makefile.am	5 Feb 2006 04:04:29 -0000	1.293
+++ gtk/Makefile.am	10 Feb 2006 16:43:19 -0000
@@ -236,6 +236,7 @@ gtk_public_h_sources =          \
 	gtkseparatormenuitem.h	\
 	gtkseparatortoolitem.h	\
 	gtksettings.h		\
+	gtksidebar.h		\
 	gtksignal.h		\
 	gtksizegroup.h		\
 	gtksocket.h		\
@@ -468,6 +469,7 @@ gtk_c_sources =                 \
 	gtkseparatormenuitem.c	\
 	gtkseparatortoolitem.c	\
 	gtksettings.c		\
+	gtksidebar.c		\
 	gtksignal.c		\
 	gtksizegroup.c		\
 	gtksocket.c		\
Index: gtk/gtk.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtk.h,v
retrieving revision 1.80
diff -u -p -r1.80 gtk.h
--- gtk/gtk.h	24 Jan 2006 03:35:51 -0000	1.80
+++ gtk/gtk.h	10 Feb 2006 16:43:19 -0000
@@ -148,6 +148,7 @@
 #include <gtk/gtkseparatormenuitem.h>
 #include <gtk/gtkseparatortoolitem.h>
 #include <gtk/gtksettings.h>
+#include <gtk/gtksidebar.h>
 #include <gtk/gtksignal.h>
 #include <gtk/gtksizegroup.h>
 #include <gtk/gtksocket.h>
Index: gtk/gtksidebar.c
===================================================================
RCS file: gtk/gtksidebar.c
diff -N gtk/gtksidebar.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gtk/gtksidebar.c	10 Feb 2006 16:43:21 -0000
@@ -0,0 +1,563 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ * Copyright (C) 2004, 2006 Red Hat, Inc.
+ *
+ * Author:
+ *   Jonathan Blandford <jrb@alum.mit.edu> (original Evince sidebar)
+ *   Bastien Nocera <hadess@hadess.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include "gtksidebar.h"
+
+enum
+{
+	PAGE_COLUMN_ID,
+	PAGE_COLUMN_TITLE,
+	PAGE_COLUMN_MENU_ITEM,
+	PAGE_COLUMN_MAIN_WIDGET,
+	PAGE_COLUMN_BUTTON_WIDGET,
+	PAGE_COLUMN_NOTEBOOK_INDEX,
+	PAGE_COLUMN_NUM_COLS
+};
+
+struct _GtkSidebarPrivate {
+	GtkWidget *notebook;
+	GtkWidget *menu;
+	GtkWidget *hbox;
+	GtkWidget *label;
+
+	GtkTreeModel *page_model;
+};
+
+enum {
+	CLOSED,
+	LAST_SIGNAL
+};
+
+static int gtk_sidebar_table_signals[LAST_SIGNAL] = { 0 };
+
+G_DEFINE_TYPE (GtkSidebar, gtk_sidebar, GTK_TYPE_VBOX)
+
+#define GTK_SIDEBAR_GET_PRIVATE(object) \
+		(G_TYPE_INSTANCE_GET_PRIVATE ((object), GTK_TYPE_SIDEBAR, GtkSidebarPrivate))
+
+static void
+gtk_sidebar_destroy (GtkObject *object)
+{
+	GtkSidebar *sidebar = GTK_SIDEBAR (object);
+
+	if (sidebar->priv->menu) {
+		gtk_menu_detach (GTK_MENU (sidebar->priv->menu));
+		sidebar->priv->menu = NULL;
+	}
+
+	(* GTK_OBJECT_CLASS (gtk_sidebar_parent_class)->destroy) (object);
+}
+
+static void
+gtk_sidebar_class_init (GtkSidebarClass *gtk_sidebar_class)
+{
+	GObjectClass *g_object_class;
+	GtkWidgetClass *widget_class;
+	GtkObjectClass *gtk_object_klass;
+ 
+	g_object_class = G_OBJECT_CLASS (gtk_sidebar_class);
+	widget_class = GTK_WIDGET_CLASS (gtk_sidebar_class);
+	gtk_object_klass = GTK_OBJECT_CLASS (gtk_sidebar_class);
+	   
+	g_type_class_add_private (g_object_class, sizeof (GtkSidebarPrivate));
+	   
+	gtk_object_klass->destroy = gtk_sidebar_destroy;
+
+	gtk_sidebar_table_signals[CLOSED] =
+		g_signal_new ("closed",
+				G_TYPE_FROM_CLASS (g_object_class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (GtkSidebarClass, closed),
+				NULL, NULL,
+				g_cclosure_marshal_VOID__VOID,
+				G_TYPE_NONE, 0);
+
+}
+
+static void
+gtk_sidebar_menu_position_under (GtkMenu  *menu,
+				int      *x,
+				int      *y,
+				gboolean *push_in,
+				gpointer  user_data)
+{
+	GtkWidget *widget;
+
+	g_return_if_fail (GTK_IS_BUTTON (user_data));
+	g_return_if_fail (GTK_WIDGET_NO_WINDOW (user_data));
+
+	widget = GTK_WIDGET (user_data);
+	   
+	gdk_window_get_origin (widget->window, x, y);
+	   
+	*x += widget->allocation.x;
+	*y += widget->allocation.y + widget->allocation.height;
+	   
+	*push_in = FALSE;
+}
+
+static gboolean
+gtk_sidebar_select_button_press_cb (GtkWidget      *widget,
+				   GdkEventButton *event,
+				   gpointer        user_data)
+{
+	GtkSidebar *sidebar = GTK_SIDEBAR (user_data);
+
+	g_message ("gtk_sidebar_select_button_press_cb");
+
+	if (event->button == 1) {
+		GtkRequisition requisition;
+		gint width;
+
+		width = widget->allocation.width;
+		gtk_widget_set_size_request (sidebar->priv->menu, -1, -1);
+		gtk_widget_size_request (sidebar->priv->menu, &requisition);
+		gtk_widget_set_size_request (sidebar->priv->menu,
+				MAX (width, requisition.width), -1);
+		gtk_widget_grab_focus (widget);
+			 
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+		gtk_menu_popup (GTK_MENU (sidebar->priv->menu),
+				NULL, NULL, gtk_sidebar_menu_position_under, widget,
+				event->button, event->time);
+
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static gboolean
+gtk_sidebar_select_button_key_press_cb (GtkWidget   *widget,
+				       GdkEventKey *event,
+				       gpointer     user_data)
+{
+	GtkSidebar *sidebar = GTK_SIDEBAR (user_data);
+
+	g_message ("gtk_sidebar_select_button_key_press_cb");
+	   
+	if (event->keyval == GDK_space ||
+	    event->keyval == GDK_KP_Space ||
+	    event->keyval == GDK_Return ||
+	    event->keyval == GDK_KP_Enter) {
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+		gtk_menu_popup (GTK_MENU (sidebar->priv->menu),
+			        NULL, NULL, gtk_sidebar_menu_position_under, widget,
+				1, event->time);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static void
+gtk_sidebar_close_clicked_cb (GtkWidget *widget,
+			     gpointer   user_data)
+{
+	GtkSidebar *sidebar = GTK_SIDEBAR (user_data);
+
+	g_message ("gtk_sidebar_close_clicked_cb");
+
+	gtk_widget_hide (GTK_WIDGET (sidebar));
+	g_signal_emit (G_OBJECT (sidebar),
+			gtk_sidebar_table_signals[CLOSED], 0, NULL);
+}
+
+static void
+gtk_sidebar_menu_deactivate_cb (GtkWidget *widget,
+			       gpointer   user_data)
+{
+	GtkWidget *menu_button;
+
+	g_message ("gtk_sidebar_menu_deactivate_cb");
+
+	menu_button = GTK_WIDGET (user_data);
+	   
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (menu_button), FALSE);
+}
+
+static void
+gtk_sidebar_menu_detach_cb (GtkWidget *widget,
+			   GtkMenu   *menu)
+{
+	GtkSidebar *sidebar = GTK_SIDEBAR (widget);
+
+	g_message ("gtk_sidebar_menu_detach_cb");
+	   
+	sidebar->priv->menu = NULL;
+}
+
+static void
+gtk_sidebar_menu_item_activate_cb (GtkWidget *widget,
+				  gpointer   user_data)
+{
+	GtkSidebar *sidebar = GTK_SIDEBAR (user_data);
+	GtkTreeIter iter;
+	GtkWidget *menu_item, *item, *button;
+	gchar *title;
+	gboolean valid;
+	gint index;
+
+	g_message ("gtk_sidebar_menu_item_activate_cb");
+
+	menu_item = gtk_menu_get_active (GTK_MENU (sidebar->priv->menu));
+	valid = gtk_tree_model_get_iter_first (sidebar->priv->page_model, &iter);
+
+	while (valid) {
+		gtk_tree_model_get (sidebar->priv->page_model,
+				    &iter,
+				    PAGE_COLUMN_TITLE, &title, 
+				    PAGE_COLUMN_MENU_ITEM, &item,
+				    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+				    PAGE_COLUMN_BUTTON_WIDGET, &button,
+				    -1);
+
+		if (item == menu_item) {
+			gtk_notebook_set_current_page
+				(GTK_NOTEBOOK (sidebar->priv->notebook), index);
+			gtk_label_set_text (GTK_LABEL (sidebar->priv->label), title);
+			//FIXME show the button here
+			valid = FALSE;
+		} else {
+			valid = gtk_tree_model_iter_next (sidebar->priv->page_model, &iter);
+		}
+		g_object_unref (item);
+		g_free (title);
+	}
+}
+
+static void
+gtk_sidebar_init (GtkSidebar *sidebar)
+{
+	GtkWidget *hbox;
+	GtkWidget *close_button;
+	GtkWidget *select_button;
+	GtkWidget *select_hbox;
+	GtkWidget *arrow;
+	GtkWidget *image;
+
+	sidebar->priv = GTK_SIDEBAR_GET_PRIVATE (sidebar);
+
+	/* data model */
+	sidebar->priv->page_model = (GtkTreeModel *)
+			gtk_list_store_new (PAGE_COLUMN_NUM_COLS,
+					    G_TYPE_STRING,
+					    G_TYPE_STRING,
+					    GTK_TYPE_WIDGET,
+					    GTK_TYPE_WIDGET,
+					    GTK_TYPE_WIDGET,
+					    G_TYPE_INT);
+
+	/* top option menu */
+	hbox = gtk_hbox_new (FALSE, 0);
+	sidebar->priv->hbox = hbox;
+	gtk_box_pack_start (GTK_BOX (sidebar), hbox, FALSE, FALSE, 0);
+	gtk_widget_show (hbox);
+
+	select_button = gtk_toggle_button_new ();
+	gtk_button_set_relief (GTK_BUTTON (select_button), GTK_RELIEF_NONE);
+	g_signal_connect (select_button, "button_press_event",
+			  G_CALLBACK (gtk_sidebar_select_button_press_cb),
+			  sidebar);
+	g_signal_connect (select_button, "key_press_event",
+			  G_CALLBACK (gtk_sidebar_select_button_key_press_cb),
+			  sidebar);
+
+	select_hbox = gtk_hbox_new (FALSE, 0);
+
+	sidebar->priv->label = gtk_label_new ("");
+	gtk_box_pack_start (GTK_BOX (select_hbox),
+			    sidebar->priv->label,
+			    FALSE, FALSE, 0);
+	gtk_widget_show (sidebar->priv->label);
+
+	arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
+	gtk_box_pack_end (GTK_BOX (select_hbox), arrow, FALSE, FALSE, 0);
+	gtk_widget_show (arrow);
+
+	gtk_container_add (GTK_CONTAINER (select_button), select_hbox);
+	gtk_widget_show (select_hbox);
+
+	gtk_box_pack_start (GTK_BOX (hbox), select_button, TRUE, TRUE, 0);
+	gtk_widget_show (select_button);
+
+	close_button = gtk_button_new ();
+	gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE);
+	g_signal_connect (close_button, "clicked",
+			  G_CALLBACK (gtk_sidebar_close_clicked_cb),
+			  sidebar);
+	   
+	image = gtk_image_new_from_stock (GTK_STOCK_CLOSE,
+					  GTK_ICON_SIZE_SMALL_TOOLBAR);
+	gtk_container_add (GTK_CONTAINER (close_button), image);
+	gtk_widget_show (image);
+   
+	gtk_box_pack_end (GTK_BOX (hbox), close_button, FALSE, FALSE, 0);
+	gtk_widget_show (close_button);
+   
+	sidebar->priv->menu = gtk_menu_new ();
+	g_signal_connect (sidebar->priv->menu, "deactivate",
+			  G_CALLBACK (gtk_sidebar_menu_deactivate_cb),
+			  select_button);
+	gtk_menu_attach_to_widget (GTK_MENU (sidebar->priv->menu),
+				   GTK_WIDGET (sidebar),
+				   gtk_sidebar_menu_detach_cb);
+	gtk_widget_show (sidebar->priv->menu);
+
+	sidebar->priv->notebook = gtk_notebook_new ();
+	gtk_notebook_set_show_border (GTK_NOTEBOOK (sidebar->priv->notebook), FALSE);
+	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (sidebar->priv->notebook), FALSE);
+	gtk_box_pack_start (GTK_BOX (sidebar), sidebar->priv->notebook,
+			    TRUE, TRUE, 6);
+	gtk_widget_show (sidebar->priv->notebook);
+}
+
+/* Public functions */
+
+GtkWidget *
+gtk_sidebar_new (void)
+{
+	GtkWidget *sidebar;
+
+	sidebar = g_object_new (GTK_TYPE_SIDEBAR, NULL);
+
+	return sidebar;
+}
+
+void
+gtk_sidebar_add_page (GtkSidebar *sidebar,
+		     const gchar *page_id,
+		     const gchar *page_title,
+		     GtkWidget   *main_widget,
+		     GtkWidget   *button)
+{
+	GtkTreeIter iter;
+	GtkWidget *menu_item;
+//	gchar *label_title;
+	int index;
+
+	g_message ("gtk_sidebar_add_page");
+
+	//FIXME use button
+	g_return_if_fail (GTK_IS_SIDEBAR (sidebar));
+	g_return_if_fail (page_id != NULL);
+	g_return_if_fail (page_title != NULL);
+	g_return_if_fail (GTK_IS_WIDGET (main_widget));
+	   
+	index = gtk_notebook_append_page (GTK_NOTEBOOK (sidebar->priv->notebook),
+					  main_widget, NULL);
+	g_message ("gtk_notebook_get_current_page %d index %d", gtk_notebook_get_current_page (GTK_NOTEBOOK (sidebar->priv->notebook)), index);
+
+	menu_item = gtk_image_menu_item_new_with_label (page_title);
+	g_signal_connect (menu_item, "activate",
+			  G_CALLBACK (gtk_sidebar_menu_item_activate_cb),
+			  sidebar);
+	gtk_widget_show (menu_item);
+	gtk_menu_shell_append (GTK_MENU_SHELL (sidebar->priv->menu),
+			       menu_item);
+
+	gtk_list_store_insert_with_values (GTK_LIST_STORE (sidebar->priv->page_model),
+					   &iter, index,
+					   PAGE_COLUMN_ID, page_id,
+					   PAGE_COLUMN_TITLE, page_title,
+					   PAGE_COLUMN_MENU_ITEM, menu_item,
+					   PAGE_COLUMN_MAIN_WIDGET, main_widget,
+					   PAGE_COLUMN_NOTEBOOK_INDEX, index,
+					   -1);
+
+#if 0
+	/* Set the first item added as active */
+	gtk_tree_model_get_iter_first (sidebar->priv->page_model, &iter);
+	gtk_tree_model_get (sidebar->priv->page_model,
+			    &iter,
+			    PAGE_COLUMN_TITLE, &label_title,
+			    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+			    -1);
+#endif
+
+	gtk_menu_set_active (GTK_MENU (sidebar->priv->menu), index);
+	gtk_label_set_text (GTK_LABEL (sidebar->priv->label), page_title);
+	gtk_notebook_set_current_page (GTK_NOTEBOOK (sidebar->priv->notebook),
+				       index);
+	//FIXME set the button
+}
+
+static gboolean
+gtk_sidebar_get_iter_for_page_id (GtkSidebar  *sidebar,
+				  const char  *page_id,
+				  GtkTreeIter *iter)
+{
+	char *id;
+	gboolean valid;
+
+	valid = gtk_tree_model_get_iter_first (sidebar->priv->page_model, iter);
+	while (valid) {
+		gtk_tree_model_get (sidebar->priv->page_model,
+				    iter,
+				    PAGE_COLUMN_ID, &id,
+				    -1);
+		if (id != NULL && strcmp (page_id, id) == 0) {
+			g_free (id);
+			return TRUE;
+		} else {
+			g_free (id);
+			valid = gtk_tree_model_iter_next (sidebar->priv->page_model, iter);
+		}
+	}
+	return FALSE;
+}
+
+static gboolean
+gtk_sidebar_get_current_iter (GtkSidebar  *sidebar,
+			      GtkTreeIter *iter)
+{
+	int current, index;
+	gboolean valid;
+
+	current = gtk_notebook_get_current_page (GTK_NOTEBOOK (sidebar->priv->notebook));
+
+	valid = gtk_tree_model_get_iter_first (sidebar->priv->page_model, iter);
+	while (valid) {
+		gtk_tree_model_get (sidebar->priv->page_model,
+				    iter,
+				    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+				    -1);
+		if (current == index) {
+			return TRUE;
+		} else {
+			valid = gtk_tree_model_iter_next (sidebar->priv->page_model, iter);
+		}
+	}
+	return FALSE;
+}
+
+void
+gtk_sidebar_remove_page (GtkSidebar *sidebar, const char *page_id)
+{
+	GtkWidget *button, *item;
+	GtkTreeIter iter;
+	gboolean valid;
+	int index;
+
+	g_return_if_fail (gtk_sidebar_get_iter_for_page_id (sidebar, page_id, &iter));
+
+	gtk_tree_model_get (sidebar->priv->page_model,
+			    &iter,
+			    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+			    PAGE_COLUMN_MENU_ITEM, &item,
+			    PAGE_COLUMN_BUTTON_WIDGET, &button,
+			    -1);
+	if (button)
+		gtk_widget_destroy (button);
+	gtk_notebook_remove_page (GTK_NOTEBOOK (sidebar->priv->notebook), index);
+	gtk_widget_destroy (item);
+	gtk_list_store_remove (GTK_LIST_STORE (sidebar->priv->page_model), &iter);
+
+	valid = (iter.stamp != 0);
+
+	while (valid) {
+		gtk_tree_model_get (sidebar->priv->page_model,
+				    &iter,
+				    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+				    -1);
+		index--;
+		gtk_list_store_set (GTK_LIST_STORE (sidebar->priv->page_model),
+				    &iter,
+				    PAGE_COLUMN_NOTEBOOK_INDEX, index,
+				    -1);
+		valid = gtk_tree_model_iter_next (sidebar->priv->page_model, &iter);
+	}
+}
+
+void
+gtk_sidebar_show_page (GtkSidebar *sidebar, const char *page_id)
+{
+	GtkWidget *item;
+	GtkTreeIter iter;
+
+	g_return_if_fail (gtk_sidebar_get_iter_for_page_id (sidebar, page_id, &iter));
+
+	gtk_tree_model_get (sidebar->priv->page_model,
+			&iter,
+			PAGE_COLUMN_MENU_ITEM, &item,
+			-1);
+	gtk_menu_item_activate (GTK_MENU_ITEM (item));
+}
+
+char*
+gtk_sidebar_get_current_page_id (GtkSidebar *sidebar)
+{
+	GtkTreeIter iter;
+	char *id;
+
+	g_return_val_if_fail (gtk_sidebar_get_current_iter (sidebar, &iter), NULL);
+
+	gtk_tree_model_get (sidebar->priv->page_model,
+			&iter,
+			PAGE_COLUMN_ID, &id,
+			-1);
+
+	return id;
+}
+
+#if 0
+void
+gtk_sidebar_set_current_page_title (GtkSidebar   *sidebar,
+				    const char   *page_title)
+{
+	GtkTreeIter iter;
+
+	g_return_val_if_fail (gtk_sidebar_get_current_iter (sidebar, &iter), NULL);
+	gtk_tree_model_get (sidebar->priv->page_model,
+			&iter,
+			PAGE_COLUMN_ID, &id,
+			-1);
+	
+}
+#endif
+
+GtkWidget*
+gtk_sidebar_get_button_for_page (GtkSidebar   *sidebar,
+				 const char   *page_id)
+{
+	//FIXME
+	return NULL;
+}
+
+void
+gtk_sidebar_set_button_for_page (GtkSidebar   *sidebar,
+				 const char   *page_id,
+				 GtkWidget    *button)
+{
+	//FIXME
+}
+
Index: gtk/gtksidebar.h
===================================================================
RCS file: gtk/gtksidebar.h
diff -N gtk/gtksidebar.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gtk/gtksidebar.h	10 Feb 2006 16:43:21 -0000
@@ -0,0 +1,84 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ * Copyright (C) 2004, 2006 Red Hat, Inc.
+ *
+ * Author:
+ *   Jonathan Blandford <jrb@alum.mit.edu> (original Evince sidebar)
+ *   Bastien Nocera <hadess@hadess.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_SIDEBAR_H__
+#define __GTK_SIDEBAR_H__
+
+#include <gtk/gtkvbox.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GtkSidebar GtkSidebar;
+typedef struct _GtkSidebarClass GtkSidebarClass;
+typedef struct _GtkSidebarPrivate GtkSidebarPrivate;
+
+#define GTK_TYPE_SIDEBAR		     (gtk_sidebar_get_type())
+#define GTK_SIDEBAR(object)	     (G_TYPE_CHECK_INSTANCE_CAST((object), GTK_TYPE_SIDEBAR, GtkSidebar))
+#define GTK_SIDEBAR_CLASS(klass)	     (G_TYPE_CHACK_CLASS_CAST((klass), GTK_TYPE_SIDEBAR, GtkSidebarClass))
+#define GTK_IS_SIDEBAR(object)	     (G_TYPE_CHECK_INSTANCE_TYPE((object), GTK_TYPE_SIDEBAR))
+#define GTK_IS_SIDEBAR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_SIDEBAR))
+#define GTK_SIDEBAR_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), GTK_TYPE_SIDEBAR, GtkSidebarClass))
+
+struct _GtkSidebar {
+	GtkVBox base_instance;
+
+	GtkSidebarPrivate *priv;
+};
+
+struct _GtkSidebarClass {
+	GtkVBoxClass base_class;
+
+	void (*closed) (GtkSidebar *sidebar);
+};
+
+GType      gtk_sidebar_get_type  	   (void);
+GtkWidget *gtk_sidebar_new         	   (void);
+
+void       gtk_sidebar_add_page    	   (GtkSidebar   *sidebar,
+					    const char   *page_id,
+					    const char   *page_title,
+					    GtkWidget    *main_widget,
+					    GtkWidget    *button);
+void       gtk_sidebar_remove_page         (GtkSidebar   *sidebar,
+					    const char   *page_id);
+void       gtk_sidebar_show_page           (GtkSidebar   *sidebar,
+					    const char   *page_id);
+
+char      *gtk_sidebar_get_page_id_for_widget
+					   (GtkSidebar   *sidebar,
+					    GtkWidget    *main_widget);
+GtkWidget *gtk_sidebar_get_current_page    (GtkSidebar   *sidebar);
+char      *gtk_sidebar_get_current_page_id (GtkSidebar   *sidebar);
+void       gtk_sidebar_set_current_page_title
+					   (GtkSidebar   *sidebar,
+					    const char   *page_title);
+void       gtk_sidebar_set_button_for_page (GtkSidebar   *sidebar,
+					    const char   *page_id,
+					    GtkWidget    *button);
+
+G_END_DECLS
+
+#endif /* __GTK_SIDEBAR_H__ */
+
+
