? glib_test.c
? glibtest
? menu_change.patch
? pixbuf_patterns.patch
? app/core/png_pats.patch
? plug-ins/common/spread1.diff
? plug-ins/common/spread2.diff
? plug-ins/common/spread3.diff
Index: app/core/gimp.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimp.c,v
retrieving revision 1.105
diff -u -r1.105 gimp.c
--- app/core/gimp.c	17 Mar 2004 14:14:16 -0000	1.105
+++ app/core/gimp.c	28 May 2004 15:21:03 -0000
@@ -573,19 +573,20 @@
 
   static const GimpDataFactoryLoaderEntry pattern_loader_entries[] =
   {
-    { gimp_pattern_load, GIMP_PATTERN_FILE_EXTENSION }
+    { gimp_pattern_legacy_load, GIMP_PATTERN_FILE_EXTENSION },
+    { gimp_pattern_load, NULL /* Fallback - try to load all files */ }
   };
 
   static const GimpDataFactoryLoaderEntry gradient_loader_entries[] =
   {
     { gimp_gradient_load, GIMP_GRADIENT_FILE_EXTENSION },
-    { gimp_gradient_load, NULL /* legacy loader */     }
+    { gimp_gradient_load, NULL /* fallback loader */     }
   };
 
   static const GimpDataFactoryLoaderEntry palette_loader_entries[] =
   {
     { gimp_palette_load, GIMP_PALETTE_FILE_EXTENSION },
-    { gimp_palette_load, NULL /* legacy loader */    }
+    { gimp_palette_load, NULL /* fallback loader */    }
   };
 
   if (gimp->be_verbose)
Index: app/core/gimpdatafactory.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimpdatafactory.c,v
retrieving revision 1.39
diff -u -r1.39 gimpdatafactory.c
--- app/core/gimpdatafactory.c	13 Feb 2004 11:53:19 -0000	1.39
+++ app/core/gimpdatafactory.c	28 May 2004 15:21:04 -0000
@@ -557,10 +557,12 @@
         }
       else
         {
-          g_message (_("Trying legacy loader on file '%s' "
-		       "with unknown extension."),
-                     gimp_filename_to_utf8 (file_data->filename));
-          goto insert;
+          /*
+     	    g_message (_("Trying fallback loader on file '%s' "
+		         "with unknown extension."),
+                       gimp_filename_to_utf8 (file_data->filename));
+          */
+	  goto insert;
         }
     }
 
Index: app/core/gimppattern.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimppattern.c,v
retrieving revision 1.48
diff -u -r1.48 gimppattern.c
--- app/core/gimppattern.c	13 Feb 2004 11:53:18 -0000	1.48
+++ app/core/gimppattern.c	28 May 2004 15:21:05 -0000
@@ -307,9 +307,9 @@
 }
 
 GimpData *
-gimp_pattern_load (const gchar  *filename,
-                   gboolean      stingy_memory_use,
-                   GError      **error)
+gimp_pattern_legacy_load (const gchar  *filename,
+                          gboolean      stingy_memory_use,
+                          GError      **error)
 {
   GimpPattern   *pattern = NULL;
   gint           fd;
@@ -435,6 +435,74 @@
   close (fd);
 
   return NULL;
+}
+
+GimpData *
+gimp_pattern_load (const gchar  *filename,
+                   gboolean      stingy_memory_use,
+                   GError      **error)
+{
+  GimpPattern   *pattern = NULL;
+  GdkPixbuf     *pat_buf = NULL;
+  guchar        *pat_data, *buf_data;
+  gchar         *name    = NULL;
+  gint           width, 
+                 height, 
+                 bytes, 
+                 rowstride, 
+                 i;
+
+  g_return_val_if_fail (filename != NULL, NULL);
+  g_return_val_if_fail (g_path_is_absolute (filename), NULL);
+  g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+  pat_buf = gdk_pixbuf_new_from_file (filename, error);
+
+  if (*error)
+    {
+      if ((*error)->domain == G_FILE_ERROR)
+	g_message (_("Could not open file %s"), filename);
+      else if ((*error)->domain == GDK_PIXBUF_ERROR)
+	g_message (_("Filename %s is not a valid GdkPixbuf"), filename);
+      
+      g_clear_error (error);
+    }
+
+
+  /*  Read in the pattern name - use filename for the moment */
+  name = g_strdup (gimp_filename_to_utf8 (filename));
+
+  pattern = g_object_new (GIMP_TYPE_PATTERN,
+                          "name", name,
+                          NULL);
+
+  g_free (name);
+
+  width     = gdk_pixbuf_get_width (pat_buf);
+  height    = gdk_pixbuf_get_height (pat_buf);
+  bytes     = gdk_pixbuf_get_n_channels (pat_buf);
+  rowstride = gdk_pixbuf_get_rowstride (pat_buf);
+
+  pattern->mask = temp_buf_new (width, height, bytes,
+				0, 0, NULL);
+  
+  pat_data = gdk_pixbuf_get_pixels (pat_buf);
+  buf_data = temp_buf_data (pattern->mask);
+
+  for (i = 0; i < height; i++)
+    {
+      memcpy(buf_data + i * width * bytes, pat_data, width * bytes);
+      pat_data += rowstride;
+    }
+
+  /* Free up loaded Pixbuf */
+  g_object_unref (pat_buf);
+  
+  /*  Swap the pattern to disk (if we're being stingy with memory) */
+  if (stingy_memory_use)
+    temp_buf_swap (pattern->mask);
+
+  return GIMP_DATA (pattern);
 }
 
 TempBuf *
Index: app/core/gimppattern.h
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimppattern.h,v
retrieving revision 1.11
diff -u -r1.11 gimppattern.h
--- app/core/gimppattern.h	2 Dec 2002 13:39:09 -0000	1.11
+++ app/core/gimppattern.h	28 May 2004 15:21:05 -0000
@@ -54,6 +54,9 @@
 GimpData * gimp_pattern_new          (const gchar        *name,
                                       gboolean            stingy_memory_use);
 GimpData * gimp_pattern_get_standard (void);
+GimpData * gimp_pattern_legacy_load  (const gchar        *filename,
+                                      gboolean            stingy_memory_use,
+                                      GError            **error);
 GimpData * gimp_pattern_load         (const gchar        *filename,
                                       gboolean            stingy_memory_use,
                                       GError            **error);
Index: plug-ins/common/spread.c
===================================================================
RCS file: /cvs/gnome/gimp/plug-ins/common/spread.c,v
retrieving revision 1.45
diff -u -r1.45 spread.c
--- plug-ins/common/spread.c	19 Mar 2004 22:50:51 -0000	1.45
+++ plug-ins/common/spread.c	28 May 2004 15:21:13 -0000
@@ -226,7 +226,7 @@
   gint     x1, y1, x2, y2;
   gint     x, y;
   gint     progress, max_progress;
-  gdouble  x_amount, y_amount;
+  gint     x_amount, y_amount;
   gdouble  angle;
   gint     xdist, ydist;
   gint     xi, yi;
