[gimp-perl] No more set_trace. Lib.xs now responds to $Gimp::verbose.



commit c19339dc58a5dad17687736fee160f42d1b3763b
Author: Ed J <edj src gnome org>
Date:   Fri May 16 03:29:52 2014 +0100

    No more set_trace. Lib.xs now responds to $Gimp::verbose.

 Gimp.pm                           |   62 +---------
 Gimp/Lib.pm                       |    6 -
 Gimp/Lib.xs                       |  231 ++++++++++++++-----------------------
 Net/Net.pm                        |   79 ++++---------
 Net/Net.xs                        |   81 +++++++------
 README                            |    4 +-
 TODO                              |    1 -
 examples/Perl-Server              |    2 -
 examples/billboard                |    1 -
 examples/blended2                 |    2 -
 examples/blowinout                |    1 -
 examples/bricks                   |    1 -
 examples/burst                    |    1 -
 examples/ditherize                |    2 -
 examples/dots                     |    1 -
 examples/dust                     |    1 -
 examples/example-extension        |    1 -
 examples/example-extension-no-fu  |    1 -
 examples/example-extension-tester |    3 +-
 examples/example-fu               |    2 +-
 examples/example-no-fu            |    2 -
 examples/exceptiontest            |    1 -
 examples/gallery                  |    2 -
 examples/glowing_steel            |    2 -
 examples/guidegrid                |    2 -
 examples/innerbevel               |    1 -
 examples/layerfuncs               |    1 -
 examples/map_to_gradient          |    1 +
 examples/mirrorsplit              |    1 -
 examples/perlotine                |    1 -
 examples/prep4gif                 |    2 -
 examples/randomblends             |    2 -
 examples/repdup                   |    2 -
 examples/roundsel                 |    2 -
 examples/selective_sharpen        |    2 -
 examples/sethspin                 |    2 -
 examples/stampify                 |    2 -
 examples/translogo                |    1 -
 examples/warp-sharp               |    1 -
 examples/webify                   |    2 -
 examples/windify                  |    2 -
 examples/yinyang                  |    1 -
 t/extension.t                     |    1 -
 t/import.t                        |    1 -
 t/load.t                          |    1 -
 t/netplugin.t                     |    1 -
 t/pdl.t                           |    1 -
 t/perlplugin.t                    |    1 -
 t/run.t                           |    1 -
 t/supplied.t                      |    1 -
 50 files changed, 165 insertions(+), 361 deletions(-)
---
diff --git a/Gimp.pm b/Gimp.pm
index 5e40d57..4f49cb8 100644
--- a/Gimp.pm
+++ b/Gimp.pm
@@ -237,7 +237,7 @@ $interface_pkg->import;
 warn "$$-Finished loading '$interface_pkg'" if $Gimp::verbose >= 2;
 
 # create some common aliases
-for(qw(gimp_procedural_db_proc_exists gimp_call_procedure set_trace initialized)) {
+for(qw(gimp_procedural_db_proc_exists gimp_call_procedure initialized)) {
    *$_ = \&{"$interface_pkg\::$_"};
 }
 
@@ -1061,66 +1061,12 @@ in a prior C<BEGIN> block:
  BEGIN { $Gimp::verbose = 1; }
  use Gimp;
 
-Currently two levels of verbosity are supported:
+Currently three levels of verbosity are supported:
 
+  0: silence
   1: some info - generally things done only once
   2: all the info
 
-=item Gimp::set_trace (tracemask)
-
-You can switch on tracing to see which parameters are used to call PDB
-functions, so you can at least see what was called to cause the error:
-
- Gimp::set_trace(TRACE_ALL);
-
-This function is never exported, so you have to qualify it when calling.
-
-C<libgimp> functions can't be traced (and won't be traceable in the
-foreseeable future).
-
-C<tracemask> is any number of the following flags or'ed together:
-
-=over 4
-
-=item TRACE_NONE
-
-nothing is printed (default).
-
-=item TRACE_CALL
-
-all PDB calls (and only PDB calls!) are printed
-with arguments and return values.
-
-=item TRACE_TYPE
-
-the parameter types are printed additionally.
-
-=item TRACE_NAME
-
-the parameter names are printed.
-
-=item TRACE_DESC
-
-the parameter descriptions.
-
-=item TRACE_ALL
-
-all of the above.
-
-=back
-
-C<set_trace> returns the old tracemask.
-
-=item Gimp::set_trace(\$tracevar)
-
-write trace into $tracevar instead of printing it to STDERR. $tracevar only
-contains the last command traces, i.e. it's cleared on every PDB invocation
-invocation.
-
-=item Gimp::set_trace(*FILEHANDLE)
-
-write trace to FILEHANDLE instead of STDERR.
-
 =item GLib debugging
 
 GIMP makes use of GLib. Environment variables including
@@ -1163,7 +1109,7 @@ or [233,40,40]), a X11-like string ("#rrggbb") or a colour name
 =item DISPLAY, IMAGE, LAYER, CHANNEL, DRAWABLE, SELECTION, VECTORS, ITEM
 
 these will be mapped to corresponding objects (IMAGE => Gimp::Image). In
-trace output you will see small integers (the image/layer/etc..-ID)
+verbose output you will see small integers (the image/layer/etc..-ID)
 
 =item PARASITE
 
diff --git a/Gimp/Lib.pm b/Gimp/Lib.pm
index 7a1403a..927b066 100644
--- a/Gimp/Lib.pm
+++ b/Gimp/Lib.pm
@@ -10,12 +10,6 @@ BEGIN {
    warn "$$-Loading ".__PACKAGE__ if $Gimp::verbose;
 }
 
-use subs qw(
-       gimp_call_procedure             gimp_main       gimp_init
-       gimp_procedural_db_proc_exists  set_trace       gimp_end
-        initialized
-);
-
 sub gimp_init {
    Gimp::croak Gimp::__("gimp_init not implemented for the Lib interface");
 }
diff --git a/Gimp/Lib.xs b/Gimp/Lib.xs
index 9a40b80..e7ae9e8 100644
--- a/Gimp/Lib.xs
+++ b/Gimp/Lib.xs
@@ -48,8 +48,6 @@
 
 #define PKG_ANY                ((char *)0)
 
-static int trace = TRACE_NONE;
-
 typedef GimpPixelRgn GimpPixelRgn_PDL;
 
 static Core* PDL; /* Structure hold core C functions */
@@ -142,51 +140,36 @@ typedef gint32 ITEM;
 typedef gint32 COLOR;
 typedef gpointer GimpPixelRgnIterator;
 
-/* tracing stuff. put at top so immediately available! */
-static SV *trace_var = 0;
-static PerlIO *trace_file = 0; /* FIXME: unportable.  */
-
-static void
-trace_init ()
-{
-  if (!trace_file)
-    SvCUR_set (trace_var, 0);
-}
+#define verbose_level SvIV(get_sv("Gimp::verbose", TRUE))
 
 #ifndef __STDC__
 #error You need to compile with an ansi-c compiler!!!
 #error Remove these lines to continue at your own risk!
 #endif
 
-#if __STDC_VERSION__ > 199900
-#define trace_printf(...) \
+#if __STDC_VERSION__ > 199900 || __GNUC__
+#define verbose_printf(level, ...) \
        do { \
-               if (trace_file) PerlIO_printf (trace_file, __VA_ARGS__); \
-               else            sv_catpvf (trace_var, __VA_ARGS__); \
-       } while(0)
-#elif __GNUC__
-#define trace_printf(frmt,args...) \
-       do { \
-               if (trace_file) PerlIO_printf (trace_file, frmt, ## args); \
-               else            sv_catpvf (trace_var, frmt, ## args); \
+         if (verbose_level >= level) PerlIO_printf (PerlIO_stderr (), __VA_ARGS__); \
        } while(0)
+
 #elif defined(__STDC__)
 
 /* sigh */
 #include <stdarg.h>
-static void trace_printf (char *frmt, ...)
+static void verbose_printf (int level, char *frmt, ...)
 {
   va_list args;
   char buffer[MAX_STRING]; /* sorry... */
 
+  if (verbose_level < level) return;
   va_start (args, frmt);
 #ifdef HAVE_VSNPRINTF
   vsnprintf (buffer, sizeof buffer, frmt, args);
 #else
   vsprintf (buffer, frmt, args);
 #endif
-  if (trace_file) PerlIO_printf (trace_file, "%s", buffer);
-  else           sv_catpv (trace_var, buffer);
+  PerlIO_printf (PerlIO_stderr (), "%s", buffer);
 }
 
 #endif
@@ -246,11 +229,32 @@ static SV *new_gdrawable (gint32 id)
    return sv_bless (newRV_noinc (sv), stash);
 }
 
-static GimpDrawable *old_gdrawable (SV *sv)
+static void check_object(SV *sv, char *pkg)
 {
-  if (!(sv_derived_from (sv, PKG_GDRAWABLE)))
-    croak (__("argument is not of type %s"), PKG_GDRAWABLE);
+  SV *rv;
+  char *name;
+  if (!SvOK(sv))
+    croak (__("argument is undef"));
+  if (!SvROK(sv))
+    croak (__("argument is not a ref: '%s'"), SvPV_nolen(sv));
+  rv = SvRV(sv);
+  if (!SvOBJECT (rv))
+    croak (__("argument is not an object: '%s'"), SvPV_nolen(sv));
+  if (!(sv_derived_from (sv, pkg)))
+    {
+      name = HvNAME (SvSTASH (rv));
+      croak (
+       __("argument is not of type %s, instead: %s='%s'"),
+       pkg,
+       name,
+       SvPV_nolen(sv)
+      );
+    }
+}
 
+static GimpDrawable *old_gdrawable (SV *sv)
+{
+  check_object(sv, PKG_GDRAWABLE);
   /* the next line lacks any type of checking.  */
   return (GimpDrawable *)SvIV(SvRV(sv));
 }
@@ -271,8 +275,7 @@ SV *new_tile (GimpTile *tile, SV *gdrawable)
 
 static GimpTile *old_tile (SV *sv)
 {
-  if (!sv_derived_from (sv, PKG_TILE))
-    croak (__("argument is not of type %s"), PKG_TILE);
+  check_object(sv, PKG_TILE);
 
   /* the next line lacks any type of checking.  */
   return (GimpTile *)SvIV(*(hv_fetch ((HV*)SvRV(sv), "_tile", 5, 0)));
@@ -327,8 +330,7 @@ static SV *new_gpixelrgn (SV *gdrawable, int x, int y, int width, int height, in
 
 static GimpPixelRgn *old_pixelrgn (SV *sv)
 {
-  if (!sv_derived_from (sv, PKG_PIXELRGN))
-    croak (__("argument is not of type %s"), PKG_PIXELRGN);
+  check_object(sv, PKG_PIXELRGN);
 
   return (GimpPixelRgn *)SvPV_nolen(SvRV(sv));
 }
@@ -380,16 +382,16 @@ perl_paramdef_count (GimpParamDef *arg, int count)
 /* horrors!  c wasn't designed for this!  */
 #define dump_printarray(args,index,ctype,datatype,frmt) {\
   int j; \
-  trace_printf ("["); \
+  verbose_printf (1, "["); \
   if (args[index].data.datatype || !args[index-1].data.d_int32) \
     { \
       for (j = 0; j < args[index-1].data.d_int32; j++) \
-       trace_printf (frmt "%s", (ctype) args[index].data.datatype[j], \
+       verbose_printf (1, frmt "%s", (ctype) args[index].data.datatype[j], \
                      j < args[index-1].data.d_int32 - 1 ? ", " : ""); \
     } \
   else \
-    trace_printf (__("(UNINITIALIZED)")); \
-  trace_printf ("]"); \
+    verbose_printf (1, __("(UNINITIALIZED)")); \
+  verbose_printf (1, "]"); \
 }
 
 static void
@@ -405,45 +407,41 @@ dump_params (int nparams, GimpParam *args, GimpParamDef *params)
   };
   int i;
 
-  trace_printf ("(");
+  if (verbose_level < 1) return;
+  verbose_printf (1, "(");
 
-  if ((trace & TRACE_DESC) == TRACE_DESC)
-    trace_printf ("\n\t");
+  verbose_printf (2, "\n\t");
 
   for (i = 0; i < nparams; i++)
     {
-      if ((trace & TRACE_TYPE) == TRACE_TYPE)
-       {
-         if ((unsigned int)params[i].type < GIMP_PDB_END+1)
-           trace_printf ("%s ", ptype[params[i].type]);
-         else
-           trace_printf ("T%d ", params[i].type);
-       }
+      if ((unsigned int)params[i].type < GIMP_PDB_END+1)
+       verbose_printf (2, "%s ", ptype[params[i].type]);
+      else
+       verbose_printf (2, "T%d ", params[i].type);
 
-      if ((trace & TRACE_NAME) == TRACE_NAME)
-       trace_printf ("%s=", params[i].name);
+      verbose_printf (2, "%s=", params[i].name);
 
       switch (args[i].type)
        {
-         case GIMP_PDB_INT32:          trace_printf ("%d", args[i].data.d_int32); break;
-         case GIMP_PDB_INT16:          trace_printf ("%d", args[i].data.d_int16); break;
-         case GIMP_PDB_INT8:           trace_printf ("%d", (guint8) args[i].data.d_int8); break;
-         case GIMP_PDB_FLOAT:          trace_printf ("%f", args[i].data.d_float); break;
-         case GIMP_PDB_STRING:         trace_printf ("\"%s\"", args[i].data.d_string ? args[i].data.d_string 
: "[null]"); break;
-         case GIMP_PDB_DISPLAY:        trace_printf ("%d", args[i].data.d_display); break;
-         case GIMP_PDB_IMAGE:          trace_printf ("%d", args[i].data.d_image); break;
-         case GIMP_PDB_ITEM:           trace_printf ("%d", args[i].data.d_item); break;
-         case GIMP_PDB_LAYER:          trace_printf ("%d", args[i].data.d_layer); break;
-         case GIMP_PDB_CHANNEL:        trace_printf ("%d", args[i].data.d_channel); break;
-         case GIMP_PDB_DRAWABLE:       trace_printf ("%d", args[i].data.d_drawable); break;
-         case GIMP_PDB_SELECTION:      trace_printf ("%d", args[i].data.d_selection); break;
+         case GIMP_PDB_INT32:          verbose_printf (1, "%d", args[i].data.d_int32); break;
+         case GIMP_PDB_INT16:          verbose_printf (1, "%d", args[i].data.d_int16); break;
+         case GIMP_PDB_INT8:           verbose_printf (1, "%d", (guint8) args[i].data.d_int8); break;
+         case GIMP_PDB_FLOAT:          verbose_printf (1, "%f", args[i].data.d_float); break;
+         case GIMP_PDB_STRING:         verbose_printf (1, "\"%s\"", args[i].data.d_string ? 
args[i].data.d_string : "[null]"); break;
+         case GIMP_PDB_DISPLAY:        verbose_printf (1, "%d", args[i].data.d_display); break;
+         case GIMP_PDB_IMAGE:          verbose_printf (1, "%d", args[i].data.d_image); break;
+         case GIMP_PDB_ITEM:           verbose_printf (1, "%d", args[i].data.d_item); break;
+         case GIMP_PDB_LAYER:          verbose_printf (1, "%d", args[i].data.d_layer); break;
+         case GIMP_PDB_CHANNEL:        verbose_printf (1, "%d", args[i].data.d_channel); break;
+         case GIMP_PDB_DRAWABLE:       verbose_printf (1, "%d", args[i].data.d_drawable); break;
+         case GIMP_PDB_SELECTION:      verbose_printf (1, "%d", args[i].data.d_selection); break;
          case GIMP_PDB_COLORARRAY:
                {
                  int j;
-                 trace_printf ("[");
+                 verbose_printf (1, "[");
                  if (args[i].data.d_colorarray || !args[i-1].data.d_int32) {
                    for (j = 0; j < args[i-1].data.d_int32; j++)
-                     trace_printf (
+                     verbose_printf (1, 
                        "[%f,%f,%f,%f]%s",
                        ((GimpRGB) args[i].data.d_colorarray[j]).r,
                        ((GimpRGB) args[i].data.d_colorarray[j]).g,
@@ -452,12 +450,12 @@ dump_params (int nparams, GimpParam *args, GimpParamDef *params)
                        j < args[i-1].data.d_int32 - 1 ? ", " : ""
                      );
                  } else
-                   trace_printf (__("(UNINITIALIZED)"));
-                 trace_printf ("]");
+                   verbose_printf (1, __("(UNINITIALIZED)"));
+                 verbose_printf (1, "]");
                }
                break;
-         case GIMP_PDB_VECTORS:        trace_printf ("%d", args[i].data.d_vectors); break;
-         case GIMP_PDB_STATUS:         trace_printf ("%d", args[i].data.d_status); break;
+         case GIMP_PDB_VECTORS:        verbose_printf (1, "%d", args[i].data.d_vectors); break;
+         case GIMP_PDB_STATUS:         verbose_printf (1, "%d", args[i].data.d_status); break;
          case GIMP_PDB_INT32ARRAY:     dump_printarray (args, i, gint32, d_int32array, "%d"); break;
          case GIMP_PDB_INT16ARRAY:     dump_printarray (args, i, gint16, d_int16array, "%d"); break;
          case GIMP_PDB_INT8ARRAY:      dump_printarray (args, i, guint8, d_int8array , "%d"); break;
@@ -465,7 +463,7 @@ dump_params (int nparams, GimpParam *args, GimpParamDef *params)
          case GIMP_PDB_STRINGARRAY:    dump_printarray (args, i, char* , d_stringarray, "'%s'"); break;
 
          case GIMP_PDB_COLOR:
-           trace_printf ("[%f,%f,%f,%f]",
+           verbose_printf (1, "[%f,%f,%f,%f]",
                          args[i].data.d_color.r,
                          args[i].data.d_color.g,
                          args[i].data.d_color.b,
@@ -478,39 +476,39 @@ dump_params (int nparams, GimpParam *args, GimpParamDef *params)
 
              if (args[i].data.d_parasite.name)
                {
-                trace_printf ("[%s, ", args[i].data.d_parasite.name);
+                verbose_printf (1, "[%s, ", args[i].data.d_parasite.name);
                 if (args[i].data.d_parasite.flags & GIMP_PARASITE_PERSISTENT)
                   {
-                    trace_printf ("GIMP_PARASITE_PERSISTENT");
+                    verbose_printf (1, "GIMP_PARASITE_PERSISTENT");
                     found |= GIMP_PARASITE_PERSISTENT;
                   }
 
                 if (args[i].data.d_parasite.flags & ~found)
                   {
                     if (found)
-                      trace_printf ("|");
-                    trace_printf ("%d", args[i].data.d_parasite.flags & ~found);
+                      verbose_printf (1, "|");
+                    verbose_printf (1, "%d", args[i].data.d_parasite.flags & ~found);
                   }
 
-                trace_printf (__(", %d bytes data]"), args[i].data.d_parasite.size);
+                verbose_printf (1, __(", %d bytes data]"), args[i].data.d_parasite.size);
               }
              else
-               trace_printf (__("[undefined]"));
+               verbose_printf (1, __("[undefined]"));
            }
            break;
 
          default:
-           trace_printf ("(?%d?)", args[i].type);
+           verbose_printf (1, "(?%d?)", args[i].type);
        }
 
-      if ((trace & TRACE_DESC) == TRACE_DESC)
-       trace_printf ("\t\"%s\"\n\t", params[i].description);
+      if (verbose_level >= 2)
+       verbose_printf (2, "\t\"%s\"\n\t", params[i].description);
       else if (i < nparams - 1)
-       trace_printf (", ");
+       verbose_printf (1, ", ");
 
     }
 
-  trace_printf (")");
+  verbose_printf (1, ")");
 }
 
 static int
@@ -1270,42 +1268,6 @@ MODULE = Gimp::Lib       PACKAGE = Gimp::Lib
 
 PROTOTYPES: ENABLE
 
-#
-# usage:
-# set_trace (int new_trace_mask);
-# set_trace (\$variable_to_trace_into);
-# set_trace (*STDOUT);
-#
-I32
-set_trace (var)
-       CODE:
-       {
-               SV *sv = ST (0);
-
-               RETVAL = trace;
-
-               if (SvROK (sv) || SvTYPE (sv) == SVt_PVGV)
-                 {
-                   if (trace_var)
-                     SvREFCNT_dec (trace_var), trace_var = 0;
-
-                   if (SvTYPE (sv) == SVt_PVGV) /* pray it's a filehandle!  */
-                     trace_file = IoOFP (GvIO (sv));
-                   else
-                     {
-                       trace_file = 0;
-                       sv = SvRV (sv);
-                       SvREFCNT_inc (sv);
-                       (void) SvUPGRADE (sv, SVt_PV);
-                       trace_var = sv;
-                     }
-                 }
-               else
-                 trace = SvIV (ST (0));
-       }
-       OUTPUT:
-       RETVAL
-
 SV *
 _autobless (sv,type)
        SV *    sv
@@ -1489,11 +1451,7 @@ PPCODE:
   // do this here as at BOOT causes error
   gimp_plugin_set_pdb_error_handler (GIMP_PDB_ERROR_HANDLER_PLUGIN);
 
-  if (trace)
-    trace_init ();
-
-  if (trace & TRACE_CALL)
-    trace_printf ("%s", proc_name);
+  verbose_printf (1, "%s", proc_name);
 
   if (
     gimp_procedural_db_proc_info(
@@ -1549,23 +1507,17 @@ PPCODE:
     }
 
     if (croak_str [0]) {
-      if (trace & TRACE_CALL) {
-       dump_params (i, args, params);
-       trace_printf (__(" = [argument error]\n"));
-      }
-
+      dump_params (i, args, params);
+      verbose_printf (1, __(" = [argument error]\n"));
       goto error;
     }
   }
 
-  if (trace & TRACE_CALL) {
-    dump_params (i, args, params);
-    trace_printf (" = ");
-  }
+  dump_params (i, args, params);
+  verbose_printf (1, " = ");
 
   if (i < nparams || j < items) {
-    if (trace & TRACE_CALL)
-      trace_printf (__("[unfinished]\n"));
+    verbose_printf (1, __("[unfinished]\n"));
 
     sprintf(
       croak_str,
@@ -1600,13 +1552,11 @@ PPCODE:
     } else
       // just try gimp_get_pdb_error()
       sprintf (croak_str, "%s: %s", proc_name, gimp_get_pdb_error ());
-    if (trace & TRACE_CALL) {
-      trace_printf ("(");
-      if ((trace & TRACE_DESC) == TRACE_DESC) trace_printf ("\n\t");
-      trace_printf (__("EXCEPTION: \"%s\""), croak_str);
-      if ((trace & TRACE_DESC) == TRACE_DESC) trace_printf ("\n\t");
-      trace_printf (")\n");
-    }
+    verbose_printf (1, "(");
+    verbose_printf (2, "\n\t");
+    verbose_printf (1, __("EXCEPTION: \"%s\""), croak_str);
+    verbose_printf (2, "\n\t");
+    verbose_printf (1, ")\n");
     goto error;
   }
   if (values[0].data.d_status != GIMP_PDB_SUCCESS) {
@@ -1614,10 +1564,8 @@ PPCODE:
     goto error;
   }
 
-  if (trace & TRACE_CALL) {
-    dump_params (nvalues-1, values+1, return_vals);
-    trace_printf ("\n");
-  }
+  dump_params (nvalues-1, values+1, return_vals);
+  verbose_printf (1, "\n");
 
   EXTEND(SP, perl_paramdef_count (return_vals, nvalues-1));
   PUTBACK;
@@ -2251,7 +2199,6 @@ BOOT:
 #if (GLIB_MAJOR_VERSION < 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 36))
        g_type_init();
 #endif
-       trace_file = PerlIO_stderr ();
        g_log_set_handler(
          "LibGimp",
          G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL,
diff --git a/Net/Net.pm b/Net/Net.pm
index 12af4fd..2737ca3 100644
--- a/Net/Net.pm
+++ b/Net/Net.pm
@@ -9,14 +9,12 @@ package Gimp::Net;
 #
 # length_of_packet cmd
 #
-# cmd                  response                description
-# AUTH password                ok [message]            authorize yourself
+# cmd                          response        description
+# AUTH password                        ok [message]    authorize yourself
 # QUIT                                         quit server
-# EXEC func args       status return-vals      run simple command
-# TRCE func trace args trace status return-vals        run simple command (with tracing)
-# TEST procname                bool                    check for procedure existance
+# EXEC verbose func args       $@ return-vals  run simple command
+# TEST procname                        bool            check for procedure existence
 # DTRY in-args                                 destroy all argument objects
-# RSET                                         reset server (NYI)
 #
 # args is "number of arguments" arguments preceded by length
 # type is first character
@@ -27,7 +25,7 @@ package Gimp::Net;
 BEGIN { warn "$$-Loading ".__PACKAGE__ if $Gimp::verbose; }
 
 use strict 'vars';
-use vars qw($VERSION $trace_res);
+our $VERSION;
 use subs qw(gimp_call_procedure);
 use base qw(DynaLoader);
 use IO::Socket;
@@ -38,16 +36,13 @@ use Gimp::Extension;
 $VERSION = 2.3002;
 bootstrap Gimp::Net $VERSION;
 
-my $PROTOCOL_VERSION = 4; # protocol version
-my ($server_fh, $gimp_pid, $trace_level, $auth);
+my $PROTOCOL_VERSION = 5; # protocol version
+my ($server_fh, $gimp_pid, $auth);
 
 my $DEFAULT_TCP_PORT  = 10009;
 my $DEFAULT_UNIX_DIR  = "/tmp/gimp-perl-serv-uid-$>/";
 my $DEFAULT_UNIX_SOCK = "gimp-perl-serv";
 
-$trace_res = *STDERR;
-$trace_level = 0;
-
 my $initialized = 0;
 
 # manual import - can't call Gimp::import as it calls us!
@@ -84,19 +79,9 @@ sub import {
 }
 
 sub gimp_call_procedure {
-   warn "$$-Net::gimp_call_procedure[$trace_level](@_)" if $Gimp::verbose;
-   my $func = shift;
-   unshift @_, $trace_level if $trace_level;
-   my @response = command($trace_level ? "TRCE" : "EXEC", $func, @_);
-   my $trace = shift @response if $trace_level;
+   warn "$$-Net::gimp_call_procedure(@_)" if $Gimp::verbose;
+   my @response = command("EXEC", $Gimp::verbose, @_);
    my $die_text = shift @response;
-   if ($trace_level) {
-      if (ref $trace_res eq "SCALAR") {
-        $$trace_res = $trace;
-      } else {
-        print $trace_res $trace;
-      }
-   }
    Gimp::recroak(Gimp::exception_strip(__FILE__, $die_text)) if $die_text;
    wantarray ? @response : $response[0];
 }
@@ -110,17 +95,6 @@ sub server_wait {
    waitpid $gimp_pid, 0;
 }
 
-sub set_trace {
-   my($trace)= _;
-   my $old_level = $trace_level;
-   if(ref $trace) {
-      $trace_res=$trace;
-   } elsif (defined $trace) {
-      $trace_level=$trace;
-   }
-   $old_level;
-}
-
 my $PROC_SF = 'extension-perl-server';
 
 sub start_server {
@@ -257,23 +231,19 @@ END {
 }
 
 # start of server-used block
-use vars qw($use_unix $use_tcp $trace_res $server_quit $max_pkt $unix $tcp
-            $ps_flags $auth @authorized $rm $saved_rm %stats);
+our ($use_unix, $use_tcp, @authorized, %stats);
 # you can enable unix sockets, tcp sockets, or both (or neither...)
-#
 # enabling tcp sockets can be a security risk. If you don't understand why,
 # you shouldn't enable it!
-#
 $use_unix      = 1;
 $use_tcp       = 1;    # tcp is enabled only when authorization is available
 my $unix_path;
 
-$server_quit = 0;
-
 my $max_pkt = 1024*1024*8;
+my $run_mode;
 
 sub slog {
-  return unless $Gimp::verbose;
+  return if $run_mode == &Gimp::RUN_NONINTERACTIVE;
   print localtime.": $$-slog(",@_,")\n";
 }
 
@@ -292,21 +262,18 @@ sub handle_request($) {
    };
    warn "$$-handle_request got '$@'" if $@ and $Gimp::verbose >= 2;
    return 0 if $@;
-   my @args = net2args(($req eq "TRCE" or $req eq "EXEC"), $data);
+   my @args = net2args(($req eq "EXEC"), $data);
    if(!$auth or $authorized[fileno($fh)]) {
-      if ($req eq "TRCE" or $req eq "EXEC") {
+      if ($req eq "EXEC") {
          no strict 'refs';
+        my $old_v = $Gimp::verbose;
+        $Gimp::verbose = shift @args;
         my $function = shift @args;
-         if ($req eq "TRCE") {
-           my $trace_level = shift @args;
-           Gimp::set_trace($trace_level);
-           $trace_res = "";
-        }
-         @args = eval { Gimp->$function(@args) };
-        unshift @args, Gimp::exception_strip(__FILE__, $@);
-        unshift @args, $trace_res if $req eq "TRCE";
-        senddata $fh, args2net(1, @args);
-         Gimp::set_trace(0) if $req eq "TRCE";
+        warn "$$-Net:Gimp->$function(@args)" if $Gimp::verbose >= 2;
+         my @retvals = eval { Gimp->$function(@args) };
+        $Gimp::verbose = $old_v;
+        unshift @retvals, Gimp::exception_strip(__FILE__, $@);
+        senddata $fh, args2net(1, @retvals);
       } elsif ($req eq "TEST") {
          no strict 'refs';
          reply $fh,
@@ -397,7 +364,7 @@ sub setup_listen_tcp {
 }
 
 sub perl_server_run {
-  (my $run_mode, my $filehandle, $Gimp::verbose) = @_;
+  ($run_mode, my $filehandle, $Gimp::verbose) = @_;
   warn "$$-".__PACKAGE__."::perl_server_run(@_)\n" if $Gimp::verbose;
   if ($run_mode == &Gimp::RUN_NONINTERACTIVE) {
       die __"unable to open Gimp::Net communications socket: $!\n"
@@ -408,8 +375,6 @@ sub perl_server_run {
       Gtk2->main;
       Gimp->quit(0);
       exit(0);
-  } else {
-     $ps_flags=0;
   }
   my $host = $ENV{'GIMP_HOST'};
   $auth = $host=~s/^(.*)\@// ? $1 : undef;     # get authorization
diff --git a/Net/Net.xs b/Net/Net.xs
index 08fb102..fb65f2c 100644
--- a/Net/Net.xs
+++ b/Net/Net.xs
@@ -92,16 +92,16 @@ static void sv2net (int deobjectify, SV *s, SV *sv)
           if (deobjectify && is_dynamic (name))
             {
               object_id++;
-
               SvREFCNT_inc(sv);
               (void)hv_store (object_cache, (char *)&object_id, sizeof(object_id), sv, 0);
-
               sv_catpvf (s, "i%d:", object_id);
-              return; /* well... */
+              return;
             }
         }
       else
-        sv_catpvn (s, "r", 1);
+       {
+         sv_catpvn (s, "r", 1);
+       }
 
       if (SvTYPE(rv) == SVt_PVAV)
         {
@@ -120,7 +120,9 @@ static void sv2net (int deobjectify, SV *s, SV *sv)
   else if (SvOK(sv))
     {
       if (SvIOK(sv))
-        sv_catpvf (s,"i%ld:", (long)SvIV(sv));
+       {
+         sv_catpvf (s,"i%ld:", (long)SvIV(sv));
+       }
       else
         {
           char *str;
@@ -133,7 +135,9 @@ static void sv2net (int deobjectify, SV *s, SV *sv)
         }
     }
   else
-    sv_catpvn (s, "u", 1);
+    {
+      sv_catpvn (s, "u", 1);
+    }
 }
 
 static SV *net2sv (int objectify, char **_s)
@@ -171,10 +175,14 @@ static SV *net2sv (int objectify, char **_s)
          s += ui;
          require_pv ("PDL.pm");
          require_pv ("PDL/IO/Dumper.pm");
-         (void)eval_pv ("import PDL;", G_VOID);
-         sv = eval_pv (tmp, G_SCALAR);
+         ENTER;
+         SAVETMPS;
+         (void)eval_pv ("import PDL;", TRUE);
+         sv = eval_pv (tmp, TRUE);
          SvREFCNT_inc (sv);
          free (tmp);
+         FREETMPS;
+         LEAVE;
          break;
        }
 
@@ -233,39 +241,38 @@ PROTOTYPES: ENABLE
 
 SV *
 args2net(deobjectify,...)
-       int     deobjectify
-       CODE:
-        int index;
-
-        if (deobjectify) init_object_cache;
-
-        RETVAL = newSVpv ("", 0);
-        (void) SvUPGRADE (RETVAL, SVt_PV);
-        SvGROW (RETVAL, INITIAL_PV);
-
-       for (index = 1; index < items; index++)
-          sv2net (deobjectify, RETVAL, ST(index));
-
-        OUTPUT:
-        RETVAL
+int deobjectify
+CODE:
+  int index;
+  if (deobjectify) init_object_cache;
+  RETVAL = newSVpv ("", 0);
+  (void) SvUPGRADE (RETVAL, SVt_PV);
+  SvGROW (RETVAL, INITIAL_PV);
+  for (index = 1; index < items; index++)
+    sv2net (deobjectify, RETVAL, ST(index));
+OUTPUT:
+  RETVAL
 
 void
 net2args(objectify,s)
-       int     objectify
-       char *  s
-        PPCODE:
-
-        if (objectify) init_object_cache;
-
-        /* this depends on a trailing zero! */
-        while (*s)
-         XPUSHs (sv_2mortal (net2sv (objectify, &s)));
+int    objectify
+char * s
+PPCODE:
+  if (objectify) init_object_cache;
+  /* this depends on a trailing zero! */
+  while (*s)
+    {
+      SV *sv;
+      PUTBACK; // this is necessary due to eval_pv in net2sv
+      sv = net2sv (objectify, &s);
+      SPAGAIN; // works without, but recommended by perl expert - leaving in
+      XPUSHs (sv_2mortal (sv));
+    }
 
 void
 destroy_objects(...)
-       CODE:
-        int index;
-
-        for (index = 0; index < items; index++)
-          destroy_object (ST(index));
+CODE:
+  int index;
+  for (index = 0; index < items; index++)
+    destroy_object (ST(index));
 
diff --git a/README b/README
index d09e8ed..e56204b 100644
--- a/README
+++ b/README
@@ -102,7 +102,7 @@ use Gimp::Fu;
 
 podregister {
   # no input parameters line - source filter inserts. See Gimp::Fu docs.
-  Gimp::set_trace(TRACE_CALL); # remove this to stop debugging output
+  $Gimp::verbose = 1; # remove this to stop debugging output
   Gimp::Context->push; # store current settings, so present ones preserved
   my $img = Gimp::Image->new($width, $height, RGB);
   $img->undo_group_start; # so all actions can be undone in one step
@@ -146,6 +146,8 @@ descriptive help message here!
   [PF_SPINNER  , "height"      , "Image height"        , 100, [100, 200]],
   [PF_STRING   , "text"        , "Message"             , "example text"],
   [PF_TEXT     , "longtext"    , "Longer text"         , "more example text"],
+  [PF_FILE     , "file"        , "File"                , "/tmp"],
+  [PF_INT8     , "int8"        , "8-bit int"           , 10],
   [PF_INT32    , "bordersize"  , "Border size"         , 10],
   [PF_FLOAT    , "borderwidth" , "Border width"        , 1/5],
   [PF_FONT     , "font"        , "Font"],
diff --git a/TODO b/TODO
index 87aec9b..f1514d1 100644
--- a/TODO
+++ b/TODO
@@ -20,7 +20,6 @@ Items as of 2014-04-29 (by Ed J)
   - gimp/plug-ins/script-fu/script-fu-console.c
   base on this:
   http://gtk2-perl.sourceforge.net/doc/gtk2-perl-study-guide/x3661.html
-* set_trace may also be obsolete
 * interactive collab image-editing:
   http://users.telenet.be/blendix/verse/#gimp_plugin
   https://github.com/verse/verse/wiki/Tutorial-Simple-C-Verse-Client
diff --git a/examples/Perl-Server b/examples/Perl-Server
index 6eb3949..13f5d8e 100755
--- a/examples/Perl-Server
+++ b/examples/Perl-Server
@@ -6,9 +6,7 @@ use Gimp;
 use Gimp::Net;
 use Gimp::Extension;
 
-Gimp::set_trace(\$Gimp::Net::trace_res);
 Gimp::ignore_functions(qw(gimp_progress_init gimp_progress_update));
-
 Gimp::on_quit \&Gimp::Net::perl_server_quit;
 podregister \&Gimp::Net::perl_server_run;
 
diff --git a/examples/billboard b/examples/billboard
index 087778c..7dd4c12 100755
--- a/examples/billboard
+++ b/examples/billboard
@@ -7,7 +7,6 @@ use Gimp::Util;
 use constant PI => 3.14159;
 
 # Uncomment below to spew forth much data about whats going on.
-#Gimp::set_trace(TRACE_ALL);
 
 sub saw {  # a sawtooth function on PI
   my $val = @_;
diff --git a/examples/blended2 b/examples/blended2
index 24e1cdd..0fb0a7c 100755
--- a/examples/blended2
+++ b/examples/blended2
@@ -4,8 +4,6 @@ use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 use Gimp::Util;
 
-# Gimp::set_trace(TRACE_ALL);
-
 podregister {
   die "Must have alpha channel\n" unless $drawable->has_alpha;
   Gimp::Context->push();
diff --git a/examples/blowinout b/examples/blowinout
index 1831f0e..cc941d7 100755
--- a/examples/blowinout
+++ b/examples/blowinout
@@ -4,7 +4,6 @@
 use Gimp;
 use Gimp::Fu;
 use strict;
-# Gimp::set_trace(TRACE_CALL);
 
 podregister {
   die "Not a layer\n" unless $drawable->is_layer;
diff --git a/examples/bricks b/examples/bricks
index faab759..78152c4 100755
--- a/examples/bricks
+++ b/examples/bricks
@@ -4,7 +4,6 @@ use Gimp;
 use Gimp::Fu;
 use Gimp::Util;
 #$Gimp::verbose = 1;
-#Gimp::set_trace(TRACE_ALL);
 
 podregister {
   Gimp::Context->push();
diff --git a/examples/burst b/examples/burst
index 2623b8a..7ff794d 100755
--- a/examples/burst
+++ b/examples/burst
@@ -3,7 +3,6 @@
 use Gimp;
 use Gimp::Fu;
 use Gimp::Util;
-# Gimp::set_trace(TRACE_ALL);
 use constant PI => 3.1415926;
 
 # find an equivalent polar value in the range of 0 to 2 pi
diff --git a/examples/ditherize b/examples/ditherize
index 5c60c03..ba091f1 100755
--- a/examples/ditherize
+++ b/examples/ditherize
@@ -4,8 +4,6 @@ use strict;
 use Gimp;
 use Gimp::Fu;
 
-#Gimp::set_trace(TRACE_ALL);
-
 my %imagetype2layertype = (
    RGB,                RGB_IMAGE,
    GRAY,       GRAY_IMAGE,
diff --git a/examples/dots b/examples/dots
index 09245af..7714084 100755
--- a/examples/dots
+++ b/examples/dots
@@ -4,7 +4,6 @@
 use Gimp;
 use Gimp::Fu;
 use strict;
-#Gimp::set_trace(TRACE_ALL);
 
 podregister {
   my $has_noselection;
diff --git a/examples/dust b/examples/dust
index 86d4f86..615e21e 100755
--- a/examples/dust
+++ b/examples/dust
@@ -52,7 +52,6 @@ use Gimp::Util;
 podregister {
   $length *= 0.75;
   set_seed $seed;
-  # Gimp::set_trace(TRACE_ALL);
   my ($w, $h) = ($image->width, $image->height);
   $image->undo_group_start;
   Gimp::Context->push;
diff --git a/examples/example-extension b/examples/example-extension
index 4bcd0c6..0a19cd9 100755
--- a/examples/example-extension
+++ b/examples/example-extension
@@ -5,7 +5,6 @@ use Gimp qw(:auto __ N_);
 use Gimp::Extension;
 
 #$Gimp::verbose = 1;
-#Gimp::set_trace(TRACE_ALL);
 my $persist;
 
 register_temp
diff --git a/examples/example-extension-no-fu b/examples/example-extension-no-fu
index 5301ff5..2334509 100755
--- a/examples/example-extension-no-fu
+++ b/examples/example-extension-no-fu
@@ -2,7 +2,6 @@
 
 BEGIN { $Gimp::verbose = 1; }
 use Gimp;
-Gimp::set_trace(TRACE_ALL);
 
 my $OTHER_EVENTLOOP = 0;
 
diff --git a/examples/example-extension-tester b/examples/example-extension-tester
index c29422d..fd91588 100755
--- a/examples/example-extension-tester
+++ b/examples/example-extension-tester
@@ -2,8 +2,7 @@
 
 use Gimp;
 use Gimp::Fu;
-#BEGIN { $Gimp::verbose = 1; }
-Gimp::set_trace(TRACE_ALL);
+BEGIN { $Gimp::verbose = 1; }
 
 podregister { die Gimp->extension_test_temp($Gimp::Fu::run_mode, 3) };
 
diff --git a/examples/example-fu b/examples/example-fu
index ff0a65a..aa2a1e7 100755
--- a/examples/example-fu
+++ b/examples/example-fu
@@ -6,7 +6,7 @@ use Gimp::Fu;
 
 podregister {
   # no input parameters line - source filter inserts. See Gimp::Fu docs.
-  Gimp::set_trace(TRACE_CALL); # remove this to stop debugging output
+  $Gimp::verbose = 1; # remove this to stop debugging output
   Gimp::Context->push; # store current settings, so present ones preserved
   my $img = Gimp::Image->new($width, $height, RGB);
   $img->undo_group_start; # so all actions can be undone in one step
diff --git a/examples/example-no-fu b/examples/example-no-fu
index dfbdb7b..4a61b7e 100755
--- a/examples/example-no-fu
+++ b/examples/example-no-fu
@@ -4,8 +4,6 @@ use Gimp;
 
 use strict 'vars';
 
-# Gimp::set_trace(TRACE_ALL);
-
 # 2014/04/20 Ed J: bit of a stir, still same really
 # 12/5/03: <sjburges gimp org>
 #  s/->mask/->get_mask
diff --git a/examples/exceptiontest b/examples/exceptiontest
index bdd682d..ba86d3e 100755
--- a/examples/exceptiontest
+++ b/examples/exceptiontest
@@ -3,7 +3,6 @@
 use Gimp;
 use Gimp::Fu;
 #BEGIN { $Gimp::verbose = 1; }
-#Gimp::set_trace(TRACE_ALL);
 
 podregister { die "I DIED\n" };
 
diff --git a/examples/gallery b/examples/gallery
index 2f45a3b..7986377 100755
--- a/examples/gallery
+++ b/examples/gallery
@@ -4,8 +4,6 @@ use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 use Gimp::Util;
 
-#Gimp::set_trace(TRACE_ALL);
-
 sub printHeader {
   my ($rf,$gf,$bf,$r,$g,$b, $htmlFile,$gallerytitle)= _;
   printf $htmlFile "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">";
diff --git a/examples/glowing_steel b/examples/glowing_steel
index ead8f82..263b07f 100755
--- a/examples/glowing_steel
+++ b/examples/glowing_steel
@@ -18,8 +18,6 @@ sub perl_fu_glowing_steel {
   my $do_highl = shift;
   my $antialias = shift;
 
-  # Gimp::set_trace(TRACE_ALL);
-
   gimp_context_push();
 
   my $image = gimp_image_new(100, 100, RGB);
diff --git a/examples/guidegrid b/examples/guidegrid
index 7749408..181bdec 100755
--- a/examples/guidegrid
+++ b/examples/guidegrid
@@ -3,8 +3,6 @@
 use Gimp;
 use Gimp::Fu;
 
-# Gimp::set_trace(TRACE_ALL);
-
 podregister {
   # Remove all existing guides (this is optional)
   if($remove_old_guides) {
diff --git a/examples/innerbevel b/examples/innerbevel
index ceca9df..07314af 100755
--- a/examples/innerbevel
+++ b/examples/innerbevel
@@ -3,7 +3,6 @@
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 use Gimp::Util;
-#Gimp::set_trace(TRACE_ALL);
 #$Gimp::verbose = 1;
 
 N_"/Xtns/Render"; N_"/Xtns/Render/Logos"; # i18n workaround
diff --git a/examples/layerfuncs b/examples/layerfuncs
index f1ea856..11c494f 100755
--- a/examples/layerfuncs
+++ b/examples/layerfuncs
@@ -2,7 +2,6 @@
 
 use Gimp;
 use Gimp::Fu;
-# Gimp::set_trace(TRACE_ALL);
 
 podregister {
   die "Must have layer selected\n" unless $drawable->is_layer;
diff --git a/examples/map_to_gradient b/examples/map_to_gradient
index 091269c..4643b8b 100755
--- a/examples/map_to_gradient
+++ b/examples/map_to_gradient
@@ -3,6 +3,7 @@
 use Gimp;
 use Gimp::Fu;
 use PDL::LiteF;
+#BEGIN { $Gimp::verbose = 3; }
 
 # convert to greyscale. could be improved, but should still be fast!
 sub togrey {
diff --git a/examples/mirrorsplit b/examples/mirrorsplit
index 21765f8..f8c4484 100755
--- a/examples/mirrorsplit
+++ b/examples/mirrorsplit
@@ -4,7 +4,6 @@ use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 use Gimp::Util;
 use strict;
-#Gimp::set_trace(TRACE_ALL);
 
 podregister {
   my $w = $drawable->width();
diff --git a/examples/perlotine b/examples/perlotine
index b181dfe..a16d937 100755
--- a/examples/perlotine
+++ b/examples/perlotine
@@ -6,7 +6,6 @@ use Gimp::Fu;
 use Gimp::Util;
 
 #$Gimp::verbose = 1;
-# Gimp::set_trace(TRACE_ALL);
 
 sub get_guides {
   my $image = shift;
diff --git a/examples/prep4gif b/examples/prep4gif
index c81f680..fcb95f4 100755
--- a/examples/prep4gif
+++ b/examples/prep4gif
@@ -3,8 +3,6 @@
 use Gimp qw(:auto N_ __);
 use Gimp::Fu;
 
-# Gimp::set_trace(TRACE_ALL);
-
 podregister {
   my $out = $image->duplicate; # only work on duplicate
   my @layers = gimp_image_get_layers($out);
diff --git a/examples/randomblends b/examples/randomblends
index 39a5a77..d2dcc83 100755
--- a/examples/randomblends
+++ b/examples/randomblends
@@ -4,8 +4,6 @@ use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 use Gimp::Util;
 
-# Gimp::set_trace(TRACE_ALL);
-
 sub randint {
     my ($int) = @_;
     return int(rand()*$int +0.5);
diff --git a/examples/repdup b/examples/repdup
index 059843d..1d61a34 100755
--- a/examples/repdup
+++ b/examples/repdup
@@ -3,8 +3,6 @@
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 
-#Gimp::set_trace(TRACE_ALL);
-
 podregister {
   $image->undo_group_start;
   my @b = gimp_selection_bounds($image);
diff --git a/examples/roundsel b/examples/roundsel
index c9cb059..d2fab10 100755
--- a/examples/roundsel
+++ b/examples/roundsel
@@ -6,8 +6,6 @@ use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 use Gimp::Util;
 
-# Gimp::set_trace(TRACE_ALL);
-
 podregister {
   my($image,$drawable,$round) = @_;
   $image->undo_group_start;
diff --git a/examples/selective_sharpen b/examples/selective_sharpen
index f6075b7..dd44978 100755
--- a/examples/selective_sharpen
+++ b/examples/selective_sharpen
@@ -4,8 +4,6 @@ use Gimp;
 use Gimp::Fu;
 use strict;
 
-# Gimp::set_trace(TRACE_ALL);
-
 podregister {
   # sanity stuff
   die "Can only operate on layers" unless $drawable->is_layer;
diff --git a/examples/sethspin b/examples/sethspin
index 515e2f6..0fff41e 100755
--- a/examples/sethspin
+++ b/examples/sethspin
@@ -7,8 +7,6 @@ use Gimp::Util;
 use List::Util qw(max);
 use strict;
 
-#Gimp::set_trace(TRACE_ALL);
-
 sub saw {  # a sawtooth function on PI
   my ($val) = @_;
   if ($val < PI/2.0) {
diff --git a/examples/stampify b/examples/stampify
index e686e27..94ec940 100755
--- a/examples/stampify
+++ b/examples/stampify
@@ -3,8 +3,6 @@
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 
-#Gimp::set_trace(TRACE_ALL);
-
 podregister {
   $nw = int(gimp_image_width($image) + 2 * $marg + $diameter);
   $nh = int(gimp_image_height($image) + 2 * $marg + $diameter);
diff --git a/examples/translogo b/examples/translogo
index f449e5e..5e69bc9 100755
--- a/examples/translogo
+++ b/examples/translogo
@@ -3,7 +3,6 @@
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 use Gimp::Util;
-#Gimp::set_trace(TRACE_CALL);
 
 podregister {
   Gimp::Context->push();
diff --git a/examples/warp-sharp b/examples/warp-sharp
index fc7f13f..9ef4995 100755
--- a/examples/warp-sharp
+++ b/examples/warp-sharp
@@ -21,7 +21,6 @@ podregister {
   my $bump_yoff;
   my $version=1;
 
-#    Gimp::set_trace(TRACE_ALL);
   $image->undo_group_start;
   if ($has_selection) {
       $old_selection=$image->selection_save;
diff --git a/examples/webify b/examples/webify
index b8bbe06..e9b8725 100755
--- a/examples/webify
+++ b/examples/webify
@@ -3,8 +3,6 @@
 use Gimp;
 use Gimp::Fu;
 
-#Gimp::set_trace(TRACE_ALL);
-
 podregister {
   $thresh /= 255;
   $image = $image->duplicate if $new;
diff --git a/examples/windify b/examples/windify
index 2d59fc8..a6271c9 100755
--- a/examples/windify
+++ b/examples/windify
@@ -3,8 +3,6 @@
 use Gimp;
 use Gimp::Fu;
 
-#Gimp::set_trace(TRACE_CALL);
-
 podregister {
   Gimp::Context->push();
   my $xsize = $drawable->width;
diff --git a/examples/yinyang b/examples/yinyang
index d697d18..1a3a165 100755
--- a/examples/yinyang
+++ b/examples/yinyang
@@ -3,7 +3,6 @@
 use Gimp;
 use Gimp::Fu;
 #$Gimp::verbose = 1;
-#Gimp::set_trace(TRACE_ALL);
 
 my @BUCKET_ARGS = (FG_BUCKET_FILL,NORMAL_MODE,100,0,0,0,0);
 
diff --git a/t/extension.t b/t/extension.t
index 2b1b927..92f4686 100644
--- a/t/extension.t
+++ b/t/extension.t
@@ -57,7 +57,6 @@ Same terms as Gimp-Perl.
 EOF
 }
 use Gimp "net_init=spawn/";
-#Gimp::set_trace(TRACE_ALL);
 
 is(Gimp::Plugin->extension_test(Gimp::RUN_NONINTERACTIVE, 7), 8, 'return val');
 
diff --git a/t/import.t b/t/import.t
index a75bc59..8b955a6 100644
--- a/t/import.t
+++ b/t/import.t
@@ -7,7 +7,6 @@ BEGIN {
   require 't/gimpsetup.pl';
 }
 use Gimp qw(:DEFAULT net_init=spawn/);
-#Gimp::set_trace(TRACE_ALL);
 
 eval { Image->new(10,10,RGB); };
 ok($@, 'polluting version should fail');
diff --git a/t/load.t b/t/load.t
index b4b5963..731647f 100644
--- a/t/load.t
+++ b/t/load.t
@@ -8,7 +8,6 @@ BEGIN {
   require 't/gimpsetup.pl';
 }
 BEGIN { use_ok('Gimp', qw(:consts canonicalise_color net_init=spawn/)); }
-#Gimp::set_trace(TRACE_ALL);
 
 my %CONST_DATA = (
   'ADD_COPY_MASK' => 5,
diff --git a/t/netplugin.t b/t/netplugin.t
index 54cac95..0a985b7 100644
--- a/t/netplugin.t
+++ b/t/netplugin.t
@@ -24,7 +24,6 @@ use Gimp::Fu qw(save_image);
 use IPC::Open3;
 use Symbol 'gensym';
 use IO::Select; # needed because output can be big and it can block!
-#Gimp::set_trace(TRACE_ALL);
 
 our (@testbench, %proc2file, %file2procs);
 require 't/examples-api.pl';
diff --git a/t/pdl.t b/t/pdl.t
index ee3c078..ebde84c 100644
--- a/t/pdl.t
+++ b/t/pdl.t
@@ -104,7 +104,6 @@ exit main;
 EOF
 }
 use Gimp qw(:DEFAULT net_init=spawn/);
-#Gimp::set_trace(TRACE_ALL);
 
 ok((my $i = Gimp::Image->new(10,10,RGB)), 'new image');
 ok(
diff --git a/t/perlplugin.t b/t/perlplugin.t
index 58e20cb..36d044e 100644
--- a/t/perlplugin.t
+++ b/t/perlplugin.t
@@ -168,7 +168,6 @@ exit main;
 EOF
 }
 use Gimp qw(:DEFAULT net_init=spawn/);
-#Gimp::set_trace(TRACE_ALL);
 
 ok((my $i = Gimp::Image->new(10,10,RGB)), 'new image');
 ok(
diff --git a/t/run.t b/t/run.t
index 39dde61..7caad80 100644
--- a/t/run.t
+++ b/t/run.t
@@ -8,7 +8,6 @@ BEGIN {
   require 't/gimpsetup.pl';
 }
 use Gimp qw(:DEFAULT net_init=spawn/);
-#Gimp::set_trace(TRACE_ALL);
 
 ok((my $i = new Gimp::Image(10,10,RGB)), 'OO Syntax for new image');
 ok(
diff --git a/t/supplied.t b/t/supplied.t
index 9561deb..8508a52 100644
--- a/t/supplied.t
+++ b/t/supplied.t
@@ -23,7 +23,6 @@ BEGIN {
     );
 }
 use Gimp qw(:consts), "net_init=spawn/";
-#Gimp::set_trace(TRACE_ALL);
 
 our @testbench;
 require 't/examples-api.pl';



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]