Index: gtk+/gtk/gtkmain.c
===================================================================
--- gtk+.orig/gtk/gtkmain.c	2006-10-25 13:02:17.000000000 -0300
+++ gtk+/gtk/gtkmain.c	2006-10-25 13:13:46.000000000 -0300
@@ -651,6 +651,7 @@
   }
 
   gtk_type_init (0);
+  _gtk_type_table_init ();
   _gtk_accel_map_init ();  
   _gtk_rc_init ();
 
Index: gtk+/gtk/gtktypeutils.c
===================================================================
--- gtk+.orig/gtk/gtktypeutils.c	2006-10-25 13:02:17.000000000 -0300
+++ gtk+/gtk/gtktypeutils.c	2006-10-25 13:13:46.000000000 -0300
@@ -28,12 +28,15 @@
 
 #include <config.h>
 #include <string.h> /* strcmp */
-
+#include <stdlib.h> /* strtol, strtoul */
+#include <gdk/gdkcolor.h>
 #include "gtktypeutils.h"
+#include "gtkadjustment.h"
+#include "gtkwidget.h"
 #include "gtkobject.h"
 #include "gtkintl.h"
 #include "gtkalias.h"
-
+#include "gtk.h"
 
 /* --- functions --- */
 GtkType
@@ -199,6 +202,239 @@
   return value;
 }
 
+gint
+_gtk_enum_from_string (GType type, const char *string)
+{
+  GEnumClass *eclass;
+  GEnumValue *ev;
+  gchar *endptr;
+  gint ret = 0;
+
+  ret = strtoul (string, &endptr, 0);
+  if (endptr != string) /* parsed a number */
+    return ret;
+
+  eclass = g_type_class_ref (type);
+  ev = g_enum_get_value_by_name (eclass, string);
+  if (!ev)
+    ev = g_enum_get_value_by_nick (eclass, string);
+
+  if (ev)
+    ret = ev->value;
+
+  g_type_class_unref (eclass);
+
+  return ret;
+}
+
+guint
+_gtk_flags_from_string (GType type, const char *string)
+{
+  GFlagsClass *fclass;
+  gchar *endptr, *prevptr;
+  guint i, j, ret;
+  char *flagstr;
+  GFlagsValue *fv;
+  const char  *flag;
+  gunichar ch;
+  gboolean eos;
+
+  ret = strtoul (string, &endptr, 0);
+  if (endptr != string) /* parsed a number */
+    return ret;
+
+  fclass = g_type_class_ref (type);
+
+  flagstr = g_strdup (string);
+  for (ret = i = j = 0; ; i++)
+    {
+
+      eos = flagstr[i] == '\0';
+
+      if (!eos && flagstr[i] != '|')
+        continue;
+
+      flag = &flagstr[j];
+      endptr = &flagstr[i];
+
+      if (!eos)
+        {
+          flagstr[i++] = '\0';
+          j = i;
+        }
+
+      /* trim spaces */
+      for (;;)
+        {
+          ch = g_utf8_get_char (flag);
+          if (!g_unichar_isspace (ch))
+            break;
+          flag = g_utf8_next_char (flag);
+        }
+
+      while (endptr > flag)
+        {
+          prevptr = g_utf8_prev_char (endptr);
+          ch = g_utf8_get_char (prevptr);
+          if (!g_unichar_isspace (ch))
+            break;
+          endptr = prevptr;
+        }
+
+      if (endptr > flag)
+        {
+          *endptr = '\0';
+          fv = g_flags_get_value_by_name (fclass, flag);
+
+          if (!fv)
+            fv = g_flags_get_value_by_nick (fclass, flag);
+
+          if (fv)
+            ret |= fv->value;
+          else
+            g_warning ("Unknown flag: '%s'", flag);
+        }
+
+      if (eos)
+        break;
+    }
+
+  g_free (flagstr);
+
+  g_type_class_unref (fclass);
+
+  return ret;
+}
+
+static GHashTable* type_table;
+
+/**
+ * gtk_registered_type_from_name
+ * @name: a type name
+ *
+ * Like g_type_from_name, but takes into account the types registered
+ * using the gtk_type_register function.
+ *
+ * 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)
+    {
+      GTypeGetFunc func = g_hash_table_lookup (type_table, name);
+      if (func)
+        gtype = func ();
+    }
+
+  return gtype;
+}
+
+void
+gtk_type_register (const gchar *name, GTypeGetFunc func)
+{
+  g_return_if_fail (g_hash_table_lookup (type_table, name) == NULL);
+
+  g_hash_table_insert (type_table, g_strdup (name), func);
+}
+
+void
+_gtk_type_table_init (void)
+{
+  type_table = g_hash_table_new (g_str_hash, g_str_equal);
+
+  g_hash_table_insert (type_table, "GdkPixbuf", gdk_pixbuf_get_type);
+  g_hash_table_insert (type_table, "GtkAboutDialog", gtk_about_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkAccelLabel", gtk_accel_label_get_type);
+  g_hash_table_insert (type_table, "GtkAction", gtk_action_get_type);
+  g_hash_table_insert (type_table, "GtkActionGroup", gtk_action_group_get_type);
+  g_hash_table_insert (type_table, "GtkAdjustment", gtk_adjustment_get_type);
+  g_hash_table_insert (type_table, "GtkAlignment", gtk_alignment_get_type);
+  g_hash_table_insert (type_table, "GtkArrow", gtk_arrow_get_type);
+  g_hash_table_insert (type_table, "GtkAspectFrame", gtk_aspect_frame_get_type);
+  g_hash_table_insert (type_table, "GtkAssistant", gtk_assistant_get_type);
+  g_hash_table_insert (type_table, "GtkButton", gtk_button_get_type);
+  g_hash_table_insert (type_table, "GtkCalendar", gtk_calendar_get_type);
+  g_hash_table_insert (type_table, "GtkCheckButton", gtk_check_button_get_type);
+  g_hash_table_insert (type_table, "GtkCellRenderer", gtk_cell_renderer_get_type);
+  g_hash_table_insert (type_table, "GtkCellRendererText", gtk_cell_renderer_text_get_type);
+  g_hash_table_insert (type_table, "GtkCellView", gtk_cell_view_get_type);
+  g_hash_table_insert (type_table, "GtkColorButton", gtk_color_button_get_type);
+  g_hash_table_insert (type_table, "GtkColorSelection", gtk_color_selection_get_type);
+  g_hash_table_insert (type_table, "GtkColorSelectionDialog", gtk_color_selection_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkComboBox", gtk_combo_box_get_type);
+  g_hash_table_insert (type_table, "GtkComboBoxEntry", gtk_combo_box_entry_get_type);
+  g_hash_table_insert (type_table, "GtkCurve", gtk_curve_get_type);
+  g_hash_table_insert (type_table, "GtkDialog", gtk_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkDrawingArea", gtk_drawing_area_get_type);
+  g_hash_table_insert (type_table, "GtkEventBox", gtk_event_box_get_type);
+  g_hash_table_insert (type_table, "GtkEntry", gtk_entry_get_type);
+  g_hash_table_insert (type_table, "GtkEntryCompletion", gtk_entry_completion_get_type);
+  g_hash_table_insert (type_table, "GtkFileChooser", gtk_file_chooser_get_type);
+  g_hash_table_insert (type_table, "GtkFileChooserDialog", gtk_file_chooser_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkFileChooserButton", gtk_file_chooser_button_get_type);
+  g_hash_table_insert (type_table, "GtkFileSelection", gtk_file_selection_get_type);
+  g_hash_table_insert (type_table, "GtkFixed", gtk_fixed_get_type);
+  g_hash_table_insert (type_table, "GtkFontSelection", gtk_font_selection_get_type);
+  g_hash_table_insert (type_table, "GtkFontSelectionDialog", gtk_font_selection_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkFrame", gtk_frame_get_type);
+  g_hash_table_insert (type_table, "GtkExpander", gtk_expander_get_type);
+  g_hash_table_insert (type_table, "GtkFontButton", gtk_font_button_get_type);
+  g_hash_table_insert (type_table, "GtkGammaCurve", gtk_gamma_curve_get_type);
+  g_hash_table_insert (type_table, "GtkHandleBox", gtk_handle_box_get_type);
+  g_hash_table_insert (type_table, "GtkHButtonBox", gtk_hbutton_box_get_type);
+  g_hash_table_insert (type_table, "GtkHBox", gtk_hbox_get_type);
+  g_hash_table_insert (type_table, "GtkHPaned", gtk_hpaned_get_type);
+  g_hash_table_insert (type_table, "GtkHRuler", gtk_hruler_get_type);
+  g_hash_table_insert (type_table, "GtkHScale", gtk_hscale_get_type);
+  g_hash_table_insert (type_table, "GtkHScrollbar", gtk_hscrollbar_get_type);
+  g_hash_table_insert (type_table, "GtkHSeparator", gtk_hseparator_get_type);
+  g_hash_table_insert (type_table, "GtkIconView", gtk_icon_view_get_type);
+  g_hash_table_insert (type_table, "GtkImage", gtk_image_get_type);
+  g_hash_table_insert (type_table, "GtkInputDialog ", gtk_input_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkLabel", gtk_label_get_type);
+  g_hash_table_insert (type_table, "GtkLayout", gtk_layout_get_type);
+  g_hash_table_insert (type_table, "GtkLinkButton", gtk_link_button_get_type);
+  g_hash_table_insert (type_table, "GtkListStore", gtk_list_store_get_type);
+  g_hash_table_insert (type_table, "GtkMenu", gtk_menu_get_type);
+  g_hash_table_insert (type_table, "GtkMenuBar", gtk_menu_bar_get_type);
+  g_hash_table_insert (type_table, "GtkMessageDialog", gtk_message_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkNotebook", gtk_notebook_get_type);
+  g_hash_table_insert (type_table, "GtkProgressBar", gtk_progress_bar_get_type);
+  g_hash_table_insert (type_table, "GtkRadioAction", gtk_radio_action_get_type);
+  g_hash_table_insert (type_table, "GtkRadioButton", gtk_radio_button_get_type);
+  g_hash_table_insert (type_table, "GtkRecentChooserDialog", gtk_recent_chooser_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkSizeGroup", gtk_size_group_get_type);
+  g_hash_table_insert (type_table, "GtkScrolledWindow", gtk_scrolled_window_get_type);
+  g_hash_table_insert (type_table, "GtkSpinButton", gtk_spin_button_get_type);
+  g_hash_table_insert (type_table, "GtkStatusbar", gtk_statusbar_get_type);
+  g_hash_table_insert (type_table, "GtkTextBuffer", gtk_text_buffer_get_type);
+  g_hash_table_insert (type_table, "GtkTextView", gtk_text_view_get_type);
+  g_hash_table_insert (type_table, "GtkToggleAction", gtk_toggle_action_get_type);
+  g_hash_table_insert (type_table, "GtkToggleButton", gtk_toggle_button_get_type);
+  g_hash_table_insert (type_table, "GtkToolbar", gtk_toolbar_get_type);
+  g_hash_table_insert (type_table, "GtkTooltips", gtk_tooltips_get_type);
+  g_hash_table_insert (type_table, "GtkTreeModelFilter", gtk_tree_model_filter_get_type);
+  g_hash_table_insert (type_table, "GtkTreeModelSort", gtk_tree_model_sort_get_type);
+  g_hash_table_insert (type_table, "GtkTreeStore", gtk_tree_store_get_type);
+  g_hash_table_insert (type_table, "GtkTreeView", gtk_tree_view_get_type);
+  g_hash_table_insert (type_table, "GtkTreeViewColumn", gtk_tree_view_column_get_type);
+  g_hash_table_insert (type_table, "GtkTable", gtk_table_get_type);
+  g_hash_table_insert (type_table, "GtkVBox", gtk_vbox_get_type);
+  g_hash_table_insert (type_table, "GtkVButtonBox", gtk_vbutton_box_get_type);
+  g_hash_table_insert (type_table, "GtkVScrollbar", gtk_vscrollbar_get_type);
+  g_hash_table_insert (type_table, "GtkVSeparator", gtk_vseparator_get_type);
+  g_hash_table_insert (type_table, "GtkViewport", gtk_viewport_get_type);
+  g_hash_table_insert (type_table, "GtkVRuler", gtk_vruler_get_type);
+  g_hash_table_insert (type_table, "GtkVPaned", gtk_vpaned_get_type);
+  g_hash_table_insert (type_table, "GtkVScale", gtk_vscale_get_type);
+  g_hash_table_insert (type_table, "GtkWindow", gtk_window_get_type);
+  g_hash_table_insert (type_table, "GtkUIManager", gtk_ui_manager_get_type);
+}
 
 #define __GTK_TYPE_UTILS_C__
 #include "gtkaliasdef.c"
Index: gtk+/gtk/gtktypeutils.h
===================================================================
--- gtk+.orig/gtk/gtktypeutils.h	2006-10-25 13:02:17.000000000 -0300
+++ gtk+/gtk/gtktypeutils.h	2006-10-25 13:13:46.000000000 -0300
@@ -229,8 +229,19 @@
 
 #endif /* GTK_DISABLE_DEPRECATED */
 
+typedef GType (*GTypeGetFunc) (void);
+
 gpointer	gtk_type_class	(GtkType	 type);
 
+void            _gtk_type_table_init     (void);
+guint           _gtk_flags_from_string   (GType         type,
+					  const char   *string);
+gint            _gtk_enum_from_string    (GType         type,
+					  const char   *string);
+void            gtk_type_register        (const gchar  *name,
+                                          GTypeGetFunc  func);
+GType           gtk_registered_type_from_name (const gchar  *name);
+
 #ifndef GTK_DISABLE_DEPRECATED
 
 GtkType		gtk_type_unique	(GtkType	   parent_type,
Index: gtk+/gtk/gtk.symbols
===================================================================
--- gtk+.orig/gtk/gtk.symbols	2006-10-25 13:11:59.000000000 -0300
+++ gtk+/gtk/gtk.symbols	2006-10-25 13:13:46.000000000 -0300
@@ -4333,6 +4333,8 @@
 #if IN_HEADER(__GTK_TYPE_UTILS_H__)
 #if IN_FILE(__GTK_TYPE_UTILS_C__)
 gtk_type_class
+gtk_type_register
+gtk_registered_type_from_name
 gtk_identifier_get_type G_GNUC_CONST
 #ifndef GTK_DISABLE_DEPRECATED
 gtk_type_enum_find_value
