Index: gtk/gtktypeutils.c
===================================================================
--- gtk/gtktypeutils.c	(revision 18074)
+++ gtk/gtktypeutils.c	(working copy)
@@ -28,10 +28,12 @@
 
 #include <config.h>
 #include <string.h> /* strcmp */
+#include <ctype.h> /* toupper */
 
 #include "gtktypeutils.h"
 #include "gtkobject.h"
 #include "gtkintl.h"
+#include "gtkuimanager.h"
 #include "gtkalias.h"
 
 
@@ -199,6 +201,71 @@ gtk_type_flags_find_value (GtkType      
   return value;
 }
 
+/*
+ * Try to map a type name to a _get_type function
+ * and call it, eg:
+ *
+ * GtkWindow -> gtk_window_get_type
+ * GtkHBox -> gtk_hbox_get_type
+ * GtkUIManager -> gtk_ui_manager_get_type
+ *
+ */
+static GType
+_gtk_resolve_type_lazily (const gchar *name)
+{
+  static GModule *module = NULL;
+  GTypeGetFunc func;
+  GString *symbol_name = g_string_new ("");
+  char c, *symbol;
+  int i;
+  GType gtype = G_TYPE_INVALID;
+
+  if (!module)
+    module = g_module_open (NULL, 0);
+  
+  for (i = 0; name[i] != '\0'; i++) {
+    c = name[i];
+    /* skip if uppercase, first or previous is uppercase */
+    if ((c == toupper (c) &&
+	 i > 0 && name[i-1] != toupper (name[i-1])) ||
+	(i > 2 && name[i]   == toupper (name[i]) &&
+	          name[i-1] == toupper (name[i-1]) &&
+	          name[i-2] == toupper (name[i-2]))) {
+      g_string_append_c (symbol_name, '_');
+    } 
+    g_string_append_c (symbol_name, tolower (c));
+  }
+  g_string_append (symbol_name, "_get_type");
+  
+  symbol = g_string_free (symbol_name, FALSE);
+
+  if (g_module_symbol (module, symbol, (gpointer)&func))
+    gtype = func ();
+  
+  g_free (symbol);
+
+  return gtype;
+}
+
+/**
+ * gtk_registered_type_from_name
+ * @name: a type name
+ *
+ * FIXME
+ *
+ * Since: 2.12
+ */
+GType
+gtk_registered_type_from_name (const gchar *name)
+{
+  GType gtype;
+  
+  gtype = g_type_from_name (name);
+  if (gtype != G_TYPE_INVALID)
+    return gtype;
+
+  return _gtk_resolve_type_lazily (name);
+}
 
 #define __GTK_TYPE_UTILS_C__
 #include "gtkaliasdef.c"
Index: gtk/gtktypeutils.h
===================================================================
--- gtk/gtktypeutils.h	(revision 18074)
+++ gtk/gtktypeutils.h	(working copy)
@@ -229,7 +229,10 @@
 
 #endif /* GTK_DISABLE_DEPRECATED */
 
+typedef GType (*GTypeGetFunc) (void);
+
 gpointer	gtk_type_class	(GtkType	 type);
+GType           gtk_registered_type_from_name (const gchar *name);
 
 #ifndef GTK_DISABLE_DEPRECATED
 
