? libnautilus-private/.nautilus-icon-factory.h.swp
? libnautilus-private/gmon.out
Index: libnautilus-private/nautilus-bookmark.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-bookmark.c,v
retrieving revision 1.63
diff -u -p -r1.63 nautilus-bookmark.c
--- libnautilus-private/nautilus-bookmark.c	16 May 2005 15:11:31 -0000	1.63
+++ libnautilus-private/nautilus-bookmark.c	22 May 2005 20:33:41 -0000
@@ -205,8 +205,7 @@ nautilus_bookmark_get_name (NautilusBook
 
 GdkPixbuf *	    
 nautilus_bookmark_get_pixbuf (NautilusBookmark *bookmark,
-			      guint icon_size,
-			      gboolean optimize_for_anti_aliasing)
+			      GtkIconSize icon_size)
 {
 	GdkPixbuf *result;
 	char *icon;
@@ -218,7 +217,7 @@ nautilus_bookmark_get_pixbuf (NautilusBo
 		return NULL;
 	}
 
-	result = nautilus_icon_factory_get_pixbuf_for_icon_force_size
+	result = nautilus_icon_factory_get_pixbuf_for_icon_with_stock_size
 		(icon, NULL,
 		 icon_size, NULL, NULL,
 		 TRUE, NULL);
@@ -483,7 +482,7 @@ create_image_widget_for_bookmark (Nautil
 	GdkPixbuf *pixbuf;
 	GtkWidget *widget;
 
-	pixbuf = nautilus_bookmark_get_pixbuf (bookmark, NAUTILUS_ICON_SIZE_FOR_MENUS, FALSE);
+	pixbuf = nautilus_bookmark_get_pixbuf (bookmark, GTK_ICON_SIZE_MENU);
 	if (pixbuf == NULL) {
 		return NULL;
 	}
Index: libnautilus-private/nautilus-bookmark.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-bookmark.h,v
retrieving revision 1.21
diff -u -p -r1.21 nautilus-bookmark.h
--- libnautilus-private/nautilus-bookmark.h	10 Mar 2003 16:45:39 -0000	1.21
+++ libnautilus-private/nautilus-bookmark.h	22 May 2005 20:33:41 -0000
@@ -25,6 +25,7 @@
 #ifndef NAUTILUS_BOOKMARK_H
 #define NAUTILUS_BOOKMARK_H
 
+#include <gtk/gtkenums.h>
 #include <gtk/gtkwidget.h>
 #include <libnautilus-private/nautilus-icon-factory.h>
 
@@ -91,8 +92,7 @@ char *                nautilus_bookmark_
 
 /* Helper functions for displaying bookmarks */
 GdkPixbuf *           nautilus_bookmark_get_pixbuf             (NautilusBookmark      *bookmark,
-								guint                  icon_size,
-								gboolean               optimize_for_anti_aliasing);
+								GtkIconSize            icon_size);
 GtkWidget *           nautilus_bookmark_menu_item_new          (NautilusBookmark      *bookmark);
 
 #endif /* NAUTILUS_BOOKMARK_H */
Index: libnautilus-private/nautilus-icon-container.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.385
diff -u -p -r1.385 nautilus-icon-container.c
--- libnautilus-private/nautilus-icon-container.c	2 May 2005 20:50:06 -0000	1.385
+++ libnautilus-private/nautilus-icon-container.c	22 May 2005 20:33:44 -0000
@@ -5016,7 +5016,7 @@ nautilus_icon_container_update_icon (Nau
 		 icon_size,
 		 &attach_points,
 		 &embedded_text_rect,
-		 TRUE, NULL);
+		 FALSE, TRUE, NULL);
 	
 	g_free (icon_name);
 
@@ -5038,7 +5038,7 @@ nautilus_icon_container_update_icon (Nau
 			 MIN (icon_size, MAXIMUM_EMBLEM_SIZE),
 			 NULL,
 			 NULL,
-			 FALSE, NULL);
+			 FALSE, FALSE, NULL);
 		if (emblem_pixbuf != NULL) {
 			emblem_pixbufs = g_list_prepend
 				(emblem_pixbufs, emblem_pixbuf);
Index: libnautilus-private/nautilus-icon-factory.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-factory.c,v
retrieving revision 1.314
diff -u -p -r1.314 nautilus-icon-factory.c
--- libnautilus-private/nautilus-icon-factory.c	21 May 2005 16:13:58 -0000	1.314
+++ libnautilus-private/nautilus-icon-factory.c	22 May 2005 20:33:45 -0000
@@ -48,6 +48,7 @@
 #include <eel/eel-vfs-extensions.h>
 #include <gtk/gtksettings.h>
 #include <gtk/gtksignal.h>
+#include <gtk/gtkiconfactory.h>
 #include <gtk/gtkicontheme.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnome/gnome-util.h>
@@ -800,6 +801,16 @@ should_show_thumbnail (NautilusFile *fil
 	return FALSE;
 }
 
+static gint
+gtk_icon_size_to_nominal_size (GtkIconSize icon_size)
+{
+	gint ret;
+
+	g_assert (gtk_icon_size_lookup (icon_size, &ret, NULL));
+
+	return ret;
+}
+
 /* key routine to get the icon for a file */
 char *
 nautilus_icon_factory_get_icon_for_file (NautilusFile *file, gboolean embedd_text)
@@ -982,9 +993,6 @@ nautilus_icon_factory_get_larger_icon_si
 	if (size < NAUTILUS_ICON_SIZE_SMALLEST) {
 		return NAUTILUS_ICON_SIZE_SMALLEST;
 	}
-	if (size < NAUTILUS_ICON_SIZE_FOR_MENUS) {
-		return NAUTILUS_ICON_SIZE_FOR_MENUS;
-	}
 	if (size < NAUTILUS_ICON_SIZE_SMALLER) {
 		return NAUTILUS_ICON_SIZE_SMALLER;
 	}
@@ -1024,9 +1032,6 @@ nautilus_icon_factory_get_smaller_icon_s
 	if (size > NAUTILUS_ICON_SIZE_SMALLER) {
 		return NAUTILUS_ICON_SIZE_SMALLER;
 	}
-	if (size > NAUTILUS_ICON_SIZE_FOR_MENUS) {
-		return NAUTILUS_ICON_SIZE_FOR_MENUS;
-	}
 	return NAUTILUS_ICON_SIZE_SMALLEST;
 }
 
@@ -1365,15 +1370,15 @@ get_icon_from_cache (const char *icon,
         return cached_icon;
 }
 
-static GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_icon_internal (const char                  *icon,
-						    const char                  *modifier,
-						    guint                        nominal_size,
-						    gboolean                     force_size,
-						    NautilusEmblemAttachPoints  *attach_points,
-						    GdkRectangle                *embedded_text_rect,
-						    gboolean                     wants_default,
-						    char                       **display_name)
+GdkPixbuf *
+nautilus_icon_factory_get_pixbuf_for_icon (const char                  *icon,
+					   const char                  *modifier,
+					   guint                        nominal_size,
+					   NautilusEmblemAttachPoints  *attach_points,
+					   GdkRectangle                *embedded_text_rect,
+					   gboolean                     force_size,
+					   gboolean                     wants_default,
+					   char                       **display_name)
 {
 	NautilusIconFactory *factory;
 	CacheIcon *cached_icon;
@@ -1426,35 +1431,23 @@ nautilus_icon_factory_get_pixbuf_for_ico
 	return pixbuf;
 }
 
-GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_icon (const char                  *icon,
-					   const char                  *modifier,
-					   guint                        nominal_size,
-					   NautilusEmblemAttachPoints  *attach_points,
-					   GdkRectangle                *embedded_text_rect,
-					   gboolean                     wants_default,
-					   char                       **display_name)
-{
-	return nautilus_icon_factory_get_pixbuf_for_icon_internal (icon, modifier, nominal_size, FALSE,
-								   attach_points, embedded_text_rect,
-								   wants_default, display_name);
-}
 
 GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_icon_force_size (const char                  *icon,
-						      const char                  *modifier,
-						      guint                        nominal_size,
-						      NautilusEmblemAttachPoints  *attach_points,
-						      GdkRectangle                *embedded_text_rect,
-						      gboolean                     wants_default,
-						      char                       **display_name)
-{
-	return nautilus_icon_factory_get_pixbuf_for_icon_internal (icon, modifier, nominal_size, TRUE,
-								   attach_points, embedded_text_rect,
-								   wants_default, display_name);
+nautilus_icon_factory_get_pixbuf_for_icon_with_stock_size (const char                  *icon,
+							   const char                  *modifier,
+							   GtkIconSize                  stock_size,
+							   NautilusEmblemAttachPoints  *attach_points,
+							   GdkRectangle                *embedded_text_rect,
+							   gboolean                     wants_default,
+							   char                       **display_name)
+{
+	return nautilus_icon_factory_get_pixbuf_for_icon (icon, modifier,
+							  gtk_icon_size_to_nominal_size (stock_size),
+							  attach_points, embedded_text_rect,
+							  TRUE /* force_size*/, wants_default,
+							  display_name);
 }
 
-
 static guint
 cache_key_hash (gconstpointer p)
 {
@@ -1526,11 +1519,11 @@ nautilus_get_relative_icon_size_for_zoom
 /* Convenience cover for nautilus_icon_factory_get_icon_for_file
  * and nautilus_icon_factory_get_pixbuf_for_icon.
  */
-static GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_file_internal (NautilusFile *file,
-						    const char *modifier,
-						    guint size_in_pixels,
-						    gboolean force_size)
+GdkPixbuf *
+nautilus_icon_factory_get_pixbuf_for_file (NautilusFile *file,
+					   const char *modifier,
+					   guint size_in_pixels,
+					   gboolean force_size)
 {
 	char *icon;
 	GdkPixbuf *pixbuf;
@@ -1542,11 +1535,11 @@ nautilus_icon_factory_get_pixbuf_for_fil
 		return NULL;
 	}
 
-	pixbuf = nautilus_icon_factory_get_pixbuf_for_icon_internal (icon, modifier,
-								     size_in_pixels,
-								     force_size,
-								     NULL, NULL,
-								     TRUE, NULL);
+	pixbuf = nautilus_icon_factory_get_pixbuf_for_icon (icon, modifier,
+							    size_in_pixels,
+							    NULL, NULL,
+							    force_size,
+							    TRUE, NULL);
 	
 	g_free (icon);
 
@@ -1554,25 +1547,14 @@ nautilus_icon_factory_get_pixbuf_for_fil
 }
 
 GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_file (NautilusFile *file,
-					   const char *modifier,
-					   guint size_in_pixels)
-{
-	return nautilus_icon_factory_get_pixbuf_for_file_internal (file,
-								   modifier,
-								   size_in_pixels,
-								   FALSE);
-}
+nautilus_icon_factory_get_pixbuf_for_file_with_stock_size (NautilusFile *file,
+							   const char   *modifier,
+							   GtkIconSize   stock_size)
+{
+	return nautilus_icon_factory_get_pixbuf_for_file (file, modifier,
+							  gtk_icon_size_to_nominal_size (stock_size),
+							  TRUE); /* force_size */
 
-GdkPixbuf *
-nautilus_icon_factory_get_pixbuf_for_file_force_size (NautilusFile *file,
-						      const char *modifier,
-						      guint size_in_pixels)
-{
-	return nautilus_icon_factory_get_pixbuf_for_file_internal (file,
-								   modifier,
-								   size_in_pixels,
-								   TRUE);
 }
 
 /* Convenience routine for getting a pixbuf from an icon name. */
@@ -1583,12 +1565,25 @@ nautilus_icon_factory_get_pixbuf_from_na
 					    gboolean force_size,
 					    char **display_name)
 {
-	return nautilus_icon_factory_get_pixbuf_for_icon_internal (icon_name, modifier,
-								   size_in_pixels, force_size,
-								   NULL, NULL,
-								   TRUE, display_name);
+	return nautilus_icon_factory_get_pixbuf_for_icon (icon_name, modifier,
+							  size_in_pixels,
+							  NULL, NULL,
+							  force_size, TRUE,
+							  display_name);
 }
-									  
+
+GdkPixbuf *
+nautilus_icon_factory_get_pixbuf_from_name_with_stock_size (const char *icon_name,
+							    const char *modifier,
+							    GtkIconSize stock_size,
+							    char **display_name)
+{
+	return nautilus_icon_factory_get_pixbuf_from_name (icon_name, modifier,
+							   gtk_icon_size_to_nominal_size (stock_size),
+							   TRUE, display_name);
+}
+
+
 GdkPixbuf *
 nautilus_icon_factory_get_thumbnail_frame (void)
 {
Index: libnautilus-private/nautilus-icon-factory.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-factory.h,v
retrieving revision 1.52
diff -u -p -r1.52 nautilus-icon-factory.h
--- libnautilus-private/nautilus-icon-factory.h	21 May 2005 16:13:59 -0000	1.52
+++ libnautilus-private/nautilus-icon-factory.h	22 May 2005 20:33:45 -0000
@@ -77,12 +77,6 @@ typedef enum {
 /* Maximum size of an icon that the icon factory will ever produce */
 #define NAUTILUS_ICON_MAXIMUM_SIZE     320
 
-/* Icon size to use for menus. NAUTILUS_ICON_SIZE_SMALLEST
- * is a little too small and NAUTILUS_ICON_SIZE_SMALLER is
- * a little too big.
- */
-#define NAUTILUS_ICON_SIZE_FOR_MENUS	20
-
 /* here's a structure to hold the emblem attach points */
 
 #define MAX_ATTACH_POINTS 12
@@ -133,25 +127,29 @@ GdkPixbuf *nautilus_icon_factory_get_pix
 								 guint                        nominal_size,
 								 NautilusEmblemAttachPoints  *attach_points,
 								 GdkRectangle                *embedded_text_rect,
+								 gboolean                     force_size,
 								 gboolean                     wants_default,
 								 char                       **display_name);
-GdkPixbuf *nautilus_icon_factory_get_pixbuf_for_icon_force_size (const char                  *icon,
-								 const char                  *modifier,
-								 guint                        nominal_size,
-								 NautilusEmblemAttachPoints  *attach_points,
-								 GdkRectangle                *embedded_text_rect,
-								 gboolean                     wants_default,
-								 char                       **display_name);
+GdkPixbuf *nautilus_icon_factory_get_pixbuf_for_icon_with_stock_size (const char                  *icon,
+								      const char                  *modifier,
+								      GtkIconSize                  stock_size,
+								      NautilusEmblemAttachPoints  *attach_points,
+								      GdkRectangle                *embedded_text_rect,
+								      gboolean                     wants_default,
+								      char                       **display_name);
+
 									  
 /* Convenience functions for the common case where you want to choose
  * and render the icon into a pixbuf all at once.
  */
 GdkPixbuf *nautilus_icon_factory_get_pixbuf_for_file            (NautilusFile *file,
 								 const char   *modifer,
-								 guint         size_in_pixels);
-GdkPixbuf *nautilus_icon_factory_get_pixbuf_for_file_force_size (NautilusFile *file,
-								 const char   *modifier,
-								 guint         size_in_pixels);
+								 guint         size_in_pixels,
+								 gboolean      force_size);
+GdkPixbuf *nautilus_icon_factory_get_pixbuf_for_file_with_stock_size (NautilusFile *file,
+								      const char   *modifier,
+								      GtkIconSize   stock_size);
+
 
 /* Convenience routine for getting a pixbuf from an icon name
  */
@@ -160,6 +158,10 @@ GdkPixbuf *           nautilus_icon_fact
 									  guint                        size_in_pixels,
 									  gboolean                     force_size,
 									  char                       **display_name);
+GdkPixbuf *           nautilus_icon_factory_get_pixbuf_from_name_with_stock_size (const char          *icon_name,
+										  const char          *modifer,
+										  GtkIconSize          stock_size,
+										  char               **display_name);
 
 GtkIconTheme *         nautilus_icon_factory_get_icon_theme        (void);
 GnomeThumbnailFactory *nautilus_icon_factory_get_thumbnail_factory (void);
Index: libnautilus-private/nautilus-ui-utilities.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-ui-utilities.c,v
retrieving revision 1.3
diff -u -p -r1.3 nautilus-ui-utilities.c
--- libnautilus-private/nautilus-ui-utilities.c	29 Nov 2004 16:39:31 -0000	1.3
+++ libnautilus-private/nautilus-ui-utilities.c	22 May 2005 20:33:45 -0000
@@ -26,6 +26,7 @@
 #include "nautilus-ui-utilities.h"
 #include "nautilus-icon-factory.h"
 
+#include <gtk/gtkenums.h>
 #include <eel/eel-debug.h>
 
 void
@@ -135,10 +136,10 @@ nautilus_action_from_menu_item (Nautilus
 	/* TODO: This should really use themed icons, but that
 	   doesn't work here yet */
 	if (icon != NULL) {
-		pixbuf = nautilus_icon_factory_get_pixbuf_from_name 
+		pixbuf = nautilus_icon_factory_get_pixbuf_from_name_with_stock_size
 			(icon,
 			 NULL,
-			 NAUTILUS_ICON_SIZE_FOR_MENUS, TRUE,
+			 GTK_ICON_SIZE_MENU,
 			 NULL);
 		if (pixbuf != NULL) {
 			g_object_set_data_full (G_OBJECT (action), "menu-icon",
