? gtk/.gtkfilechooserbutton.c.swp
Index: gtk/gtkdnd.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkdnd.c,v
retrieving revision 1.124
diff -u -r1.124 gtkdnd.c
--- gtk/gtkdnd.c	11 May 2005 19:16:18 -0000	1.124
+++ gtk/gtkdnd.c	17 May 2005 21:17:37 -0000
@@ -30,6 +30,8 @@
 #include "gdk/gdkkeysyms.h"
 
 #include "gtkdnd.h"
+#include "gtkiconfactory.h"
+#include "gtkicontheme.h"
 #include "gtkimage.h"
 #include "gtkinvisible.h"
 #include "gtkmain.h"
@@ -68,6 +70,7 @@
     GtkImagePixmapData pixmap;
     GtkImagePixbufData pixbuf;
     GtkImageStockData stock;
+    GtkImageIconNameData name;
   } icon_data;
   GdkBitmap *icon_mask;
 
@@ -2046,6 +2049,11 @@
 				     site->icon_data.stock.stock_id,
 				     -2, -2);
 	    break;
+	  case GTK_IMAGE_ICON_NAME:
+	    gtk_drag_set_icon_name (context,
+			    	    site->icon_data.name.icon_name,
+				    -2, -2);
+	    break;
 	  case GTK_IMAGE_EMPTY:
 	  default:
 	    g_assert_not_reached();
@@ -2355,6 +2363,9 @@
     case GTK_IMAGE_STOCK:
       g_free (site->icon_data.stock.stock_id);
       break;
+    case GTK_IMAGE_ICON_NAME:
+      g_free (site->icon_data.name.icon_name);
+      break;
     default:
       g_assert_not_reached();
       break;
@@ -2462,6 +2473,34 @@
   site->icon_data.stock.stock_id = g_strdup (stock_id);
 }
 
+/**
+ * gtk_drag_source_set_icon_name:
+ * @widget: a #GtkWidget
+ * @icon_name: name of icon to use
+ * 
+ * Sets the icon that will be used for drags from a particular source
+ * to a themed icon. See the docs for #GtkIconTheme for more details.
+ *
+ * Since: 2.8
+ **/
+void 
+gtk_drag_source_set_icon_name (GtkWidget   *widget,
+			       const gchar *icon_name)
+{
+  GtkDragSourceSite *site;
+
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (icon_name != NULL);
+
+  site = g_object_get_data (G_OBJECT (widget), "gtk-site-data");
+  g_return_if_fail (site != NULL);
+
+  gtk_drag_source_unset_icon (site);
+
+  site->icon_type = GTK_IMAGE_ICON_NAME;
+  site->icon_data.name.icon_name = g_strdup (icon_name);
+}
+
 static void
 gtk_drag_get_icon (GtkDragSourceInfo *info,
 		   GtkWidget        **icon_window,
@@ -2780,6 +2819,53 @@
     gtk_widget_shape_combine_mask (window, mask, 0, 0);
 
   gtk_drag_set_icon_window (context, window, hot_x, hot_y, TRUE);
+}
+
+/**
+ * gtk_drag_set_icon_name:
+ * @context: the context for a drag. (This must be called 
+ *            with a context for the source side of a drag)
+ * @icon_name: name of icon to use
+ * 
+ * Sets the icon for the window from a named themed icon. See
+ * the docs for #GtkIconTheme for more details.
+ *
+ * Since: 2.8
+ **/
+void 
+gtk_drag_set_icon_name (GdkDragContext *context,
+			const gchar    *icon_name,
+			gint            hot_x,
+			gint            hot_y)
+{
+  GdkScreen *screen;
+  GtkSettings *settings;
+  GtkIconTheme *icon_theme;
+  GdkPixbuf *pixbuf;
+  gint width, height;
+
+  g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
+  g_return_if_fail (context->is_source);
+  g_return_if_fail (icon_name != NULL);
+
+  screen = gdk_drawable_get_screen (context->source_window);
+  g_return_if_fail (screen != NULL);
+
+  settings = gtk_settings_get_for_screen (screen);
+  if (!gtk_icon_size_lookup_for_settings (settings,
+			  		  GTK_ICON_SIZE_DND,
+					  &width, &height))
+  {
+    g_warning ("Cannot lookup icon size for GTK_ICON_SIZE_DND");
+    return;
+  }
+
+  icon_theme = gtk_icon_theme_get_for_screen (screen);
+  g_return_if_fail (icon_theme != NULL);
+
+  pixbuf = gtk_icon_theme_load_icon (icon_theme, icon_name,
+		  		     MIN (width, height), 0, NULL);
+  set_icon_stock_pixbuf (context, NULL, pixbuf, hot_x, hot_y);
 }
 
 /**
Index: gtk/gtkdnd.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkdnd.h,v
retrieving revision 1.17
diff -u -r1.17 gtkdnd.h
--- gtk/gtkdnd.h	20 Mar 2005 07:01:21 -0000	1.17
+++ gtk/gtkdnd.h	17 May 2005 21:17:37 -0000
@@ -112,6 +112,8 @@
 				      GdkPixbuf   *pixbuf);
 void gtk_drag_source_set_icon_stock  (GtkWidget   *widget,
 				      const gchar *stock_id);
+void gtk_drag_source_set_icon_name   (GtkWidget   *widget,
+				      const gchar *icon_name);
 
 /* There probably should be functions for setting the targets
  * as a GtkTargetList
@@ -141,6 +143,10 @@
 			       gint            hot_y);
 void gtk_drag_set_icon_stock  (GdkDragContext *context,
 			       const gchar    *stock_id,
+			       gint            hot_x,
+			       gint            hot_y);
+void gtk_drag_set_icon_name   (GdkDragContext *context,
+			       const gchar    *icon_name,
 			       gint            hot_x,
 			       gint            hot_y);
 
