diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/batch.c my-gtk/gimp-1-2/app/batch.c
--- from-cvs/gimp-1-2/app/batch.c	Sat Dec 16 22:36:52 2000
+++ my-gtk/gimp-1-2/app/batch.c	Sat Jun 29 16:26:22 2002
@@ -127,7 +127,8 @@
   args[0].value.pdb_int = 1;
   args[1].value.pdb_pointer = cmd;
 
-  vals = procedural_db_execute ("extension_script_fu_eval", args);
+  /* HACK: the following call is treated, as if it comes from a plug-in -> never gets recorded. */
+  vals = procedural_db_execute (TRUE, "extension_script_fu_eval", args);
   switch (vals[0].value.pdb_int)
     {
     case PDB_EXECUTION_ERROR:
@@ -233,7 +234,8 @@
   args[1].value.pdb_int = flags;
   args[2].value.pdb_int = extra;
 
-  vals = procedural_db_execute ("extension_perl_server", args);
+  /* HACK: the following call is treated, as if it comes from a plug-in -> never gets recorded. */
+  vals = procedural_db_execute (TRUE, "extension_perl_server", args);
   switch (vals[0].value.pdb_int)
     {
     case PDB_EXECUTION_ERROR:
diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/fileops.c my-gtk/gimp-1-2/app/fileops.c
--- from-cvs/gimp-1-2/app/fileops.c	Fri Apr 12 19:45:14 2002
+++ my-gtk/gimp-1-2/app/fileops.c	Sun Jul 21 21:17:24 2002
@@ -794,7 +794,8 @@
   args[1].value.pdb_pointer = filename;
   args[2].value.pdb_pointer = raw_filename;
 
-  return_vals = procedural_db_execute (proc->name, args);
+  /* HACK/FIXME: may this function be called from plug-ins, too ?? */
+  return_vals = procedural_db_execute (FALSE /* ? */, proc->name, args);
 
   *status   = return_vals[0].value.pdb_int;
   gimage_id = return_vals[1].value.pdb_int;
@@ -1208,7 +1209,8 @@
   args[3].value.pdb_pointer = filename;
   args[4].value.pdb_pointer = raw_filename;
 
-  return_vals = procedural_db_execute (proc->name, args);
+  /* HACK/FIXME: may this function be called from plug-ins, too ?? */
+  return_vals = procedural_db_execute (FALSE /* ? */, proc->name, args);
 
   status = return_vals[0].value.pdb_int;
 
diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/fileops_cmds.c my-gtk/gimp-1-2/app/fileops_cmds.c
--- from-cvs/gimp-1-2/app/fileops_cmds.c	Sun Nov 04 21:00:56 2001
+++ my-gtk/gimp-1-2/app/fileops_cmds.c	Sat Jun 29 16:30:10 2002
@@ -74,7 +74,8 @@
 
   proc = &file_proc->db_info;
 
-  return procedural_db_execute (proc->name, args);
+  /* FIXME: is this function called by the core, too ?? */
+  return procedural_db_execute (TRUE, proc->name, args);
 }
 
 static ProcArg file_load_inargs[] =
@@ -147,7 +148,8 @@
       new_args[i].value.pdb_pointer = g_strdup("\0");
   }
 
-  return_vals = procedural_db_execute (proc->name, new_args);
+  /* FIXME: is this function called by the core, too ?? */
+  return_vals = procedural_db_execute (TRUE, proc->name, new_args);
   g_free (new_args);
 
   return return_vals;
diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/gimp.def my-gtk/gimp-1-2/app/gimp.def
--- from-cvs/gimp-1-2/app/gimp.def	Thu Jan 01 01:00:00 1970
+++ my-gtk/gimp-1-2/app/gimp.def	Fri Jun 28 18:28:56 2002
@@ -0,0 +1,5 @@
+EXPORTS 
+gimp_color_selector_register
+gimp_color_selector_unregister
+dialog_register
+dialog_unregister
diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/gimp.rc my-gtk/gimp-1-2/app/gimp.rc
--- from-cvs/gimp-1-2/app/gimp.rc	Thu Jan 01 01:00:00 1970
+++ my-gtk/gimp-1-2/app/gimp.rc	Sun Mar 07 13:55:48 1999
@@ -0,0 +1 @@
+wilber			ICON	"wilber.ico"
diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/gimpdnd.c my-gtk/gimp-1-2/app/gimpdnd.c
--- from-cvs/gimp-1-2/app/gimpdnd.c	Fri Jun 09 14:31:18 2000
+++ my-gtk/gimp-1-2/app/gimpdnd.c	Fri Jun 28 22:35:56 2002
@@ -1237,11 +1237,23 @@
         *name = '\0';
       name = name_buffer;
       if ((sig_len < len) && (! strncmp (name, data_type, sig_len)))
+#if GLIB_CHECK_VERSION(2,0,0)
+        {
+	  gchar *hostname;
+	  gchar *filename = g_filename_from_uri (name, &hostname, NULL);
+
+	  if (filename != NULL && (hostname == NULL || g_ascii_strcasecmp (hostname, "localhost") == 0))
+	    file_open (filename, name);
+ 
+	  g_free (filename);
+	  g_free (hostname);
+        }
+#else
         name += sig_len;
 
       if (name && strlen (name) > 2)
 	file_open (name, name);
-
+#endif
       if (*buffer)
         buffer++;
     }
diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/plug_in.c my-gtk/gimp-1-2/app/plug_in.c
--- from-cvs/gimp-1-2/app/plug_in.c	Thu Jun 13 13:58:54 2002
+++ my-gtk/gimp-1-2/app/plug_in.c	Sun Jul 21 21:22:10 2002
@@ -93,6 +93,7 @@
 #include "menus.h"
 #include "pattern_select.h"   /* Needed for closing pattern dialogs */
 #include "plug_in.h"
+#include "recorder.h"
 
 #include "tile.h"			/* ick. */
 
@@ -1000,6 +1001,18 @@
       plug_in->his_read  = g_io_channel_unix_new (my_write[0]);
       plug_in->his_write = g_io_channel_unix_new (my_read[1]);
 
+      /* HB: creating pipes sometimes fails, at least on NT. Instead of 
+       * crashing, handle it gracefully. (It may be caused by mixing
+       * debug and release msvcrt(d).dll ?)
+       */
+      if (   !plug_in->my_read  || !plug_in->my_write 
+          || !plug_in->his_read || !plug_in->his_write)
+	{
+	  g_message ("g_io_channel_unix_new() failed: Unable to start Plug-In \"%s\"\n(%s)",
+		     g_basename (plug_in->args[0]), plug_in->args[0]);
+	  return FALSE;
+	}
+
       /* Remember the file descriptors for the pipes.
        */
       plug_in->args[2] =
@@ -1705,7 +1718,8 @@
 
   if (proc_rec)
     {
-      return_vals = procedural_db_execute (proc_run->name, args);
+      /* HACK: always called by a plug-in ?? */
+      return_vals = procedural_db_execute (TRUE, proc_run->name, args);
     }
   else
     {
@@ -2448,12 +2462,14 @@
 
           if (proc_def->image_types)
             {
-              return_vals = procedural_db_execute ("gimp_register_save_handler", args);
+              /* HACK: never record */
+              return_vals = procedural_db_execute (TRUE, "gimp_register_save_handler", args);
               g_free (return_vals);
             }
           else
             {
-              return_vals = procedural_db_execute ("gimp_register_magic_load_handler", args);
+              /* HACK: always called by a plug-in ?? */
+              return_vals = procedural_db_execute (TRUE, "gimp_register_magic_load_handler", args);
               g_free (return_vals);
             }
 	}
@@ -2677,6 +2693,12 @@
 
   /* run the plug-in procedure */
   plug_in_run (proc_rec, args, argc, FALSE, TRUE, gdisp_ID);
+
+  /* pass it to a possibly running macro recorder */
+  if (record_this_call(proc_rec, args, argc))
+  {
+     /* FIXME: there are parameters pending */
+  }
 
   if (proc_rec->proc_type == PDB_PLUGIN)
     last_plug_in = proc_rec;
diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/procedural_db.c my-gtk/gimp-1-2/app/procedural_db.c
--- from-cvs/gimp-1-2/app/procedural_db.c	Sat Dec 16 22:36:54 2000
+++ my-gtk/gimp-1-2/app/procedural_db.c	Sat Jun 29 21:13:04 2002
@@ -29,6 +29,7 @@
 #include "app_procs.h"
 #include "plug_in.h"
 #include "procedural_db.h"
+#include "recorder.h"
 
 #include "libgimp/gimpparasite.h"
 
@@ -125,13 +126,15 @@
 }
 
 Argument *
-procedural_db_execute (gchar    *name,
+procedural_db_execute (gboolean from_plug_in,
+		       gchar    *name,
 		       Argument *args)
 {
   ProcRecord *procedure;
   Argument   *return_args;
   GList      *list;
   gint        i;
+  static gboolean is_rec = FALSE; /* don't recurse for record function */ 
 
   return_args = NULL;
 
@@ -175,6 +178,15 @@
 	    }
 	}
 
+      /* possibly delegate to macro recorder */
+      if (   (!from_plug_in && !is_rec) /* protect against endless recursion */
+          && (0 != strncmp(name, "gimp_procedural_db_", strlen("gimp_procedural_db_")))
+          && (0 != strncmp(name, "gimp_progress_", strlen("gimp_progress_"))))
+        {
+          record_this_call(procedure, args, procedure->num_args);
+          is_rec = FALSE;
+        }
+
       /*  call the procedure  */
       switch (procedure->proc_type)
 	{
@@ -300,7 +312,8 @@
 
   *nreturn_vals = proc->num_values;
 
-  return_vals = procedural_db_execute (name, params);
+  /* FIXME: ? Theses calls are always from within The Gimp. True ? */
+  return_vals = procedural_db_execute (FALSE, name, params);
 
   g_free (params);
 
diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/procedural_db.h my-gtk/gimp-1-2/app/procedural_db.h
--- from-cvs/gimp-1-2/app/procedural_db.h	Sat Dec 16 22:36:54 2000
+++ my-gtk/gimp-1-2/app/procedural_db.h	Sat Jun 29 16:35:14 2002
@@ -180,7 +180,8 @@
 void          procedural_db_register     (ProcRecord *procedure);
 void          procedural_db_unregister   (gchar      *name);
 ProcRecord  * procedural_db_lookup       (gchar      *name);
-Argument    * procedural_db_execute      (gchar      *name,
+Argument    * procedural_db_execute      (gboolean    from_plug_in,
+					  gchar      *name,
 					  Argument   *args);
 Argument    * procedural_db_run_proc     (gchar      *name,
 					  gint       *nreturn_vals,
diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/recorder.c my-gtk/gimp-1-2/app/recorder.c
--- from-cvs/gimp-1-2/app/recorder.c	Thu Jan 01 01:00:00 1970
+++ my-gtk/gimp-1-2/app/recorder.c	Mon Sep 16 23:01:46 2002
@@ -0,0 +1,134 @@
+/* The GIMP -- an image manipulation program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * recorder.c
+ * Copyright (C) 2002 Hans Breuer <hans@breuer.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+
+#include <string.h>
+
+#include "plug_in.h"
+#include "recorder.h"
+
+static gchar*
+arg_to_string (Argument* arg)
+{
+  switch (arg->arg_type)
+  {
+  case PDB_INT32:
+    return g_strdup_printf("INT32=%d", arg->value.pdb_int);
+  case PDB_INT16:
+    return g_strdup_printf("INT16=%d", arg->value.pdb_int);
+  case PDB_INT8:
+    return g_strdup_printf("INT8=%d", arg->value.pdb_int);
+  case PDB_FLOAT:
+    return g_strdup_printf("FLOAT=%f", arg->value.pdb_float);
+  case PDB_IMAGE:
+    return g_strdup_printf("IMAGE=%d", arg->value.pdb_int);
+  case PDB_LAYER:
+    return g_strdup_printf("LAYER=%d", arg->value.pdb_int);
+  case PDB_CHANNEL:
+    return g_strdup_printf("CHANNEL=%d", arg->value.pdb_int);
+  case PDB_DRAWABLE:
+    return g_strdup_printf("DRAWABLE=%d", arg->value.pdb_int);
+  case PDB_STRING:
+    return g_strdup_printf("STRING=%s", arg->value.pdb_pointer);
+  case PDB_STATUS:
+    return g_strdup_printf("STATUS=%d", arg->value.pdb_int);
+  /* todo:
+  PDB_INT32ARRAY,
+  PDB_INT16ARRAY,
+  PDB_INT8ARRAY,
+  PDB_FLOATARRAY,
+  PDB_STRINGARRAY,
+  PDB_COLOR,
+  PDB_REGION,
+  PDB_DISPLAY,
+  PDB_SELECTION,
+  PDB_BOUNDARY,
+  PDB_PATH,
+  PDB_PARASITE,
+  */
+  default :
+    return g_strdup_printf("t%d=?", arg->arg_type);
+  }
+}
+ 
+/*
+ */
+gboolean
+record_this_call (ProcRecord *proc_rec,
+	     Argument   *args,
+	     gint        argc)
+{
+  ProcRecord *rec_proc; /* recording procedure */
+
+  rec_proc = procedural_db_lookup ("extension_record_this_call");
+
+  if (   (!rec_proc) /* only if the record function is installed */
+                                     /* and we are not recursing */
+      || (proc_rec == rec_proc))
+  {
+    /* short-cut, nothing to do */
+    return FALSE;
+  }
+  else
+  {
+    Argument *return_vals_rec;
+    gint      nreturn_vals_rec;
+    gint      i;
+    gboolean  interactive = (argc < proc_rec->num_args); /* more paramters to come */
+
+    GString  *this_call = g_string_new(proc_rec->name);
+
+    g_string_append(this_call, " (");
+    for (i = 0; i < argc; i++)
+    {
+      gchar* param = arg_to_string(&args[i]);
+
+      if (i > 0) g_string_append_c(this_call, ',');
+
+      g_string_append(this_call, param);
+      g_free(param);
+    }
+
+    if (!interactive)
+      g_string_append_c(this_call, ')');
+
+    if (2 != rec_proc->num_args)
+      g_warning ("extension_record_this_call: wrong parameter number %d",
+                 rec_proc->num_args);
+
+    return_vals_rec =
+      procedural_db_run_proc ("extension_record_this_call",
+                              &nreturn_vals_rec,
+                              PDB_INT32, RUN_NONINTERACTIVE,
+                              PDB_STRING, this_call->str,
+                              PDB_END);
+
+    if (PDB_SUCCESS != return_vals_rec->value.pdb_int)
+      g_warning ("extension_record_this_call: PDB_ERROR %d",
+                 return_vals_rec->value.pdb_int);
+    procedural_db_destroy_args (return_vals_rec, nreturn_vals_rec);
+
+    g_string_free(this_call, TRUE);
+
+    return interactive;
+  }
+}
diff --new-file --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp-1-2/app/recorder.h my-gtk/gimp-1-2/app/recorder.h
--- from-cvs/gimp-1-2/app/recorder.h	Thu Jan 01 01:00:00 1970
+++ my-gtk/gimp-1-2/app/recorder.h	Sun Jul 02 18:03:20 2000
@@ -0,0 +1,11 @@
+#ifndef __RECORDER_H__
+#define __RECORDER_H__
+
+#include "procedural_db.h"
+
+gboolean
+record_this_call (ProcRecord *proc_rec,
+	     Argument   *args,
+	     gint        argc);
+
+#endif /* __RECORDER_H__ */
