Index: gtk/gtkwidget.c
===================================================================
--- gtk/gtkwidget.c	(revision 17999)
+++ gtk/gtkwidget.c	(working copy)
@@ -187,7 +187,7 @@ static void	gtk_widget_real_size_request
 						  GtkRequisition    *requisition);
 static void	gtk_widget_real_size_allocate	 (GtkWidget	    *widget,
 						  GtkAllocation	    *allocation);
-static void	gtk_widget_style_set		 (GtkWidget	    *widget,
+static void	gtk_widget_real_style_set	 (GtkWidget	    *widget,
 						  GtkStyle          *previous_style);
 static void	gtk_widget_direction_changed	 (GtkWidget	    *widget,
 						  GtkTextDirection   previous_direction);
@@ -384,7 +384,7 @@ gtk_widget_class_init (GtkWidgetClass *k
   klass->state_changed = NULL;
   klass->parent_set = NULL;
   klass->hierarchy_changed = NULL;
-  klass->style_set = gtk_widget_style_set;
+  klass->style_set = gtk_widget_real_style_set;
   klass->direction_changed = gtk_widget_direction_changed;
   klass->grab_notify = NULL;
   klass->child_notify = NULL;
@@ -5411,8 +5411,8 @@ gtk_widget_direction_changed (GtkWidget 
 }
 
 static void
-gtk_widget_style_set (GtkWidget *widget,
-		      GtkStyle  *previous_style)
+gtk_widget_real_style_set (GtkWidget *widget,
+			   GtkStyle  *previous_style)
 {
   if (GTK_WIDGET_REALIZED (widget) &&
       !GTK_WIDGET_NO_WINDOW (widget))
@@ -8020,6 +8020,189 @@ gtk_widget_style_get (GtkWidget   *widge
 }
 
 /**
+ * gtk_widget_style_set_property:
+ * @widget: a #GtkWidget
+ * @property_name: the name of a style property
+ * @value: new property value
+ *
+ * Sets the value of a style property of @widget.
+ */
+void
+gtk_widget_style_set_property (GtkWidget    *widget,
+			       const gchar  *property_name,
+			       const GValue *value)
+{
+  GParamSpec *pspec;
+  GtkRcProperty rc_property;
+  GtkRcStyle *rc_style;
+  GValue set_value = {0};
+
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (property_name != NULL);
+  g_return_if_fail (G_IS_VALUE (value));
+
+  pspec = g_param_spec_pool_lookup (style_property_spec_pool,
+				    property_name,
+				    G_OBJECT_TYPE (widget),
+				    TRUE);
+
+  if (!pspec)
+    {
+      g_warning ("%s: widget class `%s' has no property named `%s'",
+		 G_STRLOC,
+		 G_OBJECT_TYPE_NAME (widget),
+		 property_name);
+      return;
+    }
+
+  g_value_init (&set_value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+
+  if (g_value_type_compatible (G_VALUE_TYPE (value), G_PARAM_SPEC_VALUE_TYPE (pspec)))
+    g_value_copy (value, &set_value);
+  else if (g_value_type_transformable (G_VALUE_TYPE (value), G_PARAM_SPEC_VALUE_TYPE (pspec)))
+    g_value_transform (value, &set_value);
+  else
+    {
+      g_warning ("can't use value of type `%s' as value of style property `%s' of type `%s'",
+		 G_VALUE_TYPE_NAME (value),
+		 pspec->name,
+		 g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)));
+      g_value_unset (&set_value);
+      return;
+    }
+
+  rc_property.type_name = g_type_qname (G_OBJECT_TYPE (widget));
+  rc_property.property_name = g_quark_from_string (property_name);
+  rc_property.origin = NULL;
+  rc_property.value = set_value;
+
+  rc_style = gtk_widget_get_modifier_style (widget);
+  _gtk_rc_style_set_rc_property (rc_style, &rc_property);
+  gtk_widget_modify_style (widget, rc_style);
+
+  g_value_unset (&set_value);
+}
+
+/**
+ * gtk_widget_style_set_valist:
+ * @widget: a #GtkWidget
+ * @first_property_name: the name of the first property to get
+ * @var_args: a <type>va_list</type> of pairs of property names and
+ *     locations of the property values, starting with the location
+ *     for @first_property_name.
+ *
+ * Non-vararg variant of gtk_widget_style_set(). Used primarily by language 
+ * bindings.
+ */
+void
+gtk_widget_style_set_valist (GtkWidget   *widget,
+			     const gchar *first_property_name,
+			     va_list      var_args)
+{
+  const char *name;
+
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  name = first_property_name;
+  while (name)
+    {
+      GParamSpec *pspec;
+      GValue value = {0};
+      char *error = NULL;
+
+      pspec = g_param_spec_pool_lookup (style_property_spec_pool,
+					name,
+					G_OBJECT_TYPE (widget),
+					TRUE);
+
+      if (!pspec)
+	{
+	  g_warning ("%s: widget class `%s' has no property named `%s'",
+		     G_STRLOC,
+		     G_OBJECT_TYPE_NAME (widget),
+		     name);
+	  break;
+	}
+
+      g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+      G_VALUE_COLLECT (&value, var_args, 0, &error);
+
+      if (error)
+	{
+	  g_warning ("%s: %s", G_STRLOC, error);
+	  g_free (error);
+	  break;
+	}
+
+      gtk_widget_style_set_property (widget, name, &value);
+      g_value_unset (&value);
+
+      name = va_arg (var_args, gchar*);
+    }
+}
+
+/**
+ * gtk_widget_style_set:
+ * @widget: a #GtkWidget
+ * @first_property_name: the name of the first property to set
+ * @Varargs: pairs of property names and locations of the property
+ * values, starting with the location for @first_property_name,
+ * terminated by %NULL, similar to g_object_set().
+ *
+ * Sets the values of a multiple style properties of @widget.
+ */
+void
+gtk_widget_style_set (GtkWidget   *widget,
+		      const gchar *first_property_name,
+		      ...)
+{
+  va_list var_args;
+
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  va_start (var_args, first_property_name);
+  gtk_widget_style_set_valist (widget, first_property_name, var_args);
+  va_end (var_args);
+}
+
+/**
+ * gtk_widget_style_unset_property:
+ * @widget: a #GtkWidget
+ * @property_name: the name of a style property
+ *
+ * Unsets the value of a style property of @widget, i.e. it
+ * reverts the effect of gtk_widget_style_set().
+ */
+void
+gtk_widget_style_unset_property (GtkWidget   *widget,
+				 const gchar *property_name)
+{
+  GParamSpec *pspec;
+
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (property_name != NULL);
+
+  pspec = g_param_spec_pool_lookup (style_property_spec_pool,
+				    property_name,
+				    G_OBJECT_TYPE (widget),
+				    TRUE);
+
+  if (!pspec)
+    g_warning ("%s: widget class `%s' has no property named `%s'",
+	       G_STRLOC,
+	       G_OBJECT_TYPE_NAME (widget),
+	       property_name);
+  else
+    {
+      GtkRcStyle *rc_style = gtk_widget_get_modifier_style (widget);
+      _gtk_rc_style_unset_rc_property (rc_style,
+				       g_type_qname (G_OBJECT_TYPE (widget)),
+				       g_quark_from_string (property_name));
+      gtk_widget_modify_style (widget, rc_style);
+    }
+}
+
+/**
  * gtk_widget_path:
  * @widget: a #GtkWidget
  * @path_length: location to store length of the path, or %NULL
Index: gtk/gtkwidget.h
===================================================================
--- gtk/gtkwidget.h	(revision 17999)
+++ gtk/gtkwidget.h	(working copy)
@@ -728,6 +728,17 @@ void gtk_widget_style_get_valist   (GtkW
 void gtk_widget_style_get          (GtkWidget	     *widget,
 				    const gchar    *first_property_name,
 				    ...) G_GNUC_NULL_TERMINATED;
+void gtk_widget_style_set_property (GtkWidget	    *widget,
+				    const gchar     *property_name,
+				    const GValue    *value);
+void gtk_widget_style_set_valist   (GtkWidget	    *widget,
+				    const gchar     *first_property_name,
+				    va_list          var_args);
+void gtk_widget_style_set          (GtkWidget	    *widget,
+				    const gchar     *first_property_name,
+				    ...) G_GNUC_NULL_TERMINATED;
+void gtk_widget_style_unset_property (GtkWidget	    *widget,
+				    const gchar     *property_name);
 
 
 /* Set certain default values to be used at widget creation time.
Index: gtk/gtk.symbols
===================================================================
--- gtk/gtk.symbols	(revision 18000)
+++ gtk/gtk.symbols	(working copy)
@@ -4667,6 +4667,10 @@ gtk_widget_size_request
 gtk_widget_style_get G_GNUC_NULL_TERMINATED
 gtk_widget_style_get_property
 gtk_widget_style_get_valist
+gtk_widget_style_set
+gtk_widget_style_set_valist
+gtk_widget_style_set_property
+gtk_widget_style_unset_property
 gtk_widget_thaw_child_notify
 gtk_widget_translate_coordinates
 gtk_widget_trigger_tooltip_query
Index: gtk/gtksettings.c
===================================================================
--- gtk/gtksettings.c	(revision 17999)
+++ gtk/gtksettings.c	(working copy)
@@ -1016,7 +1016,12 @@ _gtk_settings_parse_convert (GtkRcProper
 
   g_return_val_if_fail (G_VALUE_HOLDS (dest_value, G_PARAM_SPEC_VALUE_TYPE (pspec)), FALSE);
 
-  if (parser)
+  if (g_value_type_compatible (G_VALUE_TYPE (src_value), G_VALUE_TYPE (dest_value)))
+    {
+      g_value_copy (src_value, dest_value);
+      success = TRUE;
+    }
+  else if (parser)
     {
       GString *gstring;
       gboolean free_gstring = TRUE;
Index: gtk/Makefile.am
===================================================================
--- gtk/Makefile.am	(revision 17999)
+++ gtk/Makefile.am	(working copy)
@@ -84,9 +84,11 @@ gtk.def: gtk.symbols
 	(echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gtk.symbols | sed -e '/^$$/d' -e 's/^/	/' -e 's/G_GNUC_[^ ]*//g') > gtk.def
 
 gtkalias.h: gtk.symbols
-	  $(PERL) $(srcdir)/makegtkalias.pl < $(srcdir)/gtk.symbols > gtkalias.h
+	  $(PERL) $(srcdir)/makegtkalias.pl < $(srcdir)/gtk.symbols > gtkalias.h.tmp && \
+	  mv gtkalias.h.tmp gtkalias.h
 gtkaliasdef.c: gtk.symbols
-	  $(PERL) $(srcdir)/makegtkalias.pl -def < $(srcdir)/gtk.symbols > gtkaliasdef.c
+	  $(PERL) $(srcdir)/makegtkalias.pl -def < $(srcdir)/gtk.symbols > gtkaliasdef.c.tmp && \
+	  mv gtkaliasdef.c.tmp gtkaliasdef.c
 
 check-aliases:
 	@$(TESTS_ENVIRONMENT) $(srcdir)/aliasfilescheck.sh
Index: gtk/gtkrc.c
===================================================================
--- gtk/gtkrc.c	(revision 17999)
+++ gtk/gtkrc.c	(working copy)
@@ -240,6 +240,10 @@ static gint	   gtk_rc_properties_cmp	   
 						      gconstpointer    bsearch_node2);
 static void        gtk_rc_set_free                   (GtkRcSet        *rc_set);
 
+static void	   insert_rc_property		     (GtkRcStyle      *style,
+						      GtkRcProperty   *property,
+						      gboolean         replace);
+
 
 static const GScannerConfig gtk_rc_scanner_config =
 {
@@ -1265,6 +1269,36 @@ gtk_rc_style_copy (GtkRcStyle *orig)
   return style;
 }
 
+void
+_gtk_rc_style_set_rc_property (GtkRcStyle *rc_style,
+			       GtkRcProperty *property)
+{
+  g_return_if_fail (GTK_IS_RC_STYLE (rc_style));
+  g_return_if_fail (property != NULL);
+
+  insert_rc_property (rc_style, property, TRUE);
+}
+
+void
+_gtk_rc_style_unset_rc_property (GtkRcStyle *rc_style,
+				 GQuark      type_name,
+				 GQuark      property_name)
+{
+  GtkRcProperty *node;
+
+  g_return_if_fail (GTK_IS_RC_STYLE (rc_style));
+
+  node = _gtk_rc_style_lookup_rc_property (rc_style, type_name, property_name);
+
+  if (node != NULL)
+    {
+      guint index = node - (GtkRcProperty *) rc_style->rc_properties->data;
+      g_value_unset (&node->value);
+      g_free (node->origin);
+      g_array_remove_index (rc_style->rc_properties, index);
+    }
+}
+
 void      
 gtk_rc_style_ref (GtkRcStyle *rc_style)
 {
Index: gtk/gtkrc.h
===================================================================
--- gtk/gtkrc.h	(revision 17999)
+++ gtk/gtkrc.h	(working copy)
@@ -248,6 +248,11 @@ struct _GtkRcProperty
 const GtkRcProperty* _gtk_rc_style_lookup_rc_property (GtkRcStyle *rc_style,
 						       GQuark      type_name,
 						       GQuark      property_name);
+void	      _gtk_rc_style_set_rc_property	      (GtkRcStyle *rc_style,
+						       GtkRcProperty *property);
+void	      _gtk_rc_style_unset_rc_property	      (GtkRcStyle *rc_style,
+						       GQuark      type_name,
+						       GQuark      property_name);
 
 GSList     * _gtk_rc_style_get_color_hashes        (GtkRcStyle *rc_style);
 
Index: tests/testgtk.c
===================================================================
--- tests/testgtk.c	(revision 17999)
+++ tests/testgtk.c	(working copy)
@@ -13226,6 +13226,16 @@ create_styles (GtkWidget *widget)
       gtk_widget_modify_base (entry, GTK_STATE_NORMAL, &yellow);
       gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
 
+      label = gtk_label_new ("Cursor:");
+      gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+      gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+      entry = gtk_entry_new ();
+      gtk_entry_set_text (GTK_ENTRY (entry), "Some Text");
+      gtk_widget_style_set (entry, "cursor-color", &red,
+			    "secondary-cursor-color", &red, NULL);
+      gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
+
       label = gtk_label_new ("Multiple:");
       gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
       gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
Index: tests/testtext.c
===================================================================
--- tests/testtext.c	(revision 17999)
+++ tests/testtext.c	(working copy)
@@ -984,13 +984,43 @@ do_editable_changed (gpointer callback_d
 }
 
 static void
+change_cursor_color (GtkWidget *widget,
+		     gboolean   set)
+{
+  if (set)
+    {
+      GdkColor red = {0, 65535, 0, 0};
+      gtk_widget_style_set (widget, "cursor-color", &red,
+			    "secondary-cursor-color", &red, NULL);
+    }
+  else
+    {
+      gtk_widget_style_unset_property (widget, "cursor-color");
+      gtk_widget_style_unset_property (widget, "secondary-cursor-color");
+    }
+}
+
+static void
 do_cursor_visible_changed (gpointer callback_data,
                            guint callback_action,
                            GtkWidget *widget)
 {
   View *view = view_from_widget (widget);
 
-  gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view->text_view), callback_action);
+  switch (callback_action)
+    {
+    case 0:
+      gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view->text_view), FALSE);
+      break;
+    case 1:
+      gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view->text_view), TRUE);
+      change_cursor_color (view->text_view, FALSE);
+      break;
+    case 2:
+      gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view->text_view), TRUE);
+      change_cursor_color (view->text_view, TRUE);
+      break;
+    }
 }
 
 static void
@@ -1946,8 +1976,9 @@ static GtkItemFactoryEntry menu_items[] 
   { "/Settings/Not editable",    NULL,      do_editable_changed,  FALSE, "/Settings/Editable" },
   { "/Settings/sep1",        NULL,      NULL,             0, "<Separator>" },
 
-  { "/Settings/Cursor visible",    NULL,      do_cursor_visible_changed,  TRUE, "<RadioItem>" },
-  { "/Settings/Cursor not visible", NULL,      do_cursor_visible_changed,  FALSE, "/Settings/Cursor visible" },
+  { "/Settings/Cursor normal",    NULL,      do_cursor_visible_changed,  1, "<RadioItem>" },
+  { "/Settings/Cursor not visible", NULL,      do_cursor_visible_changed,  0, "/Settings/Cursor normal" },
+  { "/Settings/Cursor colored", NULL,      do_cursor_visible_changed,  2, "/Settings/Cursor normal" },
   { "/Settings/sep1",        NULL,      NULL,          0, "<Separator>" },
   
   { "/Settings/Left-to-Right", NULL,    do_direction_changed,  GTK_TEXT_DIR_LTR, "<RadioItem>" },
