Index: galeon/ChangeLog
===================================================================
RCS file: /cvs/gnome/galeon/ChangeLog,v
retrieving revision 1.3022
diff -u -r1.3022 ChangeLog
--- galeon/ChangeLog	2002/06/15 19:42:00	1.3022
+++ galeon/ChangeLog	2002/06/16 01:13:37
@@ -1,3 +1,8 @@
+2002-06-16  Mathias Hasselmann <mathias.hasselmann@gmx.de>
+
+	* src/galeon-window.c:
+	Added support for "desktop/gnome/interface/mdi_tab_position"
+
 2002-06-15  Marco Pesenti Gritti <marco@it.gnome.org>
 	
 	* src/galeon-main.c
Index: galeon/src/galeon-window.c
===================================================================
RCS file: /cvs/gnome/galeon/src/galeon-window.c,v
retrieving revision 1.72
diff -u -r1.72 galeon-window.c
--- galeon/src/galeon-window.c	2002/06/15 19:42:03	1.72
+++ galeon/src/galeon-window.c	2002/06/16 01:13:39
@@ -40,6 +40,7 @@
 #include <bonobo/bonobo-ui-util.h>
 #include <bonobo/bonobo-ui-component.h>
 #include <libgnomevfs/gnome-vfs-uri.h>
+#include <libgnomeui/gnome-app-helper.h>
 #include <gtk/gtk.h>
 #include <X11/X.h>
 #include <X11/Xlib.h>
@@ -301,6 +302,8 @@
 	gtk_notebook_set_scrollable (notebook, TRUE);
 	gtk_notebook_set_show_border (notebook, FALSE);
 	gtk_notebook_set_show_tabs (notebook, FALSE);
+        
+        gnome_app_setup_mdi_notebook(notebook);
 
 	g_signal_connect_after (GTK_OBJECT (notebook), "switch_page",
 				GTK_SIGNAL_FUNC (
Index: gedit/src/ChangeLog
===================================================================
RCS file: /cvs/gnome/gedit/src/ChangeLog,v
retrieving revision 1.437
diff -u -r1.437 ChangeLog
--- gedit/src/ChangeLog	2002/06/14 09:29:37	1.437
+++ gedit/src/ChangeLog	2002/06/16 01:13:41
@@ -1,3 +1,8 @@
+2002-06-15  Mathias Hasselmann <mathias.hasselmann@gmx.de>
+
+	* bonobo-mdi.c:
+	Added support for "desktop/gnome/interface/mdi_tab_position"
+
 2002-06-14  Paolo Maggi <maggi@athena.polito.it>
 
 	* src/gedit-preferences.glade2: fixed a typo
Index: gedit/src/bonobo-mdi.c
===================================================================
RCS file: /cvs/gnome/gedit/src/bonobo-mdi.c,v
retrieving revision 1.18
diff -u -r1.18 bonobo-mdi.c
--- gedit/src/bonobo-mdi.c	2002/05/29 16:33:09	1.18
+++ gedit/src/bonobo-mdi.c	2002/06/16 01:13:48
@@ -32,6 +32,7 @@
 #include <gedit-marshal.h>
 #include <bonobo/bonobo-dock-layout.h>
 #include <bonobo/bonobo-ui-util.h>
+#include <libgnomeui/gnome-app-helper.h>
 
 #include "gedit-debug.h"
 
@@ -105,8 +106,6 @@
 
 struct _BonoboMDIPrivate
 {
-	GtkPositionType tab_pos;
-
 	guint 		 signal_id;
 	gint 		 in_drag : 1;
 
@@ -324,8 +323,6 @@
 	mdi->priv = g_new0 (BonoboMDIPrivate, 1);
 	g_return_if_fail (mdi->priv != NULL);
 		
-	mdi->priv->tab_pos 		= GTK_POS_TOP;
-		
 	mdi->priv->signal_id 		= 0;
 	mdi->priv->in_drag 		= FALSE;
 
@@ -778,7 +775,7 @@
 	vbox = gtk_vbox_new (FALSE, 0);
 	us = gtk_notebook_new ();
 
-	gtk_notebook_set_tab_pos (GTK_NOTEBOOK (us), mdi->priv->tab_pos);
+        gnome_app_setup_mdi_notebook (GTK_NOTEBOOK (us));
 
 	gtk_box_pack_start (GTK_BOX (vbox), us, TRUE, TRUE, 0);	
 
Index: gnome-control-center/capplets/ui-properties/ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/ui-properties/ChangeLog,v
retrieving revision 1.33
diff -u -r1.33 ChangeLog
--- gnome-control-center/capplets/ui-properties/ChangeLog	2002/05/29 18:49:34	1.33
+++ gnome-control-center/capplets/ui-properties/ChangeLog	2002/06/16 01:13:48
@@ -1,3 +1,11 @@
+2002-06-14 Mathias Hasselmann <mathias.hasselmann@gmx.de>
+
+	* gnome-ui-properties.c, gnome-ui-properties.glade:
+	  Added support for "desktop/gnome/interface/mdi_tab_position"
+          and some code cleanups regarding
+          "desktop/gnome/interface/toolbar_style"
+          
+
 2002-05-29  Jody Goldberg <jody@gnome.org>
 
 	http://bugzilla.gnome.org/show_bug.cgi?id=82802
Index: gnome-control-center/capplets/ui-properties/gnome-ui-properties.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/ui-properties/gnome-ui-properties.c,v
retrieving revision 1.21
diff -u -r1.21 gnome-ui-properties.c
--- gnome-control-center/capplets/ui-properties/gnome-ui-properties.c	2002/05/29 18:49:34	1.21
+++ gnome-control-center/capplets/ui-properties/gnome-ui-properties.c	2002/06/16 01:13:48
@@ -30,10 +30,23 @@
 #include "capplet-util.h"
 #include "gconf-property-editor.h"
 
+
+#define CONF_PREFIX                 "/desktop/gnome/interface"
+#define CONF_TOOLBAR_DETACHABLE     CONF_PREFIX"/toolbar_detachable"
+#define CONF_MENUS_HAVE_ICONS       CONF_PREFIX"/menus_have_icons"
+#define CONF_TOOLBAR_STYLE          CONF_PREFIX"/toolbar_style"
+#define CONF_MDI_PREFERRED_STYLE    CONF_PREFIX"/mdi_preferred_style"
+#define CONF_MDI_TAB_POSITION       CONF_PREFIX"/mdi_tab_position"
+
+
+#define GCONF_GET(TYPE, KEYNAME, DEFAULT) \
+    gconf_client_get_##TYPE (gconf_client_get_default (), KEYNAME, DEFAULT)
+
+
 enum
 {
-	RESPONSE_APPLY = 1,
-	RESPONSE_CLOSE
+    RESPONSE_APPLY = 1,
+    RESPONSE_CLOSE
 };
 
 static GConfEnumStringPair toolbar_style_enums[] = {
@@ -44,35 +57,90 @@
   { -1, NULL }
 };
 
-static GConfValue *
-toolbar_from_widget (GConfPropertyEditor *peditor, GConfValue *value) 
+static GConfEnumStringPair mdi_preferred_style_enums[] = {
+  { 0, "notebook" },
+  { 1, "toplevel" },
+  { 2, "modal" },
+  { -1, NULL }
+};
+
+static GConfEnumStringPair mdi_tab_position_enums[] = {
+  { 0, "top" },
+  { 1, "left" },
+  { 2, "right" },
+  { 3, "bottom" },
+  { -1, NULL }
+};
+
+
+static GConfValue * 
+value_from_widget (GConfPropertyEditor *peditor, GConfValue *value,
+                   GConfEnumStringPair *enums)
 {
   GConfValue *new_value;
 
   new_value = gconf_value_new (GCONF_VALUE_STRING);
   gconf_value_set_string (new_value,
-			  gconf_enum_to_string (toolbar_style_enums, gconf_value_get_int (value)));
+    gconf_enum_to_string (enums, gconf_value_get_int (value)));
 
   return new_value;
 }
 
 static GConfValue *
-toolbar_to_widget (GConfPropertyEditor *peditor, GConfValue *value) 
+value_to_widget (GConfPropertyEditor *peditor, GConfValue *value,
+                 GConfEnumStringPair *enums)
 {
   GConfValue *new_value;
   const gchar *str;
   gint val = 2;
 
-  str = (value && (value->type == GCONF_VALUE_STRING)) ? gconf_value_get_string (value) : NULL;
+  str = (value && (value->type == GCONF_VALUE_STRING))
+      ? gconf_value_get_string (value) : NULL;
   new_value = gconf_value_new (GCONF_VALUE_INT);
-  if (!gconf_string_to_enum (toolbar_style_enums, str, &val))
-	  val = 0;
+
+  if (!gconf_string_to_enum (enums, str, &val)) val = 0;
   gconf_value_set_int (new_value, val);
 
   return new_value;
 }
 
 
+static GConfValue *
+toolbar_from_widget (GConfPropertyEditor *peditor, GConfValue *value) 
+{
+  return value_from_widget(peditor, value, toolbar_style_enums);
+}
+
+static GConfValue *
+toolbar_to_widget (GConfPropertyEditor *peditor, GConfValue *value) 
+{
+  return value_to_widget(peditor, value, toolbar_style_enums);
+}
+
+static GConfValue *
+style_from_widget (GConfPropertyEditor *peditor, GConfValue *value) 
+{
+  return value_from_widget(peditor, value, mdi_preferred_style_enums);
+}
+
+static GConfValue *
+style_to_widget (GConfPropertyEditor *peditor, GConfValue *value) 
+{
+  return value_to_widget(peditor, value, mdi_preferred_style_enums);
+}
+
+static GConfValue *
+position_from_widget (GConfPropertyEditor *peditor, GConfValue *value) 
+{
+  return value_from_widget(peditor, value, mdi_tab_position_enums);
+}
+
+static GConfValue *
+position_to_widget (GConfPropertyEditor *peditor, GConfValue *value) 
+{
+  return value_to_widget(peditor, value, mdi_tab_position_enums);
+}
+
 static void
 dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset) 
 {
@@ -98,28 +166,31 @@
 {
   GtkWidget *handlebox;
   GtkWidget *toolbar;
-  GtkWidget *frame;
+  GtkWidget *vbox;
 
   handlebox = WID ("toolbar_handlebox");
   toolbar = WID ("toolbar_toolbar");
-  frame = WID ("toolbar_frame");
+  vbox = WID ("toolbar_vbox");
 
   g_object_ref (handlebox);
   g_object_ref (toolbar);
 
-  if (GTK_BIN (frame)->child)
-    gtk_container_remove (GTK_CONTAINER (frame), GTK_BIN (frame)->child);
+  if (handlebox->parent == vbox)
+    gtk_container_remove (GTK_CONTAINER (vbox), handlebox);
+  else if (toolbar->parent == vbox)
+    gtk_container_remove (GTK_CONTAINER (vbox), toolbar);
   if (GTK_BIN (handlebox)->child)
     gtk_container_remove (GTK_CONTAINER (handlebox), GTK_BIN (handlebox)->child);
+
   if (show)
     {
-      gtk_container_add (GTK_CONTAINER (frame), handlebox);
+      gtk_box_pack_start (GTK_BOX (vbox), handlebox, TRUE, FALSE, 0);
       gtk_container_add (GTK_CONTAINER (handlebox), toolbar);
       g_object_unref (handlebox);
     }
   else
     {
-      gtk_container_add (GTK_CONTAINER (frame), toolbar);
+      gtk_box_pack_start (GTK_BOX (vbox), toolbar, TRUE, FALSE, 0);
     }
   g_object_unref (toolbar);
 
@@ -160,6 +231,29 @@
 }
 
 static void
+set_mdi_tab_position (GladeXML *dialog, const char *value)
+{
+  static const GtkPositionType gtk_position_types[] = 
+    { GTK_POS_TOP, GTK_POS_LEFT, GTK_POS_RIGHT, GTK_POS_BOTTOM };
+
+  int index;
+
+  if (!gconf_string_to_enum (mdi_tab_position_enums, value, &index)) index = 0;
+
+  gtk_notebook_set_tab_pos (GTK_NOTEBOOK (WID("mid_tabs_notebook")),
+			    gtk_position_types[index]);
+}
+
+static void
+mdi_tab_position_cb (GConfPropertyEditor *peditor,
+		     gchar               *key,
+		     GConfValue          *value,
+		     GladeXML            *dialog)
+{
+  set_mdi_tab_position (dialog, gconf_value_get_string (value));
+}
+
+static void
 set_have_icons (GladeXML *dialog, gboolean value)
 {
   static char *menu_item_names[] = 
@@ -220,57 +314,64 @@
 {
   GtkWidget *widget;
   GObject *peditor;
-  char *toolbar_style;
+  char *cstring;
 
-  peditor = gconf_peditor_new_boolean
-    (changeset, "/desktop/gnome/interface/toolbar_detachable", WID ("detachable_toolbars_toggle"), NULL);
-  g_signal_connect (peditor,
-    "value_changed",
-    G_CALLBACK (toolbar_detachable_cb), dialog);
-
-  peditor = gconf_peditor_new_boolean
-    (changeset, "/desktop/gnome/interface/menus_have_icons", WID ("menu_icons_toggle"), NULL);
-  g_signal_connect (peditor,
-    "value_changed",
-    G_CALLBACK (menus_have_icons_cb), dialog);
+/* create property editors */
+  peditor = gconf_peditor_new_boolean(changeset, CONF_TOOLBAR_DETACHABLE, 
+                                      WID ("detachable_toolbars_toggle"), NULL);
+  g_signal_connect (peditor, "value_changed",
+                    G_CALLBACK (toolbar_detachable_cb), dialog);
+
+  peditor = gconf_peditor_new_boolean (changeset, CONF_MENUS_HAVE_ICONS,
+                                       WID ("menu_icons_toggle"), NULL);
+  g_signal_connect (peditor, "value_changed",
+                    G_CALLBACK (menus_have_icons_cb), dialog);
   
-  set_have_icons (dialog, 
-		  gconf_client_get_bool (gconf_client_get_default (),
-					 "/desktop/gnome/interface/menus_have_icons",
-					 NULL));
-
   peditor = gconf_peditor_new_select_menu
-    (changeset, "/desktop/gnome/interface/toolbar_style", WID ("toolbar_style_omenu"),
+    (changeset, CONF_TOOLBAR_STYLE, WID ("toolbar_style_omenu"),
      "conv-to-widget-cb", toolbar_to_widget,
      "conv-from-widget-cb", toolbar_from_widget,
      NULL);
-  g_signal_connect (peditor,
-    "value_changed", 
+  g_signal_connect (peditor, "value_changed", 
 		    G_CALLBACK (toolbar_style_cb), dialog);
 
+  peditor = gconf_peditor_new_select_menu
+    (changeset, CONF_MDI_PREFERRED_STYLE, WID ("mdi_preferred_style_omenu"),
+     "conv-to-widget-cb", style_to_widget,
+     "conv-from-widget-cb", style_from_widget,
+     NULL);
+
+  peditor = gconf_peditor_new_select_menu
+    (changeset, CONF_MDI_TAB_POSITION, WID ("mdi_tab_position_omenu"),
+     "conv-to-widget-cb", position_to_widget,
+     "conv-from-widget-cb", position_from_widget,
+     NULL);
+  g_signal_connect (peditor, "value_changed", 
+		    G_CALLBACK (mdi_tab_position_cb), dialog);
+
+/* fine tune some widgets */
   widget = WID ("toolbar_handlebox");
-  g_signal_connect (G_OBJECT (widget),
-    "button_press_event",
-    G_CALLBACK (button_press_blocker), NULL);
+  g_signal_connect (G_OBJECT (widget), "button_press_event",
+                    G_CALLBACK (button_press_blocker), NULL);
 
   widget = WID ("gnome_ui_properties_dialog");
-  g_signal_connect (G_OBJECT (widget),
-	"response",
-	G_CALLBACK (dialog_button_clicked_cb), changeset);
-
-  show_handlebar (dialog, 
-		  gconf_client_get_bool (gconf_client_get_default (),
-					 "/desktop/gnome/interface/toolbar_detachable",
-					 NULL));
-
-  toolbar_style = gconf_client_get_string (gconf_client_get_default (),
-					   "/desktop/gnome/interface/toolbar_style", 
-					   NULL);
-  
-  set_toolbar_style (dialog, toolbar_style);
+  g_signal_connect (G_OBJECT (widget), "response",
+	            G_CALLBACK (dialog_button_clicked_cb), changeset);
+
+/* transfer configuration */
+  show_handlebar (dialog, GCONF_GET(bool, CONF_TOOLBAR_DETACHABLE, NULL));
+
+  cstring = GCONF_GET(string, CONF_TOOLBAR_STYLE, NULL);
+  set_toolbar_style (dialog, cstring);
+  g_free (cstring);
+
+  set_have_icons (dialog, GCONF_GET(bool, CONF_MENUS_HAVE_ICONS, NULL));
 
-  g_free (toolbar_style);
+  cstring = GCONF_GET(string, CONF_MDI_TAB_POSITION, NULL);
+  set_mdi_tab_position (dialog, cstring);
+  g_free (cstring);
 
+/* finish */
   gtk_window_set_resizable (GTK_WINDOW (widget), FALSE);
   gtk_widget_show_all (widget);
 }
@@ -292,7 +393,7 @@
 		      NULL);
 
   client = gconf_client_get_default ();
-  gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+  gconf_client_add_dir (client, CONF_PREFIX, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
 
   dialog = create_dialog ();
   setup_dialog (dialog, changeset);
Index: gnome-control-center/capplets/ui-properties/gnome-ui-properties.glade
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/ui-properties/gnome-ui-properties.glade,v
retrieving revision 1.8
diff -u -r1.8 gnome-ui-properties.glade
--- gnome-control-center/capplets/ui-properties/gnome-ui-properties.glade	2002/05/14 16:34:14	1.8
+++ gnome-control-center/capplets/ui-properties/gnome-ui-properties.glade	2002/06/16 01:13:48
@@ -4,9 +4,9 @@
 <glade-interface>
 
 <widget class="GtkDialog" id="gnome_ui_properties_dialog">
-  <property name="title" translatable="yes">Toolbar and Menu Preferences</property>
+  <property name="title" translatable="yes">Toolbar, Menu and MDI Preferences</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="window_position">GTK_WIN_POS_CENTER</property>
   <property name="modal">False</property>
   <property name="default_width">400</property>
   <property name="resizable">True</property>
@@ -189,14 +189,10 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkFrame" id="toolbar_frame">
+		    <widget class="GtkVBox" id="toolbar_vbox">
 		      <property name="visible">True</property>
-		      <property name="label_xalign">0</property>
-		      <property name="label_yalign">0.5</property>
-		      <property name="shadow_type">GTK_SHADOW_NONE</property>
-		      <accessibility>
-			<atkproperty name="AtkObject::accessible_description" translatable="yes">A preview of what a toolbar looks like with these settings.</atkproperty>
-		      </accessibility>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
 
 		      <child>
 			<widget class="GtkHandleBox" id="toolbar_handlebox">
@@ -245,24 +241,32 @@
 			    </widget>
 			  </child>
 			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
 		      </child>
 
 		      <child>
-			<widget class="GtkLabel" id="label6">
+			<widget class="GtkLabel" id="label12">
 			  <property name="visible">True</property>
-			  <property name="label" translatable="yes">Sample Toolbar</property>
+			  <property name="label" translatable="yes">&lt;i&gt;Sample Toolbar&lt;/i&gt;</property>
 			  <property name="use_underline">False</property>
-			  <property name="use_markup">False</property>
-			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_RIGHT</property>
 			  <property name="wrap">False</property>
 			  <property name="selectable">False</property>
-			  <property name="xalign">0.5</property>
+			  <property name="xalign">1</property>
 			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
 			  <property name="ypad">0</property>
 			</widget>
 			<packing>
-			  <property name="type">label_item</property>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			  <property name="pack_type">GTK_PACK_END</property>
 			</packing>
 		      </child>
 		    </widget>
@@ -296,7 +300,7 @@
 	    </widget>
 	    <packing>
 	      <property name="padding">0</property>
-	      <property name="expand">True</property>
+	      <property name="expand">False</property>
 	      <property name="fill">True</property>
 	    </packing>
 	  </child>
@@ -334,14 +338,10 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkFrame" id="frame3">
+		    <widget class="GtkVBox" id="vbox7">
 		      <property name="visible">True</property>
-		      <property name="label_xalign">0</property>
-		      <property name="label_yalign">0.5</property>
-		      <property name="shadow_type">GTK_SHADOW_NONE</property>
-		      <accessibility>
-			<atkproperty name="AtkObject::accessible_description" translatable="yes">A preview of what a menubar looks like with these settings.</atkproperty>
-		      </accessibility>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
 
 		      <child>
 			<widget class="GtkMenuBar" id="menubar1">
@@ -487,24 +487,31 @@
 			    </widget>
 			  </child>
 			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
 		      </child>
 
 		      <child>
 			<widget class="GtkLabel" id="label8">
 			  <property name="visible">True</property>
-			  <property name="label" translatable="yes">Sample Menubar</property>
+			  <property name="label" translatable="yes">&lt;i&gt;Sample Menubar&lt;/i&gt;</property>
 			  <property name="use_underline">False</property>
-			  <property name="use_markup">False</property>
-			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_RIGHT</property>
 			  <property name="wrap">False</property>
 			  <property name="selectable">False</property>
-			  <property name="xalign">0.5</property>
+			  <property name="xalign">1</property>
 			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
 			  <property name="ypad">0</property>
 			</widget>
 			<packing>
-			  <property name="type">label_item</property>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
 			</packing>
 		      </child>
 		    </widget>
@@ -537,8 +544,441 @@
 	      </child>
 	    </widget>
 	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkFrame" id="frame6">
+	      <property name="visible">True</property>
+	      <property name="label_xalign">0</property>
+	      <property name="label_yalign">0.5</property>
+	      <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox5">
+		  <property name="border_width">8</property>
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">8</property>
+
+		  <child>
+		    <widget class="GtkTable" id="table1">
+		      <property name="visible">True</property>
+		      <property name="n_rows">2</property>
+		      <property name="n_columns">2</property>
+		      <property name="homogeneous">False</property>
+		      <property name="row_spacing">8</property>
+		      <property name="column_spacing">0</property>
+
+		      <child>
+			<widget class="GtkLabel" id="label17">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Preferred interface _style: </property>
+			  <property name="use_underline">True</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_CENTER</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="mnemonic_widget">toolbar_style_omenu</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">0</property>
+			  <property name="right_attach">1</property>
+			  <property name="top_attach">0</property>
+			  <property name="bottom_attach">1</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options"></property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label18">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Within _Notebook style tabs appear: </property>
+			  <property name="use_underline">True</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_CENTER</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="mnemonic_widget">toolbar_style_omenu</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">0</property>
+			  <property name="right_attach">1</property>
+			  <property name="top_attach">1</property>
+			  <property name="bottom_attach">2</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options"></property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkOptionMenu" id="mdi_preferred_style_omenu">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="history">0</property>
+
+			  <child internal-child="menu">
+			    <widget class="GtkMenu" id="menu3">
+			      <property name="visible">True</property>
+
+			      <child>
+				<widget class="GtkMenuItem" id="menuitem1">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Notebook</property>
+				  <property name="use_underline">True</property>
+				</widget>
+			      </child>
+
+			      <child>
+				<widget class="GtkMenuItem" id="menuitem2">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Toplevel Windows</property>
+				  <property name="use_underline">True</property>
+				</widget>
+			      </child>
+
+			      <child>
+				<widget class="GtkMenuItem" id="menuitem3">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Modal</property>
+				  <property name="use_underline">True</property>
+				</widget>
+			      </child>
+			    </widget>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">0</property>
+			  <property name="bottom_attach">1</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options"></property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkOptionMenu" id="mdi_tab_position_omenu">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="history">0</property>
+
+			  <child internal-child="menu">
+			    <widget class="GtkMenu" id="menu4">
+			      <property name="visible">True</property>
+
+			      <child>
+				<widget class="GtkMenuItem" id="menuitem5">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">On top</property>
+				  <property name="use_underline">True</property>
+				</widget>
+			      </child>
+
+			      <child>
+				<widget class="GtkMenuItem" id="menuitem6">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">On the left side</property>
+				  <property name="use_underline">True</property>
+				</widget>
+			      </child>
+
+			      <child>
+				<widget class="GtkMenuItem" id="menuitem7">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">On the right side</property>
+				  <property name="use_underline">True</property>
+				</widget>
+			      </child>
+
+			      <child>
+				<widget class="GtkMenuItem" id="menuitem8">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">On bottom</property>
+				  <property name="use_underline">True</property>
+				</widget>
+			      </child>
+			    </widget>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">1</property>
+			  <property name="bottom_attach">2</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options"></property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox8">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkNotebook" id="mid_tabs_notebook">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="show_tabs">True</property>
+			  <property name="show_border">True</property>
+			  <property name="tab_pos">GTK_POS_TOP</property>
+			  <property name="scrollable">False</property>
+			  <property name="tab_hborder">2</property>
+			  <property name="tab_vborder">2</property>
+			  <property name="enable_popup">False</property>
+
+			  <child>
+			    <widget class="GtkScrolledWindow" id="scrolledwindow1">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+			      <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
+			      <property name="shadow_type">GTK_SHADOW_IN</property>
+			      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+			      <child>
+				<widget class="GtkTextView" id="textview1">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="editable">True</property>
+				  <property name="justification">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap_mode">GTK_WRAP_NONE</property>
+				  <property name="cursor_visible">True</property>
+				  <property name="pixels_above_lines">0</property>
+				  <property name="pixels_below_lines">0</property>
+				  <property name="pixels_inside_wrap">0</property>
+				  <property name="left_margin">0</property>
+				  <property name="right_margin">0</property>
+				  <property name="indent">0</property>
+				  <property name="text" translatable="yes">Hello world...</property>
+				</widget>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="tab_expand">False</property>
+			      <property name="tab_fill">True</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="label14">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Document1</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0.5</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			    </widget>
+			    <packing>
+			      <property name="type">tab</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkScrolledWindow" id="scrolledwindow2">
+			      <property name="height_request">24</property>
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+			      <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
+			      <property name="shadow_type">GTK_SHADOW_IN</property>
+			      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+			      <child>
+				<widget class="GtkTextView" id="textview2">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="editable">False</property>
+				  <property name="justification">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap_mode">GTK_WRAP_NONE</property>
+				  <property name="cursor_visible">True</property>
+				  <property name="pixels_above_lines">0</property>
+				  <property name="pixels_below_lines">0</property>
+				  <property name="pixels_inside_wrap">0</property>
+				  <property name="left_margin">0</property>
+				  <property name="right_margin">0</property>
+				  <property name="indent">0</property>
+				  <property name="text" translatable="yes">#include &lt;gnome.h&gt;
+#include &quot;interface.h&quot;
+
+int main(int argc, char * argv)
+{
+    GtkWidget * hello_world;
+
+    gnome_program_init(PACKAGE, VERSION,
+                                      LIBGNOMEUI_MODULE, argc, argv, NULL);
+
+    hello_world = hello_world_create();
+    gtk_widget_show(hello_world);
+
+    gtk_main()
+    return 0;
+}</property>
+				</widget>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="tab_expand">False</property>
+			      <property name="tab_fill">True</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="label15">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Document2</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0.5</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			    </widget>
+			    <packing>
+			      <property name="type">tab</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkScrolledWindow" id="scrolledwindow3">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+			      <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
+			      <property name="shadow_type">GTK_SHADOW_IN</property>
+			      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+			      <child>
+				<widget class="GtkTextView" id="textview3">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="editable">True</property>
+				  <property name="justification">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap_mode">GTK_WRAP_NONE</property>
+				  <property name="cursor_visible">True</property>
+				  <property name="pixels_above_lines">0</property>
+				  <property name="pixels_below_lines">0</property>
+				  <property name="pixels_inside_wrap">0</property>
+				  <property name="left_margin">0</property>
+				  <property name="right_margin">0</property>
+				  <property name="indent">0</property>
+				  <property name="text" translatable="yes">Visit http://www.gnome.org/</property>
+				</widget>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="tab_expand">False</property>
+			      <property name="tab_fill">True</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="label16">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Document3</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0.5</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			    </widget>
+			    <packing>
+			      <property name="type">tab</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label13">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">&lt;i&gt;Notebook Style MDI Sample&lt;/i&gt;</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_RIGHT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">1</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label11">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Multiple Document Interfaces</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		</widget>
+		<packing>
+		  <property name="type">label_item</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
 	      <property name="padding">0</property>
-	      <property name="expand">True</property>
+	      <property name="expand">False</property>
 	      <property name="fill">True</property>
 	    </packing>
 	  </child>
Index: libgnomeui/ChangeLog
===================================================================
RCS file: /cvs/gnome/libgnomeui/ChangeLog,v
retrieving revision 1.206
diff -u -r1.206 ChangeLog
--- libgnomeui/ChangeLog	2002/06/10 13:17:31	1.206
+++ libgnomeui/ChangeLog	2002/06/16 01:13:59
@@ -1,3 +1,10 @@
+2002-06-15  Mathias Hasselmann <mathias.hasselmann@gmx.de>
+
+	* libgnomeui/gnome-app-helper.[ch].c:
+	  Added support for "desktop/gnome/interface/mdi_tab_position"
+          and some code cleanups regarding
+          "desktop/gnome/interface/toolbar_style"
+
 2002-06-10  Malcolm Tredinnick <malcolm@commsecure.com.au>
 	* libgnomeui/gnome-app-helper.c: Translate the word "Contents" in the
 	  libgnomeui domain (i.e. correctly).
Index: libgnomeui/libgnomeui/gnome-app-helper.c
===================================================================
RCS file: /cvs/gnome/libgnomeui/libgnomeui/gnome-app-helper.c,v
retrieving revision 1.210
diff -u -r1.210 gnome-app-helper.c
--- libgnomeui/libgnomeui/gnome-app-helper.c	2002/06/10 13:17:32	1.210
+++ libgnomeui/libgnomeui/gnome-app-helper.c	2002/06/16 01:14:01
@@ -328,6 +328,21 @@
   "end-game"
 };
 
+static GConfEnumStringPair toolbar_styles[] = {
+        { GTK_TOOLBAR_TEXT, "text" },
+        { GTK_TOOLBAR_ICONS, "icons" },
+        { GTK_TOOLBAR_BOTH, "both" },
+        { GTK_TOOLBAR_BOTH_HORIZ, "both_horiz" },
+	{ -1, NULL }
+};
+
+static GConfEnumStringPair tab_positions[] = {
+        { GTK_POS_LEFT, "left" },
+        { GTK_POS_RIGHT, "right" },
+        { GTK_POS_TOP, "top" },
+        { GTK_POS_BOTTOM, "bottom" },
+	{ -1, NULL }
+};
 
 static GtkWidget *
 scale_pixbuf (GdkPixbuf *pixbuf, GtkIconSize icon_size) {
@@ -2416,14 +2431,6 @@
 	return s;
 }
 
-static GConfEnumStringPair toolbar_styles[] = {
-        { GTK_TOOLBAR_TEXT, "text" },
-        { GTK_TOOLBAR_ICONS, "icons" },
-        { GTK_TOOLBAR_BOTH, "both" },
-        { GTK_TOOLBAR_BOTH_HORIZ, "both_horiz" },
-	{ -1, NULL }
-};
-
 static void
 per_app_toolbar_style_changed_notify(GConfClient            *client,
                                      guint                   cnxn_id,
@@ -2435,34 +2442,24 @@
         GtkToolbar *toolbar = GTK_TOOLBAR(w);
         gboolean got_it = FALSE;
 	GConfValue *value = gconf_entry_get_value (entry);
-
-        if (value &&
-            value->type == GCONF_VALUE_STRING &&
-            gconf_value_get_string(value) != NULL) {
 
-                if (gconf_string_to_enum(toolbar_styles,
-                                         gconf_value_get_string(value),
-                                         (gint*)&style)) {
-                        got_it = TRUE;
-                }
-        }
+        got_it = (value &&
+                  value->type == GCONF_VALUE_STRING &&
+                  gconf_value_get_string(value) != NULL &&
+                  gconf_string_to_enum(toolbar_styles,
+                                       gconf_value_get_string(value),
+                                       (gint*) &style));
 
         /* Fall back to global setting */
         if (!got_it) {
-                gchar *str;
+                gchar *str = gconf_client_get_string
+                    (client, "/desktop/gnome/interface/toolbar_style", NULL);
 
-                str = gconf_client_get_string(client,
-                                              "/desktop/gnome/interface/toolbar_style",
-                                              NULL);
-
-                if (str) {
-			if (!gconf_string_to_enum (toolbar_styles,
-						   str,
-						   (gint *)&style))
-				style = GTK_TOOLBAR_BOTH;
+                if (!(str && gconf_string_to_enum (toolbar_styles, str,
+						   (gint*) &style)))
+                    style = GTK_TOOLBAR_BOTH;
 
-                        g_free(str);
-                }
+                g_free(str);
         }
 
         gtk_toolbar_set_style(toolbar, style);
@@ -2488,24 +2485,18 @@
         g_free(per_app_key);
 
         if (str) {
-                if (gconf_string_to_enum(toolbar_styles,
-                                         str,
-                                         (gint*)&style)) {
-                        got_it = TRUE;
-                }
+                got_it = gconf_string_to_enum(toolbar_styles, str, (gint*)&style);
                 g_free(str);
         }
 
-	value = gconf_entry_get_value (entry);
-
         /* If no per-app setting use this new global setting */
         if (!got_it &&
-            value &&
+            (value = gconf_entry_get_value (entry)) &&
             value->type == GCONF_VALUE_STRING &&
             gconf_value_get_string(value) != NULL) {
-		if (!gconf_string_to_enum (toolbar_styles,
-					   gconf_value_get_string (value),
-					   (gint *)&style))
+		if (!gconf_string_to_enum
+                        (toolbar_styles, gconf_value_get_string (value),
+			 (gint*) &style))
 			style = GTK_TOOLBAR_BOTH;
         }
 
@@ -2513,6 +2504,79 @@
 }
 
 static void
+per_app_mdi_tab_position_changed_notify(GConfClient            *client,
+                                        guint                   cnxn_id,
+				        GConfEntry             *entry,
+                                        gpointer                user_data)
+{
+        GtkPositionType position = GTK_POS_TOP;
+        GtkWidget *w = user_data;
+        GtkNotebook *notebook = GTK_NOTEBOOK(w);
+        gboolean got_it = FALSE;
+	GConfValue *value = gconf_entry_get_value (entry);
+
+        got_it = (value &&
+                  value->type == GCONF_VALUE_STRING &&
+                  gconf_value_get_string(value) != NULL &&
+                  gconf_string_to_enum(tab_positions,
+                                       gconf_value_get_string(value),
+                                       (gint*) &position));
+
+        /* Fall back to global setting */
+        if (!got_it) {
+                gchar *str = gconf_client_get_string
+                    (client, "/desktop/gnome/interface/mdi_tab_position", NULL);
+
+                if (!(str && gconf_string_to_enum (tab_positions, str,
+						   (gint*) &position)))
+                    position = GTK_POS_TOP;
+
+                g_free(str);
+        }
+
+        gtk_notebook_set_tab_pos(notebook, position);
+}
+
+static void
+mdi_tab_position_changed_notify(GConfClient            *client,
+                                guint                   cnxn_id,
+			        GConfEntry             *entry,
+                                gpointer                user_data)
+{
+        GtkPositionType position = GTK_POS_TOP;
+        GtkWidget *w = user_data;
+        GtkNotebook *notebook = GTK_NOTEBOOK(w);
+        gchar *per_app_key;
+        gchar *str;
+        gboolean got_it = FALSE;
+	GConfValue *value;
+
+        /* Check for app-specific override */
+        per_app_key = gnome_gconf_get_gnome_libs_settings_relative("mdi_tab_position");
+        str = gconf_client_get_string(client, per_app_key, NULL);
+        g_free(per_app_key);
+
+        if (str) {
+                got_it = gconf_string_to_enum(tab_positions, str,
+                                              (gint*) &position);
+                g_free(str);
+        }
+
+        /* If no per-app setting use this new global setting */
+        if (!got_it &&
+            (value = gconf_entry_get_value (entry)) &&
+            value->type == GCONF_VALUE_STRING &&
+            gconf_value_get_string(value) != NULL) {
+		if (!gconf_string_to_enum
+                        (tab_positions, gconf_value_get_string (value),
+			 (gint*) &position))
+			position = GTK_POS_TOP;
+        }
+
+        gtk_notebook_set_tab_pos(notebook, position);
+}
+
+static void
 style_menu_item_activated (GtkWidget *item, GtkToolbarStyle style)
 {
 	GConfClient *conf;
@@ -2710,7 +2774,8 @@
         conf = gconf_client_get_default();
 
         g_object_ref (G_OBJECT (conf));
-        g_object_set_data_full(G_OBJECT(toolbar), gnome_app_helper_gconf_client,
+        g_object_set_data_full(G_OBJECT(toolbar), 
+                               gnome_app_helper_gconf_client,
 			       conf, (GDestroyNotify)g_object_unref);
 
         /* Attach GConf settings */
@@ -2740,48 +2805,39 @@
 
                 /* Try per-app key */
                 per_app_key = gnome_gconf_get_gnome_libs_settings_relative("toolbar_style");
+                str = gconf_client_get_string(conf, per_app_key, NULL);
 
-                str = gconf_client_get_string(conf,
-                                              per_app_key,
-                                              NULL);
-
-                if (str &&
-                    gconf_string_to_enum(toolbar_styles,
-                                         str,
-                                         (gint*)&toolbar_style)) {
-                        got_it = TRUE;
+                if (!(str && 
+                      gconf_string_to_enum(toolbar_styles, str,
+                                           (gint*) &toolbar_style))) {
+                /* Try global default */
+                    g_free(str);
+                    
+                    str = gconf_client_get_string
+                        (conf, "/desktop/gnome/interface/toolbar_style", NULL);
+
+                    if (!(str &&
+                          gconf_string_to_enum(toolbar_styles, str,
+                                               (gint*) &toolbar_style)))
+                    {
+                /* Use fallback value */
+                        toolbar_style = GTK_TOOLBAR_BOTH;
+                    }
                 }
 
                 g_free(str);
 
-                /* Try global default */
-                if (!got_it) {
-                        str = gconf_client_get_string(conf,
-                                                      "/desktop/gnome/interface/toolbar_style",
-                                                      NULL);
-
-                        if (str != NULL) {
-                                if (!gconf_string_to_enum(toolbar_styles,
-							  str,
-							  (gint*)&toolbar_style))
-					toolbar_style = GTK_TOOLBAR_BOTH;
-                                g_free(str);
-                        }
-                }
+                notify_id = gconf_client_notify_add
+                  (conf, "/desktop/gnome/interface/toolbar_style", 
+                   toolbar_style_changed_notify, toolbar, NULL, NULL);
 
-                notify_id = gconf_client_notify_add(conf,
-                                                    "/desktop/gnome/interface/toolbar_style",
-                                                    toolbar_style_changed_notify,
-                                                    toolbar, NULL, NULL);
-
                 g_signal_connect(toolbar, "destroy",
 				 G_CALLBACK(remove_notify_cb),
 				 GINT_TO_POINTER(notify_id));
 
-                notify_id = gconf_client_notify_add(conf,
-                                                    per_app_key,
-                                                    per_app_toolbar_style_changed_notify,
-                                                    toolbar, NULL, NULL);
+                notify_id = gconf_client_notify_add
+                  (conf, per_app_key,
+                   per_app_toolbar_style_changed_notify, toolbar, NULL, NULL);
 
                 g_signal_connect(toolbar, "destroy",
 				 G_CALLBACK(remove_notify_cb),
@@ -2790,6 +2846,88 @@
                 g_free(per_app_key);
 
                 gtk_toolbar_set_style (toolbar, toolbar_style);
+        }
+}
+
+/**
+ * gnome_app_setup_mdi_notebook
+ * @notebook: Pointer to a #GtkNotebook instance.
+ *
+ * Description:
+ * Sets up a notebook intended as multiple documents interface (MDI)
+ * to use GNOME user preferences.
+ **/
+
+void
+gnome_app_setup_mdi_notebook (GtkNotebook *notebook)
+{
+        GConfClient *conf;
+
+	/* make sure that things are all ready for us */
+	gnomeui_gconf_lazy_init ();
+
+
+        conf = gconf_client_get_default();
+
+        g_object_ref (G_OBJECT (conf));
+        g_object_set_data_full(G_OBJECT(notebook),
+                               gnome_app_helper_gconf_client,
+			       conf, (GDestroyNotify)g_object_unref);
+
+        { /* Tab position */
+                /* This one is a lot more complex because
+                   we have a per-app setting that overrides
+                   the default global setting */
+
+                GtkPositionType mdi_tab_position = GTK_POS_TOP;
+                guint notify_id;
+                gchar *str;
+                gchar *per_app_key;
+                gboolean got_it = FALSE;
+
+                /* Try per-app key */
+                per_app_key = gnome_gconf_get_gnome_libs_settings_relative("mdi_tab_position");
+                str = gconf_client_get_string(conf, per_app_key, NULL);
+
+                if (!(str && 
+                      gconf_string_to_enum(tab_positions, str,
+                                           (gint*) &mdi_tab_position))) {
+                /* Try global default */
+                    g_free(str);
+                    
+                    str = gconf_client_get_string
+                        (conf, "/desktop/gnome/interface/mdi_tab_position", NULL);
+
+                    if (!(str &&
+                          gconf_string_to_enum(tab_positions, str,
+                                               (gint*) &mdi_tab_position)))
+                    {
+                /* Use fallback value */
+                        mdi_tab_position = GTK_POS_TOP;
+                    }
+                }
+
+                g_free(str);
+
+                notify_id = gconf_client_notify_add
+                  (conf, "/desktop/gnome/interface/mdi_tab_position", 
+                   mdi_tab_position_changed_notify, notebook, NULL, NULL);
+
+                g_signal_connect(notebook, "destroy",
+				 G_CALLBACK(remove_notify_cb),
+				 GINT_TO_POINTER(notify_id));
+
+                notify_id = gconf_client_notify_add
+                  (conf, per_app_key, per_app_mdi_tab_position_changed_notify, 
+                   notebook, NULL, NULL);
+
+                g_signal_connect(notebook, "destroy",
+				 G_CALLBACK(remove_notify_cb),
+				 GINT_TO_POINTER(notify_id));
+
+                g_free(per_app_key);
+
+                gtk_notebook_set_tab_pos (notebook, mdi_tab_position);
         }
 }
 
Index: libgnomeui/libgnomeui/gnome-app-helper.h
===================================================================
RCS file: /cvs/gnome/libgnomeui/libgnomeui/gnome-app-helper.h,v
retrieving revision 1.94
diff -u -r1.94 gnome-app-helper.h
--- libgnomeui/libgnomeui/gnome-app-helper.h	2002/06/05 00:17:10	1.94
+++ libgnomeui/libgnomeui/gnome-app-helper.h	2002/06/16 01:14:02
@@ -39,6 +39,7 @@
 #define GNOME_APP_HELPER_H
 
 #include <gtk/gtkstatusbar.h>
+#include <gtk/gtknotebook.h>
 
 #include <libgnomeui/gnome-appbar.h>
 #include <libgnomeui/gnome-app.h>
@@ -787,6 +788,10 @@
 
 void gnome_app_setup_toolbar                (GtkToolbar *toolbar,
                                              BonoboDockItem *dock_item);
+
+
+void gnome_app_setup_mdi_notebook           (GtkNotebook *notebook);
+
 
 G_END_DECLS
 
Index: libgnomeui/test-gnome/testgnome.c
===================================================================
RCS file: /cvs/gnome/libgnomeui/test-gnome/testgnome.c,v
retrieving revision 1.31
diff -u -r1.31 testgnome.c
--- libgnomeui/test-gnome/testgnome.c	2002/04/19 23:19:09	1.31
+++ libgnomeui/test-gnome/testgnome.c	2002/06/16 01:14:04
@@ -1492,6 +1492,31 @@
 	gtk_widget_show (about_box);
 }
 
+static void
+create_mdi (void)
+{
+	TestGnomeApp *app;
+	GtkWidget *notebook;
+
+	app = create_newwin(TRUE,"testGNOME","Paper Selection");
+	notebook = gtk_notebook_new( );
+        gnome_app_setup_mdi_notebook(GTK_NOTEBOOK(notebook));
+
+        gtk_notebook_append_page(GTK_NOTEBOOK(notebook), 
+                                 gtk_label_new("\n This is the first page \n"),
+                                 gtk_label_new("First"));
+        gtk_notebook_append_page(GTK_NOTEBOOK(notebook), 
+                                 gtk_label_new("\n This is the second page \n"),
+                                 gtk_label_new("Second"));
+        gtk_notebook_append_page(GTK_NOTEBOOK(notebook), 
+                                 gtk_label_new("\n Last not least a third page \n"),
+                                 gtk_label_new("Third"));
+
+	bonobo_window_set_contents(BONOBO_WINDOW(app->app), notebook);
+	gtk_widget_show_all(notebook);
+	gtk_widget_show(app->app);
+}
+
 int
 main (int argc, char **argv)
 {
@@ -1517,6 +1542,7 @@
 /*		{ "image selector", create_image_selector },*/
 /*		{ "paper selector", create_papersel },*/
 /*		{ "unit spinner", create_unit_spinner },*/
+		  { "multi document interface", create_mdi },
 		  { "about box", create_about_box }
 	  };
 	int nbuttons = sizeof (buttons) / sizeof (buttons[0]);
Index: profterm/ChangeLog
===================================================================
RCS file: /cvs/gnome/profterm/ChangeLog,v
retrieving revision 1.196
diff -u -r1.196 ChangeLog
--- profterm/ChangeLog	2002/06/12 03:46:07	1.196
+++ profterm/ChangeLog	2002/06/16 01:14:06
@@ -1,3 +1,8 @@
+2002-06-15  Mathias Hasselmann <mathias.hasselmann@gmx.de>
+
+	* src/terminal-window.c:
+	Added support for "desktop/gnome/interface/mdi_tab_position"
+
 2002-06-11  Havoc Pennington  <hp@pobox.com>
 
 	* configure.in: 2.0.0
Index: profterm/src/terminal-window.c
===================================================================
RCS file: /cvs/gnome/profterm/src/terminal-window.c,v
retrieving revision 1.54
diff -u -r1.54 terminal-window.c
--- profterm/src/terminal-window.c	2002/05/27 08:10:11	1.54
+++ profterm/src/terminal-window.c	2002/06/16 01:14:08
@@ -30,8 +30,10 @@
 #include <libgnome/gnome-help.h>
 #include <libgnomeui/gnome-about.h>
 #include <libgnomeui/gnome-stock-icons.h>
+#include <libgnomeui/gnome-app-helper.h>
 #include <gdk/gdkx.h>
 #include <eel/eel-ellipsizing-label.h>
+#include <gtk/gtkstyle.h>
 
 struct _TerminalWindowPrivate
 {  
@@ -64,6 +66,7 @@
   void *old_geometry_widget; /* only used for pointer value as it may be freed */
   GConfClient *conf;
   guint notify_id;
+  guint notify_id2;
   guint menubar_visible : 1;
   guint use_default_menubar_visibility : 1;
   guint use_mnemonics : 1;   /* config key value */
@@ -501,7 +504,8 @@
   
   gtk_notebook_set_scrollable (GTK_NOTEBOOK (window->priv->notebook),
                                TRUE);                                      
-  
+  gnome_app_setup_mdi_notebook (GTK_NOTEBOOK (window->priv->notebook));
+
   g_signal_connect_after (G_OBJECT (window->priv->notebook),
                           "switch_page",
                           G_CALLBACK (notebook_page_switched_callback),
@@ -696,6 +700,10 @@
                               window->priv->notify_id);
   window->priv->notify_id = 0;
 
+  gconf_client_notify_remove (window->priv->conf,
+                              window->priv->notify_id2);
+  window->priv->notify_id2 = 0;
+
   if (window->priv->conf)
     g_object_unref (G_OBJECT (window->priv->conf));
   
@@ -769,6 +777,13 @@
                              config_change_notify,
                              window,
                              NULL, &err);
+
+  window->priv->notify_id2 =
+    gconf_client_notify_add (window->priv->conf,
+                             "/desktop/gnome/interface/mdi_tab_position",
+                             config_change_notify,
+                             window,
+                             NULL, &err);
   
   if (err)
     {
@@ -886,7 +901,7 @@
   
   old = terminal_screen_get_window (screen);
 
-  if (old == window)
+  if (old == window) 
     return;  
 
   g_object_ref (G_OBJECT (screen)); /* make our own new refcount */
@@ -905,6 +920,24 @@
   hbox = gtk_hbox_new (FALSE, 0);
   scrollbar = gtk_vscrollbar_new (NULL);
   label = eel_ellipsizing_label_new (terminal_screen_get_title (screen));
+
+  /* give labels a resonable minimal width based on the label font's
+   * height
+   */
+  {
+    GtkStyle *style;
+    gint width, height;
+
+    gtk_widget_ensure_style (label);
+    style = gtk_widget_get_style (label);
+    gtk_widget_get_size_request (label, &width, &height);
+
+    width = 10 * pango_font_description_get_size (style->font_desc)
+               / PANGO_SCALE;
+
+    gtk_widget_set_size_request (label, width, height);
+  }
+
   gtk_widget_show (label);
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   
@@ -948,10 +981,18 @@
   update_tab_sensitivity (window);
   
   /* Busting out the GtkNotebook crackrock features */
-  gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (window->priv->notebook),
-                                      hbox,
-                                      TRUE, TRUE, GTK_PACK_START);
-  
+  {
+    GtkPositionType position = 
+        gtk_notebook_get_tab_pos (GTK_NOTEBOOK (window->priv->notebook));
+
+    gboolean expand_and_fill =
+        ((GTK_POS_TOP == position) || (GTK_POS_BOTTOM == position));
+
+    gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (window->priv->notebook),
+                                        hbox, expand_and_fill, expand_and_fill,
+                                        GTK_PACK_START);
+  }  
+
   /* ZvtTerm is a broken POS and requires this realize to get
    * the size request right.
    */
@@ -1557,6 +1598,29 @@
           reset_menubar_labels (window);
         }
     }
+  else if (strcmp (gconf_entry_get_key (entry),
+                   "/desktop/gnome/interface/mdi_tab_position") == 0)
+    {
+      if (val && val->type == GCONF_VALUE_STRING)
+        {
+          const gchar * str = gconf_value_get_string (val);
+          update_label_packing (window, !(strcmp (str, "top") && 
+                                          strcmp (str, "bottom")));
+        }
+    }
+}
+
+static void
+update_label_packing (TerminalWindow *window, gboolean expand_and_fill)
+{
+  GtkNotebook * notebook = GTK_NOTEBOOK (window->priv->notebook);
+  GtkWidget * child;
+    
+  int i;
+
+  for (i = 0; (child = gtk_notebook_get_nth_page (notebook, i)); ++i)
+      gtk_notebook_set_tab_label_packing (notebook, child, expand_and_fill, 
+                                          expand_and_fill, GTK_PACK_START);
 }
 
 static void
