[gimp] plug-ins: port all plug-ins to the new macros



commit 4cb4b3ef3af31b6e70cbc56f7d27f973579b6ad7
Author: Michael Natterer <mitch gimp org>
Date:   Tue Aug 20 01:03:38 2019 +0200

    plug-ins: port all plug-ins to the new macros

 plug-ins/common/colormap-remap.c             |  8 +++---
 plug-ins/common/file-compressor.c            |  3 +-
 plug-ins/common/file-desktop-link.c          | 23 ++++++---------
 plug-ins/common/file-gbr.c                   |  7 ++---
 plug-ins/common/file-gif-load.c              | 11 +++-----
 plug-ins/common/file-gih.c                   | 26 ++++++++---------
 plug-ins/common/file-pat.c                   |  5 ++--
 plug-ins/common/file-png.c                   | 21 +++++++-------
 plug-ins/common/file-ps.c                    | 42 ++++++++++++++--------------
 plug-ins/common/file-svg.c                   | 19 ++++++-------
 plug-ins/common/film.c                       | 23 +++++++--------
 plug-ins/common/mail.c                       | 15 ++++------
 plug-ins/common/plugin-browser.c             | 17 ++++++-----
 plug-ins/common/procedure-browser.c          |  4 +--
 plug-ins/file-exr/file-exr.c                 |  3 +-
 plug-ins/file-ico/ico.c                      |  9 +++---
 plug-ins/file-psd/psd.c                      |  9 +++---
 plug-ins/file-raw/file-darktable.c           | 13 ++++-----
 plug-ins/file-raw/file-rawtherapee.c         | 13 ++++-----
 plug-ins/file-sgi/sgi.c                      |  5 ++--
 plug-ins/file-tiff/file-tiff.c               |  8 ++----
 plug-ins/fractal-explorer/fractal-explorer.c | 40 +++++++++++++-------------
 plug-ins/help-browser/help-browser.c         | 15 +++++-----
 plug-ins/help/help.c                         | 39 ++++++++------------------
 plug-ins/pagecurl/pagecurl.c                 | 11 ++++----
 plug-ins/print/print.c                       |  2 +-
 plug-ins/screenshot/screenshot.c             | 17 ++++++-----
 plug-ins/script-fu/scheme-wrapper.c          | 39 +++++++++++---------------
 plug-ins/script-fu/script-fu-eval.c          |  4 +--
 plug-ins/script-fu/script-fu-scripts.c       |  2 +-
 plug-ins/script-fu/script-fu-server.c        |  8 +++---
 plug-ins/script-fu/script-fu.c               |  2 +-
 32 files changed, 200 insertions(+), 263 deletions(-)
---
diff --git a/plug-ins/common/colormap-remap.c b/plug-ins/common/colormap-remap.c
index f0336df9e8..12b198de98 100644
--- a/plug-ins/common/colormap-remap.c
+++ b/plug-ins/common/colormap-remap.c
@@ -223,8 +223,8 @@ remap_run (GimpProcedure        *procedure,
 
       g_free (gimp_image_get_colormap (image_id, &n_cols));
 
-      n_col_args = g_value_get_int            (gimp_value_array_index (args, 0));
-      col_args   = gimp_value_get_uint8_array (gimp_value_array_index (args, 1));
+      n_col_args = GIMP_VALUES_GET_INT        (args, 0);
+      col_args   = GIMP_VALUES_GET_UINT8_ARRAY (args, 1);
 
       switch (run_mode)
         {
@@ -264,8 +264,8 @@ remap_run (GimpProcedure        *procedure,
   else if (strcmp (gimp_procedure_get_name (procedure),
                    PLUG_IN_PROC_SWAP) == 0)
     {
-      guchar index1 = g_value_get_uchar (gimp_value_array_index (args, 0));
-      guchar index2 = g_value_get_uchar (gimp_value_array_index (args, 1));
+      guchar index1 = GIMP_VALUES_GET_UCHAR (args, 0);
+      guchar index2 = GIMP_VALUES_GET_UCHAR (args, 1);
       guchar tmp;
       gint   n_cols;
 
diff --git a/plug-ins/common/file-compressor.c b/plug-ins/common/file-compressor.c
index 2b129622b1..79f188396f 100644
--- a/plug-ins/common/file-compressor.c
+++ b/plug-ins/common/file-compressor.c
@@ -387,8 +387,7 @@ compressor_load (GimpProcedure        *procedure,
   return_vals = gimp_procedure_new_return_values (procedure, status, error);
 
   if (image_ID != -1 && status == GIMP_PDB_SUCCESS)
-    gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                             image_ID);
+    GIMP_VALUES_SET_IMAGE (return_vals, 1, image_ID);
 
   return return_vals;
 }
diff --git a/plug-ins/common/file-desktop-link.c b/plug-ins/common/file-desktop-link.c
index dcf2d588b2..104091df0b 100644
--- a/plug-ins/common/file-desktop-link.c
+++ b/plug-ins/common/file-desktop-link.c
@@ -141,21 +141,16 @@ desktop_load (GimpProcedure        *procedure,
 
   image_ID = load_image (file, run_mode, &error);
 
-  if (image_ID != -1)
-    {
-      return_values = gimp_procedure_new_return_values (procedure,
-                                                        GIMP_PDB_SUCCESS,
-                                                        NULL);
+  if (image_ID < 1)
+    return gimp_procedure_new_return_values (procedure,
+                                             GIMP_PDB_EXECUTION_ERROR,
+                                             error);
 
-      gimp_value_set_image_id (gimp_value_array_index (return_values, 1),
-                               image_ID);
-    }
-  else
-    {
-      return_values = gimp_procedure_new_return_values (procedure,
-                                                        GIMP_PDB_EXECUTION_ERROR,
-                                                        error);
-    }
+  return_values = gimp_procedure_new_return_values (procedure,
+                                                    GIMP_PDB_SUCCESS,
+                                                    NULL);
+
+  GIMP_VALUES_SET_IMAGE (return_values, 1, image_ID);
 
   return return_values;
 }
diff --git a/plug-ins/common/file-gbr.c b/plug-ins/common/file-gbr.c
index 03c5f9d84b..a6bbb5a50a 100644
--- a/plug-ins/common/file-gbr.c
+++ b/plug-ins/common/file-gbr.c
@@ -250,9 +250,9 @@ gbr_save (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      info.spacing = g_value_get_int (gimp_value_array_index (args, 0));
+      info.spacing = GIMP_VALUES_GET_INT (args, 0);
       g_strlcpy (info.description,
-                 g_value_get_string (gimp_value_array_index (args, 1)),
+                 GIMP_VALUES_GET_STRING (args, 1),
                  sizeof (info.description));
       break;
 
@@ -279,8 +279,7 @@ gbr_save (GimpProcedure        *procedure,
 
       g_free (uri);
 
-      if (g_value_get_enum (gimp_value_array_index (save_retvals, 0)) ==
-          GIMP_PDB_SUCCESS)
+      if (GIMP_VALUES_GET_ENUM (save_retvals, 0) == GIMP_PDB_SUCCESS)
         {
           gimp_set_data (SAVE_PROC, &info, sizeof (info));
         }
diff --git a/plug-ins/common/file-gif-load.c b/plug-ins/common/file-gif-load.c
index 4d5e092202..a1e29f3c81 100644
--- a/plug-ins/common/file-gif-load.c
+++ b/plug-ins/common/file-gif-load.c
@@ -263,8 +263,7 @@ gif_load (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                           image_id);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
   return return_vals;
 }
@@ -298,11 +297,9 @@ gif_load_thumb (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1), image_id);
-  g_value_set_int         (gimp_value_array_index (return_vals, 2),
-                           gimp_image_width (image_id));
-  g_value_set_int         (gimp_value_array_index (return_vals, 3),
-                           gimp_image_height (image_id));
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
+  GIMP_VALUES_SET_INT   (return_vals, 2, gimp_image_width  (image_id));
+  GIMP_VALUES_SET_INT   (return_vals, 3, gimp_image_height (image_id));
 
   gimp_value_array_truncate (return_vals, 4);
 
diff --git a/plug-ins/common/file-gih.c b/plug-ins/common/file-gih.c
index 8c66f65b77..e15c53b797 100644
--- a/plug-ins/common/file-gih.c
+++ b/plug-ins/common/file-gih.c
@@ -372,29 +372,26 @@ gih_save (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      info.spacing = g_value_get_int (gimp_value_array_index (args, 0));
+      info.spacing = GIMP_VALUES_GET_INT (args, 0);
       g_strlcpy (info.description,
-                 g_value_get_string (gimp_value_array_index (args, 1)),
+                 GIMP_VALUES_GET_STRING (args, 1),
                  sizeof (info.description));
 
-      gihparams.cellwidth  = g_value_get_int (gimp_value_array_index (args, 2));
-      gihparams.cellheight = g_value_get_int (gimp_value_array_index (args, 3));
-      gihparams.cols       = g_value_get_int (gimp_value_array_index (args, 4));
-      gihparams.rows       = g_value_get_int (gimp_value_array_index (args, 5));
-      gihparams.dim        = g_value_get_int (gimp_value_array_index (args, 6));
+      gihparams.cellwidth  = GIMP_VALUES_GET_INT (args, 2);
+      gihparams.cellheight = GIMP_VALUES_GET_INT (args, 3);
+      gihparams.cols       = GIMP_VALUES_GET_INT (args, 4);
+      gihparams.rows       = GIMP_VALUES_GET_INT (args, 5);
+      gihparams.dim        = GIMP_VALUES_GET_INT (args, 6);
       gihparams.ncells     = 1;
 
-      if (g_value_get_int (gimp_value_array_index (args, 8)) != gihparams.dim)
+      if (GIMP_VALUES_GET_INT (args, 8) != gihparams.dim)
         {
           status = GIMP_PDB_CALLING_ERROR;
         }
       else
         {
-          const guint8 *rank =
-            gimp_value_get_uint8_array (gimp_value_array_index (args, 7));
-
-          const gchar **sel =
-            gimp_value_get_string_array (gimp_value_array_index (args, 9));
+          const guint8  *rank = GIMP_VALUES_GET_UINT8_ARRAY  (args, 7);
+          const gchar  **sel  = GIMP_VALUES_GET_STRING_ARRAY (args, 9);
 
           for (i = 0; i < gihparams.dim; i++)
             {
@@ -441,8 +438,7 @@ gih_save (GimpProcedure        *procedure,
 
       g_free (uri);
 
-      if (g_value_get_enum (gimp_value_array_index (save_retvals, 0)) ==
-          GIMP_PDB_SUCCESS)
+      if (GIMP_VALUES_GET_ENUM (save_retvals, 0) == GIMP_PDB_SUCCESS)
         {
           gimp_set_data (SAVE_PROC, &info, sizeof (info));
 
diff --git a/plug-ins/common/file-pat.c b/plug-ins/common/file-pat.c
index 97caf64194..fa1184c5fc 100644
--- a/plug-ins/common/file-pat.c
+++ b/plug-ins/common/file-pat.c
@@ -216,7 +216,7 @@ pat_save (GimpProcedure        *procedure,
 
     case GIMP_RUN_NONINTERACTIVE:
       g_strlcpy (description,
-                 g_value_get_string (gimp_value_array_index (args, 0)),
+                 GIMP_VALUES_GET_STRING (args, 0),
                  sizeof (description));
       break;
 
@@ -242,8 +242,7 @@ pat_save (GimpProcedure        *procedure,
 
       g_free (uri);
 
-      if (g_value_get_enum (gimp_value_array_index (save_retvals, 0)) ==
-          GIMP_PDB_SUCCESS)
+      if (GIMP_VALUES_GET_ENUM (save_retvals, 0) == GIMP_PDB_SUCCESS)
         {
           gimp_set_data (SAVE_PROC, description, sizeof (description));
         }
diff --git a/plug-ins/common/file-png.c b/plug-ins/common/file-png.c
index 71877d9b91..44515887d5 100644
--- a/plug-ins/common/file-png.c
+++ b/plug-ins/common/file-png.c
@@ -449,8 +449,7 @@ png_load (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                           image_id);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
   return return_vals;
 }
@@ -539,15 +538,15 @@ png_save (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      pngvals.interlaced         = g_value_get_boolean (gimp_value_array_index (args, 0));
-      pngvals.compression_level  = g_value_get_int     (gimp_value_array_index (args, 1));
-      pngvals.bkgd               = g_value_get_boolean (gimp_value_array_index (args, 2));
-      pngvals.gama               = g_value_get_boolean (gimp_value_array_index (args, 3));
-      pngvals.offs               = g_value_get_boolean (gimp_value_array_index (args, 4));
-      pngvals.phys               = g_value_get_boolean (gimp_value_array_index (args, 5));
-      pngvals.time               = g_value_get_boolean (gimp_value_array_index (args, 6));
-      pngvals.comment            = g_value_get_boolean (gimp_value_array_index (args, 7));
-      pngvals.save_transp_pixels = g_value_get_boolean (gimp_value_array_index (args, 8));
+      pngvals.interlaced         = GIMP_VALUES_GET_BOOLEAN (args, 0);
+      pngvals.compression_level  = GIMP_VALUES_GET_INT     (args, 1);
+      pngvals.bkgd               = GIMP_VALUES_GET_BOOLEAN (args, 2);
+      pngvals.gama               = GIMP_VALUES_GET_BOOLEAN (args, 3);
+      pngvals.offs               = GIMP_VALUES_GET_BOOLEAN (args, 4);
+      pngvals.phys               = GIMP_VALUES_GET_BOOLEAN (args, 5);
+      pngvals.time               = GIMP_VALUES_GET_BOOLEAN (args, 6);
+      pngvals.comment            = GIMP_VALUES_GET_BOOLEAN (args, 7);
+      pngvals.save_transp_pixels = GIMP_VALUES_GET_BOOLEAN (args, 8);
       break;
 
     case GIMP_RUN_WITH_LAST_VALS:
diff --git a/plug-ins/common/file-ps.c b/plug-ins/common/file-ps.c
index fdc5bae65e..4a1aa5e3c3 100644
--- a/plug-ins/common/file-ps.c
+++ b/plug-ins/common/file-ps.c
@@ -624,19 +624,19 @@ ps_load (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      plvals.resolution = g_value_get_int     (gimp_value_array_index (args, 0));
-      plvals.width      = g_value_get_int     (gimp_value_array_index (args, 1));
-      plvals.height     = g_value_get_int     (gimp_value_array_index (args, 2));
-      plvals.use_bbox   = g_value_get_boolean (gimp_value_array_index (args, 3));
-      if (g_value_get_string (gimp_value_array_index (args, 4)))
+      plvals.resolution = GIMP_VALUES_GET_INT     (args, 0);
+      plvals.width      = GIMP_VALUES_GET_INT     (args, 1);
+      plvals.height     = GIMP_VALUES_GET_INT     (args, 2);
+      plvals.use_bbox   = GIMP_VALUES_GET_BOOLEAN (args, 3);
+      if (GIMP_VALUES_GET_STRING (args, 4))
         g_strlcpy (plvals.pages,
-                   g_value_get_string (gimp_value_array_index (args, 4)),
+                   GIMP_VALUES_GET_STRING (args, 4),
                    sizeof (plvals.pages));
       else
         plvals.pages[0] = '\0';
-      plvals.pnm_type      = g_value_get_int (gimp_value_array_index (args, 5));
-      plvals.textalpha     = g_value_get_int (gimp_value_array_index (args, 6));
-      plvals.graphicsalpha = g_value_get_int (gimp_value_array_index (args, 7));
+      plvals.pnm_type      = GIMP_VALUES_GET_INT (args, 5);
+      plvals.textalpha     = GIMP_VALUES_GET_INT (args, 6);
+      plvals.graphicsalpha = GIMP_VALUES_GET_INT (args, 7);
       break;
 
     case GIMP_RUN_WITH_LAST_VALS:
@@ -664,7 +664,7 @@ ps_load (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1), image_id);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
   return return_vals;
 }
@@ -705,7 +705,7 @@ ps_load_thumb (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1), image_id);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
   gimp_value_array_truncate (return_vals, 2);
 
@@ -767,17 +767,17 @@ ps_save (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      psvals.width        = g_value_get_double  (gimp_value_array_index (args, 0));
-      psvals.height       = g_value_get_double  (gimp_value_array_index (args, 1));
-      psvals.x_offset     = g_value_get_double  (gimp_value_array_index (args, 2));
-      psvals.y_offset     = g_value_get_double  (gimp_value_array_index (args, 3));
-      psvals.unit_mm      = g_value_get_int     (gimp_value_array_index (args, 4));
-      psvals.keep_ratio   = g_value_get_boolean (gimp_value_array_index (args, 5));
-      psvals.rotate       = g_value_get_int     (gimp_value_array_index (args, 6));
-      psvals.eps          = g_value_get_int     (gimp_value_array_index (args, 7));
-      psvals.preview_size = g_value_get_int     (gimp_value_array_index (args, 8));
+      psvals.width        = GIMP_VALUES_GET_DOUBLE  (args, 0);
+      psvals.height       = GIMP_VALUES_GET_DOUBLE  (args, 1);
+      psvals.x_offset     = GIMP_VALUES_GET_DOUBLE  (args, 2);
+      psvals.y_offset     = GIMP_VALUES_GET_DOUBLE  (args, 3);
+      psvals.unit_mm      = GIMP_VALUES_GET_INT     (args, 4);
+      psvals.keep_ratio   = GIMP_VALUES_GET_BOOLEAN (args, 5);
+      psvals.rotate       = GIMP_VALUES_GET_INT     (args, 6);
+      psvals.eps          = GIMP_VALUES_GET_INT     (args, 7);
+      psvals.preview_size = GIMP_VALUES_GET_INT     (args, 8);
       psvals.preview      = psvals.preview_size != 0;
-      psvals.level        = g_value_get_int     (gimp_value_array_index (args, 9));
+      psvals.level        = GIMP_VALUES_GET_INT     (args, 9);
       break;
 
     case GIMP_RUN_WITH_LAST_VALS:
diff --git a/plug-ins/common/file-svg.c b/plug-ins/common/file-svg.c
index a7c372ca31..ef80ec51cf 100644
--- a/plug-ins/common/file-svg.c
+++ b/plug-ins/common/file-svg.c
@@ -242,11 +242,11 @@ svg_load (GimpProcedure        *procedure,
   switch (run_mode)
     {
     case GIMP_RUN_NONINTERACTIVE:
-      load_vals.resolution = g_value_get_double (gimp_value_array_index (args, 0));
-      load_vals.width      = g_value_get_int (gimp_value_array_index (args, 1));
-      load_vals.height     = g_value_get_int (gimp_value_array_index (args, 2));
-      load_vals.import     = g_value_get_int (gimp_value_array_index (args, 3)) != FALSE;
-      load_vals.merge      = g_value_get_int (gimp_value_array_index (args, 3)) == 2;
+      load_vals.resolution = GIMP_VALUES_GET_DOUBLE (args, 0);
+      load_vals.width      = GIMP_VALUES_GET_INT    (args, 1);
+      load_vals.height     = GIMP_VALUES_GET_INT    (args, 2);
+      load_vals.import     = GIMP_VALUES_GET_INT    (args, 3) != FALSE;
+      load_vals.merge      = GIMP_VALUES_GET_INT    (args, 3) == 2;
       break;
 
     case GIMP_RUN_INTERACTIVE:
@@ -289,8 +289,7 @@ svg_load (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                           image_id);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
   return return_vals;
 }
@@ -334,9 +333,9 @@ svg_load_thumb (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1), image_id);
-  g_value_set_int         (gimp_value_array_index (return_vals, 2), width);
-  g_value_set_int         (gimp_value_array_index (return_vals, 3), height);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
+  GIMP_VALUES_SET_INT   (return_vals, 2, width);
+  GIMP_VALUES_SET_INT   (return_vals, 3, height);
 
   gimp_value_array_truncate (return_vals, 4);
 
diff --git a/plug-ins/common/film.c b/plug-ins/common/film.c
index d4ee1949e3..e6cb9dfee4 100644
--- a/plug-ins/common/film.c
+++ b/plug-ins/common/film.c
@@ -327,7 +327,7 @@ film_run (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      filmvals.film_height = g_value_get_int (gimp_value_array_index (args, 0));
+      filmvals.film_height = GIMP_VALUES_GET_INT (args, 0);
       if (filmvals.film_height <= 0)
         {
           filmvals.keep_height = TRUE;
@@ -337,19 +337,17 @@ film_run (GimpProcedure        *procedure,
         {
           filmvals.keep_height = FALSE;
         }
-      gimp_value_get_rgb (gimp_value_array_index (args, 1),
-                          &filmvals.film_color);
-      filmvals.number_start = g_value_get_int (gimp_value_array_index (args, 2));
+      GIMP_VALUES_GET_RGB (args, 1, &filmvals.film_color);
+      filmvals.number_start = GIMP_VALUES_GET_INT (args, 2);
       g_strlcpy (filmvals.number_font,
-                 g_value_get_string (gimp_value_array_index (args, 3)),
+                 GIMP_VALUES_GET_STRING (args, 3),
                  FONT_LEN);
-      gimp_value_get_rgb (gimp_value_array_index (args, 4),
-                          &filmvals.number_color);
-      filmvals.number_pos[0] = g_value_get_int (gimp_value_array_index (args, 5));
-      filmvals.number_pos[1] = g_value_get_int (gimp_value_array_index (args, 6));
-      filmvals.num_images    = g_value_get_int (gimp_value_array_index (args, 7));
+      GIMP_VALUES_GET_RGB (args, 4, &filmvals.number_color);
+      filmvals.number_pos[0] = GIMP_VALUES_GET_INT (args, 5);
+      filmvals.number_pos[1] = GIMP_VALUES_GET_INT (args, 6);
+      filmvals.num_images    = GIMP_VALUES_GET_INT (args, 7);
       memcpy (filmvals.image,
-              gimp_value_get_int32_array (gimp_value_array_index (args, 8)),
+              GIMP_VALUES_GET_INT32_ARRAY (args, 8),
               filmvals.num_images * sizeof (gint32));
       break;
 
@@ -382,8 +380,7 @@ film_run (GimpProcedure        *procedure,
           return_vals = gimp_procedure_new_return_values (procedure, status,
                                                           NULL);
 
-          gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                                   image_id);
+          GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
           gimp_image_undo_enable (image_id);
           gimp_image_clean_all (image_id);
diff --git a/plug-ins/common/mail.c b/plug-ins/common/mail.c
index 43441f3ed0..f05c07f25b 100644
--- a/plug-ins/common/mail.c
+++ b/plug-ins/common/mail.c
@@ -283,20 +283,15 @@ mail_run (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      g_strlcpy (mail_info.filename,
-                 g_value_get_string (gimp_value_array_index (args, 0)),
+      g_strlcpy (mail_info.filename, GIMP_VALUES_GET_STRING (args, 0),
                  BUFFER_SIZE);
-      g_strlcpy (mail_info.receipt,
-                 g_value_get_string (gimp_value_array_index (args, 1)),
+      g_strlcpy (mail_info.receipt,  GIMP_VALUES_GET_STRING (args, 1),
                  BUFFER_SIZE);
-      g_strlcpy (mail_info.from,
-                 g_value_get_string (gimp_value_array_index (args, 2)),
+      g_strlcpy (mail_info.from,     GIMP_VALUES_GET_STRING (args, 2),
                  BUFFER_SIZE);
-      g_strlcpy (mail_info.subject,
-                 g_value_get_string (gimp_value_array_index (args, 3)),
+      g_strlcpy (mail_info.subject,  GIMP_VALUES_GET_STRING (args, 3),
                  BUFFER_SIZE);
-      g_strlcpy (mail_info.comment,
-                 g_value_get_string (gimp_value_array_index (args, 4)),
+      g_strlcpy (mail_info.comment,  GIMP_VALUES_GET_STRING (args, 4),
                  BUFFER_SIZE);
       break;
 
diff --git a/plug-ins/common/plugin-browser.c b/plug-ins/common/plugin-browser.c
index 0ff6bd6b1c..18cf1ab5b1 100644
--- a/plug-ins/common/plugin-browser.c
+++ b/plug-ins/common/plugin-browser.c
@@ -394,10 +394,9 @@ browser_search (GimpBrowser   *gimp_browser,
                                         G_TYPE_STRING, search_text,
                                         G_TYPE_NONE);
 
-  if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) ==
-      GIMP_PDB_SUCCESS)
+  if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
     {
-      num_plugins = g_value_get_int (gimp_value_array_index (return_vals, 1));
+      num_plugins = GIMP_VALUES_GET_INT (return_vals, 1);
     }
 
   if (! search_text || strlen (search_text) == 0)
@@ -442,12 +441,12 @@ browser_search (GimpBrowser   *gimp_browser,
       const gint        *time_ints;
       gint               i;
 
-      menu_strs     = gimp_value_get_string_array (gimp_value_array_index (return_vals, 2));
-      accel_strs    = gimp_value_get_string_array (gimp_value_array_index (return_vals, 4));
-      prog_strs     = gimp_value_get_string_array (gimp_value_array_index (return_vals, 6));
-      types_strs    = gimp_value_get_string_array (gimp_value_array_index (return_vals, 8));
-      time_ints     = gimp_value_get_int32_array (gimp_value_array_index (return_vals, 10));
-      realname_strs = gimp_value_get_string_array (gimp_value_array_index (return_vals, 12));
+      menu_strs     = GIMP_VALUES_GET_STRING_ARRAY (return_vals, 2);
+      accel_strs    = GIMP_VALUES_GET_STRING_ARRAY (return_vals, 4);
+      prog_strs     = GIMP_VALUES_GET_STRING_ARRAY (return_vals, 6);
+      types_strs    = GIMP_VALUES_GET_STRING_ARRAY (return_vals, 8);
+      time_ints     = GIMP_VALUES_GET_INT32_ARRAY  (return_vals, 10);
+      realname_strs = GIMP_VALUES_GET_STRING_ARRAY (return_vals, 12);
 
       for (i = 0; i < num_plugins; i++)
         {
diff --git a/plug-ins/common/procedure-browser.c b/plug-ins/common/procedure-browser.c
index a4cc8d27f6..3ec8537d21 100644
--- a/plug-ins/common/procedure-browser.c
+++ b/plug-ins/common/procedure-browser.c
@@ -148,9 +148,7 @@ browser_run (GimpProcedure        *procedure,
              const GimpValueArray *args,
              gpointer              run_data)
 {
-  GimpRunMode run_mode;
-
-  run_mode = g_value_get_enum (gimp_value_array_index (args, 0));
+  GimpRunMode run_mode = GIMP_VALUES_GET_ENUM (args, 0);
 
   INIT_I18N ();
 
diff --git a/plug-ins/file-exr/file-exr.c b/plug-ins/file-exr/file-exr.c
index 4896da3345..326eb733d8 100644
--- a/plug-ins/file-exr/file-exr.c
+++ b/plug-ins/file-exr/file-exr.c
@@ -151,8 +151,7 @@ exr_load (GimpProcedure        *procedure,
                                                    GIMP_PDB_SUCCESS,
                                                    NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                           image_ID);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_ID);
 
   return return_vals;
 }
diff --git a/plug-ins/file-ico/ico.c b/plug-ins/file-ico/ico.c
index 9fbe337df9..a6a5e7e18b 100644
--- a/plug-ins/file-ico/ico.c
+++ b/plug-ins/file-ico/ico.c
@@ -216,8 +216,7 @@ ico_load (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                           image_id);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
   return return_vals;
 }
@@ -255,9 +254,9 @@ ico_load_thumb (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1), image_id);
-  g_value_set_int         (gimp_value_array_index (return_vals, 2), width);
-  g_value_set_int         (gimp_value_array_index (return_vals, 3), height);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
+  GIMP_VALUES_SET_INT   (return_vals, 2, width);
+  GIMP_VALUES_SET_INT   (return_vals, 3, height);
 
   gimp_value_array_truncate (return_vals, 4);
 
diff --git a/plug-ins/file-psd/psd.c b/plug-ins/file-psd/psd.c
index 4fe230acd7..1f02a71e22 100644
--- a/plug-ins/file-psd/psd.c
+++ b/plug-ins/file-psd/psd.c
@@ -286,8 +286,7 @@ psd_load (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                           image_id);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
   return return_vals;
 }
@@ -322,9 +321,9 @@ psd_load_thumb (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1), image_id);
-  g_value_set_int         (gimp_value_array_index (return_vals, 2), width);
-  g_value_set_int         (gimp_value_array_index (return_vals, 3), height);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
+  GIMP_VALUES_SET_INT   (return_vals, 2, width);
+  GIMP_VALUES_SET_INT   (return_vals, 3, height);
 
   gimp_value_array_truncate (return_vals, 4);
 
diff --git a/plug-ins/file-raw/file-darktable.c b/plug-ins/file-raw/file-darktable.c
index 7a741043e5..814230e15a 100644
--- a/plug-ins/file-raw/file-darktable.c
+++ b/plug-ins/file-raw/file-darktable.c
@@ -326,8 +326,7 @@ darktable_load (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                           image_id);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
   return return_vals;
 }
@@ -362,11 +361,11 @@ darktable_load_thumb (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1), image_id);
-  g_value_set_int         (gimp_value_array_index (return_vals, 2), width);
-  g_value_set_int         (gimp_value_array_index (return_vals, 3), height);
-  g_value_set_enum        (gimp_value_array_index (return_vals, 4), GIMP_RGB_IMAGE);
-  g_value_set_int         (gimp_value_array_index (return_vals, 5), 1);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
+  GIMP_VALUES_SET_INT   (return_vals, 2, width);
+  GIMP_VALUES_SET_INT   (return_vals, 3, height);
+  GIMP_VALUES_SET_ENUM  (return_vals, 4, GIMP_RGB_IMAGE);
+  GIMP_VALUES_SET_INT   (return_vals, 5, 1);
 
   gimp_value_array_truncate (return_vals, 6);
 
diff --git a/plug-ins/file-raw/file-rawtherapee.c b/plug-ins/file-raw/file-rawtherapee.c
index 8006fa6eb4..980db59268 100644
--- a/plug-ins/file-raw/file-rawtherapee.c
+++ b/plug-ins/file-raw/file-rawtherapee.c
@@ -277,8 +277,7 @@ rawtherapee_load (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                           image_id);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
   return return_vals;
 }
@@ -308,11 +307,11 @@ rawtherapee_load_thumb (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1), image_id);
-  g_value_set_int         (gimp_value_array_index (return_vals, 2), 0);
-  g_value_set_int         (gimp_value_array_index (return_vals, 3), 0);
-  g_value_set_enum        (gimp_value_array_index (return_vals, 4), GIMP_RGB_IMAGE);
-  g_value_set_int         (gimp_value_array_index (return_vals, 5), 1);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
+  GIMP_VALUES_SET_INT   (return_vals, 2, 0);
+  GIMP_VALUES_SET_INT   (return_vals, 3, 0);
+  GIMP_VALUES_SET_ENUM  (return_vals, 4, GIMP_RGB_IMAGE);
+  GIMP_VALUES_SET_INT   (return_vals, 5, 1);
 
   gimp_value_array_truncate (return_vals, 6);
 
diff --git a/plug-ins/file-sgi/sgi.c b/plug-ins/file-sgi/sgi.c
index dc0d3d8d91..4f4b9a8461 100644
--- a/plug-ins/file-sgi/sgi.c
+++ b/plug-ins/file-sgi/sgi.c
@@ -221,8 +221,7 @@ sgi_load (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                           image_id);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image_id);
 
   return return_vals;
 }
@@ -275,7 +274,7 @@ sgi_save (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      compression = g_value_get_int (gimp_value_array_index (args, 0));
+      compression = GIMP_VALUES_GET_INT (args, 0);
       break;
 
     case GIMP_RUN_WITH_LAST_VALS:
diff --git a/plug-ins/file-tiff/file-tiff.c b/plug-ins/file-tiff/file-tiff.c
index d513085deb..40b6c1cfd0 100644
--- a/plug-ins/file-tiff/file-tiff.c
+++ b/plug-ins/file-tiff/file-tiff.c
@@ -278,8 +278,7 @@ tiff_load (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                           image);
+  GIMP_VALUES_SET_IMAGE (return_vals, 1, image);
 
   return return_vals;
 }
@@ -367,7 +366,7 @@ tiff_save (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      switch (g_value_get_int (gimp_value_array_index (args, 0)))
+      switch (GIMP_VALUES_GET_INT (args, 0))
         {
         case 0: tsvals.compression = COMPRESSION_NONE;          break;
         case 1: tsvals.compression = COMPRESSION_LZW;           break;
@@ -378,8 +377,7 @@ tiff_save (GimpProcedure        *procedure,
         case 6: tsvals.compression = COMPRESSION_CCITTFAX4;     break;
         }
 
-      tsvals.save_transp_pixels =
-        g_value_get_boolean (gimp_value_array_index (args, 1));
+      tsvals.save_transp_pixels = GIMP_VALUES_GET_BOOLEAN (args, 1);
       break;
 
     case GIMP_RUN_WITH_LAST_VALS:
diff --git a/plug-ins/fractal-explorer/fractal-explorer.c b/plug-ins/fractal-explorer/fractal-explorer.c
index 97f831e9e7..fbf8dc864c 100644
--- a/plug-ins/fractal-explorer/fractal-explorer.c
+++ b/plug-ins/fractal-explorer/fractal-explorer.c
@@ -384,8 +384,6 @@ explorer_run (GimpProcedure        *procedure,
   INIT_I18N ();
   gegl_init (NULL, NULL);
 
-  drawable_id = gimp_value_get_drawable_id (gimp_value_array_index (args, 2));
-
   if (! gimp_drawable_mask_intersect (drawable_id,
                                       &sel_x, &sel_y,
                                       &sel_width, &sel_height))
@@ -422,25 +420,25 @@ explorer_run (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      wvals.fractaltype  = g_value_get_int    (gimp_value_array_index (args, 0));
-      wvals.xmin         = g_value_get_double (gimp_value_array_index (args, 1));
-      wvals.xmax         = g_value_get_double (gimp_value_array_index (args, 2));
-      wvals.ymin         = g_value_get_double (gimp_value_array_index (args, 3));
-      wvals.ymax         = g_value_get_double (gimp_value_array_index (args, 4));
-      wvals.iter         = g_value_get_double (gimp_value_array_index (args, 5));
-      wvals.cx           = g_value_get_double (gimp_value_array_index (args, 6));
-      wvals.cy           = g_value_get_double (gimp_value_array_index (args, 7));
-      wvals.colormode    = g_value_get_int    (gimp_value_array_index (args, 8));
-      wvals.redstretch   = g_value_get_double (gimp_value_array_index (args, 9));
-      wvals.greenstretch = g_value_get_double (gimp_value_array_index (args, 10));
-      wvals.bluestretch  = g_value_get_double (gimp_value_array_index (args, 11));
-      wvals.redmode      = g_value_get_int    (gimp_value_array_index (args, 12));
-      wvals.greenmode    = g_value_get_int    (gimp_value_array_index (args, 13));
-      wvals.bluemode     = g_value_get_int    (gimp_value_array_index (args, 14));
-      wvals.redinvert    = g_value_get_int    (gimp_value_array_index (args, 15));
-      wvals.greeninvert  = g_value_get_int    (gimp_value_array_index (args, 16));
-      wvals.blueinvert   = g_value_get_int    (gimp_value_array_index (args, 17));
-      wvals.ncolors      = g_value_get_int    (gimp_value_array_index (args, 18));
+      wvals.fractaltype  = GIMP_VALUES_GET_INT    (args, 0);
+      wvals.xmin         = GIMP_VALUES_GET_DOUBLE (args, 1);
+      wvals.xmax         = GIMP_VALUES_GET_DOUBLE (args, 2);
+      wvals.ymin         = GIMP_VALUES_GET_DOUBLE (args, 4);
+      wvals.ymax         = GIMP_VALUES_GET_DOUBLE (args, 4);
+      wvals.iter         = GIMP_VALUES_GET_DOUBLE (args, 5);
+      wvals.cx           = GIMP_VALUES_GET_DOUBLE (args, 6);
+      wvals.cy           = GIMP_VALUES_GET_DOUBLE (args, 7);
+      wvals.colormode    = GIMP_VALUES_GET_INT    (args, 8);
+      wvals.redstretch   = GIMP_VALUES_GET_DOUBLE (args, 9);
+      wvals.greenstretch = GIMP_VALUES_GET_DOUBLE (args, 10);
+      wvals.bluestretch  = GIMP_VALUES_GET_DOUBLE (args, 11);
+      wvals.redmode      = GIMP_VALUES_GET_INT    (args, 12);
+      wvals.greenmode    = GIMP_VALUES_GET_INT    (args, 13);
+      wvals.bluemode     = GIMP_VALUES_GET_INT    (args, 14);
+      wvals.redinvert    = GIMP_VALUES_GET_INT    (args, 15);
+      wvals.greeninvert  = GIMP_VALUES_GET_INT    (args, 16);
+      wvals.blueinvert   = GIMP_VALUES_GET_INT    (args, 17);
+      wvals.ncolors      = GIMP_VALUES_GET_INT    (args, 18);
 
       make_color_map ();
       break;
diff --git a/plug-ins/help-browser/help-browser.c b/plug-ins/help-browser/help-browser.c
index 643b7cf2b0..8ded94cd2b 100644
--- a/plug-ins/help-browser/help-browser.c
+++ b/plug-ins/help-browser/help-browser.c
@@ -172,11 +172,10 @@ help_browser_run (GimpProcedure        *procedure,
 {
   INIT_I18N ();
 
-  if (! gimp_help_init
-          (g_value_get_int             (gimp_value_array_index (args, 1)),
-           gimp_value_get_string_array (gimp_value_array_index (args, 2)),
-           g_value_get_int             (gimp_value_array_index (args, 3)),
-           gimp_value_get_string_array (gimp_value_array_index (args, 4))))
+  if (! gimp_help_init (GIMP_VALUES_GET_INT          (args, 1),
+                        GIMP_VALUES_GET_STRING_ARRAY (args, 2),
+                        GIMP_VALUES_GET_INT          (args, 3),
+                        GIMP_VALUES_GET_STRING_ARRAY (args, 4)))
     {
       return gimp_procedure_new_return_values (procedure,
                                                GIMP_PDB_CALLING_ERROR,
@@ -248,15 +247,15 @@ temp_proc_run (GimpProcedure        *procedure,
   const gchar *help_id      = GIMP_HELP_DEFAULT_ID;
   const gchar *string;
 
-  string = g_value_get_string (gimp_value_array_index (args, 0));
+  string = GIMP_VALUES_GET_STRING (args, 0);
   if (string && strlen (string))
     help_domain = string;
 
-  string = g_value_get_string (gimp_value_array_index (args, 1));
+  string = GIMP_VALUES_GET_STRING (args, 1);
   if (string && strlen (string))
     help_locales = string;
 
-  string = g_value_get_string (gimp_value_array_index (args, 2));
+  string = GIMP_VALUES_GET_STRING (args, 2);
   if (string && strlen (string))
     help_id = string;
 
diff --git a/plug-ins/help/help.c b/plug-ins/help/help.c
index 7c568ac2b1..af2f944920 100644
--- a/plug-ins/help/help.c
+++ b/plug-ins/help/help.c
@@ -171,22 +171,11 @@ help_run (GimpProcedure        *procedure,
 
   INIT_I18N ();
 
-  /*  make sure all the arguments are there  */
-  if (gimp_value_array_length (args) == 4)
+  if (! gimp_help_init (GIMP_VALUES_GET_INT          (args, 0),
+                        GIMP_VALUES_GET_STRING_ARRAY (args, 1),
+                        GIMP_VALUES_GET_INT          (args, 2),
+                        GIMP_VALUES_GET_STRING_ARRAY (args, 3)))
     {
-      if (! gimp_help_init
-              (g_value_get_int             (gimp_value_array_index (args, 0)),
-               gimp_value_get_string_array (gimp_value_array_index (args, 1)),
-               g_value_get_int             (gimp_value_array_index (args, 2)),
-               gimp_value_get_string_array (gimp_value_array_index (args, 3))))
-        {
-          status = GIMP_PDB_CALLING_ERROR;
-        }
-    }
-  else
-    {
-      g_printerr ("help: wrong number of arguments in procedure call.\n");
-
       status = GIMP_PDB_CALLING_ERROR;
     }
 
@@ -267,21 +256,17 @@ help_temp_run (GimpProcedure        *procedure,
   const gchar       *help_locales = NULL;
   const gchar       *help_id      = GIMP_HELP_DEFAULT_ID;
 
-  /*  make sure all the arguments are there  */
-  if (gimp_value_array_length (args) == 4)
-    {
-      if (g_value_get_string (gimp_value_array_index (args, 0)))
-        help_proc = g_value_get_string (gimp_value_array_index (args, 0));
+  if (GIMP_VALUES_GET_STRING (args, 0))
+    help_proc = GIMP_VALUES_GET_STRING (args, 0);
 
-      if (g_value_get_string (gimp_value_array_index (args, 1)))
-        help_domain = g_value_get_string (gimp_value_array_index (args, 1));
+  if (GIMP_VALUES_GET_STRING (args, 1))
+    help_domain = GIMP_VALUES_GET_STRING (args, 1);
 
-      if (g_value_get_string (gimp_value_array_index (args, 2)))
-        help_locales = g_value_get_string (gimp_value_array_index (args, 2));
+  if (GIMP_VALUES_GET_STRING (args, 2))
+    help_locales = GIMP_VALUES_GET_STRING (args, 2);
 
-      if (g_value_get_string (gimp_value_array_index (args, 3)))
-        help_id = g_value_get_string (gimp_value_array_index (args, 3));
-    }
+  if (GIMP_VALUES_GET_STRING (args, 3))
+    help_id = GIMP_VALUES_GET_STRING (args, 3);
 
   if (! help_proc)
     status = GIMP_PDB_CALLING_ERROR;
diff --git a/plug-ins/pagecurl/pagecurl.c b/plug-ins/pagecurl/pagecurl.c
index 9aeb54e708..f95eba6955 100644
--- a/plug-ins/pagecurl/pagecurl.c
+++ b/plug-ins/pagecurl/pagecurl.c
@@ -287,10 +287,10 @@ pagecurl_run (GimpProcedure        *procedure,
 
   image_id = image;
 
-  curl.colors      = g_value_get_int     (gimp_value_array_index (args, 0));
-  curl.edge        = g_value_get_int     (gimp_value_array_index (args, 1));
-  curl.orientation = g_value_get_int     (gimp_value_array_index (args, 2));
-  curl.shade       = g_value_get_boolean (gimp_value_array_index (args, 3));
+  curl.colors      = GIMP_VALUES_GET_INT     (args, 0);
+  curl.edge        = GIMP_VALUES_GET_INT     (args, 1);
+  curl.orientation = GIMP_VALUES_GET_INT     (args, 2);
+  curl.shade       = GIMP_VALUES_GET_BOOLEAN (args, 3);
 
   if (! gimp_drawable_mask_intersect (drawable_id, &sel_x, &sel_y,
                                       &true_sel_width, &true_sel_height))
@@ -336,8 +336,7 @@ pagecurl_run (GimpProcedure        *procedure,
   return_vals = gimp_procedure_new_return_values (procedure, GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  gimp_value_set_layer_id (gimp_value_array_index (return_vals, 1),
-                           page_curl (drawable_id));
+  GIMP_VALUES_SET_LAYER (return_vals, 1, page_curl (drawable_id));
 
   if (run_mode != GIMP_RUN_NONINTERACTIVE)
     gimp_displays_flush ();
diff --git a/plug-ins/print/print.c b/plug-ins/print/print.c
index 9e66bc1e54..4fb761cf36 100644
--- a/plug-ins/print/print.c
+++ b/plug-ins/print/print.c
@@ -498,7 +498,7 @@ print_temp_proc_run (GimpProcedure        *procedure,
                      const GimpValueArray *args,
                      gpointer              run_data)
 {
-  gint32 image_ID = gimp_value_get_image_id (gimp_value_array_index (args, 0));
+  gint32 image_ID = GIMP_VALUES_GET_IMAGE (args, 0);
 
   if (print_operation)
     print_page_setup_load (print_operation, image_ID);
diff --git a/plug-ins/screenshot/screenshot.c b/plug-ins/screenshot/screenshot.c
index 50969dbf3b..8b47b28483 100644
--- a/plug-ins/screenshot/screenshot.c
+++ b/plug-ins/screenshot/screenshot.c
@@ -242,7 +242,7 @@ screenshot_run (GimpProcedure        *procedure,
   INIT_I18N ();
   gegl_init (NULL, NULL);
 
-  run_mode = g_value_get_enum (gimp_value_array_index (args, 0));
+  run_mode = GIMP_VALUES_GET_ENUM (args, 0);
 
 #ifdef PLATFORM_OSX
   if (! backend && screenshot_osx_available ())
@@ -313,13 +313,13 @@ screenshot_run (GimpProcedure        *procedure,
       break;
 
     case GIMP_RUN_NONINTERACTIVE:
-      shootvals.shoot_type   = g_value_get_int (gimp_value_array_index (args, 1));
-      shootvals.window_id    = g_value_get_int (gimp_value_array_index (args, 2));
+      shootvals.shoot_type   = GIMP_VALUES_GET_INT (args, 1);
+      shootvals.window_id    = GIMP_VALUES_GET_INT (args, 2);
       shootvals.select_delay = 0;
-      shootvals.x1           = g_value_get_int (gimp_value_array_index (args, 3));
-      shootvals.y1           = g_value_get_int (gimp_value_array_index (args, 4));
-      shootvals.x2           = g_value_get_int (gimp_value_array_index (args, 5));
-      shootvals.y2           = g_value_get_int (gimp_value_array_index (args, 6));
+      shootvals.x1           = GIMP_VALUES_GET_INT (args, 3);
+      shootvals.y1           = GIMP_VALUES_GET_INT (args, 4);
+      shootvals.x2           = GIMP_VALUES_GET_INT (args, 5);
+      shootvals.y2           = GIMP_VALUES_GET_INT (args, 6);
 
       if (! gdk_init_check (NULL, NULL))
         status = GIMP_PDB_CALLING_ERROR;
@@ -399,8 +399,7 @@ screenshot_run (GimpProcedure        *procedure,
   return_vals = gimp_procedure_new_return_values (procedure, status, error);
 
   if (status == GIMP_PDB_SUCCESS)
-    gimp_value_set_image_id (gimp_value_array_index (return_vals, 1),
-                             image_ID);
+    GIMP_VALUES_SET_IMAGE (return_vals, 1, image_ID);
 
   return return_vals;
 }
diff --git a/plug-ins/script-fu/scheme-wrapper.c b/plug-ins/script-fu/scheme-wrapper.c
index 71b808ed32..637a827496 100644
--- a/plug-ins/script-fu/scheme-wrapper.c
+++ b/plug-ins/script-fu/scheme-wrapper.c
@@ -721,7 +721,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             {
               gint32 *array;
 
-              n_elements = g_value_get_int (gimp_value_array_index (args, i - 1));
+              n_elements = GIMP_VALUES_GET_INT (args, i - 1);
 
               if (n_elements < 0 ||
                   n_elements > sc->vptr->vector_length (vector))
@@ -781,7 +781,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             {
               gint16 *array;
 
-              n_elements = g_value_get_int (gimp_value_array_index (args, i - 1));
+              n_elements = GIMP_VALUES_GET_INT (args, i - 1);
 
               if (n_elements < 0 ||
                   n_elements > sc->vptr->vector_length (vector))
@@ -839,7 +839,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             {
               guint8 *array;
 
-              n_elements = g_value_get_int (gimp_value_array_index (args, i - 1));
+              n_elements = GIMP_VALUES_GET_INT (args, i - 1);
 
               if (n_elements < 0 ||
                   n_elements > sc->vptr->vector_length (vector))
@@ -898,7 +898,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             {
               gdouble *array;
 
-              n_elements = g_value_get_int (gimp_value_array_index (args, i - 1));
+              n_elements = GIMP_VALUES_GET_INT (args, i - 1);
 
               if (n_elements < 0 ||
                   n_elements > sc->vptr->vector_length (vector))
@@ -957,7 +957,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             {
               gchar **array;
 
-              n_elements = g_value_get_int (gimp_value_array_index (args, i - 1));
+              n_elements = GIMP_VALUES_GET_INT (args, i - 1);
 
               if (n_elements < 0 ||
                   n_elements > sc->vptr->list_length (sc, vector))
@@ -1079,7 +1079,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             {
               GimpRGB *array;
 
-              n_elements = g_value_get_int (gimp_value_array_index (args, i - 1));
+              n_elements = GIMP_VALUES_GET_INT (args, i - 1);
 
               if (n_elements < 0 ||
                   n_elements > sc->vptr->vector_length (vector))
@@ -1272,7 +1272,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
   }
 #endif
 
-  switch (g_value_get_enum (gimp_value_array_index (values, 0)))
+  switch (GIMP_VALUES_GET_ENUM (values, 0))
     {
     case GIMP_PDB_EXECUTION_ERROR:
       if (gimp_value_array_length (values) > 1 &&
@@ -1281,7 +1281,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
           g_snprintf (error_str, sizeof (error_str),
                       "Procedure execution of %s failed: %s",
                       proc_name,
-                      g_value_get_string (gimp_value_array_index (values, 1)));
+                      GIMP_VALUES_GET_STRING (values, 1));
         }
       else
         {
@@ -1299,7 +1299,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
           g_snprintf (error_str, sizeof (error_str),
                       "Procedure execution of %s failed on invalid input arguments: %s",
                       proc_name,
-                      g_value_get_string (gimp_value_array_index (values, 1)));
+                      GIMP_VALUES_GET_STRING (values, 1));
         }
       else
         {
@@ -1378,8 +1378,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             }
           else if (GIMP_VALUE_HOLDS_INT32_ARRAY (value))
             {
-              gint32        n      = g_value_get_int
-                                       (gimp_value_array_index (values, i));
+              gint32        n      = GIMP_VALUES_GET_INT (values, i);
               const gint32 *v      = gimp_value_get_int32_array (value);
               pointer       vector = sc->vptr->mk_vector (sc, n);
 
@@ -1393,8 +1392,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             }
           else if (GIMP_VALUE_HOLDS_INT16_ARRAY (value))
             {
-              gint32        n      = g_value_get_int
-                                       (gimp_value_array_index (values, i));
+              gint32        n      = GIMP_VALUES_GET_INT (values, i);
               const gint16 *v      = gimp_value_get_int16_array (value);
               pointer       vector = sc->vptr->mk_vector (sc, n);
 
@@ -1408,8 +1406,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             }
           else if (GIMP_VALUE_HOLDS_UINT8_ARRAY (value))
             {
-              gint32        n      = g_value_get_int
-                                       (gimp_value_array_index (values, i));
+              gint32        n      = GIMP_VALUES_GET_INT (values, i);
               const guint8 *v      = gimp_value_get_uint8_array (value);
               pointer       vector = sc->vptr->mk_vector (sc, n);
 
@@ -1423,8 +1420,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             }
           else if (GIMP_VALUE_HOLDS_FLOAT_ARRAY (value))
             {
-              gint32         n      = g_value_get_int
-                                        (gimp_value_array_index (values, i));
+              gint32         n      = GIMP_VALUES_GET_INT (values, i);
               const gdouble *v      = gimp_value_get_float_array (value);
               pointer        vector = sc->vptr->mk_vector (sc, n);
 
@@ -1438,8 +1434,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             }
           else if (GIMP_VALUE_HOLDS_STRING_ARRAY (value))
             {
-              gint32         n    = g_value_get_int
-                                      (gimp_value_array_index (values, i));
+              gint32         n    = GIMP_VALUES_GET_INT (values, i);
               const gchar  **v    = gimp_value_get_string_array (value);
               pointer        list = sc->NIL;
 
@@ -1480,8 +1475,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
             }
           else if (GIMP_VALUE_HOLDS_RGB_ARRAY (value))
             {
-              gint32          n    = g_value_get_int
-                                       (gimp_value_array_index (values, i));
+              gint32          n = GIMP_VALUES_GET_INT (values, i);
               const GimpRGB  *v = gimp_value_get_rgb_array (value);
               pointer  vector   = sc->vptr->mk_vector (sc, n);
 
@@ -1574,8 +1568,7 @@ script_fu_marshal_procedure_call (scheme   *sc,
    */
   if (return_val == sc->NIL)
     {
-      if (g_value_get_enum (gimp_value_array_index (values, 0)) ==
-          GIMP_PDB_SUCCESS)
+      if (GIMP_VALUES_GET_INT (values, 0) == GIMP_PDB_SUCCESS)
         return_val = sc->vptr->cons (sc, sc->T, sc->NIL);
       else
         return_val = sc->vptr->cons (sc, sc->F, sc->NIL);
diff --git a/plug-ins/script-fu/script-fu-eval.c b/plug-ins/script-fu/script-fu-eval.c
index b89dc4c416..f6556d7e28 100644
--- a/plug-ins/script-fu/script-fu-eval.c
+++ b/plug-ins/script-fu/script-fu-eval.c
@@ -34,8 +34,8 @@ script_fu_eval_run (GimpProcedure        *procedure,
   GimpRunMode        run_mode;
   const gchar       *code;
 
-  run_mode = g_value_get_enum   (gimp_value_array_index (args, 0));
-  code     = g_value_get_string (gimp_value_array_index (args, 1));
+  run_mode = GIMP_VALUES_GET_ENUM   (args, 0);
+  code     = GIMP_VALUES_GET_STRING (args, 1);
 
   ts_set_run_mode (run_mode);
   ts_register_output_func (ts_gstring_output_func, output);
diff --git a/plug-ins/script-fu/script-fu-scripts.c b/plug-ins/script-fu/script-fu-scripts.c
index b54d770a42..eac9d0f49d 100644
--- a/plug-ins/script-fu/script-fu-scripts.c
+++ b/plug-ins/script-fu/script-fu-scripts.c
@@ -743,7 +743,7 @@ script_fu_script_proc (GimpProcedure        *procedure,
                                              GIMP_PDB_CALLING_ERROR,
                                              NULL);
 
-  run_mode = g_value_get_enum (gimp_value_array_index (args, 0));
+  run_mode = GIMP_VALUES_GET_ENUM (args, 0);
 
   ts_set_run_mode (run_mode);
 
diff --git a/plug-ins/script-fu/script-fu-server.c b/plug-ins/script-fu/script-fu-server.c
index 5272646230..1d92edb893 100644
--- a/plug-ins/script-fu/script-fu-server.c
+++ b/plug-ins/script-fu/script-fu-server.c
@@ -229,10 +229,10 @@ script_fu_server_run (GimpProcedure        *procedure,
   gint               port;
   const gchar       *logfile;
 
-  run_mode = g_value_get_enum   (gimp_value_array_index (args, 0));
-  ip       = g_value_get_string (gimp_value_array_index (args, 1));
-  port     = g_value_get_int    (gimp_value_array_index (args, 2));
-  logfile  = g_value_get_string (gimp_value_array_index (args, 3));
+  run_mode = GIMP_VALUES_GET_ENUM   (args, 0);
+  ip       = GIMP_VALUES_GET_STRING (args, 1);
+  port     = GIMP_VALUES_GET_INT    (args, 2);
+  logfile  = GIMP_VALUES_GET_STRING (args, 3);
 
   ts_set_run_mode (run_mode);
   ts_set_print_flag (1);
diff --git a/plug-ins/script-fu/script-fu.c b/plug-ins/script-fu/script-fu.c
index a9ea2cfedd..bc51eeb78a 100644
--- a/plug-ins/script-fu/script-fu.c
+++ b/plug-ins/script-fu/script-fu.c
@@ -294,7 +294,7 @@ script_fu_run (GimpProcedure        *procedure,
     }
 
   if (gimp_value_array_length (args) > 0)
-    ts_set_run_mode (g_value_get_enum (gimp_value_array_index (args, 0)));
+    ts_set_run_mode (GIMP_VALUES_GET_ENUM (args, 0));
 
   /*  Load all of the available scripts  */
   script_fu_find_scripts (plug_in, path);


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