diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 8b63c5c..dff34d7 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -237,6 +237,8 @@ gtk_public_h_sources =          \
 	gtklinkbutton.h		\
 	gtkliststore.h		\
 	gtkmain.h		\
+	gtkmainwindow.h		\
+	gtkmainwindowfactory.h	\
 	gtkmenu.h		\
 	gtkmenubar.h		\
 	gtkmenuitem.h		\
@@ -491,6 +493,8 @@ gtk_base_c_sources =            \
 	gtklinkbutton.c		\
 	gtkliststore.c		\
 	gtkmain.c		\
+	gtkmainwindow.c		\
+	gtkmainwindowfactory.c	\
 	gtkmarshal.c		\
 	gtkmarshalers.c		\
 	gtkmenu.c		\
diff --git a/gtk/gtkmainwindow.c b/gtk/gtkmainwindow.c
new file mode 100644
index 0000000..ed77d42
--- /dev/null
+++ b/gtk/gtkmainwindow.c
@@ -0,0 +1,117 @@
+/* gtkmainwindow.c
+ * Copyright (C) 2008 Jan Arne Petersen <jpetersen@jpetersen.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ */
+
+#include <config.h>
+
+#include "gtkintl.h"
+
+#include "gtkmainwindow.h"
+
+GType
+gtk_main_window_get_type (void)
+{
+  static GType gtk_main_window_type_id = 0;
+
+  if (G_UNLIKELY (gtk_main_window_type_id == 0)) {
+      static const GTypeInfo g_define_type_info =
+        {
+          sizeof (GtkMainWindowIface),
+          (GBaseInitFunc) NULL,
+          (GBaseFinalizeFunc) NULL,
+          (GClassInitFunc) NULL,
+          (GClassFinalizeFunc) NULL,
+          NULL,
+          0,
+          0,
+          (GInstanceInitFunc) NULL
+        };
+
+      gtk_main_window_type_id = g_type_register_static (G_TYPE_INTERFACE, I_("GtkMainWindow"),
+                                                       &g_define_type_info, 0);
+      g_type_interface_add_prerequisite (gtk_main_window_type_id, GTK_TYPE_WINDOW);
+  }
+  return gtk_main_window_type_id;
+}
+
+void
+gtk_main_window_set_menu (GtkMainWindow *main_window,
+                          GtkMenuShell  *menu_shell)
+{
+  GtkMainWindowIface *iface;
+
+  g_return_if_fail (GTK_IS_MAIN_WINDOW (main_window));
+  g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
+
+  iface = GTK_MAIN_WINDOW_GET_IFACE (main_window);
+
+  (* iface->set_menu) (main_window, menu_shell);
+}
+
+GtkMenuShell *
+gtk_main_window_get_menu (GtkMainWindow *main_window)
+{
+  GtkMainWindowIface *iface;
+
+  g_return_val_if_fail (GTK_IS_MAIN_WINDOW (main_window), NULL);
+
+  iface = GTK_MAIN_WINDOW_GET_IFACE (main_window);
+
+  return (* iface->get_menu) (main_window);
+}
+
+void
+gtk_main_window_add_toolbar (GtkMainWindow *main_window,
+                             GtkToolbar    *toolbar)
+{
+  GtkMainWindowIface *iface;
+
+  g_return_if_fail (GTK_IS_MAIN_WINDOW (main_window));
+  g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
+
+  iface = GTK_MAIN_WINDOW_GET_IFACE (main_window);
+
+  (* iface->add_toolbar) (main_window, toolbar);
+}
+
+void
+gtk_main_window_remove_toolbar (GtkMainWindow *main_window,
+                                GtkToolbar    *toolbar)
+{
+  GtkMainWindowIface *iface;
+
+  g_return_if_fail (GTK_IS_MAIN_WINDOW (main_window));
+  g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
+
+  iface = GTK_MAIN_WINDOW_GET_IFACE (main_window);
+
+  (* iface->remove_toolbar) (main_window, toolbar);
+}
+
+GList *
+gtk_main_window_get_toolbars (GtkMainWindow *main_window)
+{
+  GtkMainWindowIface *iface;
+
+  g_return_val_if_fail (GTK_IS_MAIN_WINDOW (main_window), NULL);
+
+  iface = GTK_MAIN_WINDOW_GET_IFACE (main_window);
+
+  return (* iface->get_toolbars) (main_window);
+}
+
diff --git a/gtk/gtkmainwindow.h b/gtk/gtkmainwindow.h
new file mode 100644
index 0000000..e711a3a
--- /dev/null
+++ b/gtk/gtkmainwindow.h
@@ -0,0 +1,69 @@
+/* gtkmainwindow.h
+ * Copyright (C) 2008 Jan Arne Petersen <jpetersen@jpetersen.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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_MAIN_WINDOW_H__
+#define __GTK_MAIN_WINDOW_H__
+
+#include <glib-object.h>
+
+#include <gtk/gtkmenushell.h>
+#include <gtk/gtktoolbar.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_MAIN_WINDOW           (gtk_main_window_get_type ())
+#define GTK_MAIN_WINDOW(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MAIN_WINDOW, GtkMainWindow))
+#define GTK_IS_MAIN_WINDOW(obj)	       (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MAIN_WINDOW))
+#define GTK_MAIN_WINDOW_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_MAIN_WINDOW, GtkMainWindowIface))
+
+typedef struct _GtkMainWindow      GtkMainWindow;
+typedef struct _GtkMainWindowIface GtkMainWindowIface;
+
+struct _GtkMainWindowIface
+{
+  GTypeInterface parent;
+
+  void          (*set_menu)       (GtkMainWindow *main_window,
+                                   GtkMenuShell  *menu_shell);
+  GtkMenuShell *(*get_menu)       (GtkMainWindow *main_window);
+
+  void          (*add_toolbar)    (GtkMainWindow *main_window,
+                                   GtkToolbar    *toolbar);
+  void          (*remove_toolbar) (GtkMainWindow *main_window,
+                                   GtkToolbar    *toolbar);
+  GList *       (*get_toolbars)   (GtkMainWindow *main_window);
+};
+
+GType         gtk_main_window_get_type       (void) G_GNUC_CONST;
+
+void          gtk_main_window_set_menu       (GtkMainWindow *main_window,
+                                              GtkMenuShell  *menu_shell);
+GtkMenuShell *gtk_main_window_get_menu       (GtkMainWindow *main_window);
+
+void          gtk_main_window_add_toolbar    (GtkMainWindow *main_window,
+                                              GtkToolbar    *toolbar);
+void          gtk_main_window_remove_toolbar (GtkMainWindow *main_window,
+                                              GtkToolbar    *toolbar);
+GList *       gtk_main_window_get_toolbars   (GtkMainWindow *main_window);
+
+
+G_END_DECLS
+
+#endif /* __GTK_MAIN_WINDOW_H__ */
+
diff --git a/gtk/gtkmainwindowfactory.c b/gtk/gtkmainwindowfactory.c
new file mode 100644
index 0000000..c75f4cc
--- /dev/null
+++ b/gtk/gtkmainwindowfactory.c
@@ -0,0 +1,127 @@
+/* gtkmainwindowfactory.c
+ * Copyright (C) 2008 Jan Arne Petersen <jpetersen@jpetersen.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ */
+
+#include <config.h>
+
+#include <gio/gio.h>
+
+#include "gtkmainwindowfactory.h"
+
+G_DEFINE_ABSTRACT_TYPE (GtkMainWindowFactory, gtk_main_window_factory, G_TYPE_OBJECT);
+
+G_LOCK_DEFINE_STATIC (load_modules);
+
+static void
+gtk_main_window_factory_class_init (GtkMainWindowFactoryClass *klass)
+{
+}
+
+static void
+gtk_main_window_factory_init (GtkMainWindowFactory *factory)
+{
+}
+
+static void
+load_modules (void)
+{
+  static gboolean loaded = FALSE;
+
+  G_LOCK (load_modules);
+
+  if (!loaded)
+    {
+      GIOExtensionPoint *ep;
+      GList *modules, *iter;
+
+      loaded = TRUE;
+
+      ep = g_io_extension_point_register (GTK_MAIN_WINDOW_FACTORY_EXTENSION_POINT_NAME);
+      g_io_extension_point_set_required_type (ep, GTK_TYPE_MAIN_WINDOW_FACTORY);
+
+      modules = NULL; /* g_io_modules_load_all_in_directory (GTK_EXTENSIONS_DIR); */
+
+      /* register builtin types */
+#if 0
+      _gtk_main_window_default_factory_get_type ();
+#endif
+
+      for (iter = modules; iter != NULL; iter = iter->next)
+        g_type_module_unuse (G_TYPE_MODULE (iter->data));
+      g_list_free (modules);
+    }
+
+  G_UNLOCK (load_modules);
+}
+
+static gpointer
+create_main_window_factory (gpointer arg)
+{
+  GIOExtensionPoint *ep;
+  GList *iter;
+
+  load_modules ();
+
+  ep = g_io_extension_point_lookup (GTK_MAIN_WINDOW_FACTORY_EXTENSION_POINT_NAME);
+
+  iter = g_io_extension_point_get_extensions (ep);
+  for (; iter != NULL; iter = iter->next)
+    {
+      GIOExtension *extension = iter->data;
+      GtkMainWindowFactory *factory;
+
+      factory = g_object_new (g_io_extension_get_type (extension), NULL);
+      
+      return factory;
+    }
+  
+  return NULL;
+}
+
+GtkMainWindowFactory *
+gtk_main_window_factory_get (void)
+{
+  static GOnce once_init = G_ONCE_INIT;
+
+  return g_once (&once_init, create_main_window_factory, NULL);
+}
+
+GtkMainWindow *
+gtk_main_window_factory_create_window (GtkMainWindowFactory *factory)
+{
+    GtkMainWindowFactoryClass *klass;
+
+    g_return_val_if_fail (GTK_IS_MAIN_WINDOW_FACTORY (factory), NULL);
+
+    klass = GTK_MAIN_WINDOW_FACTORY_GET_CLASS (factory);
+
+    return (* klass->create_window) (factory);
+}
+
+GtkMenuShell *
+gtk_main_window_factory_create_menu_widget (GtkMainWindowFactory *factory)
+{
+    GtkMainWindowFactoryClass *klass;
+
+    g_return_val_if_fail (GTK_IS_MAIN_WINDOW_FACTORY (factory), NULL);
+
+    klass = GTK_MAIN_WINDOW_FACTORY_GET_CLASS (factory);
+
+    return (* klass->create_menu_widget) (factory);
+}
+
diff --git a/gtk/gtkmainwindowfactory.h b/gtk/gtkmainwindowfactory.h
new file mode 100644
index 0000000..e4c6534
--- /dev/null
+++ b/gtk/gtkmainwindowfactory.h
@@ -0,0 +1,65 @@
+/* gtkmainwindowfactory.h
+ * Copyright (C) 2008 Jan Arne Petersen <jpetersen@jpetersen.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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_MAIN_WINDOW_FACTORY_H__
+#define __GTK_MAIN_WINDOW_FACTORY_H__
+
+#include <glib-object.h>
+
+#include <gtk/gtkmainwindow.h>
+#include <gtk/gtkmenushell.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_MAIN_WINDOW_FACTORY         (gtk_main_window_factory_get_type ())
+#define GTK_MAIN_WINDOW_FACTORY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_MAIN_WINDOW_FACTORY, GtkMainWindowFactory))
+#define GTK_MAIN_WINDOW_FACTORY_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GTK_TYPE_MAIN_WINDOW_FACTORY, GtkMainWindowFactoryClass))
+#define GTK_MAIN_WINDOW_FACTORY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_MAIN_WINDOW_FACTORY, GtkMainWindowFactoryClass))
+#define GTK_IS_MAIN_WINDOW_FACTORY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_MAIN_WINDOW_FACTORY))
+#define GTK_IS_MAIN_WINDOW_FACTORY_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_MAIN_WINDOW_FACTORY))
+
+#define GTK_MAIN_WINDOW_FACTORY_EXTENSION_POINT_NAME "gtk-main-window-factory"
+
+typedef struct _GtkMainWindowFactory      GtkMainWindowFactory;
+typedef struct _GtkMainWindowFactoryClass GtkMainWindowFactoryClass;
+
+struct _GtkMainWindowFactory
+{
+  GObject parent;
+};
+
+struct _GtkMainWindowFactoryClass
+{
+  GObjectClass parent;
+
+  GtkMainWindow * (*create_window)      (GtkMainWindowFactory *factory);
+  GtkMenuShell *  (*create_menu_widget) (GtkMainWindowFactory *factory);
+};
+
+GType                 gtk_main_window_factory_get_type           (void) G_GNUC_CONST;
+
+GtkMainWindowFactory *gtk_main_window_factory_get                (void);
+
+GtkMainWindow *       gtk_main_window_factory_create_window      (GtkMainWindowFactory *factory);
+GtkMenuShell *        gtk_main_window_factory_create_menu_widget (GtkMainWindowFactory *factory);
+
+G_END_DECLS
+
+#endif /* __GTK_MAIN_WINDOW_FACTORY_H__ */
+
